2 * arch/arm/plat-omap/include/mach/entry-macro.S
4 * Low-level IRQ helper macros for OMAP-based platforms
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
10 #include <mach/hardware.h>
12 #include <mach/irqs.h>
14 #if defined(CONFIG_ARCH_OMAP1)
16 #if defined(CONFIG_ARCH_OMAP730) && \
17 (defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX))
18 #error "FIXME: OMAP730 doesn't support multiple-OMAP"
19 #elif defined(CONFIG_ARCH_OMAP730)
20 #define INT_IH2_IRQ INT_730_IH2_IRQ
21 #elif defined(CONFIG_ARCH_OMAP15XX)
22 #define INT_IH2_IRQ INT_1510_IH2_IRQ
23 #elif defined(CONFIG_ARCH_OMAP16XX)
24 #define INT_IH2_IRQ INT_1610_IH2_IRQ
26 #warning "IH2 IRQ defaulted"
27 #define INT_IH2_IRQ INT_1510_IH2_IRQ
33 .macro get_irqnr_preamble, base, tmp
36 .macro arch_ret_to_user, tmp1, tmp2
39 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
40 ldr \base, =IO_ADDRESS(OMAP_IH1_BASE)
41 ldr \irqnr, [\base, #IRQ_ITR_REG_OFFSET]
42 ldr \tmp, [\base, #IRQ_MIR_REG_OFFSET]
43 mov \irqstat, #0xffffffff
44 bic \tmp, \irqstat, \tmp
48 ldr \irqnr, [\base, #IRQ_SIR_FIQ_REG_OFFSET]
50 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
51 cmpeq \irqnr, #INT_IH2_IRQ
52 ldreq \base, =IO_ADDRESS(OMAP_IH2_BASE)
53 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
54 addeqs \irqnr, \irqnr, #32
59 #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
61 #if defined(CONFIG_ARCH_OMAP24XX)
62 #include <mach/omap24xx.h>
64 #if defined(CONFIG_ARCH_OMAP34XX)
65 #include <mach/omap34xx.h>
68 #define INTCPS_SIR_IRQ_OFFSET 0x0040 /* Active interrupt number */
73 .macro get_irqnr_preamble, base, tmp
76 .macro arch_ret_to_user, tmp1, tmp2
79 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
80 ldr \base, =OMAP2_VA_IC_BASE
81 ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */
84 ldr \irqnr, [\base, #0xb8] /* IRQ pending reg 2 */
87 ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
90 ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]