2 * arch/sh/boards/se/7343/irq.c
6 #include <linux/config.h>
7 #include <linux/init.h>
8 #include <linux/interrupt.h>
12 #include <asm/mach/se7343.h>
15 disable_intreq_irq(unsigned int irq)
17 int bit = irq - OFFCHIP_IRQ_BASE;
20 val = ctrl_inw(PA_CPLD_IMSK);
22 ctrl_outw(val, PA_CPLD_IMSK);
26 enable_intreq_irq(unsigned int irq)
28 int bit = irq - OFFCHIP_IRQ_BASE;
31 val = ctrl_inw(PA_CPLD_IMSK);
33 ctrl_outw(val, PA_CPLD_IMSK);
37 mask_and_ack_intreq_irq(unsigned int irq)
39 disable_intreq_irq(irq);
43 startup_intreq_irq(unsigned int irq)
45 enable_intreq_irq(irq);
50 shutdown_intreq_irq(unsigned int irq)
52 disable_intreq_irq(irq);
56 end_intreq_irq(unsigned int irq)
58 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
59 enable_intreq_irq(irq);
62 static struct hw_interrupt_type intreq_irq_type = {
63 .typename = "FPGA-IRQ",
64 .startup = startup_intreq_irq,
65 .shutdown = shutdown_intreq_irq,
66 .enable = enable_intreq_irq,
67 .disable = disable_intreq_irq,
68 .ack = mask_and_ack_intreq_irq,
73 make_intreq_irq(unsigned int irq)
75 disable_irq_nosync(irq);
76 irq_desc[irq].handler = &intreq_irq_type;
77 disable_intreq_irq(irq);
81 shmse_irq_demux(int irq)
86 if (irq == IRQ5_IRQ) {
87 /* Read status Register */
88 val = ctrl_inw(PA_CPLD_ST);
91 return OFFCHIP_IRQ_BASE + bit - 1;
96 /* IRQ5 is multiplexed between the following sources:
100 * 4. Serial Controller
102 * We configure IRQ5 as a cascade IRQ.
104 static struct irqaction irq5 = { no_action, 0, CPU_MASK_NONE, "IRQ5-cascade",
108 * Initialize IRQ setting
111 init_7343se_IRQ(void)
113 /* Setup Multiplexed interrupts */
114 ctrl_outw(8, PA_CPLD_MODESET); /* Set all CPLD interrupts to active
117 /* Mask all CPLD controller interrupts */
118 ctrl_outw(0x0fff, PA_CPLD_IMSK);
120 /* PC Card interrupts */
121 make_intreq_irq(PC_IRQ0);
122 make_intreq_irq(PC_IRQ1);
123 make_intreq_irq(PC_IRQ2);
124 make_intreq_irq(PC_IRQ3);
126 /* Extension Slot Interrupts */
127 make_intreq_irq(EXT_IRQ0);
128 make_intreq_irq(EXT_IRQ1);
129 make_intreq_irq(EXT_IRQ2);
130 make_intreq_irq(EXT_IRQ3);
132 /* USB Controller interrupts */
133 make_intreq_irq(USB_IRQ0);
134 make_intreq_irq(USB_IRQ1);
136 /* Serial Controller interrupts */
137 make_intreq_irq(UART_IRQ0);
138 make_intreq_irq(UART_IRQ1);
140 /* Setup all external interrupts to be active low */
141 ctrl_outw(0xaaaa, INTC_ICR1);
143 make_ipr_irq(IRQ5_IRQ, IRQ5_IPR_ADDR+2, IRQ5_IPR_POS, IRQ5_PRIORITY);
144 setup_irq(IRQ5_IRQ, &irq5);
145 /* Set port control to use IRQ5 */
146 *(u16 *)0xA4050108 &= ~0xc;
148 make_ipr_irq(SIOF0_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY);
149 make_ipr_irq(VPU_IRQ, VPU_IPR_ADDR, VPU_IPR_POS, 8);
151 ctrl_outb(0x0f, INTC_IMCR5); /* enable SCIF IRQ */
153 make_ipr_irq(DMTE0_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY);
154 make_ipr_irq(DMTE1_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY);
155 make_ipr_irq(DMTE2_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY);
156 make_ipr_irq(DMTE3_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY);
157 make_ipr_irq(DMTE4_IRQ, DMA2_IPR_ADDR, DMA2_IPR_POS, DMA2_PRIORITY);
158 make_ipr_irq(DMTE5_IRQ, DMA2_IPR_ADDR, DMA2_IPR_POS, DMA2_PRIORITY);
161 make_ipr_irq(IIC0_ALI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS, IIC0_PRIORITY);
162 make_ipr_irq(IIC0_TACKI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS,
164 make_ipr_irq(IIC0_WAITI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS,
166 make_ipr_irq(IIC0_DTEI_IRQ, IIC0_IPR_ADDR, IIC0_IPR_POS, IIC0_PRIORITY);
168 make_ipr_irq(IIC1_ALI_IRQ, IIC1_IPR_ADDR, IIC1_IPR_POS, IIC1_PRIORITY);
169 make_ipr_irq(IIC1_TACKI_IRQ, IIC1_IPR_ADDR, IIC1_IPR_POS,
171 make_ipr_irq(IIC1_WAITI_IRQ, IIC1_IPR_ADDR, IIC1_IPR_POS,
173 make_ipr_irq(IIC1_DTEI_IRQ, IIC1_IPR_ADDR, IIC1_IPR_POS, IIC1_PRIORITY);
176 make_ipr_irq(SIOF0_IRQ, SIOF0_IPR_ADDR, SIOF0_IPR_POS, SIOF0_PRIORITY);
179 make_ipr_irq(SIU_IRQ, SIU_IPR_ADDR, SIU_IPR_POS, SIU_PRIORITY);
182 make_ipr_irq(CEU_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY);
183 make_ipr_irq(BEU_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY);
184 make_ipr_irq(VEU_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY);
188 make_ipr_irq(MFI_IRQ, MFI_IPR_ADDR, MFI_IPR_POS, MFI_PRIORITY);
191 make_ipr_irq(LCDC_IRQ, LCDC_IPR_ADDR, LCDC_IPR_POS, LCDC_PRIORITY);
192 ctrl_outw(0x2000, PA_MRSHPC + 0x0c); /* mrshpc irq enable */