Thread (4 messages) 4 messages, 2 authors, 2011-02-11

RE: Question on setting up external interrupt for P1020 (MPC8xxx) with device tree

flat view

From: Kenny Ho <hidden>
Date: 2011-02-11 22:15:50

Thanks Scott.

Do you know the logic of the hwirq <-> virq mapping?  When I was digging
into the GPIO interrupt, the hwirq seems to be the same as the virq
(both are 47 which is 16 (external interrupt) + 31 (internal interrupt).
If I want to use external interrupt 7 and 8, should the virq also be 7
and 8?  For some reason I am getting 41 for virq... may be I am still
doing something wrong.

This is the node definition I created:
rpcl {
	compatible =3D "ba,rpcl";
	interrupts =3D <0x7 2 0x8 2>;
	interrupt-parent =3D <&mpic>;
};

Kenny

-----Original Message-----
From: Scott Wood [mailto:<redacted>]=20
Sent: Friday, February 11, 2011 4:57 PM
To: Kenny Ho
Cc: <redacted>
Subject: Re: Question on setting up external interrupt for P1020
(MPC8xxx) with device tree

On Fri, 11 Feb 2011 14:07:26 -0500
Kenny Ho [off-list ref] wrote:
Hi,
=20
=20
=20
I am trying to write a device driver that uses an external interrupt
(one of the 16 irq lines) for the Freescale P1020 processor and I hope
some of you can help.  Am I suppose to setup a separate node in the
dts
and look for that node in my driver to setup the interrupt?=20
Ideally, yes.  It's good to describe your device with a node even if it
doesn't have interrupts.
Or does the > dts interrupt declaration belong to the
interrupt-controller
declaration?  I noticed the mpc8xxx_gpio driver defined its own
irq_chip
but I thought that may be because each gpio pin can trigger an
interrupt.
Right, it's because gpio is an interrupt controller, not just a user of
one.
Do I need to define my own irq_chip structure for my device
even if I am using one of the hard irq lines? =20
No.  If the device's node describes the interrupt correctly, you can use
irq_of_parse_and_map() on the device node to get a virtual irq that you
can
pass to request_irq().

-Scott
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help