diff options
Diffstat (limited to 'arch/arm/plat-omap/include/mach/entry-macro.S')
-rw-r--r-- | arch/arm/plat-omap/include/mach/entry-macro.S | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/arch/arm/plat-omap/include/mach/entry-macro.S b/arch/arm/plat-omap/include/mach/entry-macro.S index 33256a0e9a28..00f45c01390d 100644 --- a/arch/arm/plat-omap/include/mach/entry-macro.S +++ b/arch/arm/plat-omap/include/mach/entry-macro.S | |||
@@ -3,6 +3,9 @@ | |||
3 | * | 3 | * |
4 | * Low-level IRQ helper macros for OMAP-based platforms | 4 | * Low-level IRQ helper macros for OMAP-based platforms |
5 | * | 5 | * |
6 | * Copyright (C) 2009 Texas Instruments | ||
7 | * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
8 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | 9 | * This file is licensed under the terms of the GNU General Public |
7 | * License version 2. This program is licensed "as is" without any | 10 | * License version 2. This program is licensed "as is" without any |
8 | * warranty of any kind, whether express or implied. | 11 | * warranty of any kind, whether express or implied. |
@@ -10,6 +13,7 @@ | |||
10 | #include <mach/hardware.h> | 13 | #include <mach/hardware.h> |
11 | #include <mach/io.h> | 14 | #include <mach/io.h> |
12 | #include <mach/irqs.h> | 15 | #include <mach/irqs.h> |
16 | #include <asm/hardware/gic.h> | ||
13 | 17 | ||
14 | #if defined(CONFIG_ARCH_OMAP1) | 18 | #if defined(CONFIG_ARCH_OMAP1) |
15 | 19 | ||
@@ -56,7 +60,8 @@ | |||
56 | .endm | 60 | .endm |
57 | 61 | ||
58 | #endif | 62 | #endif |
59 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) | 63 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ |
64 | defined(CONFIG_ARCH_OMAP4) | ||
60 | 65 | ||
61 | #include <mach/omap24xx.h> | 66 | #include <mach/omap24xx.h> |
62 | #include <mach/omap34xx.h> | 67 | #include <mach/omap34xx.h> |
@@ -67,7 +72,9 @@ | |||
67 | #elif defined(CONFIG_ARCH_OMAP34XX) | 72 | #elif defined(CONFIG_ARCH_OMAP34XX) |
68 | #define OMAP2_VA_IC_BASE IO_ADDRESS(OMAP34XX_IC_BASE) | 73 | #define OMAP2_VA_IC_BASE IO_ADDRESS(OMAP34XX_IC_BASE) |
69 | #endif | 74 | #endif |
70 | 75 | #if defined(CONFIG_ARCH_OMAP4) | |
76 | #include <mach/omap44xx.h> | ||
77 | #endif | ||
71 | #define INTCPS_SIR_IRQ_OFFSET 0x0040 /* Active interrupt offset */ | 78 | #define INTCPS_SIR_IRQ_OFFSET 0x0040 /* Active interrupt offset */ |
72 | #define ACTIVEIRQ_MASK 0x7f /* Active interrupt bits */ | 79 | #define ACTIVEIRQ_MASK 0x7f /* Active interrupt bits */ |
73 | 80 | ||
@@ -80,6 +87,7 @@ | |||
80 | .macro arch_ret_to_user, tmp1, tmp2 | 87 | .macro arch_ret_to_user, tmp1, tmp2 |
81 | .endm | 88 | .endm |
82 | 89 | ||
90 | #ifndef CONFIG_ARCH_OMAP4 | ||
83 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 91 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
84 | ldr \base, =OMAP2_VA_IC_BASE | 92 | ldr \base, =OMAP2_VA_IC_BASE |
85 | ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */ | 93 | ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */ |
@@ -95,6 +103,40 @@ | |||
95 | and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */ | 103 | and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */ |
96 | 104 | ||
97 | .endm | 105 | .endm |
106 | #else | ||
107 | /* | ||
108 | * The interrupt numbering scheme is defined in the | ||
109 | * interrupt controller spec. To wit: | ||
110 | * | ||
111 | * Interrupts 0-15 are IPI | ||
112 | * 16-28 are reserved | ||
113 | * 29-31 are local. We allow 30 to be used for the watchdog. | ||
114 | * 32-1020 are global | ||
115 | * 1021-1022 are reserved | ||
116 | * 1023 is "spurious" (no interrupt) | ||
117 | * | ||
118 | * For now, we ignore all local interrupts so only return an | ||
119 | * interrupt if it's between 30 and 1020. The test_for_ipi | ||
120 | * routine below will pick up on IPIs. | ||
121 | * A simple read from the controller will tell us the number | ||
122 | * of the highest priority enabled interrupt. | ||
123 | * We then just need to check whether it is in the | ||
124 | * valid range for an IRQ (30-1020 inclusive). | ||
125 | */ | ||
126 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
127 | ldr \base, =OMAP44XX_VA_GIC_CPU_BASE | ||
128 | ldr \irqstat, [\base, #GIC_CPU_INTACK] | ||
129 | |||
130 | ldr \tmp, =1021 | ||
131 | |||
132 | bic \irqnr, \irqstat, #0x1c00 | ||
133 | |||
134 | cmp \irqnr, #29 | ||
135 | cmpcc \irqnr, \irqnr | ||
136 | cmpne \irqnr, \tmp | ||
137 | cmpcs \irqnr, \irqnr | ||
138 | .endm | ||
139 | #endif | ||
98 | 140 | ||
99 | .macro irq_prio_table | 141 | .macro irq_prio_table |
100 | .endm | 142 | .endm |