* MPC5200b external interrupt registration problem
@ 2008-05-09 18:49 Nick
2008-05-09 19:02 ` Scott Wood
2008-05-12 14:03 ` Grant Likely
0 siblings, 2 replies; 4+ messages in thread
From: Nick @ 2008-05-09 18:49 UTC (permalink / raw)
To: linuxppc-dev
Hi,
I am writing a driver to service an interrupt from our fpga. I am calling request_irq in the open
function of my driver. The fpga is connected to external interrupt 1. I am using interrupt
number 65 in the request_irq but the function is failing. I traced to a function called setup_irq
in file /kernel/irq/manage.c. It fails because at this line: if (desc->chip == &no_irq_chip) .
Is 65 the wrong interrupt number? What do I need to do to properly setup for external interrupts?
Thanks for any help,
Nick
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MPC5200b external interrupt registration problem
2008-05-09 18:49 MPC5200b external interrupt registration problem Nick
@ 2008-05-09 19:02 ` Scott Wood
2008-05-10 7:30 ` Michael Ellerman
2008-05-12 14:03 ` Grant Likely
1 sibling, 1 reply; 4+ messages in thread
From: Scott Wood @ 2008-05-09 19:02 UTC (permalink / raw)
To: Nick; +Cc: linuxppc-dev
On Fri, May 09, 2008 at 02:49:04PM -0400, Nick wrote:
> I am writing a driver to service an interrupt from our fpga. I am calling request_irq in the open
> function of my driver. The fpga is connected to external interrupt 1. I am using interrupt
> number 65 in the request_irq but the function is failing.
request_irq takes a virtual IRQ number, not a hardware IRQ number. You
need to get the virtual IRQ number from irq_of_parse_and_map(), or from
irq_create_mapping().
This would probably confuse far fewer people if we used pointers in the
API rather than virtual IRQ numbers...
-Scott
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MPC5200b external interrupt registration problem
2008-05-09 19:02 ` Scott Wood
@ 2008-05-10 7:30 ` Michael Ellerman
0 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2008-05-10 7:30 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 998 bytes --]
On Fri, 2008-05-09 at 14:02 -0500, Scott Wood wrote:
> On Fri, May 09, 2008 at 02:49:04PM -0400, Nick wrote:
> > I am writing a driver to service an interrupt from our fpga. I am calling request_irq in the open
> > function of my driver. The fpga is connected to external interrupt 1. I am using interrupt
> > number 65 in the request_irq but the function is failing.
>
> request_irq takes a virtual IRQ number, not a hardware IRQ number. You
> need to get the virtual IRQ number from irq_of_parse_and_map(), or from
> irq_create_mapping().
>
> This would probably confuse far fewer people if we used pointers in the
> API rather than virtual IRQ numbers...
I'll do the core changes if you fix all the drivers .. ;)
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: MPC5200b external interrupt registration problem
2008-05-09 18:49 MPC5200b external interrupt registration problem Nick
2008-05-09 19:02 ` Scott Wood
@ 2008-05-12 14:03 ` Grant Likely
1 sibling, 0 replies; 4+ messages in thread
From: Grant Likely @ 2008-05-12 14:03 UTC (permalink / raw)
To: Nick; +Cc: linuxppc-dev
On Fri, May 9, 2008 at 12:49 PM, Nick <ndroogh@rogers.com> wrote:
> Hi,
>
> I am writing a driver to service an interrupt from our fpga. I am calling request_irq in the open
> function of my driver. The fpga is connected to external interrupt 1. I am using interrupt
> number 65 in the request_irq but the function is failing. I traced to a function called setup_irq
> in file /kernel/irq/manage.c. It fails because at this line: if (desc->chip == &no_irq_chip) .
> Is 65 the wrong interrupt number? What do I need to do to properly setup for external interrupts?
What kernel version are you using?
Are you using arch/ppc or arch/powerpc?
There has been a major shift in embedded powerpc support in the last
year. Now, instead of hard coding the peripheral list in the platform
code, the devices are described in an OpenFirmware style device tree.
(See arch/powerpc/boot/dts/lite5200b.dts).
You need to add a node to the tree for your device and specify the
interrupt there. Then use either of_irq_map_one() or
irq_of_parse_and_map() to get something that you can pass to
request_irq().
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-05-12 14:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-09 18:49 MPC5200b external interrupt registration problem Nick
2008-05-09 19:02 ` Scott Wood
2008-05-10 7:30 ` Michael Ellerman
2008-05-12 14:03 ` Grant Likely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).