1*2874c5fdSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */ 230ad29bbSHuacai Chen /* 330ad29bbSHuacai Chen * Copyright (c) 2011 Zhang, Keguang <keguang.zhang@gmail.com> 430ad29bbSHuacai Chen * 530ad29bbSHuacai Chen * IRQ mappings for Loongson 1 630ad29bbSHuacai Chen */ 730ad29bbSHuacai Chen 830ad29bbSHuacai Chen #ifndef __ASM_MACH_LOONGSON32_IRQ_H 930ad29bbSHuacai Chen #define __ASM_MACH_LOONGSON32_IRQ_H 1030ad29bbSHuacai Chen 1130ad29bbSHuacai Chen /* 1230ad29bbSHuacai Chen * CPU core Interrupt Numbers 1330ad29bbSHuacai Chen */ 1430ad29bbSHuacai Chen #define MIPS_CPU_IRQ_BASE 0 1530ad29bbSHuacai Chen #define MIPS_CPU_IRQ(x) (MIPS_CPU_IRQ_BASE + (x)) 1630ad29bbSHuacai Chen 1730ad29bbSHuacai Chen #define SOFTINT0_IRQ MIPS_CPU_IRQ(0) 1830ad29bbSHuacai Chen #define SOFTINT1_IRQ MIPS_CPU_IRQ(1) 1930ad29bbSHuacai Chen #define INT0_IRQ MIPS_CPU_IRQ(2) 2030ad29bbSHuacai Chen #define INT1_IRQ MIPS_CPU_IRQ(3) 2130ad29bbSHuacai Chen #define INT2_IRQ MIPS_CPU_IRQ(4) 2230ad29bbSHuacai Chen #define INT3_IRQ MIPS_CPU_IRQ(5) 2330ad29bbSHuacai Chen #define INT4_IRQ MIPS_CPU_IRQ(6) 2430ad29bbSHuacai Chen #define TIMER_IRQ MIPS_CPU_IRQ(7) /* cpu timer */ 2530ad29bbSHuacai Chen 2630ad29bbSHuacai Chen #define MIPS_CPU_IRQS (MIPS_CPU_IRQ(7) + 1 - MIPS_CPU_IRQ_BASE) 2730ad29bbSHuacai Chen 2830ad29bbSHuacai Chen /* 2930ad29bbSHuacai Chen * INT0~3 Interrupt Numbers 3030ad29bbSHuacai Chen */ 3130ad29bbSHuacai Chen #define LS1X_IRQ_BASE MIPS_CPU_IRQS 3230ad29bbSHuacai Chen #define LS1X_IRQ(n, x) (LS1X_IRQ_BASE + (n << 5) + (x)) 3330ad29bbSHuacai Chen 3430ad29bbSHuacai Chen #define LS1X_UART0_IRQ LS1X_IRQ(0, 2) 3512e3280bSYang Ling #if defined(CONFIG_LOONGSON1_LS1B) 3630ad29bbSHuacai Chen #define LS1X_UART1_IRQ LS1X_IRQ(0, 3) 3730ad29bbSHuacai Chen #define LS1X_UART2_IRQ LS1X_IRQ(0, 4) 3830ad29bbSHuacai Chen #define LS1X_UART3_IRQ LS1X_IRQ(0, 5) 3912e3280bSYang Ling #elif defined(CONFIG_LOONGSON1_LS1C) 4012e3280bSYang Ling #define LS1X_UART1_IRQ LS1X_IRQ(0, 4) 4112e3280bSYang Ling #define LS1X_UART2_IRQ LS1X_IRQ(0, 5) 4212e3280bSYang Ling #endif 4330ad29bbSHuacai Chen #define LS1X_CAN0_IRQ LS1X_IRQ(0, 6) 4430ad29bbSHuacai Chen #define LS1X_CAN1_IRQ LS1X_IRQ(0, 7) 4530ad29bbSHuacai Chen #define LS1X_SPI0_IRQ LS1X_IRQ(0, 8) 4630ad29bbSHuacai Chen #define LS1X_SPI1_IRQ LS1X_IRQ(0, 9) 4730ad29bbSHuacai Chen #define LS1X_AC97_IRQ LS1X_IRQ(0, 10) 4830ad29bbSHuacai Chen #define LS1X_DMA0_IRQ LS1X_IRQ(0, 13) 4930ad29bbSHuacai Chen #define LS1X_DMA1_IRQ LS1X_IRQ(0, 14) 5030ad29bbSHuacai Chen #define LS1X_DMA2_IRQ LS1X_IRQ(0, 15) 5112e3280bSYang Ling #if defined(CONFIG_LOONGSON1_LS1C) 5212e3280bSYang Ling #define LS1X_NAND_IRQ LS1X_IRQ(0, 16) 5312e3280bSYang Ling #endif 5430ad29bbSHuacai Chen #define LS1X_PWM0_IRQ LS1X_IRQ(0, 17) 5530ad29bbSHuacai Chen #define LS1X_PWM1_IRQ LS1X_IRQ(0, 18) 5630ad29bbSHuacai Chen #define LS1X_PWM2_IRQ LS1X_IRQ(0, 19) 5730ad29bbSHuacai Chen #define LS1X_PWM3_IRQ LS1X_IRQ(0, 20) 5830ad29bbSHuacai Chen #define LS1X_RTC_INT0_IRQ LS1X_IRQ(0, 21) 5930ad29bbSHuacai Chen #define LS1X_RTC_INT1_IRQ LS1X_IRQ(0, 22) 6030ad29bbSHuacai Chen #define LS1X_RTC_INT2_IRQ LS1X_IRQ(0, 23) 6112e3280bSYang Ling #if defined(CONFIG_LOONGSON1_LS1B) 6230ad29bbSHuacai Chen #define LS1X_TOY_INT0_IRQ LS1X_IRQ(0, 24) 6330ad29bbSHuacai Chen #define LS1X_TOY_INT1_IRQ LS1X_IRQ(0, 25) 6430ad29bbSHuacai Chen #define LS1X_TOY_INT2_IRQ LS1X_IRQ(0, 26) 6530ad29bbSHuacai Chen #define LS1X_RTC_TICK_IRQ LS1X_IRQ(0, 27) 6630ad29bbSHuacai Chen #define LS1X_TOY_TICK_IRQ LS1X_IRQ(0, 28) 6712e3280bSYang Ling #define LS1X_UART4_IRQ LS1X_IRQ(0, 29) 6812e3280bSYang Ling #define LS1X_UART5_IRQ LS1X_IRQ(0, 30) 6912e3280bSYang Ling #elif defined(CONFIG_LOONGSON1_LS1C) 7012e3280bSYang Ling #define LS1X_UART3_IRQ LS1X_IRQ(0, 29) 7112e3280bSYang Ling #define LS1X_ADC_IRQ LS1X_IRQ(0, 30) 7212e3280bSYang Ling #define LS1X_SDIO_IRQ LS1X_IRQ(0, 31) 7312e3280bSYang Ling #endif 7430ad29bbSHuacai Chen 7530ad29bbSHuacai Chen #define LS1X_EHCI_IRQ LS1X_IRQ(1, 0) 7630ad29bbSHuacai Chen #define LS1X_OHCI_IRQ LS1X_IRQ(1, 1) 7712e3280bSYang Ling #if defined(CONFIG_LOONGSON1_LS1B) 7830ad29bbSHuacai Chen #define LS1X_GMAC0_IRQ LS1X_IRQ(1, 2) 7930ad29bbSHuacai Chen #define LS1X_GMAC1_IRQ LS1X_IRQ(1, 3) 8012e3280bSYang Ling #elif defined(CONFIG_LOONGSON1_LS1C) 8112e3280bSYang Ling #define LS1X_OTG_IRQ LS1X_IRQ(1, 2) 8212e3280bSYang Ling #define LS1X_GMAC0_IRQ LS1X_IRQ(1, 3) 8312e3280bSYang Ling #define LS1X_CAM_IRQ LS1X_IRQ(1, 4) 8412e3280bSYang Ling #define LS1X_UART4_IRQ LS1X_IRQ(1, 5) 8512e3280bSYang Ling #define LS1X_UART5_IRQ LS1X_IRQ(1, 6) 8612e3280bSYang Ling #define LS1X_UART6_IRQ LS1X_IRQ(1, 7) 8712e3280bSYang Ling #define LS1X_UART7_IRQ LS1X_IRQ(1, 8) 8812e3280bSYang Ling #define LS1X_UART8_IRQ LS1X_IRQ(1, 9) 8912e3280bSYang Ling #define LS1X_UART9_IRQ LS1X_IRQ(1, 13) 9012e3280bSYang Ling #define LS1X_UART10_IRQ LS1X_IRQ(1, 14) 9112e3280bSYang Ling #define LS1X_UART11_IRQ LS1X_IRQ(1, 15) 9212e3280bSYang Ling #define LS1X_I2C0_IRQ LS1X_IRQ(1, 17) 9312e3280bSYang Ling #define LS1X_I2C1_IRQ LS1X_IRQ(1, 18) 9412e3280bSYang Ling #define LS1X_I2C2_IRQ LS1X_IRQ(1, 19) 9512e3280bSYang Ling #endif 9630ad29bbSHuacai Chen 9712e3280bSYang Ling #if defined(CONFIG_LOONGSON1_LS1B) 9812e3280bSYang Ling #define INTN 4 9912e3280bSYang Ling #elif defined(CONFIG_LOONGSON1_LS1C) 10012e3280bSYang Ling #define INTN 5 10112e3280bSYang Ling #endif 10212e3280bSYang Ling 10312e3280bSYang Ling #define LS1X_IRQS (LS1X_IRQ(INTN, 31) + 1 - LS1X_IRQ_BASE) 10430ad29bbSHuacai Chen 10530ad29bbSHuacai Chen #define NR_IRQS (MIPS_CPU_IRQS + LS1X_IRQS) 10630ad29bbSHuacai Chen 10730ad29bbSHuacai Chen #endif /* __ASM_MACH_LOONGSON32_IRQ_H */ 108