xref: /linux/arch/mips/include/asm/mach-loongson32/irq.h (revision 12e3280b33fe1ada85b84f67613d03e1b6d8dbf6)
130ad29bbSHuacai Chen /*
230ad29bbSHuacai Chen  * Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com>
330ad29bbSHuacai Chen  *
430ad29bbSHuacai Chen  * IRQ mappings for Loongson 1
530ad29bbSHuacai Chen  *
630ad29bbSHuacai Chen  * This program is free software; you can redistribute	it and/or modify it
730ad29bbSHuacai Chen  * under  the terms of	the GNU General	 Public License as published by the
830ad29bbSHuacai Chen  * Free Software Foundation;  either version 2 of the  License, or (at your
930ad29bbSHuacai Chen  * option) any later version.
1030ad29bbSHuacai Chen  */
1130ad29bbSHuacai Chen 
1230ad29bbSHuacai Chen #ifndef __ASM_MACH_LOONGSON32_IRQ_H
1330ad29bbSHuacai Chen #define __ASM_MACH_LOONGSON32_IRQ_H
1430ad29bbSHuacai Chen 
1530ad29bbSHuacai Chen /*
1630ad29bbSHuacai Chen  * CPU core Interrupt Numbers
1730ad29bbSHuacai Chen  */
1830ad29bbSHuacai Chen #define MIPS_CPU_IRQ_BASE		0
1930ad29bbSHuacai Chen #define MIPS_CPU_IRQ(x)			(MIPS_CPU_IRQ_BASE + (x))
2030ad29bbSHuacai Chen 
2130ad29bbSHuacai Chen #define SOFTINT0_IRQ			MIPS_CPU_IRQ(0)
2230ad29bbSHuacai Chen #define SOFTINT1_IRQ			MIPS_CPU_IRQ(1)
2330ad29bbSHuacai Chen #define INT0_IRQ			MIPS_CPU_IRQ(2)
2430ad29bbSHuacai Chen #define INT1_IRQ			MIPS_CPU_IRQ(3)
2530ad29bbSHuacai Chen #define INT2_IRQ			MIPS_CPU_IRQ(4)
2630ad29bbSHuacai Chen #define INT3_IRQ			MIPS_CPU_IRQ(5)
2730ad29bbSHuacai Chen #define INT4_IRQ			MIPS_CPU_IRQ(6)
2830ad29bbSHuacai Chen #define TIMER_IRQ			MIPS_CPU_IRQ(7)		/* cpu timer */
2930ad29bbSHuacai Chen 
3030ad29bbSHuacai Chen #define MIPS_CPU_IRQS		(MIPS_CPU_IRQ(7) + 1 - MIPS_CPU_IRQ_BASE)
3130ad29bbSHuacai Chen 
3230ad29bbSHuacai Chen /*
3330ad29bbSHuacai Chen  * INT0~3 Interrupt Numbers
3430ad29bbSHuacai Chen  */
3530ad29bbSHuacai Chen #define LS1X_IRQ_BASE			MIPS_CPU_IRQS
3630ad29bbSHuacai Chen #define LS1X_IRQ(n, x)			(LS1X_IRQ_BASE + (n << 5) + (x))
3730ad29bbSHuacai Chen 
3830ad29bbSHuacai Chen #define LS1X_UART0_IRQ			LS1X_IRQ(0, 2)
39*12e3280bSYang Ling #if defined(CONFIG_LOONGSON1_LS1B)
4030ad29bbSHuacai Chen #define LS1X_UART1_IRQ			LS1X_IRQ(0, 3)
4130ad29bbSHuacai Chen #define LS1X_UART2_IRQ			LS1X_IRQ(0, 4)
4230ad29bbSHuacai Chen #define LS1X_UART3_IRQ			LS1X_IRQ(0, 5)
43*12e3280bSYang Ling #elif defined(CONFIG_LOONGSON1_LS1C)
44*12e3280bSYang Ling #define LS1X_UART1_IRQ			LS1X_IRQ(0, 4)
45*12e3280bSYang Ling #define LS1X_UART2_IRQ			LS1X_IRQ(0, 5)
46*12e3280bSYang Ling #endif
4730ad29bbSHuacai Chen #define LS1X_CAN0_IRQ			LS1X_IRQ(0, 6)
4830ad29bbSHuacai Chen #define LS1X_CAN1_IRQ			LS1X_IRQ(0, 7)
4930ad29bbSHuacai Chen #define LS1X_SPI0_IRQ			LS1X_IRQ(0, 8)
5030ad29bbSHuacai Chen #define LS1X_SPI1_IRQ			LS1X_IRQ(0, 9)
5130ad29bbSHuacai Chen #define LS1X_AC97_IRQ			LS1X_IRQ(0, 10)
5230ad29bbSHuacai Chen #define LS1X_DMA0_IRQ			LS1X_IRQ(0, 13)
5330ad29bbSHuacai Chen #define LS1X_DMA1_IRQ			LS1X_IRQ(0, 14)
5430ad29bbSHuacai Chen #define LS1X_DMA2_IRQ			LS1X_IRQ(0, 15)
55*12e3280bSYang Ling #if defined(CONFIG_LOONGSON1_LS1C)
56*12e3280bSYang Ling #define LS1X_NAND_IRQ			LS1X_IRQ(0, 16)
57*12e3280bSYang Ling #endif
5830ad29bbSHuacai Chen #define LS1X_PWM0_IRQ			LS1X_IRQ(0, 17)
5930ad29bbSHuacai Chen #define LS1X_PWM1_IRQ			LS1X_IRQ(0, 18)
6030ad29bbSHuacai Chen #define LS1X_PWM2_IRQ			LS1X_IRQ(0, 19)
6130ad29bbSHuacai Chen #define LS1X_PWM3_IRQ			LS1X_IRQ(0, 20)
6230ad29bbSHuacai Chen #define LS1X_RTC_INT0_IRQ		LS1X_IRQ(0, 21)
6330ad29bbSHuacai Chen #define LS1X_RTC_INT1_IRQ		LS1X_IRQ(0, 22)
6430ad29bbSHuacai Chen #define LS1X_RTC_INT2_IRQ		LS1X_IRQ(0, 23)
65*12e3280bSYang Ling #if defined(CONFIG_LOONGSON1_LS1B)
6630ad29bbSHuacai Chen #define LS1X_TOY_INT0_IRQ		LS1X_IRQ(0, 24)
6730ad29bbSHuacai Chen #define LS1X_TOY_INT1_IRQ		LS1X_IRQ(0, 25)
6830ad29bbSHuacai Chen #define LS1X_TOY_INT2_IRQ		LS1X_IRQ(0, 26)
6930ad29bbSHuacai Chen #define LS1X_RTC_TICK_IRQ		LS1X_IRQ(0, 27)
7030ad29bbSHuacai Chen #define LS1X_TOY_TICK_IRQ		LS1X_IRQ(0, 28)
71*12e3280bSYang Ling #define LS1X_UART4_IRQ			LS1X_IRQ(0, 29)
72*12e3280bSYang Ling #define LS1X_UART5_IRQ			LS1X_IRQ(0, 30)
73*12e3280bSYang Ling #elif defined(CONFIG_LOONGSON1_LS1C)
74*12e3280bSYang Ling #define LS1X_UART3_IRQ			LS1X_IRQ(0, 29)
75*12e3280bSYang Ling #define LS1X_ADC_IRQ			LS1X_IRQ(0, 30)
76*12e3280bSYang Ling #define LS1X_SDIO_IRQ			LS1X_IRQ(0, 31)
77*12e3280bSYang Ling #endif
7830ad29bbSHuacai Chen 
7930ad29bbSHuacai Chen #define LS1X_EHCI_IRQ			LS1X_IRQ(1, 0)
8030ad29bbSHuacai Chen #define LS1X_OHCI_IRQ			LS1X_IRQ(1, 1)
81*12e3280bSYang Ling #if defined(CONFIG_LOONGSON1_LS1B)
8230ad29bbSHuacai Chen #define LS1X_GMAC0_IRQ			LS1X_IRQ(1, 2)
8330ad29bbSHuacai Chen #define LS1X_GMAC1_IRQ			LS1X_IRQ(1, 3)
84*12e3280bSYang Ling #elif defined(CONFIG_LOONGSON1_LS1C)
85*12e3280bSYang Ling #define LS1X_OTG_IRQ			LS1X_IRQ(1, 2)
86*12e3280bSYang Ling #define LS1X_GMAC0_IRQ			LS1X_IRQ(1, 3)
87*12e3280bSYang Ling #define LS1X_CAM_IRQ			LS1X_IRQ(1, 4)
88*12e3280bSYang Ling #define LS1X_UART4_IRQ			LS1X_IRQ(1, 5)
89*12e3280bSYang Ling #define LS1X_UART5_IRQ			LS1X_IRQ(1, 6)
90*12e3280bSYang Ling #define LS1X_UART6_IRQ			LS1X_IRQ(1, 7)
91*12e3280bSYang Ling #define LS1X_UART7_IRQ			LS1X_IRQ(1, 8)
92*12e3280bSYang Ling #define LS1X_UART8_IRQ			LS1X_IRQ(1, 9)
93*12e3280bSYang Ling #define LS1X_UART9_IRQ			LS1X_IRQ(1, 13)
94*12e3280bSYang Ling #define LS1X_UART10_IRQ			LS1X_IRQ(1, 14)
95*12e3280bSYang Ling #define LS1X_UART11_IRQ			LS1X_IRQ(1, 15)
96*12e3280bSYang Ling #define LS1X_I2C0_IRQ			LS1X_IRQ(1, 17)
97*12e3280bSYang Ling #define LS1X_I2C1_IRQ			LS1X_IRQ(1, 18)
98*12e3280bSYang Ling #define LS1X_I2C2_IRQ			LS1X_IRQ(1, 19)
99*12e3280bSYang Ling #endif
10030ad29bbSHuacai Chen 
101*12e3280bSYang Ling #if defined(CONFIG_LOONGSON1_LS1B)
102*12e3280bSYang Ling #define INTN	4
103*12e3280bSYang Ling #elif defined(CONFIG_LOONGSON1_LS1C)
104*12e3280bSYang Ling #define INTN	5
105*12e3280bSYang Ling #endif
106*12e3280bSYang Ling 
107*12e3280bSYang Ling #define LS1X_IRQS		(LS1X_IRQ(INTN, 31) + 1 - LS1X_IRQ_BASE)
10830ad29bbSHuacai Chen 
10930ad29bbSHuacai Chen #define NR_IRQS			(MIPS_CPU_IRQS + LS1X_IRQS)
11030ad29bbSHuacai Chen 
11130ad29bbSHuacai Chen #endif /* __ASM_MACH_LOONGSON32_IRQ_H */
112