How do external irq's get mapped?

Andy Fleming afleming at freescale.com
Thu May 3 04:42:56 EST 2007


On May 1, 2007, at 18:11, Charles Krinke wrote:

> Please pardon the top post, it is done to help my local compatriots  
> read
> more easily.
>
> Andy, our MPC85xx_OPENPIC_IRQ_OFFSET is 80, but the call to
> openpic_init(MPC85xx_OPENPIC_IRQ_OFFSET) occurs after the two calls to
> openpic_set_sources. This leads me to believe that the mapping goes
>
> Internal irqs are 00..31 based on first openpic_set_sources(0, 32, ..)
> External irqs are 48..60 based on second openpic_set_sources(48, 12,
> ...)
>
> Then we have the openpic_init(80) call.
>
> So, I though the external IRQ0 was mapped to 48. But is it really  
> mapped
> to 80 + 32 or 112 instead. If that is the case, there is another
> problem.


Yeah, the set_sources functions just initialize the array of  
interrupts.  The openpic_init() actually gives them numbers and stuff.


>
> The new problem is that if I set the irq to 112, when it is  
> insmodded, I
> get an error from open_pic.c of the form:
>
> Open_pic.c:720 invalid irq 112
>
> This seems to be coming from the macro at line 144 in open_pic.c
>
> #define check_arg_irq(irq) \
>     if (irq < open_pic_irq_offset || irq >=
> NumSources+open_pic_irq_offset \
> 	|| ISR[irq - open_pic_irq_offset] == 0) { \
>       printk("open_pic.c:%d: invalid irq %d\n", __LINE__, irq); \
>       dump_stack(); }


Any  chance you can identify:

1) Where this macro is being called from when it fails

2) Which of the 3 conditions above are actually true

Andy



More information about the Linuxppc-embedded mailing list