kilauea/405ex external interrupts

4 messages, 3 authors, 2009-06-22 · open the first message on its own page

kilauea/405ex external interrupts

From: Lada Podivin <hidden>
Date: 2009-06-19 08:00:55

Hi,
I'm writing a linux driver that uses an external interrupt (ppc 405ex). I'm
using GPIO pin 30 (external IRQ 1) connected to UIC1. I'm aware of the
virtual interrupt stuff, so I added a new node to my device tree in order to
get proper virtual IRQ number. This node describes an external event and its
connection to UIC via the mentioned ext. int. Here is a sample of the
divce-tree:
...

UIC1: interrupt-controller1 {
        compatible = "ibm,uic-405ex","ibm,uic";
        interrupt-controller;
        cell-index = <1>;
        dcr-reg = <0x0d0 0x009>;
        #address-cells = <0>;
        #size-cells = <0>;
        #interrupt-cells = <2>;
        interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */
        interrupt-parent = <&UIC0>;
};

EXTEVENT: external_event {
        device_type = "external";
        #address-cells = <0>;
        #size-cells = <0>;
        #interrupt-cells = <2>;
        interrupts = <0x1e 0x1>;
        interrupt-parent = <&UIC1>;
};
...

Then I use function "irq_of_parse_and_map()" which returns the virtual IRQ
number 22. So, "request_irq()" seems to be satisfied with this number. I can
see this interrupt in the /proc/interrupts. But! When I connect a signal
source to the pin 30, nothing happens - the interrupt service routine isn't
called.

Am I suppose to configure anything else? (e. g. pin multiplexing, further
device-tree tuning...) Thank you!

Best regards,
Ladi

RE: kilauea/405ex external interrupts

From: Tirumala Reddy Marri <hidden>
Date: 2009-06-19 19:02:43

You will have to program GPIO's to select appropriate external IRQ as
they are shared .

 

From: linuxppc-dev-bounces+tmarri=amcc.com@lists.ozlabs.org
[mailto:linuxppc-dev-bounces+tmarri=amcc.com@lists.ozlabs.org] On Behalf
Of Lada Podivin
Sent: Friday, June 19, 2009 1:01 AM
To: linuxppc-dev@lists.ozlabs.org
Subject: kilauea/405ex external interrupts

 

Hi,
I'm writing a linux driver that uses an external interrupt (ppc 405ex).
I'm using GPIO pin 30 (external IRQ 1) connected to UIC1. I'm aware of
the virtual interrupt stuff, so I added a new node to my device tree in
order to get proper virtual IRQ number. This node describes an external
event and its connection to UIC via the mentioned ext. int. Here is a
sample of the divce-tree:
..

UIC1: interrupt-controller1 {
        compatible = "ibm,uic-405ex","ibm,uic";
        interrupt-controller;
        cell-index = <1>;
        dcr-reg = <0x0d0 0x009>;
        #address-cells = <0>;
        #size-cells = <0>;
        #interrupt-cells = <2>;
        interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */
        interrupt-parent = <&UIC0>;
};

EXTEVENT: external_event {
        device_type = "external";
        #address-cells = <0>;
        #size-cells = <0>;
        #interrupt-cells = <2>;
        interrupts = <0x1e 0x1>;
        interrupt-parent = <&UIC1>;
};
...

Then I use function "irq_of_parse_and_map()" which returns the virtual
IRQ number 22. So, "request_irq()" seems to be satisfied with this
number. I can see this interrupt in the /proc/interrupts. But! When I
connect a signal source to the pin 30, nothing happens - the interrupt
service routine isn't called. 

Am I suppose to configure anything else? (e. g. pin multiplexing,
further device-tree tuning...) Thank you!

Best regards,
Ladi

Re: kilauea/405ex external interrupts

From: Stefan Roese <sr@denx.de>
Date: 2009-06-22 09:36:36

On Friday 19 June 2009 10:00:52 Lada Podivin wrote:
I'm writing a linux driver that uses an external interrupt (ppc 405ex). I'm
using GPIO pin 30 (external IRQ 1) connected to UIC1. I'm aware of the
virtual interrupt stuff, so I added a new node to my device tree in order
to get proper virtual IRQ number. This node describes an external event and
its connection to UIC via the mentioned ext. int. Here is a sample of the
divce-tree:
<snip>
EXTEVENT: external_event {
        device_type = "external";
        #address-cells = <0>;
        #size-cells = <0>;
        #interrupt-cells = <2>;
        interrupts = <0x1e 0x1>;
        interrupt-parent = <&UIC1>;
};
...

Then I use function "irq_of_parse_and_map()" which returns the virtual IRQ
number 22. So, "request_irq()" seems to be satisfied with this number. I
can see this interrupt in the /proc/interrupts. But! When I connect a
signal source to the pin 30, nothing happens - the interrupt service
routine isn't called.

Am I suppose to configure anything else? (e. g. pin multiplexing, further
device-tree tuning...) Thank you!
Yes, this could very well be a problem of pin multiplexing. From looking at 
the Kilauea GPIO/Pin mux configuration in U-Boot, GPIO30 is configured as GPIO 
input and not as IRQ1. So this can't work. The easiest way to change this is 
in U-Boot (include/configs/kilauea.h).

BTW: Are you using Kilauea or a custom 405EX board?

Best regards,
Stefan

Re: kilauea/405ex external interrupts

From: Lada Podivin <hidden>
Date: 2009-06-22 11:31:36

Thanks for replies!

2009/6/22 Stefan Roese [off-list ref]

Yes, this could very well be a problem of pin multiplexing. From looking at
the Kilauea GPIO/Pin mux configuration in U-Boot, GPIO30 is configured as
GPIO
input and not as IRQ1. So this can't work. The easiest way to change this
is
in U-Boot (include/configs/kilauea.h).
Right, the pin multiplexing was the problem. I didn't know that U-BOOT can
do that - very useful information, thank you again!
BTW: Are you using Kilauea or a custom 405EX board?

Best regards,
Stefan
Yes, it's the Kilauea board.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help