Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Jul 2017 17:22:11 -0500
From:      Dustin Marquess <dmarquess@gmail.com>
To:        Ian Lepore <ian@freebsd.org>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: Allwinner GPIO IRQ?
Message-ID:  <CAJpsHY5cd9OoM680mKY2CAGof0FdPBZTqJF9uQ40dJe5ZNXpbA@mail.gmail.com>
In-Reply-To: <1501537511.90400.116.camel@freebsd.org>
References:  <CAJpsHY7DuhB3a6CPeEhzqHamdYAW5JA5h1pNAED-ibp%2Bg5TC0A@mail.gmail.com> <1501537511.90400.116.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Ian,

Thanks for the confirmation!  I'm not exactly a kernel-level dev, so I
was just pretty much guessing and poking around :).

Thanks!
-Dustin

On Mon, Jul 31, 2017 at 4:45 PM, Ian Lepore <ian@freebsd.org> wrote:
> On Mon, 2017-07-31 at 15:38 -0500, Dustin Marquess wrote:
>> I'm trying to setup gpiopps on my Pine A64.  I managed to hack up the
>> device tree and that part seems to work, however I was getting:
>>
>> gpiopps0: Pin cannot be configured for the requested signal edge
>>
>> I noticed that sys/arm/allwinner/a10_gpio.c had:
>>
>> #define A10_GPIO_DEFAULT_CAPS   (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT
>> |     \
>>     GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN)
>>
>> So I changed that to:
>>
>> #define A10_GPIO_DEFAULT_CAPS   (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT
>> |     \
>>     GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN | GPIO_INTR_MASK)
>>
>> That changed the error to:
>>
>> gpiopps0: Cannot allocate an IRQ for the GPIO
>>
>> And now I'm having problems finding a DEVMETHOD mapping for
>> bus_alloc_resource for the Allwinner gpios.  Am I right in guessing
>> that this code simply doesn't exist yet?
>>
>> Thanks!
>> -Dustin
>
> It looks like you've got the right bottom line: aw gpio isn't ready to
> support interrupts yet.  It's not because bus_alloc_resource is
> missing, it's because the code just doesn't support being an interrupt
> controller yet.  The methods missing are these (from imx_gpio.c):
>
>         DEVMETHOD(pic_disable_intr,     gpio_pic_disable_intr),
>         DEVMETHOD(pic_enable_intr,      gpio_pic_enable_intr),
>         DEVMETHOD(pic_map_intr,         gpio_pic_map_intr),
>         DEVMETHOD(pic_setup_intr,       gpio_pic_setup_intr),
>         DEVMETHOD(pic_teardown_intr,    gpio_pic_teardown_intr),
>         DEVMETHOD(pic_post_filter,      gpio_pic_post_filter),
>         DEVMETHOD(pic_post_ithread,     gpio_pic_post_ithread),
>         DEVMETHOD(pic_pre_ithread,      gpio_pic_pre_ithread),
>
> From a quick glance at the docs, it looks like only 32 of the pins on
> allwinner can be configured as interrupt sources, but it doesn't look
> like our code is ready to do that at all (I don't see any pins in the
> padconf tables that have "irq" as one of their choices).
>
> -- Ian
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJpsHY5cd9OoM680mKY2CAGof0FdPBZTqJF9uQ40dJe5ZNXpbA>