2 * include/asm-arm/arch-omap/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 <asm/hardware.h>
11 #include <asm/arch/irqs.h>
13 #if defined(CONFIG_ARCH_OMAP1)
15 #if defined(CONFIG_ARCH_OMAP730) && \
16 (defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX))
17 #error "FIXME: OMAP730 doesn't support multiple-OMAP"
18 #elif defined(CONFIG_ARCH_OMAP730)
19 #define INT_IH2_IRQ INT_730_IH2_IRQ
20 #elif defined(CONFIG_ARCH_OMAP15XX)
21 #define INT_IH2_IRQ INT_1510_IH2_IRQ
22 #elif defined(CONFIG_ARCH_OMAP16XX)
23 #define INT_IH2_IRQ INT_1610_IH2_IRQ
25 #warning "IH2 IRQ defaulted"
26 #define INT_IH2_IRQ INT_1510_IH2_IRQ
32 .macro get_irqnr_preamble, base, tmp
35 .macro arch_ret_to_user, tmp1, tmp2
38 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
39 ldr \base, =IO_ADDRESS(OMAP_IH1_BASE)
40 ldr \irqnr, [\base, #IRQ_ITR_REG_OFFSET]
41 ldr \tmp, [\base, #IRQ_MIR_REG_OFFSET]
42 mov \irqstat, #0xffffffff
43 bic \tmp, \irqstat, \tmp
47 ldr \irqnr, [\base, #IRQ_SIR_FIQ_REG_OFFSET]
49 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
50 cmpeq \irqnr, #INT_IH2_IRQ
51 ldreq \base, =IO_ADDRESS(OMAP_IH2_BASE)
52 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
53 addeqs \irqnr, \irqnr, #32
57 #elif defined(CONFIG_ARCH_OMAP24XX)
59 #include <asm/arch/omap24xx.h>
64 .macro get_irqnr_preamble, base, tmp
67 .macro arch_ret_to_user, tmp1, tmp2
70 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
71 ldr \base, =VA_IC_BASE
72 ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */
75 ldr \irqnr, [\base, #0xb8] /* IRQ pending reg 2 */
78 ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
81 ldrne \irqnr, [\base, #IRQ_SIR_IRQ]