mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
* GPIO dynamic IRQ handling for AMlogic
@ 2022-07-09 20:14 Peter Höller
  2022-07-18  7:56 ` Neil Armstrong
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Höller @ 2022-07-09 20:14 UTC (permalink / raw)
  To: linux-amlogic

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.

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.

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.

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: GPIO dynamic IRQ handling for AMlogic
  2022-07-09 20:14 GPIO dynamic IRQ handling for AMlogic Peter Höller
@ 2022-07-18  7:56 ` Neil Armstrong
  0 siblings, 0 replies; 2+ messages in thread
From: Neil Armstrong @ 2022-07-18  7:56 UTC (permalink / raw)
  To: Peter Höller, linux-amlogic

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-18  7:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-09 20:14 GPIO dynamic IRQ handling for AMlogic Peter Höller
2022-07-18  7:56 ` Neil Armstrong

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®