Merge branch 'master'
[linux-2.6] / include / asm-arm / arch-omap / entry-macro.S
1 /*
2  * include/asm-arm/arch-omap/entry-macro.S
3  *
4  * Low-level IRQ helper macros for OMAP-based platforms
5  *
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.
9  */
10
11 #if defined(CONFIG_ARCH_OMAP1)
12
13 #if defined(CONFIG_ARCH_OMAP730) && \
14         (defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX))
15 #error "FIXME: OMAP730 doesn't support multiple-OMAP"
16 #elif defined(CONFIG_ARCH_OMAP730)
17 #define INT_IH2_IRQ             INT_730_IH2_IRQ
18 #elif defined(CONFIG_ARCH_OMAP15XX)
19 #define INT_IH2_IRQ             INT_1510_IH2_IRQ
20 #elif defined(CONFIG_ARCH_OMAP16XX)
21 #define INT_IH2_IRQ             INT_1610_IH2_IRQ
22 #else
23 #warning "IH2 IRQ defaulted"
24 #define INT_IH2_IRQ             INT_1510_IH2_IRQ
25 #endif
26
27                 .macro  disable_fiq
28                 .endm
29
30                 .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
31                 ldr     \base, =IO_ADDRESS(OMAP_IH1_BASE)
32                 ldr     \irqnr, [\base, #IRQ_ITR_REG_OFFSET]
33                 ldr     \tmp, [\base, #IRQ_MIR_REG_OFFSET]
34                 mov     \irqstat, #0xffffffff
35                 bic     \tmp, \irqstat, \tmp
36                 tst     \irqnr, \tmp
37                 beq     1510f
38
39                 ldr     \irqnr, [\base, #IRQ_SIR_FIQ_REG_OFFSET]
40                 cmp     \irqnr, #0
41                 ldreq   \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
42                 cmpeq   \irqnr, #INT_IH2_IRQ
43                 ldreq   \base, =IO_ADDRESS(OMAP_IH2_BASE)
44                 ldreq   \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
45                 addeqs  \irqnr, \irqnr, #32
46 1510:
47                 .endm
48
49 #elif defined(CONFIG_ARCH_OMAP24XX)
50
51 #include <asm/arch/omap24xx.h>
52
53                 .macro  disable_fiq
54                 .endm
55
56                 .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
57                 ldr     \base, =VA_IC_BASE
58                 ldr     \irqnr, [\base, #0x98] /* IRQ pending reg 1 */
59                 cmp     \irqnr, #0x0
60                 bne     2222f
61                 ldr     \irqnr, [\base, #0xb8] /* IRQ pending reg 2 */
62                 cmp     \irqnr, #0x0
63                 bne     2222f
64                 ldr     \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
65                 cmp     \irqnr, #0x0
66 2222:
67                 ldrne   \irqnr, [\base, #IRQ_SIR_IRQ]
68
69                 .endm
70
71                 .macro  irq_prio_table
72                 .endm
73
74 #endif