From: Neil Armstrong <narmstrong@baylibre.com>
To: "Peter Höller" <drmedvet.hoeller@gmail.com>,
linux-amlogic@lists.infradead.org
Subject: Re: GPIO dynamic IRQ handling for AMlogic
Date: Mon, 18 Jul 2022 09:56:16 +0200 [thread overview]
Message-ID: <963ce12a-ade1-09c1-984d-52df1531da17@baylibre.com> (raw)
In-Reply-To: <CAJgPF1+b+=iaxE_RkAY=zG7y=PeEZ8r-2A6JSvNQbkTtHBUVAw@mail.gmail.com>
Hi Peter,
On 09/07/2022 22:14, Peter Höller wrote:
> Hi,
>
> we are working on an Odroid C2 rev2 (S905 AMlogic) project for 3 years now.
> While upgrading to Kernel 5.16 we stumbled over the issue that there
> were only 8 static IRQ availabe for GPIO, so you get reduzed down to 4
> I/O-pins, if you use them with edge both, rising as well as falling -
> if you set up the IRQs for GPIO statically.
>
> Referring to your post
> http://lists.infradead.org/pipermail/linux-amlogic/2020-July/007684.html
> from Neil Armstraong:
> <<
> The only available driver for GPIO interrupts is irq-meson-gpio and
> should be enough for most of your use-cases
> if you pass the GPIO interrupt as `interrupt = ` and `interrupt-parent
> =` as we do for the Ethernet PHY on some
> boards.
>
>>>
>
> we completely understand there is no out-of-the-box upstream
> compatibilty because you are loosing kernel's compatibilty for other
> boards. But as we are using our kernel only for odroidC2 only, we
> wondered how to customize it correctly:
>
> So we need information as foollows please:
>
> 1.) What are the IRQ-ranges availabe for GPIO of odroid C2 working
> with Kernel 5.16. Unfortunately, we cannot derive that information
> from anywhere else.
You can find those numbers in the S905 at [1] page 86, number is in the the "Input Mux Location" column.
>
> 2.) we would be verry happy to get further syntax information about
> how exactly to implement the mentioned 'interrups =' and
> 'interrupt-parent =' in the DeviceTree with the correct IRQ-ranges.
The syntax is already in the Odroid C2 DTS at [2] and follows the standard interrupts DT syntax.
> and 3.) How to correctly declare/announce the GPIO-IRQs dynamically in
> the DeviceTree (syntax) and, if so, which corresponding syntax-changes
> are needed to be done where in the driver 'irq-meson-gpio' to make
> this finally work.
The only way to get an interrupt for a GPIO in Linux is via the GPIO to_irq() callback,
but unfortunately the HW design of the Amlogic SoC doesn't make it easy to translate any
GPIO to an interrupt because it only has 8 available GPIO interrupts in a separate HW block.
An implementation exists but it's not safe enough and feature-full to be accepted upstream.
Neil
>
> with kind regards and many many thanks in advance
>
> Peter
>
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic
[1] https://dn.odroid.com/S905/DataSheet/S905_Public_Datasheet_V1.1.4.pdf
[2] https://github.com/torvalds/linux/blob/ff6992735ade75aae3e35d16b17da1008d753d28/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts#L246-L248
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
prev parent reply other threads:[~2022-07-18 7:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-09 20:14 Peter Höller
2022-07-18 7:56 ` Neil Armstrong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=963ce12a-ade1-09c1-984d-52df1531da17@baylibre.com \
--to=narmstrong@baylibre.com \
--cc=drmedvet.hoeller@gmail.com \
--cc=linux-amlogic@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®