static void tx4927_irq_pic_disable(unsigned int irq) { unsigned long flags; TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_DISABLE, "irq=%d\n", irq); #ifdef TX4927_IRQ_CHECK_PIC { if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) { TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR, "bad irq=%d \n", irq); panic("\n"); } } #endif spin_lock_irqsave(&tx4927_pic_lock, flags); tx4927_irq_pic_modify(tx4927_irq_pic_addr(irq), tx4927_irq_pic_mask(irq), 0); spin_unlock_irqrestore(&tx4927_pic_lock, flags); return; }
/* * Main init functions */ void __init tx4927_irq_init(void) { TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT, "-\n"); TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT, "=Calling tx4927_irq_cp0_init()\n"); tx4927_irq_cp0_init(); TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT, "=Calling tx4927_irq_pic_init()\n"); tx4927_irq_pic_init(); TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT, "+\n"); return; }
static void __init tx4927_irq_pic_init(void) { unsigned long flags; int i; TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_INIT, "beg=%d end=%d\n", TX4927_IRQ_PIC_BEG, TX4927_IRQ_PIC_END); for (i = TX4927_IRQ_PIC_BEG; i <= TX4927_IRQ_PIC_END; i++) { irq_desc[i].status = IRQ_DISABLED; irq_desc[i].action = 0; irq_desc[i].depth = 2; irq_desc[i].handler = &tx4927_irq_pic_type; } setup_irq(TX4927_IRQ_NEST_PIC_ON_CP0, &tx4927_irq_pic_action); spin_lock_irqsave(&tx4927_pic_lock, flags); TX4927_WR(0xff1ff640, 0x6); /* irq level mask -- only accept hightest */ TX4927_WR(0xff1ff600, TX4927_RD(0xff1ff600) | 0x1); /* irq enable */ spin_unlock_irqrestore(&tx4927_pic_lock, flags); return; }
static unsigned int tx4927_irq_pic_startup(unsigned int irq) { TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_STARTUP, "irq=%d\n", irq); tx4927_irq_pic_enable(irq); return (0); }
static void tx4927_irq_pic_mask_and_ack(unsigned int irq) { TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_MASK, "irq=%d\n", irq); tx4927_irq_pic_disable(irq); return; }
static void tx4927_irq_pic_shutdown(unsigned int irq) { TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_SHUTDOWN, "irq=%d\n", irq); tx4927_irq_pic_disable(irq); return; }
static void tx4927_irq_pic_mask_and_ack(unsigned int irq) { TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_MASK, "irq=%d\n", irq); #ifdef TX4927_IRQ_CHECK_PIC { if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) { TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR, "bad irq=%d \n", irq); panic("\n"); } } #endif tx4927_irq_pic_disable(irq); return; }
static void tx4927_irq_pic_shutdown(unsigned int irq) { TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_SHUTDOWN, "irq=%d\n", irq); #ifdef TX4927_IRQ_CHECK_PIC { if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) { TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR, "bad irq=%d \n", irq); panic("\n"); } } #endif tx4927_irq_pic_disable(irq); return; }
static unsigned int tx4927_irq_pic_startup(unsigned int irq) { TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_STARTUP, "irq=%d\n", irq); #ifdef TX4927_IRQ_CHECK_PIC { if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) { TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR, "bad irq=%d \n", irq); panic("\n"); } } #endif tx4927_irq_pic_enable(irq); return (0); }
static void tx4927_irq_pic_end(unsigned int irq) { TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_ENDIRQ, "irq=%d\n", irq); if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) { tx4927_irq_pic_enable(irq); } return; }
/* * Main init functions */ void __init tx4927_irq_init(void) { extern asmlinkage void tx4927_irq_handler(void); TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT, "-\n"); TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT, "=Calling tx4927_irq_cp0_init()\n"); tx4927_irq_cp0_init(); TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT, "=Calling tx4927_irq_pic_init()\n"); tx4927_irq_pic_init(); TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT, "=Calling set_except_vector(tx4927_irq_handler)\n"); set_except_vector(0, tx4927_irq_handler); TX4927_IRQ_DPRINTK(TX4927_IRQ_INIT, "+\n"); return; }
static void tx4927_irq_pic_end(unsigned int irq) { TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_ENDIRQ, "irq=%d\n", irq); #ifdef TX4927_IRQ_CHECK_PIC { if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) { TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR, "bad irq=%d \n", irq); panic("\n"); } } #endif if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) { tx4927_irq_pic_enable(irq); } return; }
static void tx4927_irq_cp0_disable(unsigned int irq) { unsigned long flags; TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_DISABLE, "irq=%d \n", irq); spin_lock_irqsave(&tx4927_cp0_lock, flags); tx4927_irq_cp0_modify(CCP0_STATUS, tx4927_irq_cp0_mask(irq), 0); spin_unlock_irqrestore(&tx4927_cp0_lock, flags); return; }
static void tx4927_irq_pic_disable(unsigned int irq) { unsigned long flags; TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_DISABLE, "irq=%d\n", irq); spin_lock_irqsave(&tx4927_pic_lock, flags); tx4927_irq_pic_modify(tx4927_irq_pic_addr(irq), tx4927_irq_pic_mask(irq), 0); spin_unlock_irqrestore(&tx4927_pic_lock, flags); return; }
static void tx4927_irq_cp0_enable(unsigned int irq) { unsigned long flags; TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_ENABLE, "irq=%d \n", irq); #ifdef TX4927_IRQ_CHECK_CP0 { if (irq < TX4927_IRQ_CP0_BEG || irq > TX4927_IRQ_CP0_END) { TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR, "bad irq=%d \n", irq); panic("\n"); } } #endif spin_lock_irqsave(&tx4927_cp0_lock, flags); tx4927_irq_cp0_modify(CCP0_STATUS, 0, tx4927_irq_cp0_mask(irq)); spin_unlock_irqrestore(&tx4927_cp0_lock, flags); return; }
static void __init tx4927_irq_cp0_init(void) { int i; TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_INIT, "beg=%d end=%d\n", TX4927_IRQ_CP0_BEG, TX4927_IRQ_CP0_END); for (i = TX4927_IRQ_CP0_BEG; i <= TX4927_IRQ_CP0_END; i++) { irq_desc[i].status = IRQ_DISABLED; irq_desc[i].action = 0; irq_desc[i].depth = 1; irq_desc[i].handler = &tx4927_irq_cp0_type; } return; }
int tx4927_irq_nested(void) { int sw_irq = 0; u32 level2; TX4927_IRQ_DPRINTK(TX4927_IRQ_NEST1, "-\n"); level2 = TX4927_RD(0xff1ff6a0); TX4927_IRQ_DPRINTK(TX4927_IRQ_NEST2, "=level2a=0x%x\n", level2); if ((level2 & 0x10000) == 0) { level2 &= 0x1f; TX4927_IRQ_DPRINTK(TX4927_IRQ_NEST3, "=level2b=0x%x\n", level2); sw_irq = TX4927_IRQ_PIC_BEG + level2; TX4927_IRQ_DPRINTK(TX4927_IRQ_NEST3, "=sw_irq=%d\n", sw_irq); if (sw_irq == 27) { TX4927_IRQ_DPRINTK(TX4927_IRQ_NEST4, "=irq-%d\n", sw_irq); #ifdef CONFIG_TOSHIBA_RBTX4927 { sw_irq = toshiba_rbtx4927_irq_nested(sw_irq); } #endif TX4927_IRQ_DPRINTK(TX4927_IRQ_NEST4, "=irq+%d\n", sw_irq); } } TX4927_IRQ_DPRINTK(TX4927_IRQ_NEST2, "=sw_irq=%d\n", sw_irq); TX4927_IRQ_DPRINTK(TX4927_IRQ_NEST1, "+\n"); return (sw_irq); }