X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fppc%2Fsyslib%2Fxilinx_pic.c;h=6fd4cdbada72a3fb15ad0a19b1965724333a77e2;hb=refs%2Fheads%2Fvserver;hp=483d06d9a9bb554d567a2bf75165c651335a23c7;hpb=6a77f38946aaee1cd85eeec6cf4229b204c15071;p=linux-2.6.git diff --git a/arch/ppc/syslib/xilinx_pic.c b/arch/ppc/syslib/xilinx_pic.c index 483d06d9a..6fd4cdbad 100644 --- a/arch/ppc/syslib/xilinx_pic.c +++ b/arch/ppc/syslib/xilinx_pic.c @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/xilinx_pic.c - * * Interrupt controller driver for Xilinx Virtex-II Pro. * * Author: MontaVista Software, Inc. @@ -15,8 +13,9 @@ #include #include #include -#include +#include #include +#include /* No one else should require these constants, so define them locally here. */ #define ISR 0 /* Interrupt Status Register */ @@ -79,18 +78,15 @@ xilinx_intc_end(unsigned int irq) } static struct hw_interrupt_type xilinx_intc = { - "Xilinx Interrupt Controller", - NULL, - NULL, - xilinx_intc_enable, - xilinx_intc_disable, - xilinx_intc_disable_and_ack, - xilinx_intc_end, - 0 + .typename = "Xilinx Interrupt Controller", + .enable = xilinx_intc_enable, + .disable = xilinx_intc_disable, + .ack = xilinx_intc_disable_and_ack, + .end = xilinx_intc_end, }; int -xilinx_pic_get_irq(struct pt_regs *regs) +xilinx_pic_get_irq(void) { int irq; @@ -114,6 +110,14 @@ ppc4xx_pic_init(void) { int i; + /* + * NOTE: The assumption here is that NR_IRQS is 32 or less + * (NR_IRQS is 32 for PowerPC 405 cores by default). + */ +#if (NR_IRQS > 32) +#error NR_IRQS > 32 not supported +#endif + #if XPAR_XINTC_USE_DCR == 0 intc = ioremap(XPAR_INTC_0_BASEADDR, 32); @@ -138,6 +142,12 @@ ppc4xx_pic_init(void) ppc_md.get_irq = xilinx_pic_get_irq; - for (i = 0; i < NR_IRQS; ++i) - irq_desc[i].handler = &xilinx_intc; + for (i = 0; i < NR_IRQS; ++i) { + irq_desc[i].chip = &xilinx_intc; + + if (XPAR_INTC_0_KIND_OF_INTR & (0x00000001 << i)) + irq_desc[i].status &= ~IRQ_LEVEL; + else + irq_desc[i].status |= IRQ_LEVEL; + } }