ARM: S3C24XX: assimilate s3c2416 subirqs into new structure
From: Heiko Stuebner <heiko@...> Date: Sat, 17 Nov 2012 17:46:08 +0100
Commit-Message
The contents of the base interrupt register is identical for s3c2443 and s3c2416/2450, so keep it separate already. Signed-off-by: Heiko Stuebner <heiko@...>
Patch-Comment
arch/arm/plat-s3c24xx/irq.c | 257 ++++++++++++------------------------------- 1 files changed, 72 insertions(+), 185 deletions(-)
Statistics
- 72 lines added
- 185 lines removed
Changes
------------------------- arch/arm/plat-s3c24xx/irq.c --------------------------
index ca60486..ace7e34 100644
@@ -762,158 +762,44 @@ struct syscore_ops s3c24xx_irq_syscore_ops = {
};
#endif
+#if defined CONFIG_CPU_S3C2416 || defined CONFIG_CPU_S3C2443
+struct s3c_irq_data init_s3c2443base[32] = {
+ { .type = S3C_IRQTYPE_EINT0T4, }, /* EINT0 */
+ { .type = S3C_IRQTYPE_EINT0T4, }, /* EINT1 */
+ { .type = S3C_IRQTYPE_EINT0T4, }, /* EINT2 */
+ { .type = S3C_IRQTYPE_EINT0T4, }, /* EINT3 */
+ { .type = S3C_IRQTYPE_PARENT, }, /* EINT4to7 */
+ { .type = S3C_IRQTYPE_PARENT, }, /* EINT8to23 */
+ { .type = S3C_IRQTYPE_PARENT, }, /* CAM on S3C2443/2450 */
+ { .type = S3C_IRQTYPE_EDGE, }, /* nBATT_FLT */
+ { .type = S3C_IRQTYPE_EDGE, }, /* TICK */
+ { .type = S3C_IRQTYPE_PARENT, }, /* WDT/AC97 */
+ { .type = S3C_IRQTYPE_EDGE, }, /* TIMER0 */
+ { .type = S3C_IRQTYPE_EDGE, }, /* TIMER1 */
+ { .type = S3C_IRQTYPE_EDGE, }, /* TIMER2 */
+ { .type = S3C_IRQTYPE_EDGE, }, /* TIMER3 */
+ { .type = S3C_IRQTYPE_EDGE, }, /* TIMER4 */
+ { .type = S3C_IRQTYPE_PARENT, }, /* UART2 */
+ { .type = S3C_IRQTYPE_PARENT, }, /* LCD */
+ { .type = S3C_IRQTYPE_PARENT, }, /* DMA */
+ { .type = S3C_IRQTYPE_PARENT, }, /* UART3 */
+ { .type = S3C_IRQTYPE_NONE, }, /* CFON on S3C2443/2450 */
+ { .type = S3C_IRQTYPE_EDGE, }, /* SDI1 */
+ { .type = S3C_IRQTYPE_EDGE, }, /* SDI0 */
+ { .type = S3C_IRQTYPE_EDGE, }, /* SPI0 */
+ { .type = S3C_IRQTYPE_PARENT, }, /* UART1 */
+ { .type = S3C_IRQTYPE_EDGE, }, /* NAND */
+ { .type = S3C_IRQTYPE_EDGE, }, /* USBD */
+ { .type = S3C_IRQTYPE_EDGE, }, /* USBH */
+ { .type = S3C_IRQTYPE_EDGE, }, /* IIC */
+ { .type = S3C_IRQTYPE_PARENT, }, /* UART0 */
+ { .type = S3C_IRQTYPE_NONE, }, /* SPI1 on S3C243/2450 */
+ { .type = S3C_IRQTYPE_EDGE, }, /* RTC */
+ { .type = S3C_IRQTYPE_PARENT, }, /* ADCPARENT */
};
+#endif
+#ifdef CONFIG_CPU_S3C2416
/* second interrupt register */
@@ -952,27 +838,6 @@ struct irq_chip s3c2416_irq_second = {
};
static void s3c2416_irq_add_second(void)
{
unsigned long pend;
@@ -1009,26 +874,48 @@ static void s3c2416_irq_add_second(void)
}
}
+struct s3c_irq_data init_s3c2416subint[32] = {
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 28 }, /* UART0-RX */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 28 }, /* UART0-TX */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 28 }, /* UART0-ERR */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 23 }, /* UART1-RX */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 23 }, /* UART1-TX */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 23 }, /* UART1-ERR */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 15 }, /* UART2-RX */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 15 }, /* UART2-TX */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 15 }, /* UART2-ERR */
+ { .type = S3C_IRQTYPE_SUBEDGE, .parent_irq = 31 }, /* TC */
+ { .type = S3C_IRQTYPE_SUBEDGE, .parent_irq = 31 }, /* ADC */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 6 }, /* CAM_C S3C2450 */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 6 }, /* CAM_P S3C2450 */
+ { .type = S3C_IRQTYPE_NONE }, /* reserved */
+ { .type = S3C_IRQTYPE_NONE }, /* reserved */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 16 }, /* LCD2 */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 16 }, /* LCD3 */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 16 }, /* LCD4 */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 17 }, /* DMA0 */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 17 }, /* DMA1 */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 17 }, /* DMA2 */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 17 }, /* DMA3 */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 17 }, /* DMA4 */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 17 }, /* DMA5 */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 18 }, /* UART3-RX */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 18 }, /* UART3-TX */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 18 }, /* UART3-ERR */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 9 }, /* WDT */
+ { .type = S3C_IRQTYPE_SUBLEVEL, .parent_irq = 9 }, /* AC97 */
+};
+
void __init s3c2416_init_irq(void)
{
+ /* override irq data */
+ s3c_intc[0].irqs = &init_s3c2443base[0];
+ s3c_intc[2].irqs = &init_s3c2416subint[0];
+
pr_info("S3C2416: IRQ Support\n");
s3c24xx_init_irq();
s3c2416_irq_add_second();
}