From: Matt Porter Move the code that informs the kernel if the particular interrupt is edge triggered or level sensitive from the board specific file to a "CONFIG_VIRTEX_II_PRO-specific" file. Using old IRQ numbering in that code is also fixed. Signed-off-by: Andrei Konovalov Signed-off-by: Matt Porter Signed-off-by: Andrew Morton --- 25-akpm/arch/ppc/platforms/4xx/xilinx_ml300.c | 18 ------------------ 25-akpm/arch/ppc/syslib/xilinx_pic.c | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 19 deletions(-) diff -puN arch/ppc/platforms/4xx/xilinx_ml300.c~ppc32-move-irq_descstatus-irq_level-bit-setup-to-xilinx_picc arch/ppc/platforms/4xx/xilinx_ml300.c --- 25/arch/ppc/platforms/4xx/xilinx_ml300.c~ppc32-move-irq_descstatus-irq_level-bit-setup-to-xilinx_picc Fri Feb 18 16:34:04 2005 +++ 25-akpm/arch/ppc/platforms/4xx/xilinx_ml300.c Fri Feb 18 16:34:04 2005 @@ -122,25 +122,7 @@ ml300_setup_arch(void) void __init ml300_init_irq(void) { - unsigned int i; - ppc4xx_init_IRQ(); - - /* - * For PowerPC 405 cores the default value for NR_IRQS is 32. - * See include/asm-ppc/irq.h for details. - * This is just fine for ML300. - */ -#if (NR_IRQS != 32) -#error NR_IRQS must be 32 for ML300 -#endif - - for (i = 0; i < NR_IRQS; i++) { - if (XPAR_INTC_0_KIND_OF_INTR & (0x80000000 >> i)) - irq_desc[i].status &= ~IRQ_LEVEL; - else - irq_desc[i].status |= IRQ_LEVEL; - } } void __init diff -puN arch/ppc/syslib/xilinx_pic.c~ppc32-move-irq_descstatus-irq_level-bit-setup-to-xilinx_picc arch/ppc/syslib/xilinx_pic.c --- 25/arch/ppc/syslib/xilinx_pic.c~ppc32-move-irq_descstatus-irq_level-bit-setup-to-xilinx_picc Fri Feb 18 16:34:04 2005 +++ 25-akpm/arch/ppc/syslib/xilinx_pic.c Fri Feb 18 16:34:04 2005 @@ -114,6 +114,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 +146,12 @@ ppc4xx_pic_init(void) ppc_md.get_irq = xilinx_pic_get_irq; - for (i = 0; i < NR_IRQS; ++i) + for (i = 0; i < NR_IRQS; ++i) { irq_desc[i].handler = &xilinx_intc; + + if (XPAR_INTC_0_KIND_OF_INTR & (0x00000001 << i)) + irq_desc[i].status &= ~IRQ_LEVEL; + else + irq_desc[i].status |= IRQ_LEVEL; + } } _