A20 higher External interrupr (EINT22-EINT31)

522 views
Skip to first unread message

Andrea Venturi

unread,
May 7, 2015, 2:48:59 AM5/7/15
to linux...@googlegroups.com
hello,

i have an issue about external interrupts, following this clear example: http://linux-sunxi.org/External_interrupts

it works for EINT up to EINT21 in PH port, but if i try in an Olimex A20 SOM (on a A20 SOM EVB who have a schematic available showing no hints AFAICS) an EINT in PI port (EINT22-EINT31) nothing is raised when i put the pin to GND.

i slightly more thorough description is in Olimex forum https://www.olimex.com/forum/index.php?topic=4400.0 but i suppose it's more general issue, that's why i post here too (sorry if it's seen as a bad attitude..)

BTW the A20 PIO page on linux-sunxi.org doesn't talk about these higher EINT22-EINT31 so i smell something fishy here: http://linux-sunxi.org/A20/PIO

any advice for further investigation?

bests

Andrea

Maxime Ripard

unread,
May 7, 2015, 4:00:04 AM5/7/15
to Andrea Venturi, linux...@googlegroups.com
There's more to it.

I don't think that ever supposed to work that way, most notably
because it just wouldn't work with SoCs that multiple interrupt banks
(like the A31, A23, etc.)

I think it worked by accident, because it's somewhat compatible with
the default interrupt property parsing code, but that probably need
some additional development.

What's mainly missing would be an irq_xlate function in the pinctrl
driver that would parse the interrupt property with the same format
than we have for gpios (phandle excluded, of course), which would mean
something like that in your case.

interrupt-parent = <&pio>;
interrups = <8 10 flags>;

That function would then need to lookup in our pin array that it's
indeed an interrupt, and would return the number of the interrupt
within the interupt controller (which would be 22 in your case).

I can try to cook something during the weekend, and send you a patch
for you to test.

Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
signature.asc

Andrea Venturi

unread,
May 7, 2015, 5:13:16 AM5/7/15
to linux...@googlegroups.com, andrea.ve...@gmail.com


On Thursday, May 7, 2015 at 10:00:04 AM UTC+2, Maxime Ripard wrote:
...

> any advice for further investigation?

There's more to it.


thanx for the quick reply!
 
I don't think that ever supposed to work that way, most notably
because it just wouldn't work with SoCs that multiple interrupt banks
(like the A31, A23, etc.)


sorry, i'm slowly wading my way on this topic, so i'm not very competent
I  supposed this single bank interrupt setup, as it's simpler (and older: A10 A20..) case were already working, and someway it works! :-)

then the more general case, multiple banks and so on.. will follow adding over.
 
I think it worked by accident, because it's somewhat compatible with
the default interrupt property parsing code, but that probably need
some additional development.

What's mainly missing would be an irq_xlate function in the pinctrl
driver that would parse the interrupt property with the same format
than we have for gpios (phandle excluded, of course), which would mean
something like that in your case.

interrupt-parent = <&pio>;
interrupts = <8 10 flags>;


in this example, there was a "interrupt-extended" entry that's i suppose it's more or less similar..

http://linux-sunxi.org/External_interrupts 

is that a fake/stub entry? amazing..

That function would then need to lookup in our pin array that it's
indeed an interrupt, and would return the number of the interrupt
within the interrupt controller (which would be 22 in your case).

I can try to cook something during the weekend, and send you a patch
for you to test.

that would be more than i expect.. surely i'll test!

thanx

Andrea
 

Maxime Ripard

unread,
May 7, 2015, 8:30:03 AM5/7/15
to Andrea Venturi, linux...@googlegroups.com
Please keep all the recipients in Cc.

On Thu, May 07, 2015 at 02:13:16AM -0700, Andrea Venturi wrote:
> > I don't think that ever supposed to work that way, most notably
> > because it just wouldn't work with SoCs that multiple interrupt banks
> > (like the A31, A23, etc.)
> >
> >
> sorry, i'm slowly wading my way on this topic, so i'm not very
> competent I supposed this single bank interrupt setup, as it's
> simpler (and older: A10 A20..) case were already working, and
> someway it works! :-)

Like I said, I strongly suspect it works by accident.

> then the more general case, multiple banks and so on.. will follow
> adding over.
>
> > I think it worked by accident, because it's somewhat compatible with
> > the default interrupt property parsing code, but that probably need
> > some additional development.
> >
> > What's mainly missing would be an irq_xlate function in the pinctrl
> > driver that would parse the interrupt property with the same format
> > than we have for gpios (phandle excluded, of course), which would mean
> > something like that in your case.
> >
> > interrupt-parent = <&pio>;
> > interrupts = <8 10 flags>;
>
> in this example, there was a "interrupt-extended" entry that's i suppose
> it's more or less similar..
>

interrupt-extended is a way to "group" interrupt-parent and interrupts
together. These two syntaxes are strictly equivalent.
signature.asc

ivor...@gmail.com

unread,
Nov 23, 2015, 3:12:35 PM11/23/15
to linux-sunxi, andrea.ve...@gmail.com
Dear Andrea, Maxime & Co,

In the past I have set up EINT7 for my Cubie2 per manual http://linux-sunxi.org/External_interrupts and it works well on 3.19 through 4.2 kernels.

In looking at audio sunxi-codec working I switched to 4.4-rc1 over the last week and discovered the following:
1) my module with EINT7 stop working
2) also EINT20 example from http://linux-sunxi.org/External_interrupts does not work "as is".

Any suggestion on what is going wrong?

Thank you,

Best regards,
Ivan

ivor...@gmail.com

unread,
Nov 24, 2015, 2:24:09 PM11/24/15
to linux-sunxi, andrea.ve...@gmail.com, ivor...@gmail.com
Update:

When trying to load the example
http://linux-sunxi.org/External_interrupts
just changing PH20 to PH7


[ 529.653595] /rebooter: arguments longer than property
[ 529.658844] rebooter-irq: cannot register IRQ -6
[ 529.663558] prismlx-rebooter: probe of rebooter failed with error -5

ivor...@gmail.com

unread,
Nov 25, 2015, 6:06:30 AM11/25/15
to linux-sunxi, andrea.ve...@gmail.com, ivor...@gmail.com
DTS FIXED:
Per
http://www.serverphorums.com/read.php?12,1260131

Add a proper interrupt xlate function, that uses the same description than
the GPIOs (<bank> <pin> <flags>), that will make things less confusing.

Corrected example

interrupt-parent = <&pio>;
interrupts = <7 10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */
Reply all
Reply to author
Forward
0 new messages