static void ixdp2x00_irq_mask(unsigned int irq) { unsigned long dummy; static struct slowport_cfg old_cfg; /* * This is ugly in common code but really don't know * of a better way to handle it. :( */ #ifdef CONFIG_ARCH_IXDP2400 if (machine_is_ixdp2400()) ixp2000_acquire_slowport(&slowport_cpld_cfg, &old_cfg); #endif dummy = *board_irq_mask; dummy |= IXP2000_BOARD_IRQ_MASK(irq); ixp2000_reg_wrb(board_irq_mask, dummy); #ifdef CONFIG_ARCH_IXDP2400 if (machine_is_ixdp2400()) ixp2000_release_slowport(&old_cfg); #endif }
/************************************************************************* * IXDP2x01 IRQ Handling *************************************************************************/ static void ixdp2x01_irq_mask(struct irq_data *d) { ixp2000_reg_wrb(IXDP2X01_INT_MASK_SET_REG, IXP2000_BOARD_IRQ_MASK(d->irq)); }
void __init ixp2000_init_irq(void) { int irq; /* * Mask all sources */ ixp2000_reg_write(IXP2000_IRQ_ENABLE_CLR, 0xffffffff); ixp2000_reg_write(IXP2000_FIQ_ENABLE_CLR, 0xffffffff); /* clear all GPIO edge/level detects */ ixp2000_reg_write(IXP2000_GPIO_REDR, 0); ixp2000_reg_write(IXP2000_GPIO_FEDR, 0); ixp2000_reg_write(IXP2000_GPIO_LSHR, 0); ixp2000_reg_write(IXP2000_GPIO_LSLR, 0); ixp2000_reg_write(IXP2000_GPIO_INCR, -1); /* clear PCI interrupt sources */ ixp2000_reg_wrb(IXP2000_PCI_XSCALE_INT_ENABLE, 0); /* * Certain bits in the IRQ status register of the * IXP2000 are reserved. Instead of trying to map * things non 1:1 from bit position to IRQ number, * we mark the reserved IRQs as invalid. This makes * our mask/unmask code much simpler. */ for (irq = IRQ_IXP2000_SOFT_INT; irq <= IRQ_IXP2000_THDB3; irq++) { if ((1 << irq) & IXP2000_VALID_IRQ_MASK) { set_irq_chip(irq, &ixp2000_irq_chip); set_irq_handler(irq, handle_level_irq); set_irq_flags(irq, IRQF_VALID); } else set_irq_flags(irq, 0); } for (irq = IRQ_IXP2000_DRAM0_MIN_ERR; irq <= IRQ_IXP2000_SP_INT; irq++) { if((1 << (irq - IRQ_IXP2000_DRAM0_MIN_ERR)) & IXP2000_VALID_ERR_IRQ_MASK) { set_irq_chip(irq, &ixp2000_err_irq_chip); set_irq_handler(irq, handle_level_irq); set_irq_flags(irq, IRQF_VALID); } else set_irq_flags(irq, 0); } set_irq_chained_handler(IRQ_IXP2000_ERRSUM, ixp2000_err_irq_handler); for (irq = IRQ_IXP2000_GPIO0; irq <= IRQ_IXP2000_GPIO7; irq++) { set_irq_chip(irq, &ixp2000_GPIO_irq_chip); set_irq_handler(irq, handle_level_irq); set_irq_flags(irq, IRQF_VALID); } set_irq_chained_handler(IRQ_IXP2000_GPIO, ixp2000_GPIO_irq_handler); /* * Enable PCI irqs. The actual PCI[AB] decoding is done in * entry-macro.S, so we don't need a chained handler for the * PCI interrupt source. */ ixp2000_reg_write(IXP2000_IRQ_ENABLE_SET, (1 << IRQ_IXP2000_PCI)); for (irq = IRQ_IXP2000_PCIA; irq <= IRQ_IXP2000_PCIB; irq++) { set_irq_chip(irq, &ixp2000_pci_irq_chip); set_irq_handler(irq, handle_level_irq); set_irq_flags(irq, IRQF_VALID); } }
static void ixp2000_irq_mask(unsigned int irq) { ixp2000_reg_wrb(IXP2000_IRQ_ENABLE_CLR, (1 << irq)); }
static void ixp2000_GPIO_irq_mask(unsigned int irq) { ixp2000_reg_wrb(IXP2000_GPIO_INCR, (1 << (irq - IRQ_IXP2000_GPIO0))); }
static void ixdp2x01_irq_mask(unsigned int irq) { ixp2000_reg_wrb(IXDP2X01_INT_MASK_SET_REG, IXP2000_BOARD_IRQ_MASK(irq)); }