18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2003-2005 Simtec Electronics
48c2ecf20Sopenharmony_ci *   Ben Dooks <ben@simtec.co.uk>
58c2ecf20Sopenharmony_ci */
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef __ASM_ARCH_IRQS_H
98c2ecf20Sopenharmony_ci#define __ASM_ARCH_IRQS_H __FILE__
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci/* we keep the first set of CPU IRQs out of the range of
128c2ecf20Sopenharmony_ci * the ISA space, so that the PC104 has them to itself
138c2ecf20Sopenharmony_ci * and we don't end up having to do horrible things to the
148c2ecf20Sopenharmony_ci * standard ISA drivers....
158c2ecf20Sopenharmony_ci */
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#define S3C2410_CPUIRQ_OFFSET	 (16)
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#define S3C2410_IRQ(x) ((x) + S3C2410_CPUIRQ_OFFSET)
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci/* main cpu interrupts */
228c2ecf20Sopenharmony_ci#define IRQ_EINT0      S3C2410_IRQ(0)	    /* 16 */
238c2ecf20Sopenharmony_ci#define IRQ_EINT1      S3C2410_IRQ(1)
248c2ecf20Sopenharmony_ci#define IRQ_EINT2      S3C2410_IRQ(2)
258c2ecf20Sopenharmony_ci#define IRQ_EINT3      S3C2410_IRQ(3)
268c2ecf20Sopenharmony_ci#define IRQ_EINT4t7    S3C2410_IRQ(4)	    /* 20 */
278c2ecf20Sopenharmony_ci#define IRQ_EINT8t23   S3C2410_IRQ(5)
288c2ecf20Sopenharmony_ci#define IRQ_RESERVED6  S3C2410_IRQ(6)	    /* for s3c2410 */
298c2ecf20Sopenharmony_ci#define IRQ_CAM        S3C2410_IRQ(6)	    /* for s3c2440,s3c2443 */
308c2ecf20Sopenharmony_ci#define IRQ_BATT_FLT   S3C2410_IRQ(7)
318c2ecf20Sopenharmony_ci#define IRQ_TICK       S3C2410_IRQ(8)	    /* 24 */
328c2ecf20Sopenharmony_ci#define IRQ_WDT	       S3C2410_IRQ(9)	    /* WDT/AC97 for s3c2443 */
338c2ecf20Sopenharmony_ci#define IRQ_TIMER0     S3C2410_IRQ(10)
348c2ecf20Sopenharmony_ci#define IRQ_TIMER1     S3C2410_IRQ(11)
358c2ecf20Sopenharmony_ci#define IRQ_TIMER2     S3C2410_IRQ(12)
368c2ecf20Sopenharmony_ci#define IRQ_TIMER3     S3C2410_IRQ(13)
378c2ecf20Sopenharmony_ci#define IRQ_TIMER4     S3C2410_IRQ(14)
388c2ecf20Sopenharmony_ci#define IRQ_UART2      S3C2410_IRQ(15)
398c2ecf20Sopenharmony_ci#define IRQ_LCD	       S3C2410_IRQ(16)	    /* 32 */
408c2ecf20Sopenharmony_ci#define IRQ_DMA0       S3C2410_IRQ(17)	    /* IRQ_DMA for s3c2443 */
418c2ecf20Sopenharmony_ci#define IRQ_DMA1       S3C2410_IRQ(18)
428c2ecf20Sopenharmony_ci#define IRQ_DMA2       S3C2410_IRQ(19)
438c2ecf20Sopenharmony_ci#define IRQ_DMA3       S3C2410_IRQ(20)
448c2ecf20Sopenharmony_ci#define IRQ_SDI	       S3C2410_IRQ(21)
458c2ecf20Sopenharmony_ci#define IRQ_SPI0       S3C2410_IRQ(22)
468c2ecf20Sopenharmony_ci#define IRQ_UART1      S3C2410_IRQ(23)
478c2ecf20Sopenharmony_ci#define IRQ_RESERVED24 S3C2410_IRQ(24)	    /* 40 */
488c2ecf20Sopenharmony_ci#define IRQ_NFCON      S3C2410_IRQ(24)	    /* for s3c2440 */
498c2ecf20Sopenharmony_ci#define IRQ_USBD       S3C2410_IRQ(25)
508c2ecf20Sopenharmony_ci#define IRQ_USBH       S3C2410_IRQ(26)
518c2ecf20Sopenharmony_ci#define IRQ_IIC	       S3C2410_IRQ(27)
528c2ecf20Sopenharmony_ci#define IRQ_UART0      S3C2410_IRQ(28)	    /* 44 */
538c2ecf20Sopenharmony_ci#define IRQ_SPI1       S3C2410_IRQ(29)
548c2ecf20Sopenharmony_ci#define IRQ_RTC	       S3C2410_IRQ(30)
558c2ecf20Sopenharmony_ci#define IRQ_ADCPARENT  S3C2410_IRQ(31)
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci/* interrupts generated from the external interrupts sources */
588c2ecf20Sopenharmony_ci#define IRQ_EINT0_2412 S3C2410_IRQ(32)
598c2ecf20Sopenharmony_ci#define IRQ_EINT1_2412 S3C2410_IRQ(33)
608c2ecf20Sopenharmony_ci#define IRQ_EINT2_2412 S3C2410_IRQ(34)
618c2ecf20Sopenharmony_ci#define IRQ_EINT3_2412 S3C2410_IRQ(35)
628c2ecf20Sopenharmony_ci#define IRQ_EINT4      S3C2410_IRQ(36)	   /* 52 */
638c2ecf20Sopenharmony_ci#define IRQ_EINT5      S3C2410_IRQ(37)
648c2ecf20Sopenharmony_ci#define IRQ_EINT6      S3C2410_IRQ(38)
658c2ecf20Sopenharmony_ci#define IRQ_EINT7      S3C2410_IRQ(39)
668c2ecf20Sopenharmony_ci#define IRQ_EINT8      S3C2410_IRQ(40)
678c2ecf20Sopenharmony_ci#define IRQ_EINT9      S3C2410_IRQ(41)
688c2ecf20Sopenharmony_ci#define IRQ_EINT10     S3C2410_IRQ(42)
698c2ecf20Sopenharmony_ci#define IRQ_EINT11     S3C2410_IRQ(43)
708c2ecf20Sopenharmony_ci#define IRQ_EINT12     S3C2410_IRQ(44)
718c2ecf20Sopenharmony_ci#define IRQ_EINT13     S3C2410_IRQ(45)
728c2ecf20Sopenharmony_ci#define IRQ_EINT14     S3C2410_IRQ(46)
738c2ecf20Sopenharmony_ci#define IRQ_EINT15     S3C2410_IRQ(47)
748c2ecf20Sopenharmony_ci#define IRQ_EINT16     S3C2410_IRQ(48)
758c2ecf20Sopenharmony_ci#define IRQ_EINT17     S3C2410_IRQ(49)
768c2ecf20Sopenharmony_ci#define IRQ_EINT18     S3C2410_IRQ(50)
778c2ecf20Sopenharmony_ci#define IRQ_EINT19     S3C2410_IRQ(51)
788c2ecf20Sopenharmony_ci#define IRQ_EINT20     S3C2410_IRQ(52)	   /* 68 */
798c2ecf20Sopenharmony_ci#define IRQ_EINT21     S3C2410_IRQ(53)
808c2ecf20Sopenharmony_ci#define IRQ_EINT22     S3C2410_IRQ(54)
818c2ecf20Sopenharmony_ci#define IRQ_EINT23     S3C2410_IRQ(55)
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci#define IRQ_EINT_BIT(x)	((x) - IRQ_EINT4 + 4)
848c2ecf20Sopenharmony_ci#define IRQ_EINT(x)    (((x) >= 4) ? (IRQ_EINT4 + (x) - 4) : (IRQ_EINT0 + (x)))
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci#define IRQ_LCD_FIFO   S3C2410_IRQ(56)
878c2ecf20Sopenharmony_ci#define IRQ_LCD_FRAME  S3C2410_IRQ(57)
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci/* IRQs for the interal UARTs, and ADC
908c2ecf20Sopenharmony_ci * these need to be ordered in number of appearance in the
918c2ecf20Sopenharmony_ci * SUBSRC mask register
928c2ecf20Sopenharmony_ci*/
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci#define S3C2410_IRQSUB(x)	S3C2410_IRQ((x)+58)
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci#define IRQ_S3CUART_RX0		S3C2410_IRQSUB(0)	/* 74 */
978c2ecf20Sopenharmony_ci#define IRQ_S3CUART_TX0		S3C2410_IRQSUB(1)
988c2ecf20Sopenharmony_ci#define IRQ_S3CUART_ERR0	S3C2410_IRQSUB(2)
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci#define IRQ_S3CUART_RX1		S3C2410_IRQSUB(3)	/* 77 */
1018c2ecf20Sopenharmony_ci#define IRQ_S3CUART_TX1		S3C2410_IRQSUB(4)
1028c2ecf20Sopenharmony_ci#define IRQ_S3CUART_ERR1	S3C2410_IRQSUB(5)
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci#define IRQ_S3CUART_RX2		S3C2410_IRQSUB(6)	/* 80 */
1058c2ecf20Sopenharmony_ci#define IRQ_S3CUART_TX2		S3C2410_IRQSUB(7)
1068c2ecf20Sopenharmony_ci#define IRQ_S3CUART_ERR2	S3C2410_IRQSUB(8)
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci#define IRQ_TC			S3C2410_IRQSUB(9)
1098c2ecf20Sopenharmony_ci#define IRQ_ADC			S3C2410_IRQSUB(10)
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci/* extra irqs for s3c2412 */
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci#define IRQ_S3C2412_CFSDI	S3C2410_IRQ(21)
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ci#define IRQ_S3C2412_SDI		S3C2410_IRQSUB(13)
1168c2ecf20Sopenharmony_ci#define IRQ_S3C2412_CF		S3C2410_IRQSUB(14)
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci#define IRQ_S3C2416_EINT8t15	S3C2410_IRQ(5)
1208c2ecf20Sopenharmony_ci#define IRQ_S3C2416_DMA		S3C2410_IRQ(17)
1218c2ecf20Sopenharmony_ci#define IRQ_S3C2416_UART3	S3C2410_IRQ(18)
1228c2ecf20Sopenharmony_ci#define IRQ_S3C2416_SDI1	S3C2410_IRQ(20)
1238c2ecf20Sopenharmony_ci#define IRQ_S3C2416_SDI0	S3C2410_IRQ(21)
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci#define IRQ_S3C2416_LCD2	S3C2410_IRQSUB(15)
1268c2ecf20Sopenharmony_ci#define IRQ_S3C2416_LCD3	S3C2410_IRQSUB(16)
1278c2ecf20Sopenharmony_ci#define IRQ_S3C2416_LCD4	S3C2410_IRQSUB(17)
1288c2ecf20Sopenharmony_ci#define IRQ_S3C2416_DMA0	S3C2410_IRQSUB(18)
1298c2ecf20Sopenharmony_ci#define IRQ_S3C2416_DMA1	S3C2410_IRQSUB(19)
1308c2ecf20Sopenharmony_ci#define IRQ_S3C2416_DMA2	S3C2410_IRQSUB(20)
1318c2ecf20Sopenharmony_ci#define IRQ_S3C2416_DMA3	S3C2410_IRQSUB(21)
1328c2ecf20Sopenharmony_ci#define IRQ_S3C2416_DMA4	S3C2410_IRQSUB(22)
1338c2ecf20Sopenharmony_ci#define IRQ_S3C2416_DMA5	S3C2410_IRQSUB(23)
1348c2ecf20Sopenharmony_ci#define IRQ_S32416_WDT		S3C2410_IRQSUB(27)
1358c2ecf20Sopenharmony_ci#define IRQ_S32416_AC97		S3C2410_IRQSUB(28)
1368c2ecf20Sopenharmony_ci
1378c2ecf20Sopenharmony_ci/* second interrupt-register of s3c2416/s3c2450 */
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ci#define S3C2416_IRQ(x)		S3C2410_IRQ((x) + 58 + 29)
1408c2ecf20Sopenharmony_ci#define IRQ_S3C2416_2D		S3C2416_IRQ(0)
1418c2ecf20Sopenharmony_ci#define IRQ_S3C2416_IIC1	S3C2416_IRQ(1)
1428c2ecf20Sopenharmony_ci#define IRQ_S3C2416_RESERVED2	S3C2416_IRQ(2)
1438c2ecf20Sopenharmony_ci#define IRQ_S3C2416_RESERVED3	S3C2416_IRQ(3)
1448c2ecf20Sopenharmony_ci#define IRQ_S3C2416_PCM0	S3C2416_IRQ(4)
1458c2ecf20Sopenharmony_ci#define IRQ_S3C2416_PCM1	S3C2416_IRQ(5)
1468c2ecf20Sopenharmony_ci#define IRQ_S3C2416_I2S0	S3C2416_IRQ(6)
1478c2ecf20Sopenharmony_ci#define IRQ_S3C2416_I2S1	S3C2416_IRQ(7)
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci/* extra irqs for s3c2440 */
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci#define IRQ_S3C2440_CAM_C	S3C2410_IRQSUB(11)	/* S3C2443 too */
1528c2ecf20Sopenharmony_ci#define IRQ_S3C2440_CAM_P	S3C2410_IRQSUB(12)	/* S3C2443 too */
1538c2ecf20Sopenharmony_ci#define IRQ_S3C2440_WDT		S3C2410_IRQSUB(13)
1548c2ecf20Sopenharmony_ci#define IRQ_S3C2440_AC97	S3C2410_IRQSUB(14)
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_ci/* irqs for s3c2443 */
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_ci#define IRQ_S3C2443_DMA		S3C2410_IRQ(17)		/* IRQ_DMA1 */
1598c2ecf20Sopenharmony_ci#define IRQ_S3C2443_UART3	S3C2410_IRQ(18)		/* IRQ_DMA2 */
1608c2ecf20Sopenharmony_ci#define IRQ_S3C2443_CFCON	S3C2410_IRQ(19)		/* IRQ_DMA3 */
1618c2ecf20Sopenharmony_ci#define IRQ_S3C2443_HSMMC	S3C2410_IRQ(20)		/* IRQ_SDI */
1628c2ecf20Sopenharmony_ci#define IRQ_S3C2443_NAND	S3C2410_IRQ(24)		/* reserved */
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ci#define IRQ_S3C2416_HSMMC0	S3C2410_IRQ(21)		/* S3C2416/S3C2450 */
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_ci#define IRQ_HSMMC0		IRQ_S3C2416_HSMMC0
1678c2ecf20Sopenharmony_ci#define IRQ_HSMMC1		IRQ_S3C2443_HSMMC
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci#define IRQ_S3C2443_LCD1	S3C2410_IRQSUB(14)
1708c2ecf20Sopenharmony_ci#define IRQ_S3C2443_LCD2	S3C2410_IRQSUB(15)
1718c2ecf20Sopenharmony_ci#define IRQ_S3C2443_LCD3	S3C2410_IRQSUB(16)
1728c2ecf20Sopenharmony_ci#define IRQ_S3C2443_LCD4	S3C2410_IRQSUB(17)
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ci#define IRQ_S3C2443_DMA0	S3C2410_IRQSUB(18)
1758c2ecf20Sopenharmony_ci#define IRQ_S3C2443_DMA1	S3C2410_IRQSUB(19)
1768c2ecf20Sopenharmony_ci#define IRQ_S3C2443_DMA2	S3C2410_IRQSUB(20)
1778c2ecf20Sopenharmony_ci#define IRQ_S3C2443_DMA3	S3C2410_IRQSUB(21)
1788c2ecf20Sopenharmony_ci#define IRQ_S3C2443_DMA4	S3C2410_IRQSUB(22)
1798c2ecf20Sopenharmony_ci#define IRQ_S3C2443_DMA5	S3C2410_IRQSUB(23)
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_ci/* UART3 */
1828c2ecf20Sopenharmony_ci#define IRQ_S3C2443_RX3		S3C2410_IRQSUB(24)
1838c2ecf20Sopenharmony_ci#define IRQ_S3C2443_TX3		S3C2410_IRQSUB(25)
1848c2ecf20Sopenharmony_ci#define IRQ_S3C2443_ERR3	S3C2410_IRQSUB(26)
1858c2ecf20Sopenharmony_ci
1868c2ecf20Sopenharmony_ci#define IRQ_S3C2443_WDT		S3C2410_IRQSUB(27)
1878c2ecf20Sopenharmony_ci#define IRQ_S3C2443_AC97	S3C2410_IRQSUB(28)
1888c2ecf20Sopenharmony_ci
1898c2ecf20Sopenharmony_ci#if defined(CONFIG_CPU_S3C2416)
1908c2ecf20Sopenharmony_ci#define NR_IRQS (IRQ_S3C2416_I2S1 + 1)
1918c2ecf20Sopenharmony_ci#else
1928c2ecf20Sopenharmony_ci#define NR_IRQS (IRQ_S3C2443_AC97 + 1)
1938c2ecf20Sopenharmony_ci#endif
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ci/* compatibility define. */
1968c2ecf20Sopenharmony_ci#define IRQ_UART3		IRQ_S3C2443_UART3
1978c2ecf20Sopenharmony_ci#define IRQ_S3CUART_RX3		IRQ_S3C2443_RX3
1988c2ecf20Sopenharmony_ci#define IRQ_S3CUART_TX3		IRQ_S3C2443_TX3
1998c2ecf20Sopenharmony_ci#define IRQ_S3CUART_ERR3	IRQ_S3C2443_ERR3
2008c2ecf20Sopenharmony_ci
2018c2ecf20Sopenharmony_ci#define IRQ_LCD_VSYNC		IRQ_S3C2443_LCD3
2028c2ecf20Sopenharmony_ci#define IRQ_LCD_SYSTEM		IRQ_S3C2443_LCD2
2038c2ecf20Sopenharmony_ci
2048c2ecf20Sopenharmony_ci#ifdef CONFIG_CPU_S3C2440
2058c2ecf20Sopenharmony_ci#define IRQ_S3C244X_AC97 IRQ_S3C2440_AC97
2068c2ecf20Sopenharmony_ci#else
2078c2ecf20Sopenharmony_ci#define IRQ_S3C244X_AC97 IRQ_S3C2443_AC97
2088c2ecf20Sopenharmony_ci#endif
2098c2ecf20Sopenharmony_ci
2108c2ecf20Sopenharmony_ci/* Our FIQs are routable from IRQ_EINT0 to IRQ_ADCPARENT */
2118c2ecf20Sopenharmony_ci#define FIQ_START		IRQ_EINT0
2128c2ecf20Sopenharmony_ci
2138c2ecf20Sopenharmony_ci#endif /* __ASM_ARCH_IRQ_H */
214