diff options
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r-- | arch/arm/plat-omap/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/plat-omap/clock.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/common.c | 59 | ||||
-rw-r--r-- | arch/arm/plat-omap/cpu-omap.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/debug-devices.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/debug-leds.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/devices.c | 38 | ||||
-rw-r--r-- | arch/arm/plat-omap/dma.c | 86 | ||||
-rw-r--r-- | arch/arm/plat-omap/dmtimer.c | 18 | ||||
-rw-r--r-- | arch/arm/plat-omap/fb.c | 6 | ||||
-rw-r--r-- | arch/arm/plat-omap/gpio.c | 549 | ||||
-rw-r--r-- | arch/arm/plat-omap/i2c.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/debug-macro.S | 70 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/entry-macro.S | 172 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/mtd-xip.h | 61 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/vmalloc.h | 21 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/blizzard.h (renamed from arch/arm/plat-omap/include/mach/blizzard.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/board-ams-delta.h (renamed from arch/arm/plat-omap/include/mach/board-ams-delta.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/board-sx1.h (renamed from arch/arm/plat-omap/include/mach/board-sx1.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/board-voiceblue.h (renamed from arch/arm/plat-omap/include/mach/board-voiceblue.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/board.h (renamed from arch/arm/plat-omap/include/mach/board.h) | 20 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/clkdev.h (renamed from arch/arm/plat-omap/include/mach/clkdev.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/clock.h (renamed from arch/arm/plat-omap/include/mach/clock.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/clockdomain.h (renamed from arch/arm/plat-omap/include/mach/clockdomain.h) | 6 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/common.h (renamed from arch/arm/plat-omap/include/mach/common.h) | 3 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/control.h (renamed from arch/arm/plat-omap/include/mach/control.h) | 114 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/cpu.h (renamed from arch/arm/plat-omap/include/mach/cpu.h) | 91 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/dma.h (renamed from arch/arm/plat-omap/include/mach/dma.h) | 5 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/dmtimer.h (renamed from arch/arm/plat-omap/include/mach/dmtimer.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/dsp_common.h (renamed from arch/arm/plat-omap/include/mach/dsp_common.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/fpga.h (renamed from arch/arm/plat-omap/include/mach/fpga.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/gpio-switch.h (renamed from arch/arm/plat-omap/include/mach/gpio-switch.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/gpio.h (renamed from arch/arm/plat-omap/include/mach/gpio.h) | 3 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/gpmc-smc91x.h (renamed from arch/arm/plat-omap/include/mach/gpmc-smc91x.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/gpmc.h (renamed from arch/arm/plat-omap/include/mach/gpmc.h) | 3 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/hardware.h (renamed from arch/arm/plat-omap/include/mach/hardware.h) | 16 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/hwa742.h (renamed from arch/arm/plat-omap/include/mach/hwa742.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/io.h (renamed from arch/arm/plat-omap/include/mach/io.h) | 124 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/iommu.h (renamed from arch/arm/plat-omap/include/mach/iommu.h) | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/iommu2.h (renamed from arch/arm/plat-omap/include/mach/iommu2.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/iovmm.h (renamed from arch/arm/plat-omap/include/mach/iovmm.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/irda.h (renamed from arch/arm/plat-omap/include/mach/irda.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/irqs.h (renamed from arch/arm/plat-omap/include/mach/irqs.h) | 234 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/keypad.h (renamed from arch/arm/plat-omap/include/mach/keypad.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/lcd_mipid.h (renamed from arch/arm/plat-omap/include/mach/lcd_mipid.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/led.h (renamed from arch/arm/plat-omap/include/mach/led.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/mailbox.h (renamed from arch/arm/plat-omap/include/mach/mailbox.h) | 23 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/mcbsp.h (renamed from arch/arm/plat-omap/include/mach/mcbsp.h) | 8 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/mcspi.h (renamed from arch/arm/plat-omap/include/mach/mcspi.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/memory.h (renamed from arch/arm/plat-omap/include/mach/memory.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/menelaus.h (renamed from arch/arm/plat-omap/include/mach/menelaus.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/mmc.h (renamed from arch/arm/plat-omap/include/mach/mmc.h) | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/mux.h (renamed from arch/arm/plat-omap/include/mach/mux.h) | 114 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/nand.h (renamed from arch/arm/plat-omap/include/mach/nand.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap-alsa.h (renamed from arch/arm/plat-omap/include/mach/omap-alsa.h) | 4 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap-pm.h (renamed from arch/arm/plat-omap/include/mach/omap-pm.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap1510.h (renamed from arch/arm/plat-omap/include/mach/omap1510.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap16xx.h (renamed from arch/arm/plat-omap/include/mach/omap16xx.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap24xx.h (renamed from arch/arm/plat-omap/include/mach/omap24xx.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap34xx.h (renamed from arch/arm/plat-omap/include/mach/omap34xx.h) | 11 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap44xx.h (renamed from arch/arm/plat-omap/include/mach/omap44xx.h) | 10 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap730.h (renamed from arch/arm/plat-omap/include/mach/omap730.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap7xx.h | 104 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap850.h (renamed from arch/arm/plat-omap/include/mach/omap850.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap_device.h (renamed from arch/arm/plat-omap/include/mach/omap_device.h) | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap_hwmod.h (renamed from arch/arm/plat-omap/include/mach/omap_hwmod.h) | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omapfb.h (renamed from arch/arm/plat-omap/include/mach/omapfb.h) | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/onenand.h (renamed from arch/arm/plat-omap/include/mach/onenand.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/param.h (renamed from arch/arm/plat-omap/include/mach/param.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/powerdomain.h (renamed from arch/arm/plat-omap/include/mach/powerdomain.h) | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/prcm.h (renamed from arch/arm/plat-omap/include/mach/prcm.h) | 6 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/sdrc.h (renamed from arch/arm/plat-omap/include/mach/sdrc.h) | 14 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/serial.h (renamed from arch/arm/plat-omap/include/mach/serial.h) | 4 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/smp.h (renamed from arch/arm/plat-omap/include/mach/smp.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/sram.h (renamed from arch/arm/plat-omap/include/mach/sram.h) | 7 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/system.h (renamed from arch/arm/plat-omap/include/mach/system.h) | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/tc.h (renamed from arch/arm/plat-omap/include/mach/tc.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/timer-gp.h (renamed from arch/arm/plat-omap/include/mach/timer-gp.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/timex.h (renamed from arch/arm/plat-omap/include/mach/timex.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/uncompress.h (renamed from arch/arm/plat-omap/include/mach/uncompress.h) | 11 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/usb.h (renamed from arch/arm/plat-omap/include/mach/usb.h) | 19 | ||||
-rw-r--r-- | arch/arm/plat-omap/io.c | 44 | ||||
-rw-r--r-- | arch/arm/plat-omap/iommu-debug.c | 4 | ||||
-rw-r--r-- | arch/arm/plat-omap/iommu.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/iovmm.c | 19 | ||||
-rw-r--r-- | arch/arm/plat-omap/mailbox.c | 284 | ||||
-rw-r--r-- | arch/arm/plat-omap/mcbsp.c | 10 | ||||
-rw-r--r-- | arch/arm/plat-omap/mux.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/omap-pm-noop.c | 4 | ||||
-rw-r--r-- | arch/arm/plat-omap/omap_device.c | 54 | ||||
-rw-r--r-- | arch/arm/plat-omap/sram.c | 40 | ||||
-rw-r--r-- | arch/arm/plat-omap/usb.c | 38 |
92 files changed, 1241 insertions, 1323 deletions
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index 64b3f52bd9b2..f348ddfb0492 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig | |||
@@ -165,7 +165,7 @@ config OMAP_DM_TIMER | |||
165 | choice | 165 | choice |
166 | prompt "Low-level debug console UART" | 166 | prompt "Low-level debug console UART" |
167 | depends on ARCH_OMAP | 167 | depends on ARCH_OMAP |
168 | default OMAP_LL_DEBUG_UART1 | 168 | default OMAP_LL_DEBUG_NONE |
169 | 169 | ||
170 | config OMAP_LL_DEBUG_UART1 | 170 | config OMAP_LL_DEBUG_UART1 |
171 | bool "UART1" | 171 | bool "UART1" |
@@ -176,6 +176,9 @@ config OMAP_LL_DEBUG_UART2 | |||
176 | config OMAP_LL_DEBUG_UART3 | 176 | config OMAP_LL_DEBUG_UART3 |
177 | bool "UART3" | 177 | bool "UART3" |
178 | 178 | ||
179 | config OMAP_LL_DEBUG_NONE | ||
180 | bool "None" | ||
181 | |||
179 | endchoice | 182 | endchoice |
180 | 183 | ||
181 | config OMAP_SERIAL_WAKE | 184 | config OMAP_SERIAL_WAKE |
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index bf880e966d3b..681bfc37ebb2 100644 --- a/arch/arm/plat-omap/clock.c +++ b/arch/arm/plat-omap/clock.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <linux/debugfs.h> | 24 | #include <linux/debugfs.h> |
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | 26 | ||
27 | #include <mach/clock.h> | 27 | #include <plat/clock.h> |
28 | 28 | ||
29 | static LIST_HEAD(clocks); | 29 | static LIST_HEAD(clocks); |
30 | static DEFINE_MUTEX(clocks_mutex); | 30 | static DEFINE_MUTEX(clocks_mutex); |
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c index 3a4768d55895..cc050b3313bd 100644 --- a/arch/arm/plat-omap/common.c +++ b/arch/arm/plat-omap/common.c | |||
@@ -29,13 +29,13 @@ | |||
29 | #include <asm/mach/map.h> | 29 | #include <asm/mach/map.h> |
30 | #include <asm/setup.h> | 30 | #include <asm/setup.h> |
31 | 31 | ||
32 | #include <mach/common.h> | 32 | #include <plat/common.h> |
33 | #include <mach/board.h> | 33 | #include <plat/board.h> |
34 | #include <mach/control.h> | 34 | #include <plat/control.h> |
35 | #include <mach/mux.h> | 35 | #include <plat/mux.h> |
36 | #include <mach/fpga.h> | 36 | #include <plat/fpga.h> |
37 | 37 | ||
38 | #include <mach/clock.h> | 38 | #include <plat/clock.h> |
39 | 39 | ||
40 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) | 40 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) |
41 | # include "../mach-omap2/sdrc.h" | 41 | # include "../mach-omap2/sdrc.h" |
@@ -49,6 +49,9 @@ int omap_bootloader_tag_len; | |||
49 | struct omap_board_config_kernel *omap_board_config; | 49 | struct omap_board_config_kernel *omap_board_config; |
50 | int omap_board_config_size; | 50 | int omap_board_config_size; |
51 | 51 | ||
52 | /* used by omap-smp.c and board-4430sdp.c */ | ||
53 | void __iomem *gic_cpu_base_addr; | ||
54 | |||
52 | static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out) | 55 | static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out) |
53 | { | 56 | { |
54 | struct omap_board_config_kernel *kinfo = NULL; | 57 | struct omap_board_config_kernel *kinfo = NULL; |
@@ -224,12 +227,12 @@ static void __init __omap2_set_globals(struct omap_globals *omap2_globals) | |||
224 | 227 | ||
225 | static struct omap_globals omap242x_globals = { | 228 | static struct omap_globals omap242x_globals = { |
226 | .class = OMAP242X_CLASS, | 229 | .class = OMAP242X_CLASS, |
227 | .tap = OMAP2_IO_ADDRESS(0x48014000), | 230 | .tap = OMAP2_L4_IO_ADDRESS(0x48014000), |
228 | .sdrc = OMAP2_IO_ADDRESS(OMAP2420_SDRC_BASE), | 231 | .sdrc = OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE), |
229 | .sms = OMAP2_IO_ADDRESS(OMAP2420_SMS_BASE), | 232 | .sms = OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE), |
230 | .ctrl = OMAP2_IO_ADDRESS(OMAP2420_CTRL_BASE), | 233 | .ctrl = OMAP2_L4_IO_ADDRESS(OMAP2420_CTRL_BASE), |
231 | .prm = OMAP2_IO_ADDRESS(OMAP2420_PRM_BASE), | 234 | .prm = OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE), |
232 | .cm = OMAP2_IO_ADDRESS(OMAP2420_CM_BASE), | 235 | .cm = OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE), |
233 | }; | 236 | }; |
234 | 237 | ||
235 | void __init omap2_set_globals_242x(void) | 238 | void __init omap2_set_globals_242x(void) |
@@ -242,12 +245,12 @@ void __init omap2_set_globals_242x(void) | |||
242 | 245 | ||
243 | static struct omap_globals omap243x_globals = { | 246 | static struct omap_globals omap243x_globals = { |
244 | .class = OMAP243X_CLASS, | 247 | .class = OMAP243X_CLASS, |
245 | .tap = OMAP2_IO_ADDRESS(0x4900a000), | 248 | .tap = OMAP2_L4_IO_ADDRESS(0x4900a000), |
246 | .sdrc = OMAP2_IO_ADDRESS(OMAP243X_SDRC_BASE), | 249 | .sdrc = OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE), |
247 | .sms = OMAP2_IO_ADDRESS(OMAP243X_SMS_BASE), | 250 | .sms = OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE), |
248 | .ctrl = OMAP2_IO_ADDRESS(OMAP243X_CTRL_BASE), | 251 | .ctrl = OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE), |
249 | .prm = OMAP2_IO_ADDRESS(OMAP2430_PRM_BASE), | 252 | .prm = OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE), |
250 | .cm = OMAP2_IO_ADDRESS(OMAP2430_CM_BASE), | 253 | .cm = OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE), |
251 | }; | 254 | }; |
252 | 255 | ||
253 | void __init omap2_set_globals_243x(void) | 256 | void __init omap2_set_globals_243x(void) |
@@ -260,12 +263,12 @@ void __init omap2_set_globals_243x(void) | |||
260 | 263 | ||
261 | static struct omap_globals omap343x_globals = { | 264 | static struct omap_globals omap343x_globals = { |
262 | .class = OMAP343X_CLASS, | 265 | .class = OMAP343X_CLASS, |
263 | .tap = OMAP2_IO_ADDRESS(0x4830A000), | 266 | .tap = OMAP2_L4_IO_ADDRESS(0x4830A000), |
264 | .sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE), | 267 | .sdrc = OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE), |
265 | .sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE), | 268 | .sms = OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE), |
266 | .ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE), | 269 | .ctrl = OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE), |
267 | .prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE), | 270 | .prm = OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE), |
268 | .cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE), | 271 | .cm = OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE), |
269 | }; | 272 | }; |
270 | 273 | ||
271 | void __init omap2_set_globals_343x(void) | 274 | void __init omap2_set_globals_343x(void) |
@@ -277,10 +280,10 @@ void __init omap2_set_globals_343x(void) | |||
277 | #if defined(CONFIG_ARCH_OMAP4) | 280 | #if defined(CONFIG_ARCH_OMAP4) |
278 | static struct omap_globals omap4_globals = { | 281 | static struct omap_globals omap4_globals = { |
279 | .class = OMAP443X_CLASS, | 282 | .class = OMAP443X_CLASS, |
280 | .tap = OMAP2_IO_ADDRESS(0x4830a000), | 283 | .tap = OMAP2_L4_IO_ADDRESS(0x4830a000), |
281 | .ctrl = OMAP2_IO_ADDRESS(OMAP443X_CTRL_BASE), | 284 | .ctrl = OMAP2_L4_IO_ADDRESS(OMAP443X_CTRL_BASE), |
282 | .prm = OMAP2_IO_ADDRESS(OMAP4430_PRM_BASE), | 285 | .prm = OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE), |
283 | .cm = OMAP2_IO_ADDRESS(OMAP4430_CM_BASE), | 286 | .cm = OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE), |
284 | }; | 287 | }; |
285 | 288 | ||
286 | void __init omap2_set_globals_443x(void) | 289 | void __init omap2_set_globals_443x(void) |
diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c index 341235c278ac..f8ddbdd8b076 100644 --- a/arch/arm/plat-omap/cpu-omap.c +++ b/arch/arm/plat-omap/cpu-omap.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | 24 | ||
25 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
26 | #include <mach/clock.h> | 26 | #include <plat/clock.h> |
27 | #include <asm/system.h> | 27 | #include <asm/system.h> |
28 | 28 | ||
29 | #define VERY_HI_RATE 900000000 | 29 | #define VERY_HI_RATE 900000000 |
diff --git a/arch/arm/plat-omap/debug-devices.c b/arch/arm/plat-omap/debug-devices.c index f6684832ca8f..09c1107637f6 100644 --- a/arch/arm/plat-omap/debug-devices.c +++ b/arch/arm/plat-omap/debug-devices.c | |||
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | #include <mach/hardware.h> | 17 | #include <mach/hardware.h> |
18 | 18 | ||
19 | #include <mach/board.h> | 19 | #include <plat/board.h> |
20 | #include <mach/gpio.h> | 20 | #include <mach/gpio.h> |
21 | 21 | ||
22 | 22 | ||
diff --git a/arch/arm/plat-omap/debug-leds.c b/arch/arm/plat-omap/debug-leds.c index 9395898dd49a..6c768b71ad64 100644 --- a/arch/arm/plat-omap/debug-leds.c +++ b/arch/arm/plat-omap/debug-leds.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <asm/system.h> | 18 | #include <asm/system.h> |
19 | #include <asm/mach-types.h> | 19 | #include <asm/mach-types.h> |
20 | 20 | ||
21 | #include <mach/fpga.h> | 21 | #include <plat/fpga.h> |
22 | #include <mach/gpio.h> | 22 | #include <mach/gpio.h> |
23 | 23 | ||
24 | 24 | ||
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c index a64b692a1bfe..f86617869b38 100644 --- a/arch/arm/plat-omap/devices.c +++ b/arch/arm/plat-omap/devices.c | |||
@@ -19,15 +19,15 @@ | |||
19 | #include <asm/mach-types.h> | 19 | #include <asm/mach-types.h> |
20 | #include <asm/mach/map.h> | 20 | #include <asm/mach/map.h> |
21 | 21 | ||
22 | #include <mach/tc.h> | 22 | #include <plat/tc.h> |
23 | #include <mach/control.h> | 23 | #include <plat/control.h> |
24 | #include <mach/board.h> | 24 | #include <plat/board.h> |
25 | #include <mach/mmc.h> | 25 | #include <plat/mmc.h> |
26 | #include <mach/mux.h> | 26 | #include <plat/mux.h> |
27 | #include <mach/gpio.h> | 27 | #include <mach/gpio.h> |
28 | #include <mach/menelaus.h> | 28 | #include <plat/menelaus.h> |
29 | #include <mach/mcbsp.h> | 29 | #include <plat/mcbsp.h> |
30 | #include <mach/dsp_common.h> | 30 | #include <plat/dsp_common.h> |
31 | 31 | ||
32 | #if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE) | 32 | #if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE) |
33 | 33 | ||
@@ -113,17 +113,17 @@ static void omap_init_kp(void) | |||
113 | omap_cfg_reg(E19_1610_KBR4); | 113 | omap_cfg_reg(E19_1610_KBR4); |
114 | omap_cfg_reg(N19_1610_KBR5); | 114 | omap_cfg_reg(N19_1610_KBR5); |
115 | } else if (machine_is_omap_perseus2() || machine_is_omap_fsample()) { | 115 | } else if (machine_is_omap_perseus2() || machine_is_omap_fsample()) { |
116 | omap_cfg_reg(E2_730_KBR0); | 116 | omap_cfg_reg(E2_7XX_KBR0); |
117 | omap_cfg_reg(J7_730_KBR1); | 117 | omap_cfg_reg(J7_7XX_KBR1); |
118 | omap_cfg_reg(E1_730_KBR2); | 118 | omap_cfg_reg(E1_7XX_KBR2); |
119 | omap_cfg_reg(F3_730_KBR3); | 119 | omap_cfg_reg(F3_7XX_KBR3); |
120 | omap_cfg_reg(D2_730_KBR4); | 120 | omap_cfg_reg(D2_7XX_KBR4); |
121 | 121 | ||
122 | omap_cfg_reg(C2_730_KBC0); | 122 | omap_cfg_reg(C2_7XX_KBC0); |
123 | omap_cfg_reg(D3_730_KBC1); | 123 | omap_cfg_reg(D3_7XX_KBC1); |
124 | omap_cfg_reg(E4_730_KBC2); | 124 | omap_cfg_reg(E4_7XX_KBC2); |
125 | omap_cfg_reg(F4_730_KBC3); | 125 | omap_cfg_reg(F4_7XX_KBC3); |
126 | omap_cfg_reg(E3_730_KBC4); | 126 | omap_cfg_reg(E3_7XX_KBC4); |
127 | } else if (machine_is_omap_h4()) { | 127 | } else if (machine_is_omap_h4()) { |
128 | omap_cfg_reg(T19_24XX_KBR0); | 128 | omap_cfg_reg(T19_24XX_KBR0); |
129 | omap_cfg_reg(R19_24XX_KBR1); | 129 | omap_cfg_reg(R19_24XX_KBR1); |
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 68eaae324b6a..be4ce070fb4c 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c | |||
@@ -32,9 +32,9 @@ | |||
32 | 32 | ||
33 | #include <asm/system.h> | 33 | #include <asm/system.h> |
34 | #include <mach/hardware.h> | 34 | #include <mach/hardware.h> |
35 | #include <mach/dma.h> | 35 | #include <plat/dma.h> |
36 | 36 | ||
37 | #include <mach/tc.h> | 37 | #include <plat/tc.h> |
38 | 38 | ||
39 | #undef DEBUG | 39 | #undef DEBUG |
40 | 40 | ||
@@ -54,6 +54,12 @@ enum { DMA_CHAIN_STARTED, DMA_CHAIN_NOTSTARTED }; | |||
54 | 54 | ||
55 | static int enable_1510_mode; | 55 | static int enable_1510_mode; |
56 | 56 | ||
57 | static struct omap_dma_global_context_registers { | ||
58 | u32 dma_irqenable_l0; | ||
59 | u32 dma_ocp_sysconfig; | ||
60 | u32 dma_gcr; | ||
61 | } omap_dma_global_context; | ||
62 | |||
57 | struct omap_dma_lch { | 63 | struct omap_dma_lch { |
58 | int next_lch; | 64 | int next_lch; |
59 | int dev_id; | 65 | int dev_id; |
@@ -2355,44 +2361,83 @@ void omap_stop_lcd_dma(void) | |||
2355 | } | 2361 | } |
2356 | EXPORT_SYMBOL(omap_stop_lcd_dma); | 2362 | EXPORT_SYMBOL(omap_stop_lcd_dma); |
2357 | 2363 | ||
2364 | void omap_dma_global_context_save(void) | ||
2365 | { | ||
2366 | omap_dma_global_context.dma_irqenable_l0 = | ||
2367 | dma_read(IRQENABLE_L0); | ||
2368 | omap_dma_global_context.dma_ocp_sysconfig = | ||
2369 | dma_read(OCP_SYSCONFIG); | ||
2370 | omap_dma_global_context.dma_gcr = dma_read(GCR); | ||
2371 | } | ||
2372 | |||
2373 | void omap_dma_global_context_restore(void) | ||
2374 | { | ||
2375 | int ch; | ||
2376 | |||
2377 | dma_write(omap_dma_global_context.dma_gcr, GCR); | ||
2378 | dma_write(omap_dma_global_context.dma_ocp_sysconfig, | ||
2379 | OCP_SYSCONFIG); | ||
2380 | dma_write(omap_dma_global_context.dma_irqenable_l0, | ||
2381 | IRQENABLE_L0); | ||
2382 | |||
2383 | /* | ||
2384 | * A bug in ROM code leaves IRQ status for channels 0 and 1 uncleared | ||
2385 | * after secure sram context save and restore. Hence we need to | ||
2386 | * manually clear those IRQs to avoid spurious interrupts. This | ||
2387 | * affects only secure devices. | ||
2388 | */ | ||
2389 | if (cpu_is_omap34xx() && (omap_type() != OMAP2_DEVICE_TYPE_GP)) | ||
2390 | dma_write(0x3 , IRQSTATUS_L0); | ||
2391 | |||
2392 | for (ch = 0; ch < dma_chan_count; ch++) | ||
2393 | if (dma_chan[ch].dev_id != -1) | ||
2394 | omap_clear_dma(ch); | ||
2395 | } | ||
2396 | |||
2358 | /*----------------------------------------------------------------------------*/ | 2397 | /*----------------------------------------------------------------------------*/ |
2359 | 2398 | ||
2360 | static int __init omap_init_dma(void) | 2399 | static int __init omap_init_dma(void) |
2361 | { | 2400 | { |
2401 | unsigned long base; | ||
2362 | int ch, r; | 2402 | int ch, r; |
2363 | 2403 | ||
2364 | if (cpu_class_is_omap1()) { | 2404 | if (cpu_class_is_omap1()) { |
2365 | omap_dma_base = OMAP1_IO_ADDRESS(OMAP1_DMA_BASE); | 2405 | base = OMAP1_DMA_BASE; |
2366 | dma_lch_count = OMAP1_LOGICAL_DMA_CH_COUNT; | 2406 | dma_lch_count = OMAP1_LOGICAL_DMA_CH_COUNT; |
2367 | } else if (cpu_is_omap24xx()) { | 2407 | } else if (cpu_is_omap24xx()) { |
2368 | omap_dma_base = OMAP2_IO_ADDRESS(OMAP24XX_DMA4_BASE); | 2408 | base = OMAP24XX_DMA4_BASE; |
2369 | dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; | 2409 | dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; |
2370 | } else if (cpu_is_omap34xx()) { | 2410 | } else if (cpu_is_omap34xx()) { |
2371 | omap_dma_base = OMAP2_IO_ADDRESS(OMAP34XX_DMA4_BASE); | 2411 | base = OMAP34XX_DMA4_BASE; |
2372 | dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; | 2412 | dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; |
2373 | } else if (cpu_is_omap44xx()) { | 2413 | } else if (cpu_is_omap44xx()) { |
2374 | omap_dma_base = OMAP2_IO_ADDRESS(OMAP44XX_DMA4_BASE); | 2414 | base = OMAP44XX_DMA4_BASE; |
2375 | dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; | 2415 | dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; |
2376 | } else { | 2416 | } else { |
2377 | pr_err("DMA init failed for unsupported omap\n"); | 2417 | pr_err("DMA init failed for unsupported omap\n"); |
2378 | return -ENODEV; | 2418 | return -ENODEV; |
2379 | } | 2419 | } |
2380 | 2420 | ||
2421 | omap_dma_base = ioremap(base, SZ_4K); | ||
2422 | BUG_ON(!omap_dma_base); | ||
2423 | |||
2381 | if (cpu_class_is_omap2() && omap_dma_reserve_channels | 2424 | if (cpu_class_is_omap2() && omap_dma_reserve_channels |
2382 | && (omap_dma_reserve_channels <= dma_lch_count)) | 2425 | && (omap_dma_reserve_channels <= dma_lch_count)) |
2383 | dma_lch_count = omap_dma_reserve_channels; | 2426 | dma_lch_count = omap_dma_reserve_channels; |
2384 | 2427 | ||
2385 | dma_chan = kzalloc(sizeof(struct omap_dma_lch) * dma_lch_count, | 2428 | dma_chan = kzalloc(sizeof(struct omap_dma_lch) * dma_lch_count, |
2386 | GFP_KERNEL); | 2429 | GFP_KERNEL); |
2387 | if (!dma_chan) | 2430 | if (!dma_chan) { |
2388 | return -ENOMEM; | 2431 | r = -ENOMEM; |
2432 | goto out_unmap; | ||
2433 | } | ||
2389 | 2434 | ||
2390 | if (cpu_class_is_omap2()) { | 2435 | if (cpu_class_is_omap2()) { |
2391 | dma_linked_lch = kzalloc(sizeof(struct dma_link_info) * | 2436 | dma_linked_lch = kzalloc(sizeof(struct dma_link_info) * |
2392 | dma_lch_count, GFP_KERNEL); | 2437 | dma_lch_count, GFP_KERNEL); |
2393 | if (!dma_linked_lch) { | 2438 | if (!dma_linked_lch) { |
2394 | kfree(dma_chan); | 2439 | r = -ENOMEM; |
2395 | return -ENOMEM; | 2440 | goto out_free; |
2396 | } | 2441 | } |
2397 | } | 2442 | } |
2398 | 2443 | ||
@@ -2466,7 +2511,7 @@ static int __init omap_init_dma(void) | |||
2466 | for (i = 0; i < ch; i++) | 2511 | for (i = 0; i < ch; i++) |
2467 | free_irq(omap1_dma_irq[i], | 2512 | free_irq(omap1_dma_irq[i], |
2468 | (void *) (i + 1)); | 2513 | (void *) (i + 1)); |
2469 | return r; | 2514 | goto out_free; |
2470 | } | 2515 | } |
2471 | } | 2516 | } |
2472 | } | 2517 | } |
@@ -2484,8 +2529,8 @@ static int __init omap_init_dma(void) | |||
2484 | setup_irq(irq, &omap24xx_dma_irq); | 2529 | setup_irq(irq, &omap24xx_dma_irq); |
2485 | } | 2530 | } |
2486 | 2531 | ||
2487 | /* Enable smartidle idlemodes and autoidle */ | ||
2488 | if (cpu_is_omap34xx()) { | 2532 | if (cpu_is_omap34xx()) { |
2533 | /* Enable smartidle idlemodes and autoidle */ | ||
2489 | u32 v = dma_read(OCP_SYSCONFIG); | 2534 | u32 v = dma_read(OCP_SYSCONFIG); |
2490 | v &= ~(DMA_SYSCONFIG_MIDLEMODE_MASK | | 2535 | v &= ~(DMA_SYSCONFIG_MIDLEMODE_MASK | |
2491 | DMA_SYSCONFIG_SIDLEMODE_MASK | | 2536 | DMA_SYSCONFIG_SIDLEMODE_MASK | |
@@ -2494,6 +2539,13 @@ static int __init omap_init_dma(void) | |||
2494 | DMA_SYSCONFIG_SIDLEMODE(DMA_IDLEMODE_SMARTIDLE) | | 2539 | DMA_SYSCONFIG_SIDLEMODE(DMA_IDLEMODE_SMARTIDLE) | |
2495 | DMA_SYSCONFIG_AUTOIDLE); | 2540 | DMA_SYSCONFIG_AUTOIDLE); |
2496 | dma_write(v , OCP_SYSCONFIG); | 2541 | dma_write(v , OCP_SYSCONFIG); |
2542 | /* reserve dma channels 0 and 1 in high security devices */ | ||
2543 | if (omap_type() != OMAP2_DEVICE_TYPE_GP) { | ||
2544 | printk(KERN_INFO "Reserving DMA channels 0 and 1 for " | ||
2545 | "HS ROM code\n"); | ||
2546 | dma_chan[0].dev_id = 0; | ||
2547 | dma_chan[1].dev_id = 1; | ||
2548 | } | ||
2497 | } | 2549 | } |
2498 | 2550 | ||
2499 | 2551 | ||
@@ -2508,11 +2560,19 @@ static int __init omap_init_dma(void) | |||
2508 | "(error %d)\n", r); | 2560 | "(error %d)\n", r); |
2509 | for (i = 0; i < dma_chan_count; i++) | 2561 | for (i = 0; i < dma_chan_count; i++) |
2510 | free_irq(omap1_dma_irq[i], (void *) (i + 1)); | 2562 | free_irq(omap1_dma_irq[i], (void *) (i + 1)); |
2511 | return r; | 2563 | goto out_free; |
2512 | } | 2564 | } |
2513 | } | 2565 | } |
2514 | 2566 | ||
2515 | return 0; | 2567 | return 0; |
2568 | |||
2569 | out_free: | ||
2570 | kfree(dma_chan); | ||
2571 | |||
2572 | out_unmap: | ||
2573 | iounmap(omap_dma_base); | ||
2574 | |||
2575 | return r; | ||
2516 | } | 2576 | } |
2517 | 2577 | ||
2518 | arch_initcall(omap_init_dma); | 2578 | arch_initcall(omap_init_dma); |
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index d325b54daeb5..64f407ee0f4e 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c | |||
@@ -38,7 +38,7 @@ | |||
38 | #include <linux/io.h> | 38 | #include <linux/io.h> |
39 | #include <linux/module.h> | 39 | #include <linux/module.h> |
40 | #include <mach/hardware.h> | 40 | #include <mach/hardware.h> |
41 | #include <mach/dmtimer.h> | 41 | #include <plat/dmtimer.h> |
42 | #include <mach/irqs.h> | 42 | #include <mach/irqs.h> |
43 | 43 | ||
44 | /* register offsets */ | 44 | /* register offsets */ |
@@ -742,16 +742,17 @@ EXPORT_SYMBOL_GPL(omap_dm_timers_active); | |||
742 | int __init omap_dm_timer_init(void) | 742 | int __init omap_dm_timer_init(void) |
743 | { | 743 | { |
744 | struct omap_dm_timer *timer; | 744 | struct omap_dm_timer *timer; |
745 | int i; | 745 | int i, map_size = SZ_8K; /* Module 4KB + L4 4KB except on omap1 */ |
746 | 746 | ||
747 | if (!(cpu_is_omap16xx() || cpu_class_is_omap2())) | 747 | if (!(cpu_is_omap16xx() || cpu_class_is_omap2())) |
748 | return -ENODEV; | 748 | return -ENODEV; |
749 | 749 | ||
750 | spin_lock_init(&dm_timer_lock); | 750 | spin_lock_init(&dm_timer_lock); |
751 | 751 | ||
752 | if (cpu_class_is_omap1()) | 752 | if (cpu_class_is_omap1()) { |
753 | dm_timers = omap1_dm_timers; | 753 | dm_timers = omap1_dm_timers; |
754 | else if (cpu_is_omap24xx()) { | 754 | map_size = SZ_2K; |
755 | } else if (cpu_is_omap24xx()) { | ||
755 | dm_timers = omap2_dm_timers; | 756 | dm_timers = omap2_dm_timers; |
756 | dm_source_names = omap2_dm_source_names; | 757 | dm_source_names = omap2_dm_source_names; |
757 | dm_source_clocks = omap2_dm_source_clocks; | 758 | dm_source_clocks = omap2_dm_source_clocks; |
@@ -774,10 +775,11 @@ int __init omap_dm_timer_init(void) | |||
774 | 775 | ||
775 | for (i = 0; i < dm_timer_count; i++) { | 776 | for (i = 0; i < dm_timer_count; i++) { |
776 | timer = &dm_timers[i]; | 777 | timer = &dm_timers[i]; |
777 | if (cpu_class_is_omap1()) | 778 | |
778 | timer->io_base = OMAP1_IO_ADDRESS(timer->phys_base); | 779 | /* Static mapping, never released */ |
779 | else | 780 | timer->io_base = ioremap(timer->phys_base, map_size); |
780 | timer->io_base = OMAP2_IO_ADDRESS(timer->phys_base); | 781 | BUG_ON(!timer->io_base); |
782 | |||
781 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \ | 783 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \ |
782 | defined(CONFIG_ARCH_OMAP4) | 784 | defined(CONFIG_ARCH_OMAP4) |
783 | if (cpu_class_is_omap2()) { | 785 | if (cpu_class_is_omap2()) { |
diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c index 3746222bed10..78a4ce538dbd 100644 --- a/arch/arm/plat-omap/fb.c +++ b/arch/arm/plat-omap/fb.c | |||
@@ -32,9 +32,9 @@ | |||
32 | #include <mach/hardware.h> | 32 | #include <mach/hardware.h> |
33 | #include <asm/mach/map.h> | 33 | #include <asm/mach/map.h> |
34 | 34 | ||
35 | #include <mach/board.h> | 35 | #include <plat/board.h> |
36 | #include <mach/sram.h> | 36 | #include <plat/sram.h> |
37 | #include <mach/omapfb.h> | 37 | #include <plat/omapfb.h> |
38 | 38 | ||
39 | #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) | 39 | #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) |
40 | 40 | ||
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index 7c345b757df1..055160e0620e 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c | |||
@@ -31,7 +31,7 @@ | |||
31 | /* | 31 | /* |
32 | * OMAP1510 GPIO registers | 32 | * OMAP1510 GPIO registers |
33 | */ | 33 | */ |
34 | #define OMAP1510_GPIO_BASE OMAP1_IO_ADDRESS(0xfffce000) | 34 | #define OMAP1510_GPIO_BASE 0xfffce000 |
35 | #define OMAP1510_GPIO_DATA_INPUT 0x00 | 35 | #define OMAP1510_GPIO_DATA_INPUT 0x00 |
36 | #define OMAP1510_GPIO_DATA_OUTPUT 0x04 | 36 | #define OMAP1510_GPIO_DATA_OUTPUT 0x04 |
37 | #define OMAP1510_GPIO_DIR_CONTROL 0x08 | 37 | #define OMAP1510_GPIO_DIR_CONTROL 0x08 |
@@ -45,10 +45,10 @@ | |||
45 | /* | 45 | /* |
46 | * OMAP1610 specific GPIO registers | 46 | * OMAP1610 specific GPIO registers |
47 | */ | 47 | */ |
48 | #define OMAP1610_GPIO1_BASE OMAP1_IO_ADDRESS(0xfffbe400) | 48 | #define OMAP1610_GPIO1_BASE 0xfffbe400 |
49 | #define OMAP1610_GPIO2_BASE OMAP1_IO_ADDRESS(0xfffbec00) | 49 | #define OMAP1610_GPIO2_BASE 0xfffbec00 |
50 | #define OMAP1610_GPIO3_BASE OMAP1_IO_ADDRESS(0xfffbb400) | 50 | #define OMAP1610_GPIO3_BASE 0xfffbb400 |
51 | #define OMAP1610_GPIO4_BASE OMAP1_IO_ADDRESS(0xfffbbc00) | 51 | #define OMAP1610_GPIO4_BASE 0xfffbbc00 |
52 | #define OMAP1610_GPIO_REVISION 0x0000 | 52 | #define OMAP1610_GPIO_REVISION 0x0000 |
53 | #define OMAP1610_GPIO_SYSCONFIG 0x0010 | 53 | #define OMAP1610_GPIO_SYSCONFIG 0x0010 |
54 | #define OMAP1610_GPIO_SYSSTATUS 0x0014 | 54 | #define OMAP1610_GPIO_SYSSTATUS 0x0014 |
@@ -68,52 +68,36 @@ | |||
68 | #define OMAP1610_GPIO_SET_DATAOUT 0x00f0 | 68 | #define OMAP1610_GPIO_SET_DATAOUT 0x00f0 |
69 | 69 | ||
70 | /* | 70 | /* |
71 | * OMAP730 specific GPIO registers | 71 | * OMAP7XX specific GPIO registers |
72 | */ | 72 | */ |
73 | #define OMAP730_GPIO1_BASE OMAP1_IO_ADDRESS(0xfffbc000) | 73 | #define OMAP7XX_GPIO1_BASE 0xfffbc000 |
74 | #define OMAP730_GPIO2_BASE OMAP1_IO_ADDRESS(0xfffbc800) | 74 | #define OMAP7XX_GPIO2_BASE 0xfffbc800 |
75 | #define OMAP730_GPIO3_BASE OMAP1_IO_ADDRESS(0xfffbd000) | 75 | #define OMAP7XX_GPIO3_BASE 0xfffbd000 |
76 | #define OMAP730_GPIO4_BASE OMAP1_IO_ADDRESS(0xfffbd800) | 76 | #define OMAP7XX_GPIO4_BASE 0xfffbd800 |
77 | #define OMAP730_GPIO5_BASE OMAP1_IO_ADDRESS(0xfffbe000) | 77 | #define OMAP7XX_GPIO5_BASE 0xfffbe000 |
78 | #define OMAP730_GPIO6_BASE OMAP1_IO_ADDRESS(0xfffbe800) | 78 | #define OMAP7XX_GPIO6_BASE 0xfffbe800 |
79 | #define OMAP730_GPIO_DATA_INPUT 0x00 | 79 | #define OMAP7XX_GPIO_DATA_INPUT 0x00 |
80 | #define OMAP730_GPIO_DATA_OUTPUT 0x04 | 80 | #define OMAP7XX_GPIO_DATA_OUTPUT 0x04 |
81 | #define OMAP730_GPIO_DIR_CONTROL 0x08 | 81 | #define OMAP7XX_GPIO_DIR_CONTROL 0x08 |
82 | #define OMAP730_GPIO_INT_CONTROL 0x0c | 82 | #define OMAP7XX_GPIO_INT_CONTROL 0x0c |
83 | #define OMAP730_GPIO_INT_MASK 0x10 | 83 | #define OMAP7XX_GPIO_INT_MASK 0x10 |
84 | #define OMAP730_GPIO_INT_STATUS 0x14 | 84 | #define OMAP7XX_GPIO_INT_STATUS 0x14 |
85 | 85 | ||
86 | /* | 86 | #define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE |
87 | * OMAP850 specific GPIO registers | ||
88 | */ | ||
89 | #define OMAP850_GPIO1_BASE OMAP1_IO_ADDRESS(0xfffbc000) | ||
90 | #define OMAP850_GPIO2_BASE OMAP1_IO_ADDRESS(0xfffbc800) | ||
91 | #define OMAP850_GPIO3_BASE OMAP1_IO_ADDRESS(0xfffbd000) | ||
92 | #define OMAP850_GPIO4_BASE OMAP1_IO_ADDRESS(0xfffbd800) | ||
93 | #define OMAP850_GPIO5_BASE OMAP1_IO_ADDRESS(0xfffbe000) | ||
94 | #define OMAP850_GPIO6_BASE OMAP1_IO_ADDRESS(0xfffbe800) | ||
95 | #define OMAP850_GPIO_DATA_INPUT 0x00 | ||
96 | #define OMAP850_GPIO_DATA_OUTPUT 0x04 | ||
97 | #define OMAP850_GPIO_DIR_CONTROL 0x08 | ||
98 | #define OMAP850_GPIO_INT_CONTROL 0x0c | ||
99 | #define OMAP850_GPIO_INT_MASK 0x10 | ||
100 | #define OMAP850_GPIO_INT_STATUS 0x14 | ||
101 | |||
102 | #define OMAP1_MPUIO_VBASE OMAP1_IO_ADDRESS(OMAP1_MPUIO_BASE) | ||
103 | 87 | ||
104 | /* | 88 | /* |
105 | * omap24xx specific GPIO registers | 89 | * omap24xx specific GPIO registers |
106 | */ | 90 | */ |
107 | #define OMAP242X_GPIO1_BASE OMAP2_IO_ADDRESS(0x48018000) | 91 | #define OMAP242X_GPIO1_BASE 0x48018000 |
108 | #define OMAP242X_GPIO2_BASE OMAP2_IO_ADDRESS(0x4801a000) | 92 | #define OMAP242X_GPIO2_BASE 0x4801a000 |
109 | #define OMAP242X_GPIO3_BASE OMAP2_IO_ADDRESS(0x4801c000) | 93 | #define OMAP242X_GPIO3_BASE 0x4801c000 |
110 | #define OMAP242X_GPIO4_BASE OMAP2_IO_ADDRESS(0x4801e000) | 94 | #define OMAP242X_GPIO4_BASE 0x4801e000 |
111 | 95 | ||
112 | #define OMAP243X_GPIO1_BASE OMAP2_IO_ADDRESS(0x4900C000) | 96 | #define OMAP243X_GPIO1_BASE 0x4900C000 |
113 | #define OMAP243X_GPIO2_BASE OMAP2_IO_ADDRESS(0x4900E000) | 97 | #define OMAP243X_GPIO2_BASE 0x4900E000 |
114 | #define OMAP243X_GPIO3_BASE OMAP2_IO_ADDRESS(0x49010000) | 98 | #define OMAP243X_GPIO3_BASE 0x49010000 |
115 | #define OMAP243X_GPIO4_BASE OMAP2_IO_ADDRESS(0x49012000) | 99 | #define OMAP243X_GPIO4_BASE 0x49012000 |
116 | #define OMAP243X_GPIO5_BASE OMAP2_IO_ADDRESS(0x480B6000) | 100 | #define OMAP243X_GPIO5_BASE 0x480B6000 |
117 | 101 | ||
118 | #define OMAP24XX_GPIO_REVISION 0x0000 | 102 | #define OMAP24XX_GPIO_REVISION 0x0000 |
119 | #define OMAP24XX_GPIO_SYSCONFIG 0x0010 | 103 | #define OMAP24XX_GPIO_SYSCONFIG 0x0010 |
@@ -170,24 +154,25 @@ | |||
170 | * omap34xx specific GPIO registers | 154 | * omap34xx specific GPIO registers |
171 | */ | 155 | */ |
172 | 156 | ||
173 | #define OMAP34XX_GPIO1_BASE OMAP2_IO_ADDRESS(0x48310000) | 157 | #define OMAP34XX_GPIO1_BASE 0x48310000 |
174 | #define OMAP34XX_GPIO2_BASE OMAP2_IO_ADDRESS(0x49050000) | 158 | #define OMAP34XX_GPIO2_BASE 0x49050000 |
175 | #define OMAP34XX_GPIO3_BASE OMAP2_IO_ADDRESS(0x49052000) | 159 | #define OMAP34XX_GPIO3_BASE 0x49052000 |
176 | #define OMAP34XX_GPIO4_BASE OMAP2_IO_ADDRESS(0x49054000) | 160 | #define OMAP34XX_GPIO4_BASE 0x49054000 |
177 | #define OMAP34XX_GPIO5_BASE OMAP2_IO_ADDRESS(0x49056000) | 161 | #define OMAP34XX_GPIO5_BASE 0x49056000 |
178 | #define OMAP34XX_GPIO6_BASE OMAP2_IO_ADDRESS(0x49058000) | 162 | #define OMAP34XX_GPIO6_BASE 0x49058000 |
179 | 163 | ||
180 | /* | 164 | /* |
181 | * OMAP44XX specific GPIO registers | 165 | * OMAP44XX specific GPIO registers |
182 | */ | 166 | */ |
183 | #define OMAP44XX_GPIO1_BASE OMAP2_IO_ADDRESS(0x4a310000) | 167 | #define OMAP44XX_GPIO1_BASE 0x4a310000 |
184 | #define OMAP44XX_GPIO2_BASE OMAP2_IO_ADDRESS(0x48055000) | 168 | #define OMAP44XX_GPIO2_BASE 0x48055000 |
185 | #define OMAP44XX_GPIO3_BASE OMAP2_IO_ADDRESS(0x48057000) | 169 | #define OMAP44XX_GPIO3_BASE 0x48057000 |
186 | #define OMAP44XX_GPIO4_BASE OMAP2_IO_ADDRESS(0x48059000) | 170 | #define OMAP44XX_GPIO4_BASE 0x48059000 |
187 | #define OMAP44XX_GPIO5_BASE OMAP2_IO_ADDRESS(0x4805B000) | 171 | #define OMAP44XX_GPIO5_BASE 0x4805B000 |
188 | #define OMAP44XX_GPIO6_BASE OMAP2_IO_ADDRESS(0x4805D000) | 172 | #define OMAP44XX_GPIO6_BASE 0x4805D000 |
189 | 173 | ||
190 | struct gpio_bank { | 174 | struct gpio_bank { |
175 | unsigned long pbase; | ||
191 | void __iomem *base; | 176 | void __iomem *base; |
192 | u16 irq; | 177 | u16 irq; |
193 | u16 virtual_irq_start; | 178 | u16 virtual_irq_start; |
@@ -210,101 +195,134 @@ struct gpio_bank { | |||
210 | spinlock_t lock; | 195 | spinlock_t lock; |
211 | struct gpio_chip chip; | 196 | struct gpio_chip chip; |
212 | struct clk *dbck; | 197 | struct clk *dbck; |
198 | u32 mod_usage; | ||
213 | }; | 199 | }; |
214 | 200 | ||
215 | #define METHOD_MPUIO 0 | 201 | #define METHOD_MPUIO 0 |
216 | #define METHOD_GPIO_1510 1 | 202 | #define METHOD_GPIO_1510 1 |
217 | #define METHOD_GPIO_1610 2 | 203 | #define METHOD_GPIO_1610 2 |
218 | #define METHOD_GPIO_730 3 | 204 | #define METHOD_GPIO_7XX 3 |
219 | #define METHOD_GPIO_850 4 | ||
220 | #define METHOD_GPIO_24XX 5 | 205 | #define METHOD_GPIO_24XX 5 |
221 | 206 | ||
222 | #ifdef CONFIG_ARCH_OMAP16XX | 207 | #ifdef CONFIG_ARCH_OMAP16XX |
223 | static struct gpio_bank gpio_bank_1610[5] = { | 208 | static struct gpio_bank gpio_bank_1610[5] = { |
224 | { OMAP1_MPUIO_VBASE, INT_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO}, | 209 | { OMAP1_MPUIO_VBASE, NULL, INT_MPUIO, IH_MPUIO_BASE, |
225 | { OMAP1610_GPIO1_BASE, INT_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_1610 }, | 210 | METHOD_MPUIO }, |
226 | { OMAP1610_GPIO2_BASE, INT_1610_GPIO_BANK2, IH_GPIO_BASE + 16, METHOD_GPIO_1610 }, | 211 | { OMAP1610_GPIO1_BASE, NULL, INT_GPIO_BANK1, IH_GPIO_BASE, |
227 | { OMAP1610_GPIO3_BASE, INT_1610_GPIO_BANK3, IH_GPIO_BASE + 32, METHOD_GPIO_1610 }, | 212 | METHOD_GPIO_1610 }, |
228 | { OMAP1610_GPIO4_BASE, INT_1610_GPIO_BANK4, IH_GPIO_BASE + 48, METHOD_GPIO_1610 }, | 213 | { OMAP1610_GPIO2_BASE, NULL, INT_1610_GPIO_BANK2, IH_GPIO_BASE + 16, |
214 | METHOD_GPIO_1610 }, | ||
215 | { OMAP1610_GPIO3_BASE, NULL, INT_1610_GPIO_BANK3, IH_GPIO_BASE + 32, | ||
216 | METHOD_GPIO_1610 }, | ||
217 | { OMAP1610_GPIO4_BASE, NULL, INT_1610_GPIO_BANK4, IH_GPIO_BASE + 48, | ||
218 | METHOD_GPIO_1610 }, | ||
229 | }; | 219 | }; |
230 | #endif | 220 | #endif |
231 | 221 | ||
232 | #ifdef CONFIG_ARCH_OMAP15XX | 222 | #ifdef CONFIG_ARCH_OMAP15XX |
233 | static struct gpio_bank gpio_bank_1510[2] = { | 223 | static struct gpio_bank gpio_bank_1510[2] = { |
234 | { OMAP1_MPUIO_VBASE, INT_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO }, | 224 | { OMAP1_MPUIO_VBASE, NULL, INT_MPUIO, IH_MPUIO_BASE, |
235 | { OMAP1510_GPIO_BASE, INT_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_1510 } | 225 | METHOD_MPUIO }, |
236 | }; | 226 | { OMAP1510_GPIO_BASE, NULL, INT_GPIO_BANK1, IH_GPIO_BASE, |
237 | #endif | 227 | METHOD_GPIO_1510 } |
238 | |||
239 | #ifdef CONFIG_ARCH_OMAP730 | ||
240 | static struct gpio_bank gpio_bank_730[7] = { | ||
241 | { OMAP1_MPUIO_VBASE, INT_730_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO }, | ||
242 | { OMAP730_GPIO1_BASE, INT_730_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_730 }, | ||
243 | { OMAP730_GPIO2_BASE, INT_730_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_730 }, | ||
244 | { OMAP730_GPIO3_BASE, INT_730_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_730 }, | ||
245 | { OMAP730_GPIO4_BASE, INT_730_GPIO_BANK4, IH_GPIO_BASE + 96, METHOD_GPIO_730 }, | ||
246 | { OMAP730_GPIO5_BASE, INT_730_GPIO_BANK5, IH_GPIO_BASE + 128, METHOD_GPIO_730 }, | ||
247 | { OMAP730_GPIO6_BASE, INT_730_GPIO_BANK6, IH_GPIO_BASE + 160, METHOD_GPIO_730 }, | ||
248 | }; | 228 | }; |
249 | #endif | 229 | #endif |
250 | 230 | ||
251 | #ifdef CONFIG_ARCH_OMAP850 | 231 | #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) |
252 | static struct gpio_bank gpio_bank_850[7] = { | 232 | static struct gpio_bank gpio_bank_7xx[7] = { |
253 | { OMAP1_MPUIO_VBASE, INT_850_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO }, | 233 | { OMAP1_MPUIO_VBASE, NULL, INT_7XX_MPUIO, IH_MPUIO_BASE, |
254 | { OMAP850_GPIO1_BASE, INT_850_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_850 }, | 234 | METHOD_MPUIO }, |
255 | { OMAP850_GPIO2_BASE, INT_850_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_850 }, | 235 | { OMAP7XX_GPIO1_BASE, NULL, INT_7XX_GPIO_BANK1, IH_GPIO_BASE, |
256 | { OMAP850_GPIO3_BASE, INT_850_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_850 }, | 236 | METHOD_GPIO_7XX }, |
257 | { OMAP850_GPIO4_BASE, INT_850_GPIO_BANK4, IH_GPIO_BASE + 96, METHOD_GPIO_850 }, | 237 | { OMAP7XX_GPIO2_BASE, NULL, INT_7XX_GPIO_BANK2, IH_GPIO_BASE + 32, |
258 | { OMAP850_GPIO5_BASE, INT_850_GPIO_BANK5, IH_GPIO_BASE + 128, METHOD_GPIO_850 }, | 238 | METHOD_GPIO_7XX }, |
259 | { OMAP850_GPIO6_BASE, INT_850_GPIO_BANK6, IH_GPIO_BASE + 160, METHOD_GPIO_850 }, | 239 | { OMAP7XX_GPIO3_BASE, NULL, INT_7XX_GPIO_BANK3, IH_GPIO_BASE + 64, |
240 | METHOD_GPIO_7XX }, | ||
241 | { OMAP7XX_GPIO4_BASE, NULL, INT_7XX_GPIO_BANK4, IH_GPIO_BASE + 96, | ||
242 | METHOD_GPIO_7XX }, | ||
243 | { OMAP7XX_GPIO5_BASE, NULL, INT_7XX_GPIO_BANK5, IH_GPIO_BASE + 128, | ||
244 | METHOD_GPIO_7XX }, | ||
245 | { OMAP7XX_GPIO6_BASE, NULL, INT_7XX_GPIO_BANK6, IH_GPIO_BASE + 160, | ||
246 | METHOD_GPIO_7XX }, | ||
260 | }; | 247 | }; |
261 | #endif | 248 | #endif |
262 | 249 | ||
263 | |||
264 | #ifdef CONFIG_ARCH_OMAP24XX | 250 | #ifdef CONFIG_ARCH_OMAP24XX |
265 | 251 | ||
266 | static struct gpio_bank gpio_bank_242x[4] = { | 252 | static struct gpio_bank gpio_bank_242x[4] = { |
267 | { OMAP242X_GPIO1_BASE, INT_24XX_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_24XX }, | 253 | { OMAP242X_GPIO1_BASE, NULL, INT_24XX_GPIO_BANK1, IH_GPIO_BASE, |
268 | { OMAP242X_GPIO2_BASE, INT_24XX_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_24XX }, | 254 | METHOD_GPIO_24XX }, |
269 | { OMAP242X_GPIO3_BASE, INT_24XX_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_24XX }, | 255 | { OMAP242X_GPIO2_BASE, NULL, INT_24XX_GPIO_BANK2, IH_GPIO_BASE + 32, |
270 | { OMAP242X_GPIO4_BASE, INT_24XX_GPIO_BANK4, IH_GPIO_BASE + 96, METHOD_GPIO_24XX }, | 256 | METHOD_GPIO_24XX }, |
257 | { OMAP242X_GPIO3_BASE, NULL, INT_24XX_GPIO_BANK3, IH_GPIO_BASE + 64, | ||
258 | METHOD_GPIO_24XX }, | ||
259 | { OMAP242X_GPIO4_BASE, NULL, INT_24XX_GPIO_BANK4, IH_GPIO_BASE + 96, | ||
260 | METHOD_GPIO_24XX }, | ||
271 | }; | 261 | }; |
272 | 262 | ||
273 | static struct gpio_bank gpio_bank_243x[5] = { | 263 | static struct gpio_bank gpio_bank_243x[5] = { |
274 | { OMAP243X_GPIO1_BASE, INT_24XX_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_24XX }, | 264 | { OMAP243X_GPIO1_BASE, NULL, INT_24XX_GPIO_BANK1, IH_GPIO_BASE, |
275 | { OMAP243X_GPIO2_BASE, INT_24XX_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_24XX }, | 265 | METHOD_GPIO_24XX }, |
276 | { OMAP243X_GPIO3_BASE, INT_24XX_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_24XX }, | 266 | { OMAP243X_GPIO2_BASE, NULL, INT_24XX_GPIO_BANK2, IH_GPIO_BASE + 32, |
277 | { OMAP243X_GPIO4_BASE, INT_24XX_GPIO_BANK4, IH_GPIO_BASE + 96, METHOD_GPIO_24XX }, | 267 | METHOD_GPIO_24XX }, |
278 | { OMAP243X_GPIO5_BASE, INT_24XX_GPIO_BANK5, IH_GPIO_BASE + 128, METHOD_GPIO_24XX }, | 268 | { OMAP243X_GPIO3_BASE, NULL, INT_24XX_GPIO_BANK3, IH_GPIO_BASE + 64, |
269 | METHOD_GPIO_24XX }, | ||
270 | { OMAP243X_GPIO4_BASE, NULL, INT_24XX_GPIO_BANK4, IH_GPIO_BASE + 96, | ||
271 | METHOD_GPIO_24XX }, | ||
272 | { OMAP243X_GPIO5_BASE, NULL, INT_24XX_GPIO_BANK5, IH_GPIO_BASE + 128, | ||
273 | METHOD_GPIO_24XX }, | ||
279 | }; | 274 | }; |
280 | 275 | ||
281 | #endif | 276 | #endif |
282 | 277 | ||
283 | #ifdef CONFIG_ARCH_OMAP34XX | 278 | #ifdef CONFIG_ARCH_OMAP34XX |
284 | static struct gpio_bank gpio_bank_34xx[6] = { | 279 | static struct gpio_bank gpio_bank_34xx[6] = { |
285 | { OMAP34XX_GPIO1_BASE, INT_34XX_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_24XX }, | 280 | { OMAP34XX_GPIO1_BASE, NULL, INT_34XX_GPIO_BANK1, IH_GPIO_BASE, |
286 | { OMAP34XX_GPIO2_BASE, INT_34XX_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_24XX }, | 281 | METHOD_GPIO_24XX }, |
287 | { OMAP34XX_GPIO3_BASE, INT_34XX_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_24XX }, | 282 | { OMAP34XX_GPIO2_BASE, NULL, INT_34XX_GPIO_BANK2, IH_GPIO_BASE + 32, |
288 | { OMAP34XX_GPIO4_BASE, INT_34XX_GPIO_BANK4, IH_GPIO_BASE + 96, METHOD_GPIO_24XX }, | 283 | METHOD_GPIO_24XX }, |
289 | { OMAP34XX_GPIO5_BASE, INT_34XX_GPIO_BANK5, IH_GPIO_BASE + 128, METHOD_GPIO_24XX }, | 284 | { OMAP34XX_GPIO3_BASE, NULL, INT_34XX_GPIO_BANK3, IH_GPIO_BASE + 64, |
290 | { OMAP34XX_GPIO6_BASE, INT_34XX_GPIO_BANK6, IH_GPIO_BASE + 160, METHOD_GPIO_24XX }, | 285 | METHOD_GPIO_24XX }, |
286 | { OMAP34XX_GPIO4_BASE, NULL, INT_34XX_GPIO_BANK4, IH_GPIO_BASE + 96, | ||
287 | METHOD_GPIO_24XX }, | ||
288 | { OMAP34XX_GPIO5_BASE, NULL, INT_34XX_GPIO_BANK5, IH_GPIO_BASE + 128, | ||
289 | METHOD_GPIO_24XX }, | ||
290 | { OMAP34XX_GPIO6_BASE, NULL, INT_34XX_GPIO_BANK6, IH_GPIO_BASE + 160, | ||
291 | METHOD_GPIO_24XX }, | ||
291 | }; | 292 | }; |
292 | 293 | ||
294 | struct omap3_gpio_regs { | ||
295 | u32 sysconfig; | ||
296 | u32 irqenable1; | ||
297 | u32 irqenable2; | ||
298 | u32 wake_en; | ||
299 | u32 ctrl; | ||
300 | u32 oe; | ||
301 | u32 leveldetect0; | ||
302 | u32 leveldetect1; | ||
303 | u32 risingdetect; | ||
304 | u32 fallingdetect; | ||
305 | u32 dataout; | ||
306 | u32 setwkuena; | ||
307 | u32 setdataout; | ||
308 | }; | ||
309 | |||
310 | static struct omap3_gpio_regs gpio_context[OMAP34XX_NR_GPIOS]; | ||
293 | #endif | 311 | #endif |
294 | 312 | ||
295 | #ifdef CONFIG_ARCH_OMAP4 | 313 | #ifdef CONFIG_ARCH_OMAP4 |
296 | static struct gpio_bank gpio_bank_44xx[6] = { | 314 | static struct gpio_bank gpio_bank_44xx[6] = { |
297 | { OMAP44XX_GPIO1_BASE, INT_44XX_GPIO_BANK1, IH_GPIO_BASE, \ | 315 | { OMAP44XX_GPIO1_BASE, NULL, INT_44XX_GPIO_BANK1, IH_GPIO_BASE, |
298 | METHOD_GPIO_24XX }, | 316 | METHOD_GPIO_24XX }, |
299 | { OMAP44XX_GPIO2_BASE, INT_44XX_GPIO_BANK2, IH_GPIO_BASE + 32, \ | 317 | { OMAP44XX_GPIO2_BASE, NULL, INT_44XX_GPIO_BANK2, IH_GPIO_BASE + 32, |
300 | METHOD_GPIO_24XX }, | 318 | METHOD_GPIO_24XX }, |
301 | { OMAP44XX_GPIO3_BASE, INT_44XX_GPIO_BANK3, IH_GPIO_BASE + 64, \ | 319 | { OMAP44XX_GPIO3_BASE, NULL, INT_44XX_GPIO_BANK3, IH_GPIO_BASE + 64, |
302 | METHOD_GPIO_24XX }, | 320 | METHOD_GPIO_24XX }, |
303 | { OMAP44XX_GPIO4_BASE, INT_44XX_GPIO_BANK4, IH_GPIO_BASE + 96, \ | 321 | { OMAP44XX_GPIO4_BASE, NULL, INT_44XX_GPIO_BANK4, IH_GPIO_BASE + 96, |
304 | METHOD_GPIO_24XX }, | 322 | METHOD_GPIO_24XX }, |
305 | { OMAP44XX_GPIO5_BASE, INT_44XX_GPIO_BANK5, IH_GPIO_BASE + 128, \ | 323 | { OMAP44XX_GPIO5_BASE, NULL, INT_44XX_GPIO_BANK5, IH_GPIO_BASE + 128, |
306 | METHOD_GPIO_24XX }, | 324 | METHOD_GPIO_24XX }, |
307 | { OMAP44XX_GPIO6_BASE, INT_44XX_GPIO_BANK6, IH_GPIO_BASE + 160, \ | 325 | { OMAP44XX_GPIO6_BASE, NULL, INT_44XX_GPIO_BANK6, IH_GPIO_BASE + 160, |
308 | METHOD_GPIO_24XX }, | 326 | METHOD_GPIO_24XX }, |
309 | }; | 327 | }; |
310 | 328 | ||
@@ -402,14 +420,9 @@ static void _set_gpio_direction(struct gpio_bank *bank, int gpio, int is_input) | |||
402 | reg += OMAP1610_GPIO_DIRECTION; | 420 | reg += OMAP1610_GPIO_DIRECTION; |
403 | break; | 421 | break; |
404 | #endif | 422 | #endif |
405 | #ifdef CONFIG_ARCH_OMAP730 | 423 | #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) |
406 | case METHOD_GPIO_730: | 424 | case METHOD_GPIO_7XX: |
407 | reg += OMAP730_GPIO_DIR_CONTROL; | 425 | reg += OMAP7XX_GPIO_DIR_CONTROL; |
408 | break; | ||
409 | #endif | ||
410 | #ifdef CONFIG_ARCH_OMAP850 | ||
411 | case METHOD_GPIO_850: | ||
412 | reg += OMAP850_GPIO_DIR_CONTROL; | ||
413 | break; | 426 | break; |
414 | #endif | 427 | #endif |
415 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) | 428 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) |
@@ -469,19 +482,9 @@ static void _set_gpio_dataout(struct gpio_bank *bank, int gpio, int enable) | |||
469 | l = 1 << gpio; | 482 | l = 1 << gpio; |
470 | break; | 483 | break; |
471 | #endif | 484 | #endif |
472 | #ifdef CONFIG_ARCH_OMAP730 | 485 | #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) |
473 | case METHOD_GPIO_730: | 486 | case METHOD_GPIO_7XX: |
474 | reg += OMAP730_GPIO_DATA_OUTPUT; | 487 | reg += OMAP7XX_GPIO_DATA_OUTPUT; |
475 | l = __raw_readl(reg); | ||
476 | if (enable) | ||
477 | l |= 1 << gpio; | ||
478 | else | ||
479 | l &= ~(1 << gpio); | ||
480 | break; | ||
481 | #endif | ||
482 | #ifdef CONFIG_ARCH_OMAP850 | ||
483 | case METHOD_GPIO_850: | ||
484 | reg += OMAP850_GPIO_DATA_OUTPUT; | ||
485 | l = __raw_readl(reg); | 488 | l = __raw_readl(reg); |
486 | if (enable) | 489 | if (enable) |
487 | l |= 1 << gpio; | 490 | l |= 1 << gpio; |
@@ -537,14 +540,9 @@ static int _get_gpio_datain(struct gpio_bank *bank, int gpio) | |||
537 | reg += OMAP1610_GPIO_DATAIN; | 540 | reg += OMAP1610_GPIO_DATAIN; |
538 | break; | 541 | break; |
539 | #endif | 542 | #endif |
540 | #ifdef CONFIG_ARCH_OMAP730 | 543 | #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) |
541 | case METHOD_GPIO_730: | 544 | case METHOD_GPIO_7XX: |
542 | reg += OMAP730_GPIO_DATA_INPUT; | 545 | reg += OMAP7XX_GPIO_DATA_INPUT; |
543 | break; | ||
544 | #endif | ||
545 | #ifdef CONFIG_ARCH_OMAP850 | ||
546 | case METHOD_GPIO_850: | ||
547 | reg += OMAP850_GPIO_DATA_INPUT; | ||
548 | break; | 546 | break; |
549 | #endif | 547 | #endif |
550 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) | 548 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) |
@@ -588,14 +586,9 @@ static int _get_gpio_dataout(struct gpio_bank *bank, int gpio) | |||
588 | reg += OMAP1610_GPIO_DATAOUT; | 586 | reg += OMAP1610_GPIO_DATAOUT; |
589 | break; | 587 | break; |
590 | #endif | 588 | #endif |
591 | #ifdef CONFIG_ARCH_OMAP730 | 589 | #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) |
592 | case METHOD_GPIO_730: | 590 | case METHOD_GPIO_7XX: |
593 | reg += OMAP730_GPIO_DATA_OUTPUT; | 591 | reg += OMAP7XX_GPIO_DATA_OUTPUT; |
594 | break; | ||
595 | #endif | ||
596 | #ifdef CONFIG_ARCH_OMAP850 | ||
597 | case METHOD_GPIO_850: | ||
598 | reg += OMAP850_GPIO_DATA_OUTPUT; | ||
599 | break; | 592 | break; |
600 | #endif | 593 | #endif |
601 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ | 594 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ |
@@ -636,6 +629,10 @@ void omap_set_gpio_debounce(int gpio, int enable) | |||
636 | #else | 629 | #else |
637 | reg += OMAP24XX_GPIO_DEBOUNCE_EN; | 630 | reg += OMAP24XX_GPIO_DEBOUNCE_EN; |
638 | #endif | 631 | #endif |
632 | if (!(bank->mod_usage & l)) { | ||
633 | printk(KERN_ERR "GPIO %d not requested\n", gpio); | ||
634 | return; | ||
635 | } | ||
639 | 636 | ||
640 | spin_lock_irqsave(&bank->lock, flags); | 637 | spin_lock_irqsave(&bank->lock, flags); |
641 | val = __raw_readl(reg); | 638 | val = __raw_readl(reg); |
@@ -671,6 +668,11 @@ void omap_set_gpio_debounce_time(int gpio, int enc_time) | |||
671 | bank = get_gpio_bank(gpio); | 668 | bank = get_gpio_bank(gpio); |
672 | reg = bank->base; | 669 | reg = bank->base; |
673 | 670 | ||
671 | if (!bank->mod_usage) { | ||
672 | printk(KERN_ERR "GPIO not requested\n"); | ||
673 | return; | ||
674 | } | ||
675 | |||
674 | enc_time &= 0xff; | 676 | enc_time &= 0xff; |
675 | #ifdef CONFIG_ARCH_OMAP4 | 677 | #ifdef CONFIG_ARCH_OMAP4 |
676 | reg += OMAP4_GPIO_DEBOUNCINGTIME; | 678 | reg += OMAP4_GPIO_DEBOUNCINGTIME; |
@@ -797,21 +799,9 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger) | |||
797 | __raw_writel(1 << gpio, bank->base + OMAP1610_GPIO_CLEAR_WAKEUPENA); | 799 | __raw_writel(1 << gpio, bank->base + OMAP1610_GPIO_CLEAR_WAKEUPENA); |
798 | break; | 800 | break; |
799 | #endif | 801 | #endif |
800 | #ifdef CONFIG_ARCH_OMAP730 | 802 | #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) |
801 | case METHOD_GPIO_730: | 803 | case METHOD_GPIO_7XX: |
802 | reg += OMAP730_GPIO_INT_CONTROL; | 804 | reg += OMAP7XX_GPIO_INT_CONTROL; |
803 | l = __raw_readl(reg); | ||
804 | if (trigger & IRQ_TYPE_EDGE_RISING) | ||
805 | l |= 1 << gpio; | ||
806 | else if (trigger & IRQ_TYPE_EDGE_FALLING) | ||
807 | l &= ~(1 << gpio); | ||
808 | else | ||
809 | goto bad; | ||
810 | break; | ||
811 | #endif | ||
812 | #ifdef CONFIG_ARCH_OMAP850 | ||
813 | case METHOD_GPIO_850: | ||
814 | reg += OMAP850_GPIO_INT_CONTROL; | ||
815 | l = __raw_readl(reg); | 805 | l = __raw_readl(reg); |
816 | if (trigger & IRQ_TYPE_EDGE_RISING) | 806 | if (trigger & IRQ_TYPE_EDGE_RISING) |
817 | l |= 1 << gpio; | 807 | l |= 1 << gpio; |
@@ -897,14 +887,9 @@ static void _clear_gpio_irqbank(struct gpio_bank *bank, int gpio_mask) | |||
897 | reg += OMAP1610_GPIO_IRQSTATUS1; | 887 | reg += OMAP1610_GPIO_IRQSTATUS1; |
898 | break; | 888 | break; |
899 | #endif | 889 | #endif |
900 | #ifdef CONFIG_ARCH_OMAP730 | 890 | #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) |
901 | case METHOD_GPIO_730: | 891 | case METHOD_GPIO_7XX: |
902 | reg += OMAP730_GPIO_INT_STATUS; | 892 | reg += OMAP7XX_GPIO_INT_STATUS; |
903 | break; | ||
904 | #endif | ||
905 | #ifdef CONFIG_ARCH_OMAP850 | ||
906 | case METHOD_GPIO_850: | ||
907 | reg += OMAP850_GPIO_INT_STATUS; | ||
908 | break; | 893 | break; |
909 | #endif | 894 | #endif |
910 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) | 895 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) |
@@ -971,16 +956,9 @@ static u32 _get_gpio_irqbank_mask(struct gpio_bank *bank) | |||
971 | mask = 0xffff; | 956 | mask = 0xffff; |
972 | break; | 957 | break; |
973 | #endif | 958 | #endif |
974 | #ifdef CONFIG_ARCH_OMAP730 | 959 | #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) |
975 | case METHOD_GPIO_730: | 960 | case METHOD_GPIO_7XX: |
976 | reg += OMAP730_GPIO_INT_MASK; | 961 | reg += OMAP7XX_GPIO_INT_MASK; |
977 | mask = 0xffffffff; | ||
978 | inv = 1; | ||
979 | break; | ||
980 | #endif | ||
981 | #ifdef CONFIG_ARCH_OMAP850 | ||
982 | case METHOD_GPIO_850: | ||
983 | reg += OMAP850_GPIO_INT_MASK; | ||
984 | mask = 0xffffffff; | 962 | mask = 0xffffffff; |
985 | inv = 1; | 963 | inv = 1; |
986 | break; | 964 | break; |
@@ -1044,19 +1022,9 @@ static void _enable_gpio_irqbank(struct gpio_bank *bank, int gpio_mask, int enab | |||
1044 | l = gpio_mask; | 1022 | l = gpio_mask; |
1045 | break; | 1023 | break; |
1046 | #endif | 1024 | #endif |
1047 | #ifdef CONFIG_ARCH_OMAP730 | 1025 | #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) |
1048 | case METHOD_GPIO_730: | 1026 | case METHOD_GPIO_7XX: |
1049 | reg += OMAP730_GPIO_INT_MASK; | 1027 | reg += OMAP7XX_GPIO_INT_MASK; |
1050 | l = __raw_readl(reg); | ||
1051 | if (enable) | ||
1052 | l &= ~(gpio_mask); | ||
1053 | else | ||
1054 | l |= gpio_mask; | ||
1055 | break; | ||
1056 | #endif | ||
1057 | #ifdef CONFIG_ARCH_OMAP850 | ||
1058 | case METHOD_GPIO_850: | ||
1059 | reg += OMAP850_GPIO_INT_MASK; | ||
1060 | l = __raw_readl(reg); | 1028 | l = __raw_readl(reg); |
1061 | if (enable) | 1029 | if (enable) |
1062 | l &= ~(gpio_mask); | 1030 | l &= ~(gpio_mask); |
@@ -1186,6 +1154,16 @@ static int omap_gpio_request(struct gpio_chip *chip, unsigned offset) | |||
1186 | __raw_writel(__raw_readl(reg) | (1 << offset), reg); | 1154 | __raw_writel(__raw_readl(reg) | (1 << offset), reg); |
1187 | } | 1155 | } |
1188 | #endif | 1156 | #endif |
1157 | if (!cpu_class_is_omap1()) { | ||
1158 | if (!bank->mod_usage) { | ||
1159 | u32 ctrl; | ||
1160 | ctrl = __raw_readl(bank->base + OMAP24XX_GPIO_CTRL); | ||
1161 | ctrl &= 0xFFFFFFFE; | ||
1162 | /* Module is enabled, clocks are not gated */ | ||
1163 | __raw_writel(ctrl, bank->base + OMAP24XX_GPIO_CTRL); | ||
1164 | } | ||
1165 | bank->mod_usage |= 1 << offset; | ||
1166 | } | ||
1189 | spin_unlock_irqrestore(&bank->lock, flags); | 1167 | spin_unlock_irqrestore(&bank->lock, flags); |
1190 | 1168 | ||
1191 | return 0; | 1169 | return 0; |
@@ -1212,6 +1190,16 @@ static void omap_gpio_free(struct gpio_chip *chip, unsigned offset) | |||
1212 | __raw_writel(1 << offset, reg); | 1190 | __raw_writel(1 << offset, reg); |
1213 | } | 1191 | } |
1214 | #endif | 1192 | #endif |
1193 | if (!cpu_class_is_omap1()) { | ||
1194 | bank->mod_usage &= ~(1 << offset); | ||
1195 | if (!bank->mod_usage) { | ||
1196 | u32 ctrl; | ||
1197 | ctrl = __raw_readl(bank->base + OMAP24XX_GPIO_CTRL); | ||
1198 | /* Module is disabled, clocks are gated */ | ||
1199 | ctrl |= 1; | ||
1200 | __raw_writel(ctrl, bank->base + OMAP24XX_GPIO_CTRL); | ||
1201 | } | ||
1202 | } | ||
1215 | _reset_gpio(bank, bank->chip.base + offset); | 1203 | _reset_gpio(bank, bank->chip.base + offset); |
1216 | spin_unlock_irqrestore(&bank->lock, flags); | 1204 | spin_unlock_irqrestore(&bank->lock, flags); |
1217 | } | 1205 | } |
@@ -1249,13 +1237,9 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | |||
1249 | if (bank->method == METHOD_GPIO_1610) | 1237 | if (bank->method == METHOD_GPIO_1610) |
1250 | isr_reg = bank->base + OMAP1610_GPIO_IRQSTATUS1; | 1238 | isr_reg = bank->base + OMAP1610_GPIO_IRQSTATUS1; |
1251 | #endif | 1239 | #endif |
1252 | #ifdef CONFIG_ARCH_OMAP730 | 1240 | #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) |
1253 | if (bank->method == METHOD_GPIO_730) | 1241 | if (bank->method == METHOD_GPIO_7XX) |
1254 | isr_reg = bank->base + OMAP730_GPIO_INT_STATUS; | 1242 | isr_reg = bank->base + OMAP7XX_GPIO_INT_STATUS; |
1255 | #endif | ||
1256 | #ifdef CONFIG_ARCH_OMAP850 | ||
1257 | if (bank->method == METHOD_GPIO_850) | ||
1258 | isr_reg = bank->base + OMAP850_GPIO_INT_STATUS; | ||
1259 | #endif | 1243 | #endif |
1260 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) | 1244 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) |
1261 | if (bank->method == METHOD_GPIO_24XX) | 1245 | if (bank->method == METHOD_GPIO_24XX) |
@@ -1524,11 +1508,8 @@ static int gpio_is_input(struct gpio_bank *bank, int mask) | |||
1524 | case METHOD_GPIO_1610: | 1508 | case METHOD_GPIO_1610: |
1525 | reg += OMAP1610_GPIO_DIRECTION; | 1509 | reg += OMAP1610_GPIO_DIRECTION; |
1526 | break; | 1510 | break; |
1527 | case METHOD_GPIO_730: | 1511 | case METHOD_GPIO_7XX: |
1528 | reg += OMAP730_GPIO_DIR_CONTROL; | 1512 | reg += OMAP7XX_GPIO_DIR_CONTROL; |
1529 | break; | ||
1530 | case METHOD_GPIO_850: | ||
1531 | reg += OMAP850_GPIO_DIR_CONTROL; | ||
1532 | break; | 1513 | break; |
1533 | case METHOD_GPIO_24XX: | 1514 | case METHOD_GPIO_24XX: |
1534 | reg += OMAP24XX_GPIO_OE; | 1515 | reg += OMAP24XX_GPIO_OE; |
@@ -1607,6 +1588,23 @@ static struct clk * gpio5_fck; | |||
1607 | static struct clk *gpio_iclks[OMAP34XX_NR_GPIOS]; | 1588 | static struct clk *gpio_iclks[OMAP34XX_NR_GPIOS]; |
1608 | #endif | 1589 | #endif |
1609 | 1590 | ||
1591 | static void __init omap_gpio_show_rev(void) | ||
1592 | { | ||
1593 | u32 rev; | ||
1594 | |||
1595 | if (cpu_is_omap16xx()) | ||
1596 | rev = __raw_readw(gpio_bank[1].base + OMAP1610_GPIO_REVISION); | ||
1597 | else if (cpu_is_omap24xx() || cpu_is_omap34xx()) | ||
1598 | rev = __raw_readl(gpio_bank[0].base + OMAP24XX_GPIO_REVISION); | ||
1599 | else if (cpu_is_omap44xx()) | ||
1600 | rev = __raw_readl(gpio_bank[0].base + OMAP4_GPIO_REVISION); | ||
1601 | else | ||
1602 | return; | ||
1603 | |||
1604 | printk(KERN_INFO "OMAP GPIO hardware version %d.%d\n", | ||
1605 | (rev >> 4) & 0x0f, rev & 0x0f); | ||
1606 | } | ||
1607 | |||
1610 | /* This lock class tells lockdep that GPIO irqs are in a different | 1608 | /* This lock class tells lockdep that GPIO irqs are in a different |
1611 | * category than their parents, so it won't report false recursion. | 1609 | * category than their parents, so it won't report false recursion. |
1612 | */ | 1610 | */ |
@@ -1617,6 +1615,7 @@ static int __init _omap_gpio_init(void) | |||
1617 | int i; | 1615 | int i; |
1618 | int gpio = 0; | 1616 | int gpio = 0; |
1619 | struct gpio_bank *bank; | 1617 | struct gpio_bank *bank; |
1618 | int bank_size = SZ_8K; /* Module 4KB + L4 4KB except on omap1 */ | ||
1620 | char clk_name[11]; | 1619 | char clk_name[11]; |
1621 | 1620 | ||
1622 | initialized = 1; | 1621 | initialized = 1; |
@@ -1679,77 +1678,45 @@ static int __init _omap_gpio_init(void) | |||
1679 | 1678 | ||
1680 | #ifdef CONFIG_ARCH_OMAP15XX | 1679 | #ifdef CONFIG_ARCH_OMAP15XX |
1681 | if (cpu_is_omap15xx()) { | 1680 | if (cpu_is_omap15xx()) { |
1682 | printk(KERN_INFO "OMAP1510 GPIO hardware\n"); | ||
1683 | gpio_bank_count = 2; | 1681 | gpio_bank_count = 2; |
1684 | gpio_bank = gpio_bank_1510; | 1682 | gpio_bank = gpio_bank_1510; |
1683 | bank_size = SZ_2K; | ||
1685 | } | 1684 | } |
1686 | #endif | 1685 | #endif |
1687 | #if defined(CONFIG_ARCH_OMAP16XX) | 1686 | #if defined(CONFIG_ARCH_OMAP16XX) |
1688 | if (cpu_is_omap16xx()) { | 1687 | if (cpu_is_omap16xx()) { |
1689 | u32 rev; | ||
1690 | |||
1691 | gpio_bank_count = 5; | 1688 | gpio_bank_count = 5; |
1692 | gpio_bank = gpio_bank_1610; | 1689 | gpio_bank = gpio_bank_1610; |
1693 | rev = __raw_readw(gpio_bank[1].base + OMAP1610_GPIO_REVISION); | 1690 | bank_size = SZ_2K; |
1694 | printk(KERN_INFO "OMAP GPIO hardware version %d.%d\n", | ||
1695 | (rev >> 4) & 0x0f, rev & 0x0f); | ||
1696 | } | 1691 | } |
1697 | #endif | 1692 | #endif |
1698 | #ifdef CONFIG_ARCH_OMAP730 | 1693 | #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) |
1699 | if (cpu_is_omap730()) { | 1694 | if (cpu_is_omap7xx()) { |
1700 | printk(KERN_INFO "OMAP730 GPIO hardware\n"); | ||
1701 | gpio_bank_count = 7; | ||
1702 | gpio_bank = gpio_bank_730; | ||
1703 | } | ||
1704 | #endif | ||
1705 | #ifdef CONFIG_ARCH_OMAP850 | ||
1706 | if (cpu_is_omap850()) { | ||
1707 | printk(KERN_INFO "OMAP850 GPIO hardware\n"); | ||
1708 | gpio_bank_count = 7; | 1695 | gpio_bank_count = 7; |
1709 | gpio_bank = gpio_bank_850; | 1696 | gpio_bank = gpio_bank_7xx; |
1697 | bank_size = SZ_2K; | ||
1710 | } | 1698 | } |
1711 | #endif | 1699 | #endif |
1712 | |||
1713 | #ifdef CONFIG_ARCH_OMAP24XX | 1700 | #ifdef CONFIG_ARCH_OMAP24XX |
1714 | if (cpu_is_omap242x()) { | 1701 | if (cpu_is_omap242x()) { |
1715 | int rev; | ||
1716 | |||
1717 | gpio_bank_count = 4; | 1702 | gpio_bank_count = 4; |
1718 | gpio_bank = gpio_bank_242x; | 1703 | gpio_bank = gpio_bank_242x; |
1719 | rev = __raw_readl(gpio_bank[0].base + OMAP24XX_GPIO_REVISION); | ||
1720 | printk(KERN_INFO "OMAP242x GPIO hardware version %d.%d\n", | ||
1721 | (rev >> 4) & 0x0f, rev & 0x0f); | ||
1722 | } | 1704 | } |
1723 | if (cpu_is_omap243x()) { | 1705 | if (cpu_is_omap243x()) { |
1724 | int rev; | ||
1725 | |||
1726 | gpio_bank_count = 5; | 1706 | gpio_bank_count = 5; |
1727 | gpio_bank = gpio_bank_243x; | 1707 | gpio_bank = gpio_bank_243x; |
1728 | rev = __raw_readl(gpio_bank[0].base + OMAP24XX_GPIO_REVISION); | ||
1729 | printk(KERN_INFO "OMAP243x GPIO hardware version %d.%d\n", | ||
1730 | (rev >> 4) & 0x0f, rev & 0x0f); | ||
1731 | } | 1708 | } |
1732 | #endif | 1709 | #endif |
1733 | #ifdef CONFIG_ARCH_OMAP34XX | 1710 | #ifdef CONFIG_ARCH_OMAP34XX |
1734 | if (cpu_is_omap34xx()) { | 1711 | if (cpu_is_omap34xx()) { |
1735 | int rev; | ||
1736 | |||
1737 | gpio_bank_count = OMAP34XX_NR_GPIOS; | 1712 | gpio_bank_count = OMAP34XX_NR_GPIOS; |
1738 | gpio_bank = gpio_bank_34xx; | 1713 | gpio_bank = gpio_bank_34xx; |
1739 | rev = __raw_readl(gpio_bank[0].base + OMAP24XX_GPIO_REVISION); | ||
1740 | printk(KERN_INFO "OMAP34xx GPIO hardware version %d.%d\n", | ||
1741 | (rev >> 4) & 0x0f, rev & 0x0f); | ||
1742 | } | 1714 | } |
1743 | #endif | 1715 | #endif |
1744 | #ifdef CONFIG_ARCH_OMAP4 | 1716 | #ifdef CONFIG_ARCH_OMAP4 |
1745 | if (cpu_is_omap44xx()) { | 1717 | if (cpu_is_omap44xx()) { |
1746 | int rev; | ||
1747 | |||
1748 | gpio_bank_count = OMAP34XX_NR_GPIOS; | 1718 | gpio_bank_count = OMAP34XX_NR_GPIOS; |
1749 | gpio_bank = gpio_bank_44xx; | 1719 | gpio_bank = gpio_bank_44xx; |
1750 | rev = __raw_readl(gpio_bank[0].base + OMAP4_GPIO_REVISION); | ||
1751 | printk(KERN_INFO "OMAP44xx GPIO hardware version %d.%d\n", | ||
1752 | (rev >> 4) & 0x0f, rev & 0x0f); | ||
1753 | } | 1720 | } |
1754 | #endif | 1721 | #endif |
1755 | for (i = 0; i < gpio_bank_count; i++) { | 1722 | for (i = 0; i < gpio_bank_count; i++) { |
@@ -1757,6 +1724,14 @@ static int __init _omap_gpio_init(void) | |||
1757 | 1724 | ||
1758 | bank = &gpio_bank[i]; | 1725 | bank = &gpio_bank[i]; |
1759 | spin_lock_init(&bank->lock); | 1726 | spin_lock_init(&bank->lock); |
1727 | |||
1728 | /* Static mapping, never released */ | ||
1729 | bank->base = ioremap(bank->pbase, bank_size); | ||
1730 | if (!bank->base) { | ||
1731 | printk(KERN_ERR "Could not ioremap gpio bank%i\n", i); | ||
1732 | continue; | ||
1733 | } | ||
1734 | |||
1760 | if (bank_is_mpuio(bank)) | 1735 | if (bank_is_mpuio(bank)) |
1761 | __raw_writew(0xffff, bank->base + OMAP_MPUIO_GPIO_MASKIT); | 1736 | __raw_writew(0xffff, bank->base + OMAP_MPUIO_GPIO_MASKIT); |
1762 | if (cpu_is_omap15xx() && bank->method == METHOD_GPIO_1510) { | 1737 | if (cpu_is_omap15xx() && bank->method == METHOD_GPIO_1510) { |
@@ -1768,11 +1743,11 @@ static int __init _omap_gpio_init(void) | |||
1768 | __raw_writew(0xffff, bank->base + OMAP1610_GPIO_IRQSTATUS1); | 1743 | __raw_writew(0xffff, bank->base + OMAP1610_GPIO_IRQSTATUS1); |
1769 | __raw_writew(0x0014, bank->base + OMAP1610_GPIO_SYSCONFIG); | 1744 | __raw_writew(0x0014, bank->base + OMAP1610_GPIO_SYSCONFIG); |
1770 | } | 1745 | } |
1771 | if (cpu_is_omap7xx() && bank->method == METHOD_GPIO_730) { | 1746 | if (cpu_is_omap7xx() && bank->method == METHOD_GPIO_7XX) { |
1772 | __raw_writel(0xffffffff, bank->base + OMAP730_GPIO_INT_MASK); | 1747 | __raw_writel(0xffffffff, bank->base + OMAP7XX_GPIO_INT_MASK); |
1773 | __raw_writel(0x00000000, bank->base + OMAP730_GPIO_INT_STATUS); | 1748 | __raw_writel(0x00000000, bank->base + OMAP7XX_GPIO_INT_STATUS); |
1774 | 1749 | ||
1775 | gpio_count = 32; /* 730 has 32-bit GPIOs */ | 1750 | gpio_count = 32; /* 7xx has 32-bit GPIOs */ |
1776 | } | 1751 | } |
1777 | 1752 | ||
1778 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ | 1753 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ |
@@ -1804,6 +1779,8 @@ static int __init _omap_gpio_init(void) | |||
1804 | gpio_count = 32; | 1779 | gpio_count = 32; |
1805 | } | 1780 | } |
1806 | #endif | 1781 | #endif |
1782 | |||
1783 | bank->mod_usage = 0; | ||
1807 | /* REVISIT eventually switch from OMAP-specific gpio structs | 1784 | /* REVISIT eventually switch from OMAP-specific gpio structs |
1808 | * over to the generic ones | 1785 | * over to the generic ones |
1809 | */ | 1786 | */ |
@@ -1862,6 +1839,8 @@ static int __init _omap_gpio_init(void) | |||
1862 | if (cpu_is_omap34xx()) | 1839 | if (cpu_is_omap34xx()) |
1863 | omap_writel(1 << 0, 0x48306814); | 1840 | omap_writel(1 << 0, 0x48306814); |
1864 | 1841 | ||
1842 | omap_gpio_show_rev(); | ||
1843 | |||
1865 | return 0; | 1844 | return 0; |
1866 | } | 1845 | } |
1867 | 1846 | ||
@@ -2106,6 +2085,81 @@ void omap2_gpio_resume_after_retention(void) | |||
2106 | 2085 | ||
2107 | #endif | 2086 | #endif |
2108 | 2087 | ||
2088 | #ifdef CONFIG_ARCH_OMAP34XX | ||
2089 | /* save the registers of bank 2-6 */ | ||
2090 | void omap_gpio_save_context(void) | ||
2091 | { | ||
2092 | int i; | ||
2093 | |||
2094 | /* saving banks from 2-6 only since GPIO1 is in WKUP */ | ||
2095 | for (i = 1; i < gpio_bank_count; i++) { | ||
2096 | struct gpio_bank *bank = &gpio_bank[i]; | ||
2097 | gpio_context[i].sysconfig = | ||
2098 | __raw_readl(bank->base + OMAP24XX_GPIO_SYSCONFIG); | ||
2099 | gpio_context[i].irqenable1 = | ||
2100 | __raw_readl(bank->base + OMAP24XX_GPIO_IRQENABLE1); | ||
2101 | gpio_context[i].irqenable2 = | ||
2102 | __raw_readl(bank->base + OMAP24XX_GPIO_IRQENABLE2); | ||
2103 | gpio_context[i].wake_en = | ||
2104 | __raw_readl(bank->base + OMAP24XX_GPIO_WAKE_EN); | ||
2105 | gpio_context[i].ctrl = | ||
2106 | __raw_readl(bank->base + OMAP24XX_GPIO_CTRL); | ||
2107 | gpio_context[i].oe = | ||
2108 | __raw_readl(bank->base + OMAP24XX_GPIO_OE); | ||
2109 | gpio_context[i].leveldetect0 = | ||
2110 | __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0); | ||
2111 | gpio_context[i].leveldetect1 = | ||
2112 | __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1); | ||
2113 | gpio_context[i].risingdetect = | ||
2114 | __raw_readl(bank->base + OMAP24XX_GPIO_RISINGDETECT); | ||
2115 | gpio_context[i].fallingdetect = | ||
2116 | __raw_readl(bank->base + OMAP24XX_GPIO_FALLINGDETECT); | ||
2117 | gpio_context[i].dataout = | ||
2118 | __raw_readl(bank->base + OMAP24XX_GPIO_DATAOUT); | ||
2119 | gpio_context[i].setwkuena = | ||
2120 | __raw_readl(bank->base + OMAP24XX_GPIO_SETWKUENA); | ||
2121 | gpio_context[i].setdataout = | ||
2122 | __raw_readl(bank->base + OMAP24XX_GPIO_SETDATAOUT); | ||
2123 | } | ||
2124 | } | ||
2125 | |||
2126 | /* restore the required registers of bank 2-6 */ | ||
2127 | void omap_gpio_restore_context(void) | ||
2128 | { | ||
2129 | int i; | ||
2130 | |||
2131 | for (i = 1; i < gpio_bank_count; i++) { | ||
2132 | struct gpio_bank *bank = &gpio_bank[i]; | ||
2133 | __raw_writel(gpio_context[i].sysconfig, | ||
2134 | bank->base + OMAP24XX_GPIO_SYSCONFIG); | ||
2135 | __raw_writel(gpio_context[i].irqenable1, | ||
2136 | bank->base + OMAP24XX_GPIO_IRQENABLE1); | ||
2137 | __raw_writel(gpio_context[i].irqenable2, | ||
2138 | bank->base + OMAP24XX_GPIO_IRQENABLE2); | ||
2139 | __raw_writel(gpio_context[i].wake_en, | ||
2140 | bank->base + OMAP24XX_GPIO_WAKE_EN); | ||
2141 | __raw_writel(gpio_context[i].ctrl, | ||
2142 | bank->base + OMAP24XX_GPIO_CTRL); | ||
2143 | __raw_writel(gpio_context[i].oe, | ||
2144 | bank->base + OMAP24XX_GPIO_OE); | ||
2145 | __raw_writel(gpio_context[i].leveldetect0, | ||
2146 | bank->base + OMAP24XX_GPIO_LEVELDETECT0); | ||
2147 | __raw_writel(gpio_context[i].leveldetect1, | ||
2148 | bank->base + OMAP24XX_GPIO_LEVELDETECT1); | ||
2149 | __raw_writel(gpio_context[i].risingdetect, | ||
2150 | bank->base + OMAP24XX_GPIO_RISINGDETECT); | ||
2151 | __raw_writel(gpio_context[i].fallingdetect, | ||
2152 | bank->base + OMAP24XX_GPIO_FALLINGDETECT); | ||
2153 | __raw_writel(gpio_context[i].dataout, | ||
2154 | bank->base + OMAP24XX_GPIO_DATAOUT); | ||
2155 | __raw_writel(gpio_context[i].setwkuena, | ||
2156 | bank->base + OMAP24XX_GPIO_SETWKUENA); | ||
2157 | __raw_writel(gpio_context[i].setdataout, | ||
2158 | bank->base + OMAP24XX_GPIO_SETDATAOUT); | ||
2159 | } | ||
2160 | } | ||
2161 | #endif | ||
2162 | |||
2109 | /* | 2163 | /* |
2110 | * This may get called early from board specific init | 2164 | * This may get called early from board specific init |
2111 | * for boards that have interrupts routed via FPGA. | 2165 | * for boards that have interrupts routed via FPGA. |
@@ -2160,8 +2214,7 @@ static int dbg_gpio_show(struct seq_file *s, void *unused) | |||
2160 | 2214 | ||
2161 | if (bank_is_mpuio(bank)) | 2215 | if (bank_is_mpuio(bank)) |
2162 | gpio = OMAP_MPUIO(0); | 2216 | gpio = OMAP_MPUIO(0); |
2163 | else if (cpu_class_is_omap2() || cpu_is_omap730() || | 2217 | else if (cpu_class_is_omap2() || cpu_is_omap7xx()) |
2164 | cpu_is_omap850()) | ||
2165 | bankwidth = 32; | 2218 | bankwidth = 32; |
2166 | 2219 | ||
2167 | for (j = 0; j < bankwidth; j++, gpio++, mask <<= 1) { | 2220 | for (j = 0; j < bankwidth; j++, gpio++, mask <<= 1) { |
diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c index 8b848391f0c8..c08362dbb8ed 100644 --- a/arch/arm/plat-omap/i2c.c +++ b/arch/arm/plat-omap/i2c.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
28 | #include <linux/i2c.h> | 28 | #include <linux/i2c.h> |
29 | #include <mach/irqs.h> | 29 | #include <mach/irqs.h> |
30 | #include <mach/mux.h> | 30 | #include <plat/mux.h> |
31 | 31 | ||
32 | #define OMAP_I2C_SIZE 0x3f | 32 | #define OMAP_I2C_SIZE 0x3f |
33 | #define OMAP1_I2C_BASE 0xfffb3800 | 33 | #define OMAP1_I2C_BASE 0xfffb3800 |
diff --git a/arch/arm/plat-omap/include/mach/debug-macro.S b/arch/arm/plat-omap/include/mach/debug-macro.S deleted file mode 100644 index ac24050e3416..000000000000 --- a/arch/arm/plat-omap/include/mach/debug-macro.S +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | /* arch/arm/plat-omap/include/mach/debug-macro.S | ||
2 | * | ||
3 | * Debugging macro include header | ||
4 | * | ||
5 | * Copyright (C) 1994-1999 Russell King | ||
6 | * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | .macro addruart,rx | ||
15 | mrc p15, 0, \rx, c1, c0 | ||
16 | tst \rx, #1 @ MMU enabled? | ||
17 | #ifdef CONFIG_ARCH_OMAP1 | ||
18 | moveq \rx, #0xff000000 @ physical base address | ||
19 | movne \rx, #0xfe000000 @ virtual base | ||
20 | orr \rx, \rx, #0x00fb0000 | ||
21 | #ifdef CONFIG_OMAP_LL_DEBUG_UART3 | ||
22 | orr \rx, \rx, #0x00009000 @ UART 3 | ||
23 | #endif | ||
24 | #if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3) | ||
25 | orr \rx, \rx, #0x00000800 @ UART 2 & 3 | ||
26 | #endif | ||
27 | |||
28 | #elif CONFIG_ARCH_OMAP2 | ||
29 | moveq \rx, #0x48000000 @ physical base address | ||
30 | movne \rx, #0xd8000000 @ virtual base | ||
31 | orr \rx, \rx, #0x0006a000 | ||
32 | #ifdef CONFIG_OMAP_LL_DEBUG_UART2 | ||
33 | add \rx, \rx, #0x00002000 @ UART 2 | ||
34 | #endif | ||
35 | #ifdef CONFIG_OMAP_LL_DEBUG_UART3 | ||
36 | add \rx, \rx, #0x00004000 @ UART 3 | ||
37 | #endif | ||
38 | |||
39 | #elif defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) | ||
40 | moveq \rx, #0x48000000 @ physical base address | ||
41 | movne \rx, #0xd8000000 @ virtual base | ||
42 | orr \rx, \rx, #0x0006a000 | ||
43 | #ifdef CONFIG_OMAP_LL_DEBUG_UART2 | ||
44 | add \rx, \rx, #0x00002000 @ UART 2 | ||
45 | #endif | ||
46 | #ifdef CONFIG_OMAP_LL_DEBUG_UART3 | ||
47 | add \rx, \rx, #0x00fb0000 @ UART 3 | ||
48 | add \rx, \rx, #0x00006000 | ||
49 | #endif | ||
50 | #endif | ||
51 | .endm | ||
52 | |||
53 | .macro senduart,rd,rx | ||
54 | strb \rd, [\rx] | ||
55 | .endm | ||
56 | |||
57 | .macro busyuart,rd,rx | ||
58 | 1001: ldrb \rd, [\rx, #(0x5 << 2)] @ OMAP-1510 and friends | ||
59 | and \rd, \rd, #0x60 | ||
60 | teq \rd, #0x60 | ||
61 | beq 1002f | ||
62 | ldrb \rd, [\rx, #(0x5 << 0)] @ OMAP-730 only | ||
63 | and \rd, \rd, #0x60 | ||
64 | teq \rd, #0x60 | ||
65 | bne 1001b | ||
66 | 1002: | ||
67 | .endm | ||
68 | |||
69 | .macro waituart,rd,rx | ||
70 | .endm | ||
diff --git a/arch/arm/plat-omap/include/mach/entry-macro.S b/arch/arm/plat-omap/include/mach/entry-macro.S deleted file mode 100644 index a5592991634d..000000000000 --- a/arch/arm/plat-omap/include/mach/entry-macro.S +++ /dev/null | |||
@@ -1,172 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-omap/include/mach/entry-macro.S | ||
3 | * | ||
4 | * Low-level IRQ helper macros for OMAP-based platforms | ||
5 | * | ||
6 | * Copyright (C) 2009 Texas Instruments | ||
7 | * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | #include <mach/hardware.h> | ||
14 | #include <mach/io.h> | ||
15 | #include <mach/irqs.h> | ||
16 | #include <asm/hardware/gic.h> | ||
17 | |||
18 | #if defined(CONFIG_ARCH_OMAP1) | ||
19 | |||
20 | #if defined(CONFIG_ARCH_OMAP730) && \ | ||
21 | (defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)) | ||
22 | #error "FIXME: OMAP730 doesn't support multiple-OMAP" | ||
23 | #elif defined(CONFIG_ARCH_OMAP730) | ||
24 | #define INT_IH2_IRQ INT_730_IH2_IRQ | ||
25 | #elif defined(CONFIG_ARCH_OMAP15XX) | ||
26 | #define INT_IH2_IRQ INT_1510_IH2_IRQ | ||
27 | #elif defined(CONFIG_ARCH_OMAP16XX) | ||
28 | #define INT_IH2_IRQ INT_1610_IH2_IRQ | ||
29 | #else | ||
30 | #warning "IH2 IRQ defaulted" | ||
31 | #define INT_IH2_IRQ INT_1510_IH2_IRQ | ||
32 | #endif | ||
33 | |||
34 | .macro disable_fiq | ||
35 | .endm | ||
36 | |||
37 | .macro get_irqnr_preamble, base, tmp | ||
38 | .endm | ||
39 | |||
40 | .macro arch_ret_to_user, tmp1, tmp2 | ||
41 | .endm | ||
42 | |||
43 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
44 | ldr \base, =OMAP1_IO_ADDRESS(OMAP_IH1_BASE) | ||
45 | ldr \irqnr, [\base, #IRQ_ITR_REG_OFFSET] | ||
46 | ldr \tmp, [\base, #IRQ_MIR_REG_OFFSET] | ||
47 | mov \irqstat, #0xffffffff | ||
48 | bic \tmp, \irqstat, \tmp | ||
49 | tst \irqnr, \tmp | ||
50 | beq 1510f | ||
51 | |||
52 | ldr \irqnr, [\base, #IRQ_SIR_FIQ_REG_OFFSET] | ||
53 | cmp \irqnr, #0 | ||
54 | ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET] | ||
55 | cmpeq \irqnr, #INT_IH2_IRQ | ||
56 | ldreq \base, =OMAP1_IO_ADDRESS(OMAP_IH2_BASE) | ||
57 | ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET] | ||
58 | addeqs \irqnr, \irqnr, #32 | ||
59 | 1510: | ||
60 | .endm | ||
61 | |||
62 | #endif | ||
63 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ | ||
64 | defined(CONFIG_ARCH_OMAP4) | ||
65 | |||
66 | #include <mach/omap24xx.h> | ||
67 | #include <mach/omap34xx.h> | ||
68 | |||
69 | /* REVISIT: This should be set dynamically if CONFIG_MULTI_OMAP2 is selected */ | ||
70 | #if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) | ||
71 | #define OMAP2_VA_IC_BASE OMAP2_IO_ADDRESS(OMAP24XX_IC_BASE) | ||
72 | #elif defined(CONFIG_ARCH_OMAP34XX) | ||
73 | #define OMAP2_VA_IC_BASE OMAP2_IO_ADDRESS(OMAP34XX_IC_BASE) | ||
74 | #endif | ||
75 | #if defined(CONFIG_ARCH_OMAP4) | ||
76 | #include <mach/omap44xx.h> | ||
77 | #endif | ||
78 | #define INTCPS_SIR_IRQ_OFFSET 0x0040 /* Active interrupt offset */ | ||
79 | #define ACTIVEIRQ_MASK 0x7f /* Active interrupt bits */ | ||
80 | |||
81 | .macro disable_fiq | ||
82 | .endm | ||
83 | |||
84 | .macro get_irqnr_preamble, base, tmp | ||
85 | .endm | ||
86 | |||
87 | .macro arch_ret_to_user, tmp1, tmp2 | ||
88 | .endm | ||
89 | |||
90 | #ifndef CONFIG_ARCH_OMAP4 | ||
91 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
92 | ldr \base, =OMAP2_VA_IC_BASE | ||
93 | ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */ | ||
94 | cmp \irqnr, #0x0 | ||
95 | bne 2222f | ||
96 | ldr \irqnr, [\base, #0xb8] /* IRQ pending reg 2 */ | ||
97 | cmp \irqnr, #0x0 | ||
98 | bne 2222f | ||
99 | ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */ | ||
100 | cmp \irqnr, #0x0 | ||
101 | 2222: | ||
102 | ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET] | ||
103 | and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */ | ||
104 | |||
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 | |||
140 | /* We assume that irqstat (the raw value of the IRQ acknowledge | ||
141 | * register) is preserved from the macro above. | ||
142 | * If there is an IPI, we immediately signal end of interrupt | ||
143 | * on the controller, since this requires the original irqstat | ||
144 | * value which we won't easily be able to recreate later. | ||
145 | */ | ||
146 | |||
147 | .macro test_for_ipi, irqnr, irqstat, base, tmp | ||
148 | bic \irqnr, \irqstat, #0x1c00 | ||
149 | cmp \irqnr, #16 | ||
150 | it cc | ||
151 | strcc \irqstat, [\base, #GIC_CPU_EOI] | ||
152 | it cs | ||
153 | cmpcs \irqnr, \irqnr | ||
154 | .endm | ||
155 | |||
156 | /* As above, this assumes that irqstat and base are preserved */ | ||
157 | |||
158 | .macro test_for_ltirq, irqnr, irqstat, base, tmp | ||
159 | bic \irqnr, \irqstat, #0x1c00 | ||
160 | mov \tmp, #0 | ||
161 | cmp \irqnr, #29 | ||
162 | itt eq | ||
163 | moveq \tmp, #1 | ||
164 | streq \irqstat, [\base, #GIC_CPU_EOI] | ||
165 | cmp \tmp, #0 | ||
166 | .endm | ||
167 | #endif | ||
168 | |||
169 | .macro irq_prio_table | ||
170 | .endm | ||
171 | |||
172 | #endif | ||
diff --git a/arch/arm/plat-omap/include/mach/mtd-xip.h b/arch/arm/plat-omap/include/mach/mtd-xip.h deleted file mode 100644 index f82a8dcaad94..000000000000 --- a/arch/arm/plat-omap/include/mach/mtd-xip.h +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | /* | ||
2 | * MTD primitives for XIP support. Architecture specific functions. | ||
3 | * | ||
4 | * Do not include this file directly. It's included from linux/mtd/xip.h | ||
5 | * | ||
6 | * Author: Vladimir Barinov <vbarinov@embeddedalley.com> | ||
7 | * | ||
8 | * (c) 2005 MontaVista Software, Inc. This file is licensed under the | ||
9 | * terms of the GNU General Public License version 2. This program is | ||
10 | * licensed "as is" without any warranty of any kind, whether express or | ||
11 | * implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ARCH_OMAP_MTD_XIP_H__ | ||
15 | #define __ARCH_OMAP_MTD_XIP_H__ | ||
16 | |||
17 | #include <mach/hardware.h> | ||
18 | #define OMAP_MPU_TIMER_BASE (0xfffec500) | ||
19 | #define OMAP_MPU_TIMER_OFFSET 0x100 | ||
20 | |||
21 | typedef struct { | ||
22 | u32 cntl; /* CNTL_TIMER, R/W */ | ||
23 | u32 load_tim; /* LOAD_TIM, W */ | ||
24 | u32 read_tim; /* READ_TIM, R */ | ||
25 | } xip_omap_mpu_timer_regs_t; | ||
26 | |||
27 | #define xip_omap_mpu_timer_base(n) \ | ||
28 | ((volatile xip_omap_mpu_timer_regs_t*)OMAP1_IO_ADDRESS(OMAP_MPU_TIMER_BASE + \ | ||
29 | (n)*OMAP_MPU_TIMER_OFFSET)) | ||
30 | |||
31 | static inline unsigned long xip_omap_mpu_timer_read(int nr) | ||
32 | { | ||
33 | volatile xip_omap_mpu_timer_regs_t* timer = xip_omap_mpu_timer_base(nr); | ||
34 | return timer->read_tim; | ||
35 | } | ||
36 | |||
37 | #define xip_irqpending() \ | ||
38 | (omap_readl(OMAP_IH1_ITR) & ~omap_readl(OMAP_IH1_MIR)) | ||
39 | #define xip_currtime() (~xip_omap_mpu_timer_read(0)) | ||
40 | |||
41 | /* | ||
42 | * It's permitted to do approxmation for xip_elapsed_since macro | ||
43 | * (see linux/mtd/xip.h) | ||
44 | */ | ||
45 | |||
46 | #ifdef CONFIG_MACH_OMAP_PERSEUS2 | ||
47 | #define xip_elapsed_since(x) (signed)((~xip_omap_mpu_timer_read(0) - (x)) / 7) | ||
48 | #else | ||
49 | #define xip_elapsed_since(x) (signed)((~xip_omap_mpu_timer_read(0) - (x)) / 6) | ||
50 | #endif | ||
51 | |||
52 | /* | ||
53 | * xip_cpu_idle() is used when waiting for a delay equal or larger than | ||
54 | * the system timer tick period. This should put the CPU into idle mode | ||
55 | * to save power and to be woken up only when some interrupts are pending. | ||
56 | * As above, this should not rely upon standard kernel code. | ||
57 | */ | ||
58 | |||
59 | #define xip_cpu_idle() asm volatile ("mcr p15, 0, %0, c7, c0, 4" :: "r" (1)) | ||
60 | |||
61 | #endif /* __ARCH_OMAP_MTD_XIP_H__ */ | ||
diff --git a/arch/arm/plat-omap/include/mach/vmalloc.h b/arch/arm/plat-omap/include/mach/vmalloc.h deleted file mode 100644 index b97dfafeebda..000000000000 --- a/arch/arm/plat-omap/include/mach/vmalloc.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/plat-omap/include/mach/vmalloc.h | ||
3 | * | ||
4 | * Copyright (C) 2000 Russell King. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | #define VMALLOC_END (PAGE_OFFSET + 0x18000000) | ||
21 | |||
diff --git a/arch/arm/plat-omap/include/mach/blizzard.h b/arch/arm/plat-omap/include/plat/blizzard.h index 8d160f171372..8d160f171372 100644 --- a/arch/arm/plat-omap/include/mach/blizzard.h +++ b/arch/arm/plat-omap/include/plat/blizzard.h | |||
diff --git a/arch/arm/plat-omap/include/mach/board-ams-delta.h b/arch/arm/plat-omap/include/plat/board-ams-delta.h index 51b102dc906b..51b102dc906b 100644 --- a/arch/arm/plat-omap/include/mach/board-ams-delta.h +++ b/arch/arm/plat-omap/include/plat/board-ams-delta.h | |||
diff --git a/arch/arm/plat-omap/include/mach/board-sx1.h b/arch/arm/plat-omap/include/plat/board-sx1.h index 355adbdaae33..355adbdaae33 100644 --- a/arch/arm/plat-omap/include/mach/board-sx1.h +++ b/arch/arm/plat-omap/include/plat/board-sx1.h | |||
diff --git a/arch/arm/plat-omap/include/mach/board-voiceblue.h b/arch/arm/plat-omap/include/plat/board-voiceblue.h index 27916b210f57..27916b210f57 100644 --- a/arch/arm/plat-omap/include/mach/board-voiceblue.h +++ b/arch/arm/plat-omap/include/plat/board-voiceblue.h | |||
diff --git a/arch/arm/plat-omap/include/mach/board.h b/arch/arm/plat-omap/include/plat/board.h index 8e913c322810..abb17b604f82 100644 --- a/arch/arm/plat-omap/include/mach/board.h +++ b/arch/arm/plat-omap/include/plat/board.h | |||
@@ -12,7 +12,19 @@ | |||
12 | 12 | ||
13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | 14 | ||
15 | #include <mach/gpio-switch.h> | 15 | #include <plat/gpio-switch.h> |
16 | |||
17 | /* | ||
18 | * OMAP35x EVM revision | ||
19 | * Run time detection of EVM revision is done by reading Ethernet | ||
20 | * PHY ID - | ||
21 | * GEN_1 = 0x01150000 | ||
22 | * GEN_2 = 0x92200000 | ||
23 | */ | ||
24 | enum { | ||
25 | OMAP3EVM_BOARD_GEN_1 = 0, /* EVM Rev between A - D */ | ||
26 | OMAP3EVM_BOARD_GEN_2, /* EVM Rev >= Rev E */ | ||
27 | }; | ||
16 | 28 | ||
17 | /* Different peripheral ids */ | 29 | /* Different peripheral ids */ |
18 | #define OMAP_TAG_CLOCK 0x4f01 | 30 | #define OMAP_TAG_CLOCK 0x4f01 |
@@ -157,4 +169,10 @@ extern int omap_board_config_size; | |||
157 | /* for TI reference platforms sharing the same debug card */ | 169 | /* for TI reference platforms sharing the same debug card */ |
158 | extern int debug_card_init(u32 addr, unsigned gpio); | 170 | extern int debug_card_init(u32 addr, unsigned gpio); |
159 | 171 | ||
172 | /* OMAP3EVM revision */ | ||
173 | #if defined(CONFIG_MACH_OMAP3EVM) | ||
174 | u8 get_omap3_evm_rev(void); | ||
175 | #else | ||
176 | #define get_omap3_evm_rev() (-EINVAL) | ||
177 | #endif | ||
160 | #endif | 178 | #endif |
diff --git a/arch/arm/plat-omap/include/mach/clkdev.h b/arch/arm/plat-omap/include/plat/clkdev.h index 730c49d1ebd8..730c49d1ebd8 100644 --- a/arch/arm/plat-omap/include/mach/clkdev.h +++ b/arch/arm/plat-omap/include/plat/clkdev.h | |||
diff --git a/arch/arm/plat-omap/include/mach/clock.h b/arch/arm/plat-omap/include/plat/clock.h index 4b8b0d65cbf2..4b8b0d65cbf2 100644 --- a/arch/arm/plat-omap/include/mach/clock.h +++ b/arch/arm/plat-omap/include/plat/clock.h | |||
diff --git a/arch/arm/plat-omap/include/mach/clockdomain.h b/arch/arm/plat-omap/include/plat/clockdomain.h index 99ebd886f134..eb734826e64e 100644 --- a/arch/arm/plat-omap/include/mach/clockdomain.h +++ b/arch/arm/plat-omap/include/plat/clockdomain.h | |||
@@ -16,9 +16,9 @@ | |||
16 | #ifndef __ASM_ARM_ARCH_OMAP_CLOCKDOMAIN_H | 16 | #ifndef __ASM_ARM_ARCH_OMAP_CLOCKDOMAIN_H |
17 | #define __ASM_ARM_ARCH_OMAP_CLOCKDOMAIN_H | 17 | #define __ASM_ARM_ARCH_OMAP_CLOCKDOMAIN_H |
18 | 18 | ||
19 | #include <mach/powerdomain.h> | 19 | #include <plat/powerdomain.h> |
20 | #include <mach/clock.h> | 20 | #include <plat/clock.h> |
21 | #include <mach/cpu.h> | 21 | #include <plat/cpu.h> |
22 | 22 | ||
23 | /* Clockdomain capability flags */ | 23 | /* Clockdomain capability flags */ |
24 | #define CLKDM_CAN_FORCE_SLEEP (1 << 0) | 24 | #define CLKDM_CAN_FORCE_SLEEP (1 << 0) |
diff --git a/arch/arm/plat-omap/include/mach/common.h b/arch/arm/plat-omap/include/plat/common.h index fdeab421b4dc..064f1730f43b 100644 --- a/arch/arm/plat-omap/include/mach/common.h +++ b/arch/arm/plat-omap/include/plat/common.h | |||
@@ -31,6 +31,9 @@ | |||
31 | 31 | ||
32 | struct sys_timer; | 32 | struct sys_timer; |
33 | 33 | ||
34 | /* used by omap-smp.c and board-4430sdp.c */ | ||
35 | extern void __iomem *gic_cpu_base_addr; | ||
36 | |||
34 | extern void omap_map_common_io(void); | 37 | extern void omap_map_common_io(void); |
35 | extern struct sys_timer omap_timer; | 38 | extern struct sys_timer omap_timer; |
36 | #if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE) | 39 | #if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE) |
diff --git a/arch/arm/plat-omap/include/mach/control.h b/arch/arm/plat-omap/include/plat/control.h index 826d317cdbec..2ae884378638 100644 --- a/arch/arm/plat-omap/include/mach/control.h +++ b/arch/arm/plat-omap/include/plat/control.h | |||
@@ -20,15 +20,18 @@ | |||
20 | 20 | ||
21 | #ifndef __ASSEMBLY__ | 21 | #ifndef __ASSEMBLY__ |
22 | #define OMAP242X_CTRL_REGADDR(reg) \ | 22 | #define OMAP242X_CTRL_REGADDR(reg) \ |
23 | OMAP2_IO_ADDRESS(OMAP242X_CTRL_BASE + (reg)) | 23 | OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE + (reg)) |
24 | #define OMAP243X_CTRL_REGADDR(reg) \ | 24 | #define OMAP243X_CTRL_REGADDR(reg) \ |
25 | OMAP2_IO_ADDRESS(OMAP243X_CTRL_BASE + (reg)) | 25 | OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE + (reg)) |
26 | #define OMAP343X_CTRL_REGADDR(reg) \ | 26 | #define OMAP343X_CTRL_REGADDR(reg) \ |
27 | OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE + (reg)) | 27 | OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE + (reg)) |
28 | #else | 28 | #else |
29 | #define OMAP242X_CTRL_REGADDR(reg) OMAP2_IO_ADDRESS(OMAP242X_CTRL_BASE + (reg)) | 29 | #define OMAP242X_CTRL_REGADDR(reg) \ |
30 | #define OMAP243X_CTRL_REGADDR(reg) OMAP2_IO_ADDRESS(OMAP243X_CTRL_BASE + (reg)) | 30 | OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE + (reg)) |
31 | #define OMAP343X_CTRL_REGADDR(reg) OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE + (reg)) | 31 | #define OMAP243X_CTRL_REGADDR(reg) \ |
32 | OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE + (reg)) | ||
33 | #define OMAP343X_CTRL_REGADDR(reg) \ | ||
34 | OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE + (reg)) | ||
32 | #endif /* __ASSEMBLY__ */ | 35 | #endif /* __ASSEMBLY__ */ |
33 | 36 | ||
34 | /* | 37 | /* |
@@ -109,6 +112,8 @@ | |||
109 | #define OMAP24XX_CONTROL_TEST_KEY_8 (OMAP2_CONTROL_GENERAL + 0x00e0) | 112 | #define OMAP24XX_CONTROL_TEST_KEY_8 (OMAP2_CONTROL_GENERAL + 0x00e0) |
110 | #define OMAP24XX_CONTROL_TEST_KEY_9 (OMAP2_CONTROL_GENERAL + 0x00e4) | 113 | #define OMAP24XX_CONTROL_TEST_KEY_9 (OMAP2_CONTROL_GENERAL + 0x00e4) |
111 | 114 | ||
115 | #define OMAP343X_CONTROL_PADCONF_SYSNIRQ (OMAP2_CONTROL_INTERFACE + 0x01b0) | ||
116 | |||
112 | /* 34xx-only CONTROL_GENERAL register offsets */ | 117 | /* 34xx-only CONTROL_GENERAL register offsets */ |
113 | #define OMAP343X_CONTROL_PADCONF_OFF (OMAP2_CONTROL_GENERAL + 0x0000) | 118 | #define OMAP343X_CONTROL_PADCONF_OFF (OMAP2_CONTROL_GENERAL + 0x0000) |
114 | #define OMAP343X_CONTROL_MEM_DFTRW0 (OMAP2_CONTROL_GENERAL + 0x0008) | 119 | #define OMAP343X_CONTROL_MEM_DFTRW0 (OMAP2_CONTROL_GENERAL + 0x0008) |
@@ -141,8 +146,51 @@ | |||
141 | #define OMAP343X_CONTROL_TEST_KEY_13 (OMAP2_CONTROL_GENERAL + 0x00fc) | 146 | #define OMAP343X_CONTROL_TEST_KEY_13 (OMAP2_CONTROL_GENERAL + 0x00fc) |
142 | #define OMAP343X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190) | 147 | #define OMAP343X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190) |
143 | #define OMAP343X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194) | 148 | #define OMAP343X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194) |
144 | #define OMAP343X_CONTROL_PBIAS_LITE (OMAP2_CONTROL_GENERAL + 0x02b0) | 149 | #define OMAP343X_CONTROL_DEBOBS(i) (OMAP2_CONTROL_GENERAL + 0x01B0 \ |
145 | #define OMAP343X_CONTROL_TEMP_SENSOR (OMAP2_CONTROL_GENERAL + 0x02b4) | 150 | + ((i) >> 1) * 4 + (!(i) & 1) * 2) |
151 | #define OMAP343X_CONTROL_PROG_IO0 (OMAP2_CONTROL_GENERAL + 0x01D4) | ||
152 | #define OMAP343X_CONTROL_PROG_IO1 (OMAP2_CONTROL_GENERAL + 0x01D8) | ||
153 | #define OMAP343X_CONTROL_DSS_DPLL_SPREADING (OMAP2_CONTROL_GENERAL + 0x01E0) | ||
154 | #define OMAP343X_CONTROL_CORE_DPLL_SPREADING (OMAP2_CONTROL_GENERAL + 0x01E4) | ||
155 | #define OMAP343X_CONTROL_PER_DPLL_SPREADING (OMAP2_CONTROL_GENERAL + 0x01E8) | ||
156 | #define OMAP343X_CONTROL_USBHOST_DPLL_SPREADING (OMAP2_CONTROL_GENERAL + 0x01EC) | ||
157 | #define OMAP343X_CONTROL_PBIAS_LITE (OMAP2_CONTROL_GENERAL + 0x02B0) | ||
158 | #define OMAP343X_CONTROL_TEMP_SENSOR (OMAP2_CONTROL_GENERAL + 0x02B4) | ||
159 | #define OMAP343X_CONTROL_SRAMLDO4 (OMAP2_CONTROL_GENERAL + 0x02B8) | ||
160 | #define OMAP343X_CONTROL_SRAMLDO5 (OMAP2_CONTROL_GENERAL + 0x02C0) | ||
161 | #define OMAP343X_CONTROL_CSI (OMAP2_CONTROL_GENERAL + 0x02C4) | ||
162 | |||
163 | |||
164 | /* 34xx PADCONF register offsets */ | ||
165 | #define OMAP343X_PADCONF_ETK(i) (OMAP2_CONTROL_PADCONFS + 0x5a8 + \ | ||
166 | (i)*2) | ||
167 | #define OMAP343X_PADCONF_ETK_CLK OMAP343X_PADCONF_ETK(0) | ||
168 | #define OMAP343X_PADCONF_ETK_CTL OMAP343X_PADCONF_ETK(1) | ||
169 | #define OMAP343X_PADCONF_ETK_D0 OMAP343X_PADCONF_ETK(2) | ||
170 | #define OMAP343X_PADCONF_ETK_D1 OMAP343X_PADCONF_ETK(3) | ||
171 | #define OMAP343X_PADCONF_ETK_D2 OMAP343X_PADCONF_ETK(4) | ||
172 | #define OMAP343X_PADCONF_ETK_D3 OMAP343X_PADCONF_ETK(5) | ||
173 | #define OMAP343X_PADCONF_ETK_D4 OMAP343X_PADCONF_ETK(6) | ||
174 | #define OMAP343X_PADCONF_ETK_D5 OMAP343X_PADCONF_ETK(7) | ||
175 | #define OMAP343X_PADCONF_ETK_D6 OMAP343X_PADCONF_ETK(8) | ||
176 | #define OMAP343X_PADCONF_ETK_D7 OMAP343X_PADCONF_ETK(9) | ||
177 | #define OMAP343X_PADCONF_ETK_D8 OMAP343X_PADCONF_ETK(10) | ||
178 | #define OMAP343X_PADCONF_ETK_D9 OMAP343X_PADCONF_ETK(11) | ||
179 | #define OMAP343X_PADCONF_ETK_D10 OMAP343X_PADCONF_ETK(12) | ||
180 | #define OMAP343X_PADCONF_ETK_D11 OMAP343X_PADCONF_ETK(13) | ||
181 | #define OMAP343X_PADCONF_ETK_D12 OMAP343X_PADCONF_ETK(14) | ||
182 | #define OMAP343X_PADCONF_ETK_D13 OMAP343X_PADCONF_ETK(15) | ||
183 | #define OMAP343X_PADCONF_ETK_D14 OMAP343X_PADCONF_ETK(16) | ||
184 | #define OMAP343X_PADCONF_ETK_D15 OMAP343X_PADCONF_ETK(17) | ||
185 | |||
186 | /* 34xx GENERAL_WKUP regist offsets */ | ||
187 | #define OMAP343X_CONTROL_WKUP_DEBOBSMUX(i) (OMAP343X_CONTROL_GENERAL_WKUP + \ | ||
188 | 0x008 + (i)) | ||
189 | #define OMAP343X_CONTROL_WKUP_DEBOBS0 (OMAP343X_CONTROL_GENERAL_WKUP + 0x008) | ||
190 | #define OMAP343X_CONTROL_WKUP_DEBOBS1 (OMAP343X_CONTROL_GENERAL_WKUP + 0x00C) | ||
191 | #define OMAP343X_CONTROL_WKUP_DEBOBS2 (OMAP343X_CONTROL_GENERAL_WKUP + 0x010) | ||
192 | #define OMAP343X_CONTROL_WKUP_DEBOBS3 (OMAP343X_CONTROL_GENERAL_WKUP + 0x014) | ||
193 | #define OMAP343X_CONTROL_WKUP_DEBOBS4 (OMAP343X_CONTROL_GENERAL_WKUP + 0x018) | ||
146 | 194 | ||
147 | /* 34xx D2D idle-related pins, handled by PM core */ | 195 | /* 34xx D2D idle-related pins, handled by PM core */ |
148 | #define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250 | 196 | #define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250 |
@@ -193,6 +241,9 @@ | |||
193 | #define OMAP2_PBIASLITEPWRDNZ0 (1 << 1) | 241 | #define OMAP2_PBIASLITEPWRDNZ0 (1 << 1) |
194 | #define OMAP2_PBIASLITEVMODE0 (1 << 0) | 242 | #define OMAP2_PBIASLITEVMODE0 (1 << 0) |
195 | 243 | ||
244 | /* CONTROL_PROG_IO1 bits */ | ||
245 | #define OMAP3630_PRG_SDMMC1_SPEEDCTRL (1 << 20) | ||
246 | |||
196 | /* CONTROL_IVA2_BOOTMOD bits */ | 247 | /* CONTROL_IVA2_BOOTMOD bits */ |
197 | #define OMAP3_IVA2_BOOTMOD_SHIFT 0 | 248 | #define OMAP3_IVA2_BOOTMOD_SHIFT 0 |
198 | #define OMAP3_IVA2_BOOTMOD_MASK (0xf << 0) | 249 | #define OMAP3_IVA2_BOOTMOD_MASK (0xf << 0) |
@@ -202,6 +253,44 @@ | |||
202 | #define OMAP3_PADCONF_WAKEUPEVENT0 (1 << 15) | 253 | #define OMAP3_PADCONF_WAKEUPEVENT0 (1 << 15) |
203 | #define OMAP3_PADCONF_WAKEUPENABLE0 (1 << 14) | 254 | #define OMAP3_PADCONF_WAKEUPENABLE0 (1 << 14) |
204 | 255 | ||
256 | #define OMAP343X_SCRATCHPAD_ROM (OMAP343X_CTRL_BASE + 0x860) | ||
257 | #define OMAP343X_SCRATCHPAD (OMAP343X_CTRL_BASE + 0x910) | ||
258 | #define OMAP343X_SCRATCHPAD_ROM_OFFSET 0x19C | ||
259 | |||
260 | /* | ||
261 | * CONTROL OMAP STATUS register to identify OMAP3 features | ||
262 | */ | ||
263 | #define OMAP3_CONTROL_OMAP_STATUS 0x044c | ||
264 | |||
265 | #define OMAP3_SGX_SHIFT 13 | ||
266 | #define OMAP3_SGX_MASK (3 << OMAP3_SGX_SHIFT) | ||
267 | #define FEAT_SGX_FULL 0 | ||
268 | #define FEAT_SGX_HALF 1 | ||
269 | #define FEAT_SGX_NONE 2 | ||
270 | |||
271 | #define OMAP3_IVA_SHIFT 12 | ||
272 | #define OMAP3_IVA_MASK (1 << OMAP3_SGX_SHIFT) | ||
273 | #define FEAT_IVA 0 | ||
274 | #define FEAT_IVA_NONE 1 | ||
275 | |||
276 | #define OMAP3_L2CACHE_SHIFT 10 | ||
277 | #define OMAP3_L2CACHE_MASK (3 << OMAP3_L2CACHE_SHIFT) | ||
278 | #define FEAT_L2CACHE_NONE 0 | ||
279 | #define FEAT_L2CACHE_64KB 1 | ||
280 | #define FEAT_L2CACHE_128KB 2 | ||
281 | #define FEAT_L2CACHE_256KB 3 | ||
282 | |||
283 | #define OMAP3_ISP_SHIFT 5 | ||
284 | #define OMAP3_ISP_MASK (1<< OMAP3_ISP_SHIFT) | ||
285 | #define FEAT_ISP 0 | ||
286 | #define FEAT_ISP_NONE 1 | ||
287 | |||
288 | #define OMAP3_NEON_SHIFT 4 | ||
289 | #define OMAP3_NEON_MASK (1<< OMAP3_NEON_SHIFT) | ||
290 | #define FEAT_NEON 0 | ||
291 | #define FEAT_NEON_NONE 1 | ||
292 | |||
293 | |||
205 | #ifndef __ASSEMBLY__ | 294 | #ifndef __ASSEMBLY__ |
206 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \ | 295 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \ |
207 | defined(CONFIG_ARCH_OMAP4) | 296 | defined(CONFIG_ARCH_OMAP4) |
@@ -212,6 +301,15 @@ extern u32 omap_ctrl_readl(u16 offset); | |||
212 | extern void omap_ctrl_writeb(u8 val, u16 offset); | 301 | extern void omap_ctrl_writeb(u8 val, u16 offset); |
213 | extern void omap_ctrl_writew(u16 val, u16 offset); | 302 | extern void omap_ctrl_writew(u16 val, u16 offset); |
214 | extern void omap_ctrl_writel(u32 val, u16 offset); | 303 | extern void omap_ctrl_writel(u32 val, u16 offset); |
304 | |||
305 | extern void omap3_save_scratchpad_contents(void); | ||
306 | extern void omap3_clear_scratchpad_contents(void); | ||
307 | extern u32 *get_restore_pointer(void); | ||
308 | extern u32 *get_es3_restore_pointer(void); | ||
309 | extern u32 omap3_arm_context[128]; | ||
310 | extern void omap3_control_save_context(void); | ||
311 | extern void omap3_control_restore_context(void); | ||
312 | |||
215 | #else | 313 | #else |
216 | #define omap_ctrl_base_get() 0 | 314 | #define omap_ctrl_base_get() 0 |
217 | #define omap_ctrl_readb(x) 0 | 315 | #define omap_ctrl_readb(x) 0 |
diff --git a/arch/arm/plat-omap/include/mach/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h index f129efb3075e..2e1789001dfe 100644 --- a/arch/arm/plat-omap/include/mach/cpu.h +++ b/arch/arm/plat-omap/include/plat/cpu.h | |||
@@ -30,6 +30,8 @@ | |||
30 | #ifndef __ASM_ARCH_OMAP_CPU_H | 30 | #ifndef __ASM_ARCH_OMAP_CPU_H |
31 | #define __ASM_ARCH_OMAP_CPU_H | 31 | #define __ASM_ARCH_OMAP_CPU_H |
32 | 32 | ||
33 | #include <linux/bitops.h> | ||
34 | |||
33 | /* | 35 | /* |
34 | * Omap device type i.e. EMU/HS/TST/GP/BAD | 36 | * Omap device type i.e. EMU/HS/TST/GP/BAD |
35 | */ | 37 | */ |
@@ -57,6 +59,23 @@ struct omap_chip_id { | |||
57 | unsigned int omap_rev(void); | 59 | unsigned int omap_rev(void); |
58 | 60 | ||
59 | /* | 61 | /* |
62 | * Define CPU revision bits | ||
63 | * | ||
64 | * Verbose meaning of the revision bits may be different for a silicon | ||
65 | * family. This difference can be handled separately. | ||
66 | */ | ||
67 | #define OMAP_REVBITS_00 0x00 | ||
68 | #define OMAP_REVBITS_10 0x10 | ||
69 | #define OMAP_REVBITS_20 0x20 | ||
70 | #define OMAP_REVBITS_30 0x30 | ||
71 | #define OMAP_REVBITS_40 0x40 | ||
72 | |||
73 | /* | ||
74 | * Get the CPU revision for OMAP devices | ||
75 | */ | ||
76 | #define GET_OMAP_REVISION() ((omap_rev() >> 8) & 0xff) | ||
77 | |||
78 | /* | ||
60 | * Test if multicore OMAP support is needed | 79 | * Test if multicore OMAP support is needed |
61 | */ | 80 | */ |
62 | #undef MULTI_OMAP1 | 81 | #undef MULTI_OMAP1 |
@@ -161,6 +180,7 @@ IS_OMAP_CLASS(34xx, 0x34) | |||
161 | IS_OMAP_SUBCLASS(242x, 0x242) | 180 | IS_OMAP_SUBCLASS(242x, 0x242) |
162 | IS_OMAP_SUBCLASS(243x, 0x243) | 181 | IS_OMAP_SUBCLASS(243x, 0x243) |
163 | IS_OMAP_SUBCLASS(343x, 0x343) | 182 | IS_OMAP_SUBCLASS(343x, 0x343) |
183 | IS_OMAP_SUBCLASS(363x, 0x363) | ||
164 | 184 | ||
165 | #define cpu_is_omap7xx() 0 | 185 | #define cpu_is_omap7xx() 0 |
166 | #define cpu_is_omap15xx() 0 | 186 | #define cpu_is_omap15xx() 0 |
@@ -264,6 +284,8 @@ IS_OMAP_SUBCLASS(343x, 0x343) | |||
264 | * cpu_is_omap2423(): True for OMAP2423 | 284 | * cpu_is_omap2423(): True for OMAP2423 |
265 | * cpu_is_omap2430(): True for OMAP2430 | 285 | * cpu_is_omap2430(): True for OMAP2430 |
266 | * cpu_is_omap3430(): True for OMAP3430 | 286 | * cpu_is_omap3430(): True for OMAP3430 |
287 | * cpu_is_omap3505(): True for OMAP3505 | ||
288 | * cpu_is_omap3517(): True for OMAP3517 | ||
267 | */ | 289 | */ |
268 | #define GET_OMAP_TYPE ((omap_rev() >> 16) & 0xffff) | 290 | #define GET_OMAP_TYPE ((omap_rev() >> 16) & 0xffff) |
269 | 291 | ||
@@ -287,6 +309,8 @@ IS_OMAP_TYPE(2422, 0x2422) | |||
287 | IS_OMAP_TYPE(2423, 0x2423) | 309 | IS_OMAP_TYPE(2423, 0x2423) |
288 | IS_OMAP_TYPE(2430, 0x2430) | 310 | IS_OMAP_TYPE(2430, 0x2430) |
289 | IS_OMAP_TYPE(3430, 0x3430) | 311 | IS_OMAP_TYPE(3430, 0x3430) |
312 | IS_OMAP_TYPE(3505, 0x3505) | ||
313 | IS_OMAP_TYPE(3517, 0x3517) | ||
290 | 314 | ||
291 | #define cpu_is_omap310() 0 | 315 | #define cpu_is_omap310() 0 |
292 | #define cpu_is_omap730() 0 | 316 | #define cpu_is_omap730() 0 |
@@ -301,7 +325,14 @@ IS_OMAP_TYPE(3430, 0x3430) | |||
301 | #define cpu_is_omap2422() 0 | 325 | #define cpu_is_omap2422() 0 |
302 | #define cpu_is_omap2423() 0 | 326 | #define cpu_is_omap2423() 0 |
303 | #define cpu_is_omap2430() 0 | 327 | #define cpu_is_omap2430() 0 |
328 | #define cpu_is_omap3503() 0 | ||
329 | #define cpu_is_omap3515() 0 | ||
330 | #define cpu_is_omap3525() 0 | ||
331 | #define cpu_is_omap3530() 0 | ||
332 | #define cpu_is_omap3505() 0 | ||
333 | #define cpu_is_omap3517() 0 | ||
304 | #define cpu_is_omap3430() 0 | 334 | #define cpu_is_omap3430() 0 |
335 | #define cpu_is_omap3630() 0 | ||
305 | 336 | ||
306 | /* | 337 | /* |
307 | * Whether we have MULTI_OMAP1 or not, we still need to distinguish | 338 | * Whether we have MULTI_OMAP1 or not, we still need to distinguish |
@@ -351,7 +382,27 @@ IS_OMAP_TYPE(3430, 0x3430) | |||
351 | 382 | ||
352 | #if defined(CONFIG_ARCH_OMAP34XX) | 383 | #if defined(CONFIG_ARCH_OMAP34XX) |
353 | # undef cpu_is_omap3430 | 384 | # undef cpu_is_omap3430 |
385 | # undef cpu_is_omap3503 | ||
386 | # undef cpu_is_omap3515 | ||
387 | # undef cpu_is_omap3525 | ||
388 | # undef cpu_is_omap3530 | ||
389 | # undef cpu_is_omap3505 | ||
390 | # undef cpu_is_omap3517 | ||
354 | # define cpu_is_omap3430() is_omap3430() | 391 | # define cpu_is_omap3430() is_omap3430() |
392 | # define cpu_is_omap3503() (cpu_is_omap3430() && \ | ||
393 | (!omap3_has_iva()) && \ | ||
394 | (!omap3_has_sgx())) | ||
395 | # define cpu_is_omap3515() (cpu_is_omap3430() && \ | ||
396 | (omap3_has_iva()) && \ | ||
397 | (!omap3_has_sgx())) | ||
398 | # define cpu_is_omap3525() (cpu_is_omap3430() && \ | ||
399 | (omap3_has_sgx()) && \ | ||
400 | (!omap3_has_iva())) | ||
401 | # define cpu_is_omap3530() (cpu_is_omap3430()) | ||
402 | # define cpu_is_omap3505() is_omap3505() | ||
403 | # define cpu_is_omap3517() is_omap3517() | ||
404 | # undef cpu_is_omap3630 | ||
405 | # define cpu_is_omap3630() is_omap363x() | ||
355 | #endif | 406 | #endif |
356 | 407 | ||
357 | # if defined(CONFIG_ARCH_OMAP4) | 408 | # if defined(CONFIG_ARCH_OMAP4) |
@@ -382,6 +433,16 @@ IS_OMAP_TYPE(3430, 0x3430) | |||
382 | #define OMAP3430_REV_ES3_0 0x34303034 | 433 | #define OMAP3430_REV_ES3_0 0x34303034 |
383 | #define OMAP3430_REV_ES3_1 0x34304034 | 434 | #define OMAP3430_REV_ES3_1 0x34304034 |
384 | 435 | ||
436 | #define OMAP3630_REV_ES1_0 0x36300034 | ||
437 | |||
438 | #define OMAP35XX_CLASS 0x35000034 | ||
439 | #define OMAP3503_REV(v) (OMAP35XX_CLASS | (0x3503 << 16) | (v << 12)) | ||
440 | #define OMAP3515_REV(v) (OMAP35XX_CLASS | (0x3515 << 16) | (v << 12)) | ||
441 | #define OMAP3525_REV(v) (OMAP35XX_CLASS | (0x3525 << 16) | (v << 12)) | ||
442 | #define OMAP3530_REV(v) (OMAP35XX_CLASS | (0x3530 << 16) | (v << 12)) | ||
443 | #define OMAP3505_REV(v) (OMAP35XX_CLASS | (0x3505 << 16) | (v << 12)) | ||
444 | #define OMAP3517_REV(v) (OMAP35XX_CLASS | (0x3517 << 16) | (v << 12)) | ||
445 | |||
385 | #define OMAP443X_CLASS 0x44300034 | 446 | #define OMAP443X_CLASS 0x44300034 |
386 | 447 | ||
387 | /* | 448 | /* |
@@ -405,6 +466,7 @@ IS_OMAP_TYPE(3430, 0x3430) | |||
405 | #define CHIP_IS_OMAP3430ES2 (1 << 4) | 466 | #define CHIP_IS_OMAP3430ES2 (1 << 4) |
406 | #define CHIP_IS_OMAP3430ES3_0 (1 << 5) | 467 | #define CHIP_IS_OMAP3430ES3_0 (1 << 5) |
407 | #define CHIP_IS_OMAP3430ES3_1 (1 << 6) | 468 | #define CHIP_IS_OMAP3430ES3_1 (1 << 6) |
469 | #define CHIP_IS_OMAP3630ES1 (1 << 7) | ||
408 | 470 | ||
409 | #define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430) | 471 | #define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430) |
410 | 472 | ||
@@ -416,11 +478,36 @@ IS_OMAP_TYPE(3430, 0x3430) | |||
416 | */ | 478 | */ |
417 | #define CHIP_GE_OMAP3430ES2 (CHIP_IS_OMAP3430ES2 | \ | 479 | #define CHIP_GE_OMAP3430ES2 (CHIP_IS_OMAP3430ES2 | \ |
418 | CHIP_IS_OMAP3430ES3_0 | \ | 480 | CHIP_IS_OMAP3430ES3_0 | \ |
419 | CHIP_IS_OMAP3430ES3_1) | 481 | CHIP_IS_OMAP3430ES3_1 | \ |
420 | #define CHIP_GE_OMAP3430ES3_1 (CHIP_IS_OMAP3430ES3_1) | 482 | CHIP_IS_OMAP3630ES1) |
483 | #define CHIP_GE_OMAP3430ES3_1 (CHIP_IS_OMAP3430ES3_1 | \ | ||
484 | CHIP_IS_OMAP3630ES1) | ||
421 | 485 | ||
422 | 486 | ||
423 | int omap_chip_is(struct omap_chip_id oci); | 487 | int omap_chip_is(struct omap_chip_id oci); |
424 | void omap2_check_revision(void); | 488 | void omap2_check_revision(void); |
425 | 489 | ||
490 | /* | ||
491 | * Runtime detection of OMAP3 features | ||
492 | */ | ||
493 | extern u32 omap3_features; | ||
494 | |||
495 | #define OMAP3_HAS_L2CACHE BIT(0) | ||
496 | #define OMAP3_HAS_IVA BIT(1) | ||
497 | #define OMAP3_HAS_SGX BIT(2) | ||
498 | #define OMAP3_HAS_NEON BIT(3) | ||
499 | #define OMAP3_HAS_ISP BIT(4) | ||
500 | |||
501 | #define OMAP3_HAS_FEATURE(feat,flag) \ | ||
502 | static inline unsigned int omap3_has_ ##feat(void) \ | ||
503 | { \ | ||
504 | return (omap3_features & OMAP3_HAS_ ##flag); \ | ||
505 | } \ | ||
506 | |||
507 | OMAP3_HAS_FEATURE(l2cache, L2CACHE) | ||
508 | OMAP3_HAS_FEATURE(sgx, SGX) | ||
509 | OMAP3_HAS_FEATURE(iva, IVA) | ||
510 | OMAP3_HAS_FEATURE(neon, NEON) | ||
511 | OMAP3_HAS_FEATURE(isp, ISP) | ||
512 | |||
426 | #endif | 513 | #endif |
diff --git a/arch/arm/plat-omap/include/mach/dma.h b/arch/arm/plat-omap/include/plat/dma.h index 72f680b7180d..1c017b29b7e9 100644 --- a/arch/arm/plat-omap/include/mach/dma.h +++ b/arch/arm/plat-omap/include/plat/dma.h | |||
@@ -633,6 +633,11 @@ extern void omap_set_dma_dst_endian_type(int lch, enum end_type etype); | |||
633 | extern void omap_set_dma_src_endian_type(int lch, enum end_type etype); | 633 | extern void omap_set_dma_src_endian_type(int lch, enum end_type etype); |
634 | extern int omap_get_dma_index(int lch, int *ei, int *fi); | 634 | extern int omap_get_dma_index(int lch, int *ei, int *fi); |
635 | 635 | ||
636 | void omap_dma_global_context_save(void); | ||
637 | void omap_dma_global_context_restore(void); | ||
638 | |||
639 | extern void omap_dma_disable_irq(int lch); | ||
640 | |||
636 | /* Chaining APIs */ | 641 | /* Chaining APIs */ |
637 | #ifndef CONFIG_ARCH_OMAP1 | 642 | #ifndef CONFIG_ARCH_OMAP1 |
638 | extern int omap_request_dma_chain(int dev_id, const char *dev_name, | 643 | extern int omap_request_dma_chain(int dev_id, const char *dev_name, |
diff --git a/arch/arm/plat-omap/include/mach/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h index 20f1054c0a80..20f1054c0a80 100644 --- a/arch/arm/plat-omap/include/mach/dmtimer.h +++ b/arch/arm/plat-omap/include/plat/dmtimer.h | |||
diff --git a/arch/arm/plat-omap/include/mach/dsp_common.h b/arch/arm/plat-omap/include/plat/dsp_common.h index da97736f3efa..da97736f3efa 100644 --- a/arch/arm/plat-omap/include/mach/dsp_common.h +++ b/arch/arm/plat-omap/include/plat/dsp_common.h | |||
diff --git a/arch/arm/plat-omap/include/mach/fpga.h b/arch/arm/plat-omap/include/plat/fpga.h index f1864a652f7a..f1864a652f7a 100644 --- a/arch/arm/plat-omap/include/mach/fpga.h +++ b/arch/arm/plat-omap/include/plat/fpga.h | |||
diff --git a/arch/arm/plat-omap/include/mach/gpio-switch.h b/arch/arm/plat-omap/include/plat/gpio-switch.h index 10da0e07c0cf..10da0e07c0cf 100644 --- a/arch/arm/plat-omap/include/mach/gpio-switch.h +++ b/arch/arm/plat-omap/include/plat/gpio-switch.h | |||
diff --git a/arch/arm/plat-omap/include/mach/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h index 633ff688b928..de7c54731cbe 100644 --- a/arch/arm/plat-omap/include/mach/gpio.h +++ b/arch/arm/plat-omap/include/plat/gpio.h | |||
@@ -76,7 +76,8 @@ extern void omap2_gpio_prepare_for_retention(void); | |||
76 | extern void omap2_gpio_resume_after_retention(void); | 76 | extern void omap2_gpio_resume_after_retention(void); |
77 | extern void omap_set_gpio_debounce(int gpio, int enable); | 77 | extern void omap_set_gpio_debounce(int gpio, int enable); |
78 | extern void omap_set_gpio_debounce_time(int gpio, int enable); | 78 | extern void omap_set_gpio_debounce_time(int gpio, int enable); |
79 | 79 | extern void omap_gpio_save_context(void); | |
80 | extern void omap_gpio_restore_context(void); | ||
80 | /*-------------------------------------------------------------------------*/ | 81 | /*-------------------------------------------------------------------------*/ |
81 | 82 | ||
82 | /* Wrappers for "new style" GPIO calls, using the new infrastructure | 83 | /* Wrappers for "new style" GPIO calls, using the new infrastructure |
diff --git a/arch/arm/plat-omap/include/mach/gpmc-smc91x.h b/arch/arm/plat-omap/include/plat/gpmc-smc91x.h index b64fbee4d567..b64fbee4d567 100644 --- a/arch/arm/plat-omap/include/mach/gpmc-smc91x.h +++ b/arch/arm/plat-omap/include/plat/gpmc-smc91x.h | |||
diff --git a/arch/arm/plat-omap/include/mach/gpmc.h b/arch/arm/plat-omap/include/plat/gpmc.h index 9c99cda77ba6..696e0ca051b7 100644 --- a/arch/arm/plat-omap/include/mach/gpmc.h +++ b/arch/arm/plat-omap/include/plat/gpmc.h | |||
@@ -52,6 +52,7 @@ | |||
52 | #define GPMC_CONFIG1_FCLK_DIV2 (GPMC_CONFIG1_FCLK_DIV(1)) | 52 | #define GPMC_CONFIG1_FCLK_DIV2 (GPMC_CONFIG1_FCLK_DIV(1)) |
53 | #define GPMC_CONFIG1_FCLK_DIV3 (GPMC_CONFIG1_FCLK_DIV(2)) | 53 | #define GPMC_CONFIG1_FCLK_DIV3 (GPMC_CONFIG1_FCLK_DIV(2)) |
54 | #define GPMC_CONFIG1_FCLK_DIV4 (GPMC_CONFIG1_FCLK_DIV(3)) | 54 | #define GPMC_CONFIG1_FCLK_DIV4 (GPMC_CONFIG1_FCLK_DIV(3)) |
55 | #define GPMC_CONFIG7_CSVALID (1 << 6) | ||
55 | 56 | ||
56 | /* | 57 | /* |
57 | * Note that all values in this struct are in nanoseconds, while | 58 | * Note that all values in this struct are in nanoseconds, while |
@@ -107,6 +108,8 @@ extern int gpmc_prefetch_enable(int cs, int dma_mode, | |||
107 | unsigned int u32_count, int is_write); | 108 | unsigned int u32_count, int is_write); |
108 | extern void gpmc_prefetch_reset(void); | 109 | extern void gpmc_prefetch_reset(void); |
109 | extern int gpmc_prefetch_status(void); | 110 | extern int gpmc_prefetch_status(void); |
111 | extern void omap3_gpmc_save_context(void); | ||
112 | extern void omap3_gpmc_restore_context(void); | ||
110 | extern void __init gpmc_init(void); | 113 | extern void __init gpmc_init(void); |
111 | 114 | ||
112 | #endif | 115 | #endif |
diff --git a/arch/arm/plat-omap/include/mach/hardware.h b/arch/arm/plat-omap/include/plat/hardware.h index 26c1fbff08aa..d5b26adfb890 100644 --- a/arch/arm/plat-omap/include/mach/hardware.h +++ b/arch/arm/plat-omap/include/plat/hardware.h | |||
@@ -39,9 +39,9 @@ | |||
39 | #include <asm/sizes.h> | 39 | #include <asm/sizes.h> |
40 | #ifndef __ASSEMBLER__ | 40 | #ifndef __ASSEMBLER__ |
41 | #include <asm/types.h> | 41 | #include <asm/types.h> |
42 | #include <mach/cpu.h> | 42 | #include <plat/cpu.h> |
43 | #endif | 43 | #endif |
44 | #include <mach/serial.h> | 44 | #include <plat/serial.h> |
45 | 45 | ||
46 | /* | 46 | /* |
47 | * --------------------------------------------------------------------------- | 47 | * --------------------------------------------------------------------------- |
@@ -280,11 +280,11 @@ | |||
280 | * --------------------------------------------------------------------------- | 280 | * --------------------------------------------------------------------------- |
281 | */ | 281 | */ |
282 | 282 | ||
283 | #include "omap730.h" | 283 | #include <plat/omap7xx.h> |
284 | #include "omap1510.h" | 284 | #include <plat/omap1510.h> |
285 | #include "omap16xx.h" | 285 | #include <plat/omap16xx.h> |
286 | #include "omap24xx.h" | 286 | #include <plat/omap24xx.h> |
287 | #include "omap34xx.h" | 287 | #include <plat/omap34xx.h> |
288 | #include "omap44xx.h" | 288 | #include <plat/omap44xx.h> |
289 | 289 | ||
290 | #endif /* __ASM_ARCH_OMAP_HARDWARE_H */ | 290 | #endif /* __ASM_ARCH_OMAP_HARDWARE_H */ |
diff --git a/arch/arm/plat-omap/include/mach/hwa742.h b/arch/arm/plat-omap/include/plat/hwa742.h index 886248d32b49..886248d32b49 100644 --- a/arch/arm/plat-omap/include/mach/hwa742.h +++ b/arch/arm/plat-omap/include/plat/hwa742.h | |||
diff --git a/arch/arm/plat-omap/include/mach/io.h b/arch/arm/plat-omap/include/plat/io.h index 8d32df32b0b1..7e5319f907d1 100644 --- a/arch/arm/plat-omap/include/mach/io.h +++ b/arch/arm/plat-omap/include/plat/io.h | |||
@@ -63,8 +63,24 @@ | |||
63 | #define OMAP1_IO_OFFSET 0x01000000 /* Virtual IO = 0xfefb0000 */ | 63 | #define OMAP1_IO_OFFSET 0x01000000 /* Virtual IO = 0xfefb0000 */ |
64 | #define OMAP1_IO_ADDRESS(pa) IOMEM((pa) - OMAP1_IO_OFFSET) | 64 | #define OMAP1_IO_ADDRESS(pa) IOMEM((pa) - OMAP1_IO_OFFSET) |
65 | 65 | ||
66 | #define OMAP2_IO_OFFSET 0x90000000 | 66 | #define OMAP2_L3_IO_OFFSET 0x90000000 |
67 | #define OMAP2_IO_ADDRESS(pa) IOMEM((pa) + OMAP2_IO_OFFSET) /* L3 and L4 */ | 67 | #define OMAP2_L3_IO_ADDRESS(pa) IOMEM((pa) + OMAP2_L3_IO_OFFSET) /* L3 */ |
68 | |||
69 | |||
70 | #define OMAP2_L4_IO_OFFSET 0xb2000000 | ||
71 | #define OMAP2_L4_IO_ADDRESS(pa) IOMEM((pa) + OMAP2_L4_IO_OFFSET) /* L4 */ | ||
72 | |||
73 | #define OMAP4_L3_IO_OFFSET 0xb4000000 | ||
74 | #define OMAP4_L3_IO_ADDRESS(pa) IOMEM((pa) + OMAP4_L3_IO_OFFSET) /* L3 */ | ||
75 | |||
76 | #define OMAP4_L3_PER_IO_OFFSET 0xb1100000 | ||
77 | #define OMAP4_L3_PER_IO_ADDRESS(pa) IOMEM((pa) + OMAP4_L3_PER_IO_OFFSET) | ||
78 | |||
79 | #define OMAP4_GPMC_IO_OFFSET 0xa9000000 | ||
80 | #define OMAP4_GPMC_IO_ADDRESS(pa) IOMEM((pa) + OMAP4_GPMC_IO_OFFSET) | ||
81 | |||
82 | #define OMAP2_EMU_IO_OFFSET 0xaa800000 /* Emulation */ | ||
83 | #define OMAP2_EMU_IO_ADDRESS(pa) IOMEM((pa) + OMAP2_EMU_IO_OFFSET) | ||
68 | 84 | ||
69 | /* | 85 | /* |
70 | * ---------------------------------------------------------------------------- | 86 | * ---------------------------------------------------------------------------- |
@@ -83,24 +99,27 @@ | |||
83 | */ | 99 | */ |
84 | 100 | ||
85 | /* We map both L3 and L4 on OMAP2 */ | 101 | /* We map both L3 and L4 on OMAP2 */ |
86 | #define L3_24XX_PHYS L3_24XX_BASE /* 0x68000000 */ | 102 | #define L3_24XX_PHYS L3_24XX_BASE /* 0x68000000 --> 0xf8000000*/ |
87 | #define L3_24XX_VIRT 0xf8000000 | 103 | #define L3_24XX_VIRT (L3_24XX_PHYS + OMAP2_L3_IO_OFFSET) |
88 | #define L3_24XX_SIZE SZ_1M /* 44kB of 128MB used, want 1MB sect */ | 104 | #define L3_24XX_SIZE SZ_1M /* 44kB of 128MB used, want 1MB sect */ |
89 | #define L4_24XX_PHYS L4_24XX_BASE /* 0x48000000 */ | 105 | #define L4_24XX_PHYS L4_24XX_BASE /* 0x48000000 --> 0xfa000000 */ |
90 | #define L4_24XX_VIRT 0xd8000000 | 106 | #define L4_24XX_VIRT (L4_24XX_PHYS + OMAP2_L4_IO_OFFSET) |
91 | #define L4_24XX_SIZE SZ_1M /* 1MB of 128MB used, want 1MB sect */ | 107 | #define L4_24XX_SIZE SZ_1M /* 1MB of 128MB used, want 1MB sect */ |
92 | 108 | ||
93 | #define L4_WK_243X_PHYS L4_WK_243X_BASE /* 0x49000000 */ | 109 | #define L4_WK_243X_PHYS L4_WK_243X_BASE /* 0x49000000 --> 0xfb000000 */ |
94 | #define L4_WK_243X_VIRT 0xd9000000 | 110 | #define L4_WK_243X_VIRT (L4_WK_243X_PHYS + OMAP2_L4_IO_OFFSET) |
95 | #define L4_WK_243X_SIZE SZ_1M | 111 | #define L4_WK_243X_SIZE SZ_1M |
96 | #define OMAP243X_GPMC_PHYS OMAP243X_GPMC_BASE /* 0x49000000 */ | 112 | #define OMAP243X_GPMC_PHYS OMAP243X_GPMC_BASE |
97 | #define OMAP243X_GPMC_VIRT 0xFE000000 | 113 | #define OMAP243X_GPMC_VIRT (OMAP243X_GPMC_PHYS + OMAP2_L3_IO_OFFSET) |
114 | /* 0x6e000000 --> 0xfe000000 */ | ||
98 | #define OMAP243X_GPMC_SIZE SZ_1M | 115 | #define OMAP243X_GPMC_SIZE SZ_1M |
99 | #define OMAP243X_SDRC_PHYS OMAP243X_SDRC_BASE | 116 | #define OMAP243X_SDRC_PHYS OMAP243X_SDRC_BASE |
100 | #define OMAP243X_SDRC_VIRT 0xFD000000 | 117 | /* 0x6D000000 --> 0xfd000000 */ |
118 | #define OMAP243X_SDRC_VIRT (OMAP243X_SDRC_PHYS + OMAP2_L3_IO_OFFSET) | ||
101 | #define OMAP243X_SDRC_SIZE SZ_1M | 119 | #define OMAP243X_SDRC_SIZE SZ_1M |
102 | #define OMAP243X_SMS_PHYS OMAP243X_SMS_BASE | 120 | #define OMAP243X_SMS_PHYS OMAP243X_SMS_BASE |
103 | #define OMAP243X_SMS_VIRT 0xFC000000 | 121 | /* 0x6c000000 --> 0xfc000000 */ |
122 | #define OMAP243X_SMS_VIRT (OMAP243X_SMS_PHYS + OMAP2_L3_IO_OFFSET) | ||
104 | #define OMAP243X_SMS_SIZE SZ_1M | 123 | #define OMAP243X_SMS_SIZE SZ_1M |
105 | 124 | ||
106 | /* DSP */ | 125 | /* DSP */ |
@@ -121,12 +140,12 @@ | |||
121 | */ | 140 | */ |
122 | 141 | ||
123 | /* We map both L3 and L4 on OMAP3 */ | 142 | /* We map both L3 and L4 on OMAP3 */ |
124 | #define L3_34XX_PHYS L3_34XX_BASE /* 0x68000000 */ | 143 | #define L3_34XX_PHYS L3_34XX_BASE /* 0x68000000 --> 0xf8000000 */ |
125 | #define L3_34XX_VIRT 0xf8000000 | 144 | #define L3_34XX_VIRT (L3_34XX_PHYS + OMAP2_L3_IO_OFFSET) |
126 | #define L3_34XX_SIZE SZ_1M /* 44kB of 128MB used, want 1MB sect */ | 145 | #define L3_34XX_SIZE SZ_1M /* 44kB of 128MB used, want 1MB sect */ |
127 | 146 | ||
128 | #define L4_34XX_PHYS L4_34XX_BASE /* 0x48000000 */ | 147 | #define L4_34XX_PHYS L4_34XX_BASE /* 0x48000000 --> 0xfa000000 */ |
129 | #define L4_34XX_VIRT 0xd8000000 | 148 | #define L4_34XX_VIRT (L4_34XX_PHYS + OMAP2_L4_IO_OFFSET) |
130 | #define L4_34XX_SIZE SZ_4M /* 1MB of 128MB used, want 1MB sect */ | 149 | #define L4_34XX_SIZE SZ_4M /* 1MB of 128MB used, want 1MB sect */ |
131 | 150 | ||
132 | /* | 151 | /* |
@@ -134,28 +153,33 @@ | |||
134 | * VPOM3430 was not working for Int controller | 153 | * VPOM3430 was not working for Int controller |
135 | */ | 154 | */ |
136 | 155 | ||
137 | #define L4_WK_34XX_PHYS L4_WK_34XX_BASE /* 0x48300000 */ | 156 | #define L4_WK_34XX_PHYS L4_WK_34XX_BASE /* 0x48300000 --> 0xfa300000 */ |
138 | #define L4_WK_34XX_VIRT 0xd8300000 | 157 | #define L4_WK_34XX_VIRT (L4_WK_34XX_PHYS + OMAP2_L4_IO_OFFSET) |
139 | #define L4_WK_34XX_SIZE SZ_1M | 158 | #define L4_WK_34XX_SIZE SZ_1M |
140 | 159 | ||
141 | #define L4_PER_34XX_PHYS L4_PER_34XX_BASE /* 0x49000000 */ | 160 | #define L4_PER_34XX_PHYS L4_PER_34XX_BASE |
142 | #define L4_PER_34XX_VIRT 0xd9000000 | 161 | /* 0x49000000 --> 0xfb000000 */ |
162 | #define L4_PER_34XX_VIRT (L4_PER_34XX_PHYS + OMAP2_L4_IO_OFFSET) | ||
143 | #define L4_PER_34XX_SIZE SZ_1M | 163 | #define L4_PER_34XX_SIZE SZ_1M |
144 | 164 | ||
145 | #define L4_EMU_34XX_PHYS L4_EMU_34XX_BASE /* 0x54000000 */ | 165 | #define L4_EMU_34XX_PHYS L4_EMU_34XX_BASE |
146 | #define L4_EMU_34XX_VIRT 0xe4000000 | 166 | /* 0x54000000 --> 0xfe800000 */ |
147 | #define L4_EMU_34XX_SIZE SZ_64M | 167 | #define L4_EMU_34XX_VIRT (L4_EMU_34XX_PHYS + OMAP2_EMU_IO_OFFSET) |
168 | #define L4_EMU_34XX_SIZE SZ_8M | ||
148 | 169 | ||
149 | #define OMAP34XX_GPMC_PHYS OMAP34XX_GPMC_BASE /* 0x6E000000 */ | 170 | #define OMAP34XX_GPMC_PHYS OMAP34XX_GPMC_BASE |
150 | #define OMAP34XX_GPMC_VIRT 0xFE000000 | 171 | /* 0x6e000000 --> 0xfe000000 */ |
172 | #define OMAP34XX_GPMC_VIRT (OMAP34XX_GPMC_PHYS + OMAP2_L3_IO_OFFSET) | ||
151 | #define OMAP34XX_GPMC_SIZE SZ_1M | 173 | #define OMAP34XX_GPMC_SIZE SZ_1M |
152 | 174 | ||
153 | #define OMAP343X_SMS_PHYS OMAP343X_SMS_BASE /* 0x6C000000 */ | 175 | #define OMAP343X_SMS_PHYS OMAP343X_SMS_BASE |
154 | #define OMAP343X_SMS_VIRT 0xFC000000 | 176 | /* 0x6c000000 --> 0xfc000000 */ |
177 | #define OMAP343X_SMS_VIRT (OMAP343X_SMS_PHYS + OMAP2_L3_IO_OFFSET) | ||
155 | #define OMAP343X_SMS_SIZE SZ_1M | 178 | #define OMAP343X_SMS_SIZE SZ_1M |
156 | 179 | ||
157 | #define OMAP343X_SDRC_PHYS OMAP343X_SDRC_BASE /* 0x6D000000 */ | 180 | #define OMAP343X_SDRC_PHYS OMAP343X_SDRC_BASE |
158 | #define OMAP343X_SDRC_VIRT 0xFD000000 | 181 | /* 0x6D000000 --> 0xfd000000 */ |
182 | #define OMAP343X_SDRC_VIRT (OMAP343X_SDRC_PHYS + OMAP2_L3_IO_OFFSET) | ||
159 | #define OMAP343X_SDRC_SIZE SZ_1M | 183 | #define OMAP343X_SDRC_SIZE SZ_1M |
160 | 184 | ||
161 | /* DSP */ | 185 | /* DSP */ |
@@ -176,32 +200,54 @@ | |||
176 | */ | 200 | */ |
177 | 201 | ||
178 | /* We map both L3 and L4 on OMAP4 */ | 202 | /* We map both L3 and L4 on OMAP4 */ |
179 | #define L3_44XX_PHYS L3_44XX_BASE | 203 | #define L3_44XX_PHYS L3_44XX_BASE /* 0x44000000 --> 0xf8000000 */ |
180 | #define L3_44XX_VIRT 0xd4000000 | 204 | #define L3_44XX_VIRT (L3_44XX_PHYS + OMAP4_L3_IO_OFFSET) |
181 | #define L3_44XX_SIZE SZ_1M | 205 | #define L3_44XX_SIZE SZ_1M |
182 | 206 | ||
183 | #define L4_44XX_PHYS L4_44XX_BASE | 207 | #define L4_44XX_PHYS L4_44XX_BASE /* 0x4a000000 --> 0xfc000000 */ |
184 | #define L4_44XX_VIRT 0xda000000 | 208 | #define L4_44XX_VIRT (L4_44XX_PHYS + OMAP2_L4_IO_OFFSET) |
185 | #define L4_44XX_SIZE SZ_4M | 209 | #define L4_44XX_SIZE SZ_4M |
186 | 210 | ||
187 | 211 | ||
188 | #define L4_WK_44XX_PHYS L4_WK_44XX_BASE | 212 | #define L4_WK_44XX_PHYS L4_WK_44XX_BASE /* 0x4a300000 --> 0xfc300000 */ |
189 | #define L4_WK_44XX_VIRT 0xda300000 | 213 | #define L4_WK_44XX_VIRT (L4_WK_44XX_PHYS + OMAP2_L4_IO_OFFSET) |
190 | #define L4_WK_44XX_SIZE SZ_1M | 214 | #define L4_WK_44XX_SIZE SZ_1M |
191 | 215 | ||
192 | #define L4_PER_44XX_PHYS L4_PER_44XX_BASE | 216 | #define L4_PER_44XX_PHYS L4_PER_44XX_BASE |
193 | #define L4_PER_44XX_VIRT 0xd8000000 | 217 | /* 0x48000000 --> 0xfa000000 */ |
218 | #define L4_PER_44XX_VIRT (L4_PER_44XX_PHYS + OMAP2_L4_IO_OFFSET) | ||
194 | #define L4_PER_44XX_SIZE SZ_4M | 219 | #define L4_PER_44XX_SIZE SZ_4M |
195 | 220 | ||
221 | #define L4_ABE_44XX_PHYS L4_ABE_44XX_BASE | ||
222 | /* 0x49000000 --> 0xfb000000 */ | ||
223 | #define L4_ABE_44XX_VIRT (L4_ABE_44XX_PHYS + OMAP2_L4_IO_OFFSET) | ||
224 | #define L4_ABE_44XX_SIZE SZ_1M | ||
225 | |||
196 | #define L4_EMU_44XX_PHYS L4_EMU_44XX_BASE | 226 | #define L4_EMU_44XX_PHYS L4_EMU_44XX_BASE |
197 | #define L4_EMU_44XX_VIRT 0xe4000000 | 227 | /* 0x54000000 --> 0xfe800000 */ |
198 | #define L4_EMU_44XX_SIZE SZ_64M | 228 | #define L4_EMU_44XX_VIRT (L4_EMU_44XX_PHYS + OMAP2_EMU_IO_OFFSET) |
229 | #define L4_EMU_44XX_SIZE SZ_8M | ||
199 | 230 | ||
200 | #define OMAP44XX_GPMC_PHYS OMAP44XX_GPMC_BASE | 231 | #define OMAP44XX_GPMC_PHYS OMAP44XX_GPMC_BASE |
201 | #define OMAP44XX_GPMC_VIRT 0xe0000000 | 232 | /* 0x50000000 --> 0xf9000000 */ |
233 | #define OMAP44XX_GPMC_VIRT (OMAP44XX_GPMC_PHYS + OMAP4_GPMC_IO_OFFSET) | ||
202 | #define OMAP44XX_GPMC_SIZE SZ_1M | 234 | #define OMAP44XX_GPMC_SIZE SZ_1M |
203 | 235 | ||
204 | 236 | ||
237 | #define OMAP44XX_EMIF1_PHYS OMAP44XX_EMIF1_BASE | ||
238 | /* 0x4c000000 --> 0xfd100000 */ | ||
239 | #define OMAP44XX_EMIF1_VIRT (OMAP44XX_EMIF1_PHYS + OMAP4_L3_PER_IO_OFFSET) | ||
240 | #define OMAP44XX_EMIF1_SIZE SZ_1M | ||
241 | |||
242 | #define OMAP44XX_EMIF2_PHYS OMAP44XX_EMIF2_BASE | ||
243 | /* 0x4d000000 --> 0xfd200000 */ | ||
244 | #define OMAP44XX_EMIF2_VIRT (OMAP44XX_EMIF2_PHYS + OMAP4_L3_PER_IO_OFFSET) | ||
245 | #define OMAP44XX_EMIF2_SIZE SZ_1M | ||
246 | |||
247 | #define OMAP44XX_DMM_PHYS OMAP44XX_DMM_BASE | ||
248 | /* 0x4e000000 --> 0xfd300000 */ | ||
249 | #define OMAP44XX_DMM_VIRT (OMAP44XX_DMM_PHYS + OMAP4_L3_PER_IO_OFFSET) | ||
250 | #define OMAP44XX_DMM_SIZE SZ_1M | ||
205 | /* | 251 | /* |
206 | * ---------------------------------------------------------------------------- | 252 | * ---------------------------------------------------------------------------- |
207 | * Omap specific register access | 253 | * Omap specific register access |
diff --git a/arch/arm/plat-omap/include/mach/iommu.h b/arch/arm/plat-omap/include/plat/iommu.h index 46d41ac83dbf..0752af9d099e 100644 --- a/arch/arm/plat-omap/include/mach/iommu.h +++ b/arch/arm/plat-omap/include/plat/iommu.h | |||
@@ -107,7 +107,7 @@ struct iommu_platform_data { | |||
107 | #if defined(CONFIG_ARCH_OMAP1) | 107 | #if defined(CONFIG_ARCH_OMAP1) |
108 | #error "iommu for this processor not implemented yet" | 108 | #error "iommu for this processor not implemented yet" |
109 | #else | 109 | #else |
110 | #include <mach/iommu2.h> | 110 | #include <plat/iommu2.h> |
111 | #endif | 111 | #endif |
112 | 112 | ||
113 | /* | 113 | /* |
diff --git a/arch/arm/plat-omap/include/mach/iommu2.h b/arch/arm/plat-omap/include/plat/iommu2.h index 10ad05f410e9..10ad05f410e9 100644 --- a/arch/arm/plat-omap/include/mach/iommu2.h +++ b/arch/arm/plat-omap/include/plat/iommu2.h | |||
diff --git a/arch/arm/plat-omap/include/mach/iovmm.h b/arch/arm/plat-omap/include/plat/iovmm.h index bdc7ce5d7a4a..bdc7ce5d7a4a 100644 --- a/arch/arm/plat-omap/include/mach/iovmm.h +++ b/arch/arm/plat-omap/include/plat/iovmm.h | |||
diff --git a/arch/arm/plat-omap/include/mach/irda.h b/arch/arm/plat-omap/include/plat/irda.h index 40f60339d1c6..40f60339d1c6 100644 --- a/arch/arm/plat-omap/include/mach/irda.h +++ b/arch/arm/plat-omap/include/plat/irda.h | |||
diff --git a/arch/arm/plat-omap/include/mach/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h index 28a165058b61..ce5dd2d1dc21 100644 --- a/arch/arm/plat-omap/include/mach/irqs.h +++ b/arch/arm/plat-omap/include/plat/irqs.h | |||
@@ -86,49 +86,26 @@ | |||
86 | #define INT_1610_SSR_FIFO_0 29 | 86 | #define INT_1610_SSR_FIFO_0 29 |
87 | 87 | ||
88 | /* | 88 | /* |
89 | * OMAP-730 specific IRQ numbers for interrupt handler 1 | 89 | * OMAP-7xx specific IRQ numbers for interrupt handler 1 |
90 | */ | 90 | */ |
91 | #define INT_730_IH2_FIQ 0 | 91 | #define INT_7XX_IH2_FIQ 0 |
92 | #define INT_730_IH2_IRQ 1 | 92 | #define INT_7XX_IH2_IRQ 1 |
93 | #define INT_730_USB_NON_ISO 2 | 93 | #define INT_7XX_USB_NON_ISO 2 |
94 | #define INT_730_USB_ISO 3 | 94 | #define INT_7XX_USB_ISO 3 |
95 | #define INT_730_ICR 4 | 95 | #define INT_7XX_ICR 4 |
96 | #define INT_730_EAC 5 | 96 | #define INT_7XX_EAC 5 |
97 | #define INT_730_GPIO_BANK1 6 | 97 | #define INT_7XX_GPIO_BANK1 6 |
98 | #define INT_730_GPIO_BANK2 7 | 98 | #define INT_7XX_GPIO_BANK2 7 |
99 | #define INT_730_GPIO_BANK3 8 | 99 | #define INT_7XX_GPIO_BANK3 8 |
100 | #define INT_730_McBSP2TX 10 | 100 | #define INT_7XX_McBSP2TX 10 |
101 | #define INT_730_McBSP2RX 11 | 101 | #define INT_7XX_McBSP2RX 11 |
102 | #define INT_730_McBSP2RX_OVF 12 | 102 | #define INT_7XX_McBSP2RX_OVF 12 |
103 | #define INT_730_LCD_LINE 14 | 103 | #define INT_7XX_LCD_LINE 14 |
104 | #define INT_730_GSM_PROTECT 15 | 104 | #define INT_7XX_GSM_PROTECT 15 |
105 | #define INT_730_TIMER3 16 | 105 | #define INT_7XX_TIMER3 16 |
106 | #define INT_730_GPIO_BANK5 17 | 106 | #define INT_7XX_GPIO_BANK5 17 |
107 | #define INT_730_GPIO_BANK6 18 | 107 | #define INT_7XX_GPIO_BANK6 18 |
108 | #define INT_730_SPGIO_WR 29 | 108 | #define INT_7XX_SPGIO_WR 29 |
109 | |||
110 | /* | ||
111 | * OMAP-850 specific IRQ numbers for interrupt handler 1 | ||
112 | */ | ||
113 | #define INT_850_IH2_FIQ 0 | ||
114 | #define INT_850_IH2_IRQ 1 | ||
115 | #define INT_850_USB_NON_ISO 2 | ||
116 | #define INT_850_USB_ISO 3 | ||
117 | #define INT_850_ICR 4 | ||
118 | #define INT_850_EAC 5 | ||
119 | #define INT_850_GPIO_BANK1 6 | ||
120 | #define INT_850_GPIO_BANK2 7 | ||
121 | #define INT_850_GPIO_BANK3 8 | ||
122 | #define INT_850_McBSP2TX 10 | ||
123 | #define INT_850_McBSP2RX 11 | ||
124 | #define INT_850_McBSP2RX_OVF 12 | ||
125 | #define INT_850_LCD_LINE 14 | ||
126 | #define INT_850_GSM_PROTECT 15 | ||
127 | #define INT_850_TIMER3 16 | ||
128 | #define INT_850_GPIO_BANK5 17 | ||
129 | #define INT_850_GPIO_BANK6 18 | ||
130 | #define INT_850_SPGIO_WR 29 | ||
131 | |||
132 | 109 | ||
133 | /* | 110 | /* |
134 | * IRQ numbers for interrupt handler 2 | 111 | * IRQ numbers for interrupt handler 2 |
@@ -206,120 +183,62 @@ | |||
206 | #define INT_1610_SHA1MD5 (91 + IH2_BASE) | 183 | #define INT_1610_SHA1MD5 (91 + IH2_BASE) |
207 | 184 | ||
208 | /* | 185 | /* |
209 | * OMAP-730 specific IRQ numbers for interrupt handler 2 | 186 | * OMAP-7xx specific IRQ numbers for interrupt handler 2 |
210 | */ | 187 | */ |
211 | #define INT_730_HW_ERRORS (0 + IH2_BASE) | 188 | #define INT_7XX_HW_ERRORS (0 + IH2_BASE) |
212 | #define INT_730_NFIQ_PWR_FAIL (1 + IH2_BASE) | 189 | #define INT_7XX_NFIQ_PWR_FAIL (1 + IH2_BASE) |
213 | #define INT_730_CFCD (2 + IH2_BASE) | 190 | #define INT_7XX_CFCD (2 + IH2_BASE) |
214 | #define INT_730_CFIREQ (3 + IH2_BASE) | 191 | #define INT_7XX_CFIREQ (3 + IH2_BASE) |
215 | #define INT_730_I2C (4 + IH2_BASE) | 192 | #define INT_7XX_I2C (4 + IH2_BASE) |
216 | #define INT_730_PCC (5 + IH2_BASE) | 193 | #define INT_7XX_PCC (5 + IH2_BASE) |
217 | #define INT_730_MPU_EXT_NIRQ (6 + IH2_BASE) | 194 | #define INT_7XX_MPU_EXT_NIRQ (6 + IH2_BASE) |
218 | #define INT_730_SPI_100K_1 (7 + IH2_BASE) | 195 | #define INT_7XX_SPI_100K_1 (7 + IH2_BASE) |
219 | #define INT_730_SYREN_SPI (8 + IH2_BASE) | 196 | #define INT_7XX_SYREN_SPI (8 + IH2_BASE) |
220 | #define INT_730_VLYNQ (9 + IH2_BASE) | 197 | #define INT_7XX_VLYNQ (9 + IH2_BASE) |
221 | #define INT_730_GPIO_BANK4 (10 + IH2_BASE) | 198 | #define INT_7XX_GPIO_BANK4 (10 + IH2_BASE) |
222 | #define INT_730_McBSP1TX (11 + IH2_BASE) | 199 | #define INT_7XX_McBSP1TX (11 + IH2_BASE) |
223 | #define INT_730_McBSP1RX (12 + IH2_BASE) | 200 | #define INT_7XX_McBSP1RX (12 + IH2_BASE) |
224 | #define INT_730_McBSP1RX_OF (13 + IH2_BASE) | 201 | #define INT_7XX_McBSP1RX_OF (13 + IH2_BASE) |
225 | #define INT_730_UART_MODEM_IRDA_2 (14 + IH2_BASE) | 202 | #define INT_7XX_UART_MODEM_IRDA_2 (14 + IH2_BASE) |
226 | #define INT_730_UART_MODEM_1 (15 + IH2_BASE) | 203 | #define INT_7XX_UART_MODEM_1 (15 + IH2_BASE) |
227 | #define INT_730_MCSI (16 + IH2_BASE) | 204 | #define INT_7XX_MCSI (16 + IH2_BASE) |
228 | #define INT_730_uWireTX (17 + IH2_BASE) | 205 | #define INT_7XX_uWireTX (17 + IH2_BASE) |
229 | #define INT_730_uWireRX (18 + IH2_BASE) | 206 | #define INT_7XX_uWireRX (18 + IH2_BASE) |
230 | #define INT_730_SMC_CD (19 + IH2_BASE) | 207 | #define INT_7XX_SMC_CD (19 + IH2_BASE) |
231 | #define INT_730_SMC_IREQ (20 + IH2_BASE) | 208 | #define INT_7XX_SMC_IREQ (20 + IH2_BASE) |
232 | #define INT_730_HDQ_1WIRE (21 + IH2_BASE) | 209 | #define INT_7XX_HDQ_1WIRE (21 + IH2_BASE) |
233 | #define INT_730_TIMER32K (22 + IH2_BASE) | 210 | #define INT_7XX_TIMER32K (22 + IH2_BASE) |
234 | #define INT_730_MMC_SDIO (23 + IH2_BASE) | 211 | #define INT_7XX_MMC_SDIO (23 + IH2_BASE) |
235 | #define INT_730_UPLD (24 + IH2_BASE) | 212 | #define INT_7XX_UPLD (24 + IH2_BASE) |
236 | #define INT_730_USB_HHC_1 (27 + IH2_BASE) | 213 | #define INT_7XX_USB_HHC_1 (27 + IH2_BASE) |
237 | #define INT_730_USB_HHC_2 (28 + IH2_BASE) | 214 | #define INT_7XX_USB_HHC_2 (28 + IH2_BASE) |
238 | #define INT_730_USB_GENI (29 + IH2_BASE) | 215 | #define INT_7XX_USB_GENI (29 + IH2_BASE) |
239 | #define INT_730_USB_OTG (30 + IH2_BASE) | 216 | #define INT_7XX_USB_OTG (30 + IH2_BASE) |
240 | #define INT_730_CAMERA_IF (31 + IH2_BASE) | 217 | #define INT_7XX_CAMERA_IF (31 + IH2_BASE) |
241 | #define INT_730_RNG (32 + IH2_BASE) | 218 | #define INT_7XX_RNG (32 + IH2_BASE) |
242 | #define INT_730_DUAL_MODE_TIMER (33 + IH2_BASE) | 219 | #define INT_7XX_DUAL_MODE_TIMER (33 + IH2_BASE) |
243 | #define INT_730_DBB_RF_EN (34 + IH2_BASE) | 220 | #define INT_7XX_DBB_RF_EN (34 + IH2_BASE) |
244 | #define INT_730_MPUIO_KEYPAD (35 + IH2_BASE) | 221 | #define INT_7XX_MPUIO_KEYPAD (35 + IH2_BASE) |
245 | #define INT_730_SHA1_MD5 (36 + IH2_BASE) | 222 | #define INT_7XX_SHA1_MD5 (36 + IH2_BASE) |
246 | #define INT_730_SPI_100K_2 (37 + IH2_BASE) | 223 | #define INT_7XX_SPI_100K_2 (37 + IH2_BASE) |
247 | #define INT_730_RNG_IDLE (38 + IH2_BASE) | 224 | #define INT_7XX_RNG_IDLE (38 + IH2_BASE) |
248 | #define INT_730_MPUIO (39 + IH2_BASE) | 225 | #define INT_7XX_MPUIO (39 + IH2_BASE) |
249 | #define INT_730_LLPC_LCD_CTRL_CAN_BE_OFF (40 + IH2_BASE) | 226 | #define INT_7XX_LLPC_LCD_CTRL_CAN_BE_OFF (40 + IH2_BASE) |
250 | #define INT_730_LLPC_OE_FALLING (41 + IH2_BASE) | 227 | #define INT_7XX_LLPC_OE_FALLING (41 + IH2_BASE) |
251 | #define INT_730_LLPC_OE_RISING (42 + IH2_BASE) | 228 | #define INT_7XX_LLPC_OE_RISING (42 + IH2_BASE) |
252 | #define INT_730_LLPC_VSYNC (43 + IH2_BASE) | 229 | #define INT_7XX_LLPC_VSYNC (43 + IH2_BASE) |
253 | #define INT_730_WAKE_UP_REQ (46 + IH2_BASE) | 230 | #define INT_7XX_WAKE_UP_REQ (46 + IH2_BASE) |
254 | #define INT_730_DMA_CH6 (53 + IH2_BASE) | 231 | #define INT_7XX_DMA_CH6 (53 + IH2_BASE) |
255 | #define INT_730_DMA_CH7 (54 + IH2_BASE) | 232 | #define INT_7XX_DMA_CH7 (54 + IH2_BASE) |
256 | #define INT_730_DMA_CH8 (55 + IH2_BASE) | 233 | #define INT_7XX_DMA_CH8 (55 + IH2_BASE) |
257 | #define INT_730_DMA_CH9 (56 + IH2_BASE) | 234 | #define INT_7XX_DMA_CH9 (56 + IH2_BASE) |
258 | #define INT_730_DMA_CH10 (57 + IH2_BASE) | 235 | #define INT_7XX_DMA_CH10 (57 + IH2_BASE) |
259 | #define INT_730_DMA_CH11 (58 + IH2_BASE) | 236 | #define INT_7XX_DMA_CH11 (58 + IH2_BASE) |
260 | #define INT_730_DMA_CH12 (59 + IH2_BASE) | 237 | #define INT_7XX_DMA_CH12 (59 + IH2_BASE) |
261 | #define INT_730_DMA_CH13 (60 + IH2_BASE) | 238 | #define INT_7XX_DMA_CH13 (60 + IH2_BASE) |
262 | #define INT_730_DMA_CH14 (61 + IH2_BASE) | 239 | #define INT_7XX_DMA_CH14 (61 + IH2_BASE) |
263 | #define INT_730_DMA_CH15 (62 + IH2_BASE) | 240 | #define INT_7XX_DMA_CH15 (62 + IH2_BASE) |
264 | #define INT_730_NAND (63 + IH2_BASE) | 241 | #define INT_7XX_NAND (63 + IH2_BASE) |
265 | |||
266 | /* | ||
267 | * OMAP-850 specific IRQ numbers for interrupt handler 2 | ||
268 | */ | ||
269 | #define INT_850_HW_ERRORS (0 + IH2_BASE) | ||
270 | #define INT_850_NFIQ_PWR_FAIL (1 + IH2_BASE) | ||
271 | #define INT_850_CFCD (2 + IH2_BASE) | ||
272 | #define INT_850_CFIREQ (3 + IH2_BASE) | ||
273 | #define INT_850_I2C (4 + IH2_BASE) | ||
274 | #define INT_850_PCC (5 + IH2_BASE) | ||
275 | #define INT_850_MPU_EXT_NIRQ (6 + IH2_BASE) | ||
276 | #define INT_850_SPI_100K_1 (7 + IH2_BASE) | ||
277 | #define INT_850_SYREN_SPI (8 + IH2_BASE) | ||
278 | #define INT_850_VLYNQ (9 + IH2_BASE) | ||
279 | #define INT_850_GPIO_BANK4 (10 + IH2_BASE) | ||
280 | #define INT_850_McBSP1TX (11 + IH2_BASE) | ||
281 | #define INT_850_McBSP1RX (12 + IH2_BASE) | ||
282 | #define INT_850_McBSP1RX_OF (13 + IH2_BASE) | ||
283 | #define INT_850_UART_MODEM_IRDA_2 (14 + IH2_BASE) | ||
284 | #define INT_850_UART_MODEM_1 (15 + IH2_BASE) | ||
285 | #define INT_850_MCSI (16 + IH2_BASE) | ||
286 | #define INT_850_uWireTX (17 + IH2_BASE) | ||
287 | #define INT_850_uWireRX (18 + IH2_BASE) | ||
288 | #define INT_850_SMC_CD (19 + IH2_BASE) | ||
289 | #define INT_850_SMC_IREQ (20 + IH2_BASE) | ||
290 | #define INT_850_HDQ_1WIRE (21 + IH2_BASE) | ||
291 | #define INT_850_TIMER32K (22 + IH2_BASE) | ||
292 | #define INT_850_MMC_SDIO (23 + IH2_BASE) | ||
293 | #define INT_850_UPLD (24 + IH2_BASE) | ||
294 | #define INT_850_USB_HHC_1 (27 + IH2_BASE) | ||
295 | #define INT_850_USB_HHC_2 (28 + IH2_BASE) | ||
296 | #define INT_850_USB_GENI (29 + IH2_BASE) | ||
297 | #define INT_850_USB_OTG (30 + IH2_BASE) | ||
298 | #define INT_850_CAMERA_IF (31 + IH2_BASE) | ||
299 | #define INT_850_RNG (32 + IH2_BASE) | ||
300 | #define INT_850_DUAL_MODE_TIMER (33 + IH2_BASE) | ||
301 | #define INT_850_DBB_RF_EN (34 + IH2_BASE) | ||
302 | #define INT_850_MPUIO_KEYPAD (35 + IH2_BASE) | ||
303 | #define INT_850_SHA1_MD5 (36 + IH2_BASE) | ||
304 | #define INT_850_SPI_100K_2 (37 + IH2_BASE) | ||
305 | #define INT_850_RNG_IDLE (38 + IH2_BASE) | ||
306 | #define INT_850_MPUIO (39 + IH2_BASE) | ||
307 | #define INT_850_LLPC_LCD_CTRL_CAN_BE_OFF (40 + IH2_BASE) | ||
308 | #define INT_850_LLPC_OE_FALLING (41 + IH2_BASE) | ||
309 | #define INT_850_LLPC_OE_RISING (42 + IH2_BASE) | ||
310 | #define INT_850_LLPC_VSYNC (43 + IH2_BASE) | ||
311 | #define INT_850_WAKE_UP_REQ (46 + IH2_BASE) | ||
312 | #define INT_850_DMA_CH6 (53 + IH2_BASE) | ||
313 | #define INT_850_DMA_CH7 (54 + IH2_BASE) | ||
314 | #define INT_850_DMA_CH8 (55 + IH2_BASE) | ||
315 | #define INT_850_DMA_CH9 (56 + IH2_BASE) | ||
316 | #define INT_850_DMA_CH10 (57 + IH2_BASE) | ||
317 | #define INT_850_DMA_CH11 (58 + IH2_BASE) | ||
318 | #define INT_850_DMA_CH12 (59 + IH2_BASE) | ||
319 | #define INT_850_DMA_CH13 (60 + IH2_BASE) | ||
320 | #define INT_850_DMA_CH14 (61 + IH2_BASE) | ||
321 | #define INT_850_DMA_CH15 (62 + IH2_BASE) | ||
322 | #define INT_850_NAND (63 + IH2_BASE) | ||
323 | 242 | ||
324 | #define INT_24XX_SYS_NIRQ 7 | 243 | #define INT_24XX_SYS_NIRQ 7 |
325 | #define INT_24XX_SDMA_IRQ0 12 | 244 | #define INT_24XX_SDMA_IRQ0 12 |
@@ -558,9 +477,14 @@ | |||
558 | 477 | ||
559 | #define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32)) | 478 | #define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32)) |
560 | 479 | ||
480 | #define INTCPS_NR_MIR_REGS 3 | ||
481 | #define INTCPS_NR_IRQS 96 | ||
482 | |||
561 | #ifndef __ASSEMBLY__ | 483 | #ifndef __ASSEMBLY__ |
562 | extern void omap_init_irq(void); | 484 | extern void omap_init_irq(void); |
563 | extern int omap_irq_pending(void); | 485 | extern int omap_irq_pending(void); |
486 | void omap_intc_save_context(void); | ||
487 | void omap_intc_restore_context(void); | ||
564 | #endif | 488 | #endif |
565 | 489 | ||
566 | #include <mach/hardware.h> | 490 | #include <mach/hardware.h> |
diff --git a/arch/arm/plat-omap/include/mach/keypad.h b/arch/arm/plat-omap/include/plat/keypad.h index 3ae52ccc793c..3ae52ccc793c 100644 --- a/arch/arm/plat-omap/include/mach/keypad.h +++ b/arch/arm/plat-omap/include/plat/keypad.h | |||
diff --git a/arch/arm/plat-omap/include/mach/lcd_mipid.h b/arch/arm/plat-omap/include/plat/lcd_mipid.h index 8e52c6572281..8e52c6572281 100644 --- a/arch/arm/plat-omap/include/mach/lcd_mipid.h +++ b/arch/arm/plat-omap/include/plat/lcd_mipid.h | |||
diff --git a/arch/arm/plat-omap/include/mach/led.h b/arch/arm/plat-omap/include/plat/led.h index 25e451e7e2fd..25e451e7e2fd 100644 --- a/arch/arm/plat-omap/include/mach/led.h +++ b/arch/arm/plat-omap/include/plat/led.h | |||
diff --git a/arch/arm/plat-omap/include/mach/mailbox.h b/arch/arm/plat-omap/include/plat/mailbox.h index b7a6991814ec..729166b76a7c 100644 --- a/arch/arm/plat-omap/include/mach/mailbox.h +++ b/arch/arm/plat-omap/include/plat/mailbox.h | |||
@@ -6,9 +6,9 @@ | |||
6 | #include <linux/wait.h> | 6 | #include <linux/wait.h> |
7 | #include <linux/workqueue.h> | 7 | #include <linux/workqueue.h> |
8 | #include <linux/blkdev.h> | 8 | #include <linux/blkdev.h> |
9 | #include <linux/interrupt.h> | ||
9 | 10 | ||
10 | typedef u32 mbox_msg_t; | 11 | typedef u32 mbox_msg_t; |
11 | typedef void (mbox_receiver_t)(mbox_msg_t msg); | ||
12 | struct omap_mbox; | 12 | struct omap_mbox; |
13 | 13 | ||
14 | typedef int __bitwise omap_mbox_irq_t; | 14 | typedef int __bitwise omap_mbox_irq_t; |
@@ -29,8 +29,10 @@ struct omap_mbox_ops { | |||
29 | int (*fifo_empty)(struct omap_mbox *mbox); | 29 | int (*fifo_empty)(struct omap_mbox *mbox); |
30 | int (*fifo_full)(struct omap_mbox *mbox); | 30 | int (*fifo_full)(struct omap_mbox *mbox); |
31 | /* irq */ | 31 | /* irq */ |
32 | void (*enable_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq); | 32 | void (*enable_irq)(struct omap_mbox *mbox, |
33 | void (*disable_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq); | 33 | omap_mbox_irq_t irq); |
34 | void (*disable_irq)(struct omap_mbox *mbox, | ||
35 | omap_mbox_irq_t irq); | ||
34 | void (*ack_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq); | 36 | void (*ack_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq); |
35 | int (*is_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq); | 37 | int (*is_irq)(struct omap_mbox *mbox, omap_mbox_irq_t irq); |
36 | /* ctx */ | 38 | /* ctx */ |
@@ -42,6 +44,7 @@ struct omap_mbox_queue { | |||
42 | spinlock_t lock; | 44 | spinlock_t lock; |
43 | struct request_queue *queue; | 45 | struct request_queue *queue; |
44 | struct work_struct work; | 46 | struct work_struct work; |
47 | struct tasklet_struct tasklet; | ||
45 | int (*callback)(void *); | 48 | int (*callback)(void *); |
46 | struct omap_mbox *mbox; | 49 | struct omap_mbox *mbox; |
47 | }; | 50 | }; |
@@ -64,7 +67,7 @@ struct omap_mbox { | |||
64 | void (*err_notify)(void); | 67 | void (*err_notify)(void); |
65 | }; | 68 | }; |
66 | 69 | ||
67 | int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg, void *); | 70 | int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg); |
68 | void omap_mbox_init_seq(struct omap_mbox *); | 71 | void omap_mbox_init_seq(struct omap_mbox *); |
69 | 72 | ||
70 | struct omap_mbox *omap_mbox_get(const char *); | 73 | struct omap_mbox *omap_mbox_get(const char *); |
@@ -93,4 +96,16 @@ static inline void omap_mbox_restore_ctx(struct omap_mbox *mbox) | |||
93 | mbox->ops->restore_ctx(mbox); | 96 | mbox->ops->restore_ctx(mbox); |
94 | } | 97 | } |
95 | 98 | ||
99 | static inline void omap_mbox_enable_irq(struct omap_mbox *mbox, | ||
100 | omap_mbox_irq_t irq) | ||
101 | { | ||
102 | mbox->ops->enable_irq(mbox, irq); | ||
103 | } | ||
104 | |||
105 | static inline void omap_mbox_disable_irq(struct omap_mbox *mbox, | ||
106 | omap_mbox_irq_t irq) | ||
107 | { | ||
108 | mbox->ops->disable_irq(mbox, irq); | ||
109 | } | ||
110 | |||
96 | #endif /* MAILBOX_H */ | 111 | #endif /* MAILBOX_H */ |
diff --git a/arch/arm/plat-omap/include/mach/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h index e0d6eca222cc..4f22e5bb7ff7 100644 --- a/arch/arm/plat-omap/include/mach/mcbsp.h +++ b/arch/arm/plat-omap/include/plat/mcbsp.h | |||
@@ -28,10 +28,10 @@ | |||
28 | #include <linux/spinlock.h> | 28 | #include <linux/spinlock.h> |
29 | 29 | ||
30 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
31 | #include <mach/clock.h> | 31 | #include <plat/clock.h> |
32 | 32 | ||
33 | #define OMAP730_MCBSP1_BASE 0xfffb1000 | 33 | #define OMAP7XX_MCBSP1_BASE 0xfffb1000 |
34 | #define OMAP730_MCBSP2_BASE 0xfffb1800 | 34 | #define OMAP7XX_MCBSP2_BASE 0xfffb1800 |
35 | 35 | ||
36 | #define OMAP1510_MCBSP1_BASE 0xe1011800 | 36 | #define OMAP1510_MCBSP1_BASE 0xe1011800 |
37 | #define OMAP1510_MCBSP2_BASE 0xfffb1000 | 37 | #define OMAP1510_MCBSP2_BASE 0xfffb1000 |
@@ -58,7 +58,7 @@ | |||
58 | #define OMAP44XX_MCBSP3_BASE 0x49026000 | 58 | #define OMAP44XX_MCBSP3_BASE 0x49026000 |
59 | #define OMAP44XX_MCBSP4_BASE 0x48074000 | 59 | #define OMAP44XX_MCBSP4_BASE 0x48074000 |
60 | 60 | ||
61 | #if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP730) | 61 | #if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) |
62 | 62 | ||
63 | #define OMAP_MCBSP_REG_DRR2 0x00 | 63 | #define OMAP_MCBSP_REG_DRR2 0x00 |
64 | #define OMAP_MCBSP_REG_DRR1 0x02 | 64 | #define OMAP_MCBSP_REG_DRR1 0x02 |
diff --git a/arch/arm/plat-omap/include/mach/mcspi.h b/arch/arm/plat-omap/include/plat/mcspi.h index 1254e4945b6f..1254e4945b6f 100644 --- a/arch/arm/plat-omap/include/mach/mcspi.h +++ b/arch/arm/plat-omap/include/plat/mcspi.h | |||
diff --git a/arch/arm/plat-omap/include/mach/memory.h b/arch/arm/plat-omap/include/plat/memory.h index 3325f7b49eaa..3325f7b49eaa 100644 --- a/arch/arm/plat-omap/include/mach/memory.h +++ b/arch/arm/plat-omap/include/plat/memory.h | |||
diff --git a/arch/arm/plat-omap/include/mach/menelaus.h b/arch/arm/plat-omap/include/plat/menelaus.h index 3122bf68c7ce..3122bf68c7ce 100644 --- a/arch/arm/plat-omap/include/mach/menelaus.h +++ b/arch/arm/plat-omap/include/plat/menelaus.h | |||
diff --git a/arch/arm/plat-omap/include/mach/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h index 7229b9593301..29937137bf3e 100644 --- a/arch/arm/plat-omap/include/mach/mmc.h +++ b/arch/arm/plat-omap/include/plat/mmc.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/device.h> | 15 | #include <linux/device.h> |
16 | #include <linux/mmc/host.h> | 16 | #include <linux/mmc/host.h> |
17 | 17 | ||
18 | #include <mach/board.h> | 18 | #include <plat/board.h> |
19 | 19 | ||
20 | #define OMAP15XX_NR_MMC 1 | 20 | #define OMAP15XX_NR_MMC 1 |
21 | #define OMAP16XX_NR_MMC 2 | 21 | #define OMAP16XX_NR_MMC 2 |
diff --git a/arch/arm/plat-omap/include/mach/mux.h b/arch/arm/plat-omap/include/plat/mux.h index 0f49d2d563d9..ba77de601501 100644 --- a/arch/arm/plat-omap/include/mach/mux.h +++ b/arch/arm/plat-omap/include/plat/mux.h | |||
@@ -51,23 +51,13 @@ | |||
51 | .pu_pd_reg = PU_PD_SEL_##reg, \ | 51 | .pu_pd_reg = PU_PD_SEL_##reg, \ |
52 | .pu_pd_val = status, | 52 | .pu_pd_val = status, |
53 | 53 | ||
54 | #define MUX_REG_730(reg, mode_offset, mode) .mux_reg_name = "OMAP730_IO_CONF_"#reg, \ | 54 | #define MUX_REG_7XX(reg, mode_offset, mode) .mux_reg_name = "OMAP7XX_IO_CONF_"#reg, \ |
55 | .mux_reg = OMAP730_IO_CONF_##reg, \ | 55 | .mux_reg = OMAP7XX_IO_CONF_##reg, \ |
56 | .mask_offset = mode_offset, \ | 56 | .mask_offset = mode_offset, \ |
57 | .mask = mode, | 57 | .mask = mode, |
58 | 58 | ||
59 | #define PULL_REG_730(reg, bit, status) .pull_name = "OMAP730_IO_CONF_"#reg, \ | 59 | #define PULL_REG_7XX(reg, bit, status) .pull_name = "OMAP7XX_IO_CONF_"#reg, \ |
60 | .pull_reg = OMAP730_IO_CONF_##reg, \ | 60 | .pull_reg = OMAP7XX_IO_CONF_##reg, \ |
61 | .pull_bit = bit, \ | ||
62 | .pull_val = status, | ||
63 | |||
64 | #define MUX_REG_850(reg, mode_offset, mode) .mux_reg_name = "OMAP850_IO_CONF_"#reg, \ | ||
65 | .mux_reg = OMAP850_IO_CONF_##reg, \ | ||
66 | .mask_offset = mode_offset, \ | ||
67 | .mask = mode, | ||
68 | |||
69 | #define PULL_REG_850(reg, bit, status) .pull_name = "OMAP850_IO_CONF_"#reg, \ | ||
70 | .pull_reg = OMAP850_IO_CONF_##reg, \ | ||
71 | .pull_bit = bit, \ | 61 | .pull_bit = bit, \ |
72 | .pull_val = status, | 62 | .pull_val = status, |
73 | 63 | ||
@@ -84,21 +74,12 @@ | |||
84 | #define PU_PD_REG(reg, status) .pu_pd_reg = PU_PD_SEL_##reg, \ | 74 | #define PU_PD_REG(reg, status) .pu_pd_reg = PU_PD_SEL_##reg, \ |
85 | .pu_pd_val = status, | 75 | .pu_pd_val = status, |
86 | 76 | ||
87 | #define MUX_REG_730(reg, mode_offset, mode) \ | 77 | #define MUX_REG_7XX(reg, mode_offset, mode) \ |
88 | .mux_reg = OMAP730_IO_CONF_##reg, \ | 78 | .mux_reg = OMAP7XX_IO_CONF_##reg, \ |
89 | .mask_offset = mode_offset, \ | 79 | .mask_offset = mode_offset, \ |
90 | .mask = mode, | 80 | .mask = mode, |
91 | 81 | ||
92 | #define PULL_REG_730(reg, bit, status) .pull_reg = OMAP730_IO_CONF_##reg, \ | 82 | #define PULL_REG_7XX(reg, bit, status) .pull_reg = OMAP7XX_IO_CONF_##reg, \ |
93 | .pull_bit = bit, \ | ||
94 | .pull_val = status, | ||
95 | |||
96 | #define MUX_REG_850(reg, mode_offset, mode) \ | ||
97 | .mux_reg = OMAP850_IO_CONF_##reg, \ | ||
98 | .mask_offset = mode_offset, \ | ||
99 | .mask = mode, | ||
100 | |||
101 | #define PULL_REG_850(reg, bit, status) .pull_reg = OMAP850_IO_CONF_##reg, \ | ||
102 | .pull_bit = bit, \ | 83 | .pull_bit = bit, \ |
103 | .pull_val = status, | 84 | .pull_val = status, |
104 | 85 | ||
@@ -118,32 +99,21 @@ | |||
118 | 99 | ||
119 | /* | 100 | /* |
120 | * OMAP730/850 has a slightly different config for the pin mux. | 101 | * OMAP730/850 has a slightly different config for the pin mux. |
121 | * - config regs are the OMAP730_IO_CONF_x regs (see omap730.h) regs and | 102 | * - config regs are the OMAP7XX_IO_CONF_x regs (see omap730.h) regs and |
122 | * not the FUNC_MUX_CTRL_x regs from hardware.h | 103 | * not the FUNC_MUX_CTRL_x regs from hardware.h |
123 | * - for pull-up/down, only has one enable bit which is is in the same register | 104 | * - for pull-up/down, only has one enable bit which is is in the same register |
124 | * as mux config | 105 | * as mux config |
125 | */ | 106 | */ |
126 | #define MUX_CFG_730(desc, mux_reg, mode_offset, mode, \ | 107 | #define MUX_CFG_7XX(desc, mux_reg, mode_offset, mode, \ |
127 | pull_bit, pull_status, debug_status)\ | ||
128 | { \ | ||
129 | .name = desc, \ | ||
130 | .debug = debug_status, \ | ||
131 | MUX_REG_730(mux_reg, mode_offset, mode) \ | ||
132 | PULL_REG_730(mux_reg, pull_bit, pull_status) \ | ||
133 | PU_PD_REG(NA, 0) \ | ||
134 | }, | ||
135 | |||
136 | #define MUX_CFG_850(desc, mux_reg, mode_offset, mode, \ | ||
137 | pull_bit, pull_status, debug_status)\ | 108 | pull_bit, pull_status, debug_status)\ |
138 | { \ | 109 | { \ |
139 | .name = desc, \ | 110 | .name = desc, \ |
140 | .debug = debug_status, \ | 111 | .debug = debug_status, \ |
141 | MUX_REG_850(mux_reg, mode_offset, mode) \ | 112 | MUX_REG_7XX(mux_reg, mode_offset, mode) \ |
142 | PULL_REG_850(mux_reg, pull_bit, pull_status) \ | 113 | PULL_REG_7XX(mux_reg, pull_bit, pull_status) \ |
143 | PU_PD_REG(NA, 0) \ | 114 | PU_PD_REG(NA, 0) \ |
144 | }, | 115 | }, |
145 | 116 | ||
146 | |||
147 | #define MUX_CFG_24XX(desc, reg_offset, mode, \ | 117 | #define MUX_CFG_24XX(desc, reg_offset, mode, \ |
148 | pull_en, pull_mode, dbg) \ | 118 | pull_en, pull_mode, dbg) \ |
149 | { \ | 119 | { \ |
@@ -232,45 +202,30 @@ struct pin_config { | |||
232 | 202 | ||
233 | }; | 203 | }; |
234 | 204 | ||
235 | enum omap730_index { | 205 | enum omap7xx_index { |
236 | /* OMAP 730 keyboard */ | 206 | /* OMAP 730 keyboard */ |
237 | E2_730_KBR0, | 207 | E2_7XX_KBR0, |
238 | J7_730_KBR1, | 208 | J7_7XX_KBR1, |
239 | E1_730_KBR2, | 209 | E1_7XX_KBR2, |
240 | F3_730_KBR3, | 210 | F3_7XX_KBR3, |
241 | D2_730_KBR4, | 211 | D2_7XX_KBR4, |
242 | C2_730_KBC0, | 212 | C2_7XX_KBC0, |
243 | D3_730_KBC1, | 213 | D3_7XX_KBC1, |
244 | E4_730_KBC2, | 214 | E4_7XX_KBC2, |
245 | F4_730_KBC3, | 215 | F4_7XX_KBC3, |
246 | E3_730_KBC4, | 216 | E3_7XX_KBC4, |
247 | 217 | ||
248 | /* USB */ | 218 | /* USB */ |
249 | AA17_730_USB_DM, | 219 | AA17_7XX_USB_DM, |
250 | W16_730_USB_PU_EN, | 220 | W16_7XX_USB_PU_EN, |
251 | W17_730_USB_VBUSI, | 221 | W17_7XX_USB_VBUSI, |
222 | |||
223 | /* MMC */ | ||
224 | MMC_7XX_CMD, | ||
225 | MMC_7XX_CLK, | ||
226 | MMC_7XX_DAT0, | ||
252 | }; | 227 | }; |
253 | 228 | ||
254 | enum omap850_index { | ||
255 | /* OMAP 850 keyboard */ | ||
256 | E2_850_KBR0, | ||
257 | J7_850_KBR1, | ||
258 | E1_850_KBR2, | ||
259 | F3_850_KBR3, | ||
260 | D2_850_KBR4, | ||
261 | C2_850_KBC0, | ||
262 | D3_850_KBC1, | ||
263 | E4_850_KBC2, | ||
264 | F4_850_KBC3, | ||
265 | E3_850_KBC4, | ||
266 | |||
267 | /* USB */ | ||
268 | AA17_850_USB_DM, | ||
269 | W16_850_USB_PU_EN, | ||
270 | W17_850_USB_VBUSI, | ||
271 | }; | ||
272 | |||
273 | |||
274 | enum omap1xxx_index { | 229 | enum omap1xxx_index { |
275 | /* UART1 (BT_UART_GATING)*/ | 230 | /* UART1 (BT_UART_GATING)*/ |
276 | UART1_TX = 0, | 231 | UART1_TX = 0, |
@@ -879,6 +834,10 @@ enum omap34xx_index { | |||
879 | AH4_3430_MMC2_DAT1, | 834 | AH4_3430_MMC2_DAT1, |
880 | AG4_3430_MMC2_DAT2, | 835 | AG4_3430_MMC2_DAT2, |
881 | AF4_3430_MMC2_DAT3, | 836 | AF4_3430_MMC2_DAT3, |
837 | AE4_3430_MMC2_DAT4, | ||
838 | AH3_3430_MMC2_DAT5, | ||
839 | AF3_3430_MMC2_DAT6, | ||
840 | AE3_3430_MMC2_DAT7, | ||
882 | 841 | ||
883 | /* MMC3 */ | 842 | /* MMC3 */ |
884 | AF10_3430_MMC3_CLK, | 843 | AF10_3430_MMC3_CLK, |
@@ -890,6 +849,11 @@ enum omap34xx_index { | |||
890 | 849 | ||
891 | /* SYS_NIRQ T2 INT1 */ | 850 | /* SYS_NIRQ T2 INT1 */ |
892 | AF26_34XX_SYS_NIRQ, | 851 | AF26_34XX_SYS_NIRQ, |
852 | |||
853 | /* EHCI GPIO's for OMAP3EVM (Rev >= E) */ | ||
854 | AH14_34XX_GPIO21, | ||
855 | AF9_34XX_GPIO22, | ||
856 | U3_34XX_GPIO61, | ||
893 | }; | 857 | }; |
894 | 858 | ||
895 | struct omap_mux_cfg { | 859 | struct omap_mux_cfg { |
diff --git a/arch/arm/plat-omap/include/mach/nand.h b/arch/arm/plat-omap/include/plat/nand.h index 631a7bed1eef..631a7bed1eef 100644 --- a/arch/arm/plat-omap/include/mach/nand.h +++ b/arch/arm/plat-omap/include/plat/nand.h | |||
diff --git a/arch/arm/plat-omap/include/mach/omap-alsa.h b/arch/arm/plat-omap/include/plat/omap-alsa.h index bdf30a0f87f2..b53055b390d0 100644 --- a/arch/arm/plat-omap/include/mach/omap-alsa.h +++ b/arch/arm/plat-omap/include/plat/omap-alsa.h | |||
@@ -40,10 +40,10 @@ | |||
40 | #ifndef __OMAP_ALSA_H | 40 | #ifndef __OMAP_ALSA_H |
41 | #define __OMAP_ALSA_H | 41 | #define __OMAP_ALSA_H |
42 | 42 | ||
43 | #include <mach/dma.h> | 43 | #include <plat/dma.h> |
44 | #include <sound/core.h> | 44 | #include <sound/core.h> |
45 | #include <sound/pcm.h> | 45 | #include <sound/pcm.h> |
46 | #include <mach/mcbsp.h> | 46 | #include <plat/mcbsp.h> |
47 | #include <linux/platform_device.h> | 47 | #include <linux/platform_device.h> |
48 | 48 | ||
49 | #define DMA_BUF_SIZE (1024 * 8) | 49 | #define DMA_BUF_SIZE (1024 * 8) |
diff --git a/arch/arm/plat-omap/include/mach/omap-pm.h b/arch/arm/plat-omap/include/plat/omap-pm.h index 3ee41d711492..3ee41d711492 100644 --- a/arch/arm/plat-omap/include/mach/omap-pm.h +++ b/arch/arm/plat-omap/include/plat/omap-pm.h | |||
diff --git a/arch/arm/plat-omap/include/mach/omap1510.h b/arch/arm/plat-omap/include/plat/omap1510.h index d24004668138..d24004668138 100644 --- a/arch/arm/plat-omap/include/mach/omap1510.h +++ b/arch/arm/plat-omap/include/plat/omap1510.h | |||
diff --git a/arch/arm/plat-omap/include/mach/omap16xx.h b/arch/arm/plat-omap/include/plat/omap16xx.h index 0e69b504c25f..0e69b504c25f 100644 --- a/arch/arm/plat-omap/include/mach/omap16xx.h +++ b/arch/arm/plat-omap/include/plat/omap16xx.h | |||
diff --git a/arch/arm/plat-omap/include/mach/omap24xx.h b/arch/arm/plat-omap/include/plat/omap24xx.h index 696edfc145a6..696edfc145a6 100644 --- a/arch/arm/plat-omap/include/mach/omap24xx.h +++ b/arch/arm/plat-omap/include/plat/omap24xx.h | |||
diff --git a/arch/arm/plat-omap/include/mach/omap34xx.h b/arch/arm/plat-omap/include/plat/omap34xx.h index f8d186a73712..077f05979f86 100644 --- a/arch/arm/plat-omap/include/mach/omap34xx.h +++ b/arch/arm/plat-omap/include/plat/omap34xx.h | |||
@@ -72,16 +72,15 @@ | |||
72 | #define OMAP3430_ISP_CSI2A_END (OMAP3430_ISP_CSI2A_BASE + 0x16F) | 72 | #define OMAP3430_ISP_CSI2A_END (OMAP3430_ISP_CSI2A_BASE + 0x16F) |
73 | #define OMAP3430_ISP_CSI2PHY_END (OMAP3430_ISP_CSI2PHY_BASE + 0x007) | 73 | #define OMAP3430_ISP_CSI2PHY_END (OMAP3430_ISP_CSI2PHY_BASE + 0x007) |
74 | 74 | ||
75 | #define OMAP34XX_IVA_INTC_BASE 0x40000000 | ||
76 | #define OMAP34XX_HSUSB_OTG_BASE (L4_34XX_BASE + 0xAB000) | 75 | #define OMAP34XX_HSUSB_OTG_BASE (L4_34XX_BASE + 0xAB000) |
77 | #define OMAP34XX_HSUSB_HOST_BASE (L4_34XX_BASE + 0x64000) | ||
78 | #define OMAP34XX_USBTLL_BASE (L4_34XX_BASE + 0x62000) | 76 | #define OMAP34XX_USBTLL_BASE (L4_34XX_BASE + 0x62000) |
77 | #define OMAP34XX_UHH_CONFIG_BASE (L4_34XX_BASE + 0x64000) | ||
78 | #define OMAP34XX_OHCI_BASE (L4_34XX_BASE + 0x64400) | ||
79 | #define OMAP34XX_EHCI_BASE (L4_34XX_BASE + 0x64800) | ||
80 | #define OMAP34XX_SR1_BASE 0x480C9000 | ||
81 | #define OMAP34XX_SR2_BASE 0x480CB000 | ||
79 | 82 | ||
80 | #define OMAP34XX_MAILBOX_BASE (L4_34XX_BASE + 0x94000) | 83 | #define OMAP34XX_MAILBOX_BASE (L4_34XX_BASE + 0x94000) |
81 | 84 | ||
82 | #define OMAP34XX_DSP_BASE 0x58000000 | ||
83 | #define OMAP34XX_DSP_MEM_BASE (OMAP34XX_DSP_BASE + 0x0) | ||
84 | #define OMAP34XX_DSP_IPI_BASE (OMAP34XX_DSP_BASE + 0x1000000) | ||
85 | #define OMAP34XX_DSP_MMU_BASE (OMAP34XX_DSP_BASE + 0x2000000) | ||
86 | #endif /* __ASM_ARCH_OMAP34XX_H */ | 85 | #endif /* __ASM_ARCH_OMAP34XX_H */ |
87 | 86 | ||
diff --git a/arch/arm/plat-omap/include/mach/omap44xx.h b/arch/arm/plat-omap/include/plat/omap44xx.h index b3ba5ac7b4a4..e52902a15c1a 100644 --- a/arch/arm/plat-omap/include/mach/omap44xx.h +++ b/arch/arm/plat-omap/include/plat/omap44xx.h | |||
@@ -22,6 +22,9 @@ | |||
22 | #define L4_PER_44XX_BASE 0x48000000 | 22 | #define L4_PER_44XX_BASE 0x48000000 |
23 | #define L4_EMU_44XX_BASE 0x54000000 | 23 | #define L4_EMU_44XX_BASE 0x54000000 |
24 | #define L3_44XX_BASE 0x44000000 | 24 | #define L3_44XX_BASE 0x44000000 |
25 | #define OMAP44XX_EMIF1_BASE 0x4c000000 | ||
26 | #define OMAP44XX_EMIF2_BASE 0x4d000000 | ||
27 | #define OMAP44XX_DMM_BASE 0x4e000000 | ||
25 | #define OMAP4430_32KSYNCT_BASE 0x4a304000 | 28 | #define OMAP4430_32KSYNCT_BASE 0x4a304000 |
26 | #define OMAP4430_CM_BASE 0x4a004000 | 29 | #define OMAP4430_CM_BASE 0x4a004000 |
27 | #define OMAP4430_PRM_BASE 0x48306000 | 30 | #define OMAP4430_PRM_BASE 0x48306000 |
@@ -33,14 +36,11 @@ | |||
33 | #define IRQ_SIR_IRQ 0x0040 | 36 | #define IRQ_SIR_IRQ 0x0040 |
34 | #define OMAP44XX_GIC_DIST_BASE 0x48241000 | 37 | #define OMAP44XX_GIC_DIST_BASE 0x48241000 |
35 | #define OMAP44XX_GIC_CPU_BASE 0x48240100 | 38 | #define OMAP44XX_GIC_CPU_BASE 0x48240100 |
36 | #define OMAP44XX_VA_GIC_CPU_BASE OMAP2_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE) | ||
37 | #define OMAP44XX_SCU_BASE 0x48240000 | 39 | #define OMAP44XX_SCU_BASE 0x48240000 |
38 | #define OMAP44XX_VA_SCU_BASE OMAP2_IO_ADDRESS(OMAP44XX_SCU_BASE) | ||
39 | #define OMAP44XX_LOCAL_TWD_BASE 0x48240600 | 40 | #define OMAP44XX_LOCAL_TWD_BASE 0x48240600 |
40 | #define OMAP44XX_VA_LOCAL_TWD_BASE OMAP2_IO_ADDRESS(OMAP44XX_LOCAL_TWD_BASE) | ||
41 | #define OMAP44XX_LOCAL_TWD_SIZE 0x00000100 | ||
42 | #define OMAP44XX_WKUPGEN_BASE 0x48281000 | 41 | #define OMAP44XX_WKUPGEN_BASE 0x48281000 |
43 | #define OMAP44XX_VA_WKUPGEN_BASE OMAP2_IO_ADDRESS(OMAP44XX_WKUPGEN_BASE) | 42 | |
43 | #define OMAP44XX_MAILBOX_BASE (L4_44XX_BASE + 0xF4000) | ||
44 | 44 | ||
45 | #endif /* __ASM_ARCH_OMAP44XX_H */ | 45 | #endif /* __ASM_ARCH_OMAP44XX_H */ |
46 | 46 | ||
diff --git a/arch/arm/plat-omap/include/mach/omap730.h b/arch/arm/plat-omap/include/plat/omap730.h index 14272bc1a6fd..14272bc1a6fd 100644 --- a/arch/arm/plat-omap/include/mach/omap730.h +++ b/arch/arm/plat-omap/include/plat/omap730.h | |||
diff --git a/arch/arm/plat-omap/include/plat/omap7xx.h b/arch/arm/plat-omap/include/plat/omap7xx.h new file mode 100644 index 000000000000..53f52414b0e9 --- /dev/null +++ b/arch/arm/plat-omap/include/plat/omap7xx.h | |||
@@ -0,0 +1,104 @@ | |||
1 | /* arch/arm/plat-omap/include/mach/omap7xx.h | ||
2 | * | ||
3 | * Hardware definitions for TI OMAP7XX processor. | ||
4 | * | ||
5 | * Cleanup for Linux-2.6 by Dirk Behme <dirk.behme@de.bosch.com> | ||
6 | * Adapted for omap850 by Zebediah C. McClure <zmc@lurian.net> | ||
7 | * Adapted for omap7xx by Alistair Buxton <a.j.buxton@gmail.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License as published by the | ||
11 | * Free Software Foundation; either version 2 of the License, or (at your | ||
12 | * option) any later version. | ||
13 | * | ||
14 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
15 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
16 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
17 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
20 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
21 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License along | ||
26 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
27 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
28 | */ | ||
29 | |||
30 | #ifndef __ASM_ARCH_OMAP7XX_H | ||
31 | #define __ASM_ARCH_OMAP7XX_H | ||
32 | |||
33 | /* | ||
34 | * ---------------------------------------------------------------------------- | ||
35 | * Base addresses | ||
36 | * ---------------------------------------------------------------------------- | ||
37 | */ | ||
38 | |||
39 | /* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */ | ||
40 | |||
41 | #define OMAP7XX_DSP_BASE 0xE0000000 | ||
42 | #define OMAP7XX_DSP_SIZE 0x50000 | ||
43 | #define OMAP7XX_DSP_START 0xE0000000 | ||
44 | |||
45 | #define OMAP7XX_DSPREG_BASE 0xE1000000 | ||
46 | #define OMAP7XX_DSPREG_SIZE SZ_128K | ||
47 | #define OMAP7XX_DSPREG_START 0xE1000000 | ||
48 | |||
49 | /* | ||
50 | * ---------------------------------------------------------------------------- | ||
51 | * OMAP7XX specific configuration registers | ||
52 | * ---------------------------------------------------------------------------- | ||
53 | */ | ||
54 | #define OMAP7XX_CONFIG_BASE 0xfffe1000 | ||
55 | #define OMAP7XX_IO_CONF_0 0xfffe1070 | ||
56 | #define OMAP7XX_IO_CONF_1 0xfffe1074 | ||
57 | #define OMAP7XX_IO_CONF_2 0xfffe1078 | ||
58 | #define OMAP7XX_IO_CONF_3 0xfffe107c | ||
59 | #define OMAP7XX_IO_CONF_4 0xfffe1080 | ||
60 | #define OMAP7XX_IO_CONF_5 0xfffe1084 | ||
61 | #define OMAP7XX_IO_CONF_6 0xfffe1088 | ||
62 | #define OMAP7XX_IO_CONF_7 0xfffe108c | ||
63 | #define OMAP7XX_IO_CONF_8 0xfffe1090 | ||
64 | #define OMAP7XX_IO_CONF_9 0xfffe1094 | ||
65 | #define OMAP7XX_IO_CONF_10 0xfffe1098 | ||
66 | #define OMAP7XX_IO_CONF_11 0xfffe109c | ||
67 | #define OMAP7XX_IO_CONF_12 0xfffe10a0 | ||
68 | #define OMAP7XX_IO_CONF_13 0xfffe10a4 | ||
69 | |||
70 | #define OMAP7XX_MODE_1 0xfffe1010 | ||
71 | #define OMAP7XX_MODE_2 0xfffe1014 | ||
72 | |||
73 | /* CSMI specials: in terms of base + offset */ | ||
74 | #define OMAP7XX_MODE2_OFFSET 0x14 | ||
75 | |||
76 | /* | ||
77 | * ---------------------------------------------------------------------------- | ||
78 | * OMAP7XX traffic controller configuration registers | ||
79 | * ---------------------------------------------------------------------------- | ||
80 | */ | ||
81 | #define OMAP7XX_FLASH_CFG_0 0xfffecc10 | ||
82 | #define OMAP7XX_FLASH_ACFG_0 0xfffecc50 | ||
83 | #define OMAP7XX_FLASH_CFG_1 0xfffecc14 | ||
84 | #define OMAP7XX_FLASH_ACFG_1 0xfffecc54 | ||
85 | |||
86 | /* | ||
87 | * ---------------------------------------------------------------------------- | ||
88 | * OMAP7XX DSP control registers | ||
89 | * ---------------------------------------------------------------------------- | ||
90 | */ | ||
91 | #define OMAP7XX_ICR_BASE 0xfffbb800 | ||
92 | #define OMAP7XX_DSP_M_CTL 0xfffbb804 | ||
93 | #define OMAP7XX_DSP_MMU_BASE 0xfffed200 | ||
94 | |||
95 | /* | ||
96 | * ---------------------------------------------------------------------------- | ||
97 | * OMAP7XX PCC_UPLD configuration registers | ||
98 | * ---------------------------------------------------------------------------- | ||
99 | */ | ||
100 | #define OMAP7XX_PCC_UPLD_CTRL_BASE (0xfffe0900) | ||
101 | #define OMAP7XX_PCC_UPLD_CTRL (OMAP7XX_PCC_UPLD_CTRL_BASE + 0x00) | ||
102 | |||
103 | #endif /* __ASM_ARCH_OMAP7XX_H */ | ||
104 | |||
diff --git a/arch/arm/plat-omap/include/mach/omap850.h b/arch/arm/plat-omap/include/plat/omap850.h index c33f67981712..c33f67981712 100644 --- a/arch/arm/plat-omap/include/mach/omap850.h +++ b/arch/arm/plat-omap/include/plat/omap850.h | |||
diff --git a/arch/arm/plat-omap/include/mach/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h index bd0e136db337..11a9773a4e7f 100644 --- a/arch/arm/plat-omap/include/mach/omap_device.h +++ b/arch/arm/plat-omap/include/plat/omap_device.h | |||
@@ -34,7 +34,7 @@ | |||
34 | #include <linux/kernel.h> | 34 | #include <linux/kernel.h> |
35 | #include <linux/platform_device.h> | 35 | #include <linux/platform_device.h> |
36 | 36 | ||
37 | #include <mach/omap_hwmod.h> | 37 | #include <plat/omap_hwmod.h> |
38 | 38 | ||
39 | /* omap_device._state values */ | 39 | /* omap_device._state values */ |
40 | #define OMAP_DEVICE_STATE_UNKNOWN 0 | 40 | #define OMAP_DEVICE_STATE_UNKNOWN 0 |
diff --git a/arch/arm/plat-omap/include/mach/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h index 1f79c20e2929..dbdd123eca16 100644 --- a/arch/arm/plat-omap/include/mach/omap_hwmod.h +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h | |||
@@ -35,7 +35,7 @@ | |||
35 | #include <linux/kernel.h> | 35 | #include <linux/kernel.h> |
36 | #include <linux/ioport.h> | 36 | #include <linux/ioport.h> |
37 | 37 | ||
38 | #include <mach/cpu.h> | 38 | #include <plat/cpu.h> |
39 | 39 | ||
40 | struct omap_device; | 40 | struct omap_device; |
41 | 41 | ||
diff --git a/arch/arm/plat-omap/include/mach/omapfb.h b/arch/arm/plat-omap/include/plat/omapfb.h index b226bdf45739..bfef7ab95f17 100644 --- a/arch/arm/plat-omap/include/mach/omapfb.h +++ b/arch/arm/plat-omap/include/plat/omapfb.h | |||
@@ -168,7 +168,7 @@ enum omapfb_update_mode { | |||
168 | #include <linux/fb.h> | 168 | #include <linux/fb.h> |
169 | #include <linux/mutex.h> | 169 | #include <linux/mutex.h> |
170 | 170 | ||
171 | #include <mach/board.h> | 171 | #include <plat/board.h> |
172 | 172 | ||
173 | #define OMAP_LCDC_INV_VSYNC 0x0001 | 173 | #define OMAP_LCDC_INV_VSYNC 0x0001 |
174 | #define OMAP_LCDC_INV_HSYNC 0x0002 | 174 | #define OMAP_LCDC_INV_HSYNC 0x0002 |
diff --git a/arch/arm/plat-omap/include/mach/onenand.h b/arch/arm/plat-omap/include/plat/onenand.h index 72f433d7d827..72f433d7d827 100644 --- a/arch/arm/plat-omap/include/mach/onenand.h +++ b/arch/arm/plat-omap/include/plat/onenand.h | |||
diff --git a/arch/arm/plat-omap/include/mach/param.h b/arch/arm/plat-omap/include/plat/param.h index 1eb4dc326979..1eb4dc326979 100644 --- a/arch/arm/plat-omap/include/mach/param.h +++ b/arch/arm/plat-omap/include/plat/param.h | |||
diff --git a/arch/arm/plat-omap/include/mach/powerdomain.h b/arch/arm/plat-omap/include/plat/powerdomain.h index fa6461423bd0..3d45ee1d3cf4 100644 --- a/arch/arm/plat-omap/include/mach/powerdomain.h +++ b/arch/arm/plat-omap/include/plat/powerdomain.h | |||
@@ -19,7 +19,7 @@ | |||
19 | 19 | ||
20 | #include <asm/atomic.h> | 20 | #include <asm/atomic.h> |
21 | 21 | ||
22 | #include <mach/cpu.h> | 22 | #include <plat/cpu.h> |
23 | 23 | ||
24 | 24 | ||
25 | /* Powerdomain basic power states */ | 25 | /* Powerdomain basic power states */ |
diff --git a/arch/arm/plat-omap/include/mach/prcm.h b/arch/arm/plat-omap/include/plat/prcm.h index cda2a70397b4..e63e94e18975 100644 --- a/arch/arm/plat-omap/include/mach/prcm.h +++ b/arch/arm/plat-omap/include/plat/prcm.h | |||
@@ -27,9 +27,13 @@ u32 omap_prcm_get_reset_sources(void); | |||
27 | void omap_prcm_arch_reset(char mode); | 27 | void omap_prcm_arch_reset(char mode); |
28 | int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, const char *name); | 28 | int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, const char *name); |
29 | 29 | ||
30 | #endif | 30 | #define START_PADCONF_SAVE 0x2 |
31 | #define PADCONF_SAVE_DONE 0x1 | ||
31 | 32 | ||
33 | void omap3_prcm_save_context(void); | ||
34 | void omap3_prcm_restore_context(void); | ||
32 | 35 | ||
36 | #endif | ||
33 | 37 | ||
34 | 38 | ||
35 | 39 | ||
diff --git a/arch/arm/plat-omap/include/mach/sdrc.h b/arch/arm/plat-omap/include/plat/sdrc.h index 1c09c78a48f2..f704030d2a70 100644 --- a/arch/arm/plat-omap/include/mach/sdrc.h +++ b/arch/arm/plat-omap/include/plat/sdrc.h | |||
@@ -44,6 +44,12 @@ | |||
44 | #define SDRC_RFR_CTRL_1 0x0D4 | 44 | #define SDRC_RFR_CTRL_1 0x0D4 |
45 | #define SDRC_MANUAL_1 0x0D8 | 45 | #define SDRC_MANUAL_1 0x0D8 |
46 | 46 | ||
47 | #define SDRC_POWER_AUTOCOUNT_SHIFT 8 | ||
48 | #define SDRC_POWER_AUTOCOUNT_MASK (0xffff << SDRC_POWER_AUTOCOUNT_SHIFT) | ||
49 | #define SDRC_POWER_CLKCTRL_SHIFT 4 | ||
50 | #define SDRC_POWER_CLKCTRL_MASK (0x3 << SDRC_POWER_CLKCTRL_SHIFT) | ||
51 | #define SDRC_SELF_REFRESH_ON_AUTOCOUNT (0x2 << SDRC_POWER_CLKCTRL_SHIFT) | ||
52 | |||
47 | /* | 53 | /* |
48 | * These values represent the number of memory clock cycles between | 54 | * These values represent the number of memory clock cycles between |
49 | * autorefresh initiation. They assume 1 refresh per 64 ms (JEDEC), 8192 | 55 | * autorefresh initiation. They assume 1 refresh per 64 ms (JEDEC), 8192 |
@@ -80,11 +86,11 @@ | |||
80 | */ | 86 | */ |
81 | 87 | ||
82 | #define OMAP242X_SMS_REGADDR(reg) \ | 88 | #define OMAP242X_SMS_REGADDR(reg) \ |
83 | (void __iomem *)OMAP2_IO_ADDRESS(OMAP2420_SMS_BASE + reg) | 89 | (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE + reg) |
84 | #define OMAP243X_SMS_REGADDR(reg) \ | 90 | #define OMAP243X_SMS_REGADDR(reg) \ |
85 | (void __iomem *)OMAP2_IO_ADDRESS(OMAP243X_SMS_BASE + reg) | 91 | (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE + reg) |
86 | #define OMAP343X_SMS_REGADDR(reg) \ | 92 | #define OMAP343X_SMS_REGADDR(reg) \ |
87 | (void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE + reg) | 93 | (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE + reg) |
88 | 94 | ||
89 | /* SMS register offsets - read/write with sms_{read,write}_reg() */ | 95 | /* SMS register offsets - read/write with sms_{read,write}_reg() */ |
90 | 96 | ||
@@ -120,6 +126,8 @@ void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0, | |||
120 | int omap2_sdrc_get_params(unsigned long r, | 126 | int omap2_sdrc_get_params(unsigned long r, |
121 | struct omap_sdrc_params **sdrc_cs0, | 127 | struct omap_sdrc_params **sdrc_cs0, |
122 | struct omap_sdrc_params **sdrc_cs1); | 128 | struct omap_sdrc_params **sdrc_cs1); |
129 | void omap2_sms_save_context(void); | ||
130 | void omap2_sms_restore_context(void); | ||
123 | 131 | ||
124 | #ifdef CONFIG_ARCH_OMAP2 | 132 | #ifdef CONFIG_ARCH_OMAP2 |
125 | 133 | ||
diff --git a/arch/arm/plat-omap/include/mach/serial.h b/arch/arm/plat-omap/include/plat/serial.h index e249186d26e2..9951345a25d6 100644 --- a/arch/arm/plat-omap/include/mach/serial.h +++ b/arch/arm/plat-omap/include/plat/serial.h | |||
@@ -20,26 +20,22 @@ | |||
20 | #define OMAP_UART1_BASE 0xfffb0000 | 20 | #define OMAP_UART1_BASE 0xfffb0000 |
21 | #define OMAP_UART2_BASE 0xfffb0800 | 21 | #define OMAP_UART2_BASE 0xfffb0800 |
22 | #define OMAP_UART3_BASE 0xfffb9800 | 22 | #define OMAP_UART3_BASE 0xfffb9800 |
23 | #define OMAP_MAX_NR_PORTS 3 | ||
24 | #elif defined(CONFIG_ARCH_OMAP2) | 23 | #elif defined(CONFIG_ARCH_OMAP2) |
25 | /* OMAP2 serial ports */ | 24 | /* OMAP2 serial ports */ |
26 | #define OMAP_UART1_BASE 0x4806a000 | 25 | #define OMAP_UART1_BASE 0x4806a000 |
27 | #define OMAP_UART2_BASE 0x4806c000 | 26 | #define OMAP_UART2_BASE 0x4806c000 |
28 | #define OMAP_UART3_BASE 0x4806e000 | 27 | #define OMAP_UART3_BASE 0x4806e000 |
29 | #define OMAP_MAX_NR_PORTS 3 | ||
30 | #elif defined(CONFIG_ARCH_OMAP3) | 28 | #elif defined(CONFIG_ARCH_OMAP3) |
31 | /* OMAP3 serial ports */ | 29 | /* OMAP3 serial ports */ |
32 | #define OMAP_UART1_BASE 0x4806a000 | 30 | #define OMAP_UART1_BASE 0x4806a000 |
33 | #define OMAP_UART2_BASE 0x4806c000 | 31 | #define OMAP_UART2_BASE 0x4806c000 |
34 | #define OMAP_UART3_BASE 0x49020000 | 32 | #define OMAP_UART3_BASE 0x49020000 |
35 | #define OMAP_MAX_NR_PORTS 3 | ||
36 | #elif defined(CONFIG_ARCH_OMAP4) | 33 | #elif defined(CONFIG_ARCH_OMAP4) |
37 | /* OMAP4 serial ports */ | 34 | /* OMAP4 serial ports */ |
38 | #define OMAP_UART1_BASE 0x4806a000 | 35 | #define OMAP_UART1_BASE 0x4806a000 |
39 | #define OMAP_UART2_BASE 0x4806c000 | 36 | #define OMAP_UART2_BASE 0x4806c000 |
40 | #define OMAP_UART3_BASE 0x48020000 | 37 | #define OMAP_UART3_BASE 0x48020000 |
41 | #define OMAP_UART4_BASE 0x4806e000 | 38 | #define OMAP_UART4_BASE 0x4806e000 |
42 | #define OMAP_MAX_NR_PORTS 4 | ||
43 | #endif | 39 | #endif |
44 | 40 | ||
45 | #define OMAP1510_BASE_BAUD (12000000/16) | 41 | #define OMAP1510_BASE_BAUD (12000000/16) |
diff --git a/arch/arm/plat-omap/include/mach/smp.h b/arch/arm/plat-omap/include/plat/smp.h index dcaa8fde7063..dcaa8fde7063 100644 --- a/arch/arm/plat-omap/include/mach/smp.h +++ b/arch/arm/plat-omap/include/plat/smp.h | |||
diff --git a/arch/arm/plat-omap/include/mach/sram.h b/arch/arm/plat-omap/include/plat/sram.h index 8974e3fc2691..16a1b458d53c 100644 --- a/arch/arm/plat-omap/include/mach/sram.h +++ b/arch/arm/plat-omap/include/plat/sram.h | |||
@@ -27,6 +27,7 @@ extern u32 omap3_configure_core_dpll( | |||
27 | u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0, | 27 | u32 sdrc_actim_ctrl_b_0, u32 sdrc_mr_0, |
28 | u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1, | 28 | u32 sdrc_rfr_ctrl_1, u32 sdrc_actim_ctrl_a_1, |
29 | u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1); | 29 | u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1); |
30 | extern void omap3_sram_restore_context(void); | ||
30 | 31 | ||
31 | /* Do not use these */ | 32 | /* Do not use these */ |
32 | extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl); | 33 | extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl); |
@@ -68,4 +69,10 @@ extern u32 omap3_sram_configure_core_dpll( | |||
68 | u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1); | 69 | u32 sdrc_actim_ctrl_b_1, u32 sdrc_mr_1); |
69 | extern unsigned long omap3_sram_configure_core_dpll_sz; | 70 | extern unsigned long omap3_sram_configure_core_dpll_sz; |
70 | 71 | ||
72 | #ifdef CONFIG_PM | ||
73 | extern void omap_push_sram_idle(void); | ||
74 | #else | ||
75 | static inline void omap_push_sram_idle(void) {} | ||
76 | #endif /* CONFIG_PM */ | ||
77 | |||
71 | #endif | 78 | #endif |
diff --git a/arch/arm/plat-omap/include/mach/system.h b/arch/arm/plat-omap/include/plat/system.h index ed8ec7477261..c58a4ef42a45 100644 --- a/arch/arm/plat-omap/include/mach/system.h +++ b/arch/arm/plat-omap/include/plat/system.h | |||
@@ -9,7 +9,7 @@ | |||
9 | #include <asm/mach-types.h> | 9 | #include <asm/mach-types.h> |
10 | #include <mach/hardware.h> | 10 | #include <mach/hardware.h> |
11 | 11 | ||
12 | #include <mach/prcm.h> | 12 | #include <plat/prcm.h> |
13 | 13 | ||
14 | #ifndef CONFIG_MACH_VOICEBLUE | 14 | #ifndef CONFIG_MACH_VOICEBLUE |
15 | #define voiceblue_reset() do {} while (0) | 15 | #define voiceblue_reset() do {} while (0) |
diff --git a/arch/arm/plat-omap/include/mach/tc.h b/arch/arm/plat-omap/include/plat/tc.h index d2fcd789bb9a..d2fcd789bb9a 100644 --- a/arch/arm/plat-omap/include/mach/tc.h +++ b/arch/arm/plat-omap/include/plat/tc.h | |||
diff --git a/arch/arm/plat-omap/include/mach/timer-gp.h b/arch/arm/plat-omap/include/plat/timer-gp.h index c88d346b59d9..c88d346b59d9 100644 --- a/arch/arm/plat-omap/include/mach/timer-gp.h +++ b/arch/arm/plat-omap/include/plat/timer-gp.h | |||
diff --git a/arch/arm/plat-omap/include/mach/timex.h b/arch/arm/plat-omap/include/plat/timex.h index 6d35767bc48f..6d35767bc48f 100644 --- a/arch/arm/plat-omap/include/mach/timex.h +++ b/arch/arm/plat-omap/include/plat/timex.h | |||
diff --git a/arch/arm/plat-omap/include/mach/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h index 0814c5f210c3..13c305d62127 100644 --- a/arch/arm/plat-omap/include/mach/uncompress.h +++ b/arch/arm/plat-omap/include/plat/uncompress.h | |||
@@ -19,12 +19,13 @@ | |||
19 | 19 | ||
20 | #include <linux/types.h> | 20 | #include <linux/types.h> |
21 | #include <linux/serial_reg.h> | 21 | #include <linux/serial_reg.h> |
22 | #include <mach/serial.h> | 22 | #include <plat/serial.h> |
23 | 23 | ||
24 | unsigned int system_rev; | 24 | unsigned int system_rev; |
25 | 25 | ||
26 | #define UART_OMAP_MDR1 0x08 /* mode definition register */ | 26 | #define UART_OMAP_MDR1 0x08 /* mode definition register */ |
27 | #define OMAP_ID_730 0x355F | 27 | #define OMAP_ID_730 0x355F |
28 | #define OMAP_ID_850 0x362C | ||
28 | #define ID_MASK 0x7fff | 29 | #define ID_MASK 0x7fff |
29 | #define check_port(base, shift) ((base[UART_OMAP_MDR1 << shift] & 7) == 0) | 30 | #define check_port(base, shift) ((base[UART_OMAP_MDR1 << shift] & 7) == 0) |
30 | #define omap_get_id() ((*(volatile unsigned int *)(0xfffed404)) >> 12) & ID_MASK | 31 | #define omap_get_id() ((*(volatile unsigned int *)(0xfffed404)) >> 12) & ID_MASK |
@@ -43,8 +44,12 @@ static void putc(int c) | |||
43 | uart = (volatile u8 *)(OMAP_UART3_BASE); | 44 | uart = (volatile u8 *)(OMAP_UART3_BASE); |
44 | #elif defined(CONFIG_OMAP_LL_DEBUG_UART2) | 45 | #elif defined(CONFIG_OMAP_LL_DEBUG_UART2) |
45 | uart = (volatile u8 *)(OMAP_UART2_BASE); | 46 | uart = (volatile u8 *)(OMAP_UART2_BASE); |
46 | #else | 47 | #elif defined(CONFIG_OMAP_LL_DEBUG_UART1) |
47 | uart = (volatile u8 *)(OMAP_UART1_BASE); | 48 | uart = (volatile u8 *)(OMAP_UART1_BASE); |
49 | #elif defined(CONFIG_OMAP_LL_DEBUG_NONE) | ||
50 | return; | ||
51 | #else | ||
52 | return; | ||
48 | #endif | 53 | #endif |
49 | 54 | ||
50 | #ifdef CONFIG_ARCH_OMAP1 | 55 | #ifdef CONFIG_ARCH_OMAP1 |
@@ -53,7 +58,7 @@ static void putc(int c) | |||
53 | /* MMU is not on, so cpu_is_omapXXXX() won't work here */ | 58 | /* MMU is not on, so cpu_is_omapXXXX() won't work here */ |
54 | unsigned int omap_id = omap_get_id(); | 59 | unsigned int omap_id = omap_get_id(); |
55 | 60 | ||
56 | if (omap_id == OMAP_ID_730) | 61 | if (omap_id == OMAP_ID_730 || omap_id == OMAP_ID_850) |
57 | shift = 0; | 62 | shift = 0; |
58 | 63 | ||
59 | if (check_port(uart, shift)) | 64 | if (check_port(uart, shift)) |
diff --git a/arch/arm/plat-omap/include/mach/usb.h b/arch/arm/plat-omap/include/plat/usb.h index f337e1761e2c..33a500eb2f93 100644 --- a/arch/arm/plat-omap/include/mach/usb.h +++ b/arch/arm/plat-omap/include/plat/usb.h | |||
@@ -3,7 +3,22 @@ | |||
3 | #ifndef __ASM_ARCH_OMAP_USB_H | 3 | #ifndef __ASM_ARCH_OMAP_USB_H |
4 | #define __ASM_ARCH_OMAP_USB_H | 4 | #define __ASM_ARCH_OMAP_USB_H |
5 | 5 | ||
6 | #include <mach/board.h> | 6 | #include <plat/board.h> |
7 | |||
8 | #define OMAP3_HS_USB_PORTS 3 | ||
9 | enum ehci_hcd_omap_mode { | ||
10 | EHCI_HCD_OMAP_MODE_UNKNOWN, | ||
11 | EHCI_HCD_OMAP_MODE_PHY, | ||
12 | EHCI_HCD_OMAP_MODE_TLL, | ||
13 | }; | ||
14 | |||
15 | struct ehci_hcd_omap_platform_data { | ||
16 | enum ehci_hcd_omap_mode port_mode[OMAP3_HS_USB_PORTS]; | ||
17 | unsigned phy_reset:1; | ||
18 | |||
19 | /* have to be valid if phy_reset is true and portx is in phy mode */ | ||
20 | int reset_gpio_port[OMAP3_HS_USB_PORTS]; | ||
21 | }; | ||
7 | 22 | ||
8 | /*-------------------------------------------------------------------------*/ | 23 | /*-------------------------------------------------------------------------*/ |
9 | 24 | ||
@@ -29,6 +44,8 @@ | |||
29 | 44 | ||
30 | extern void usb_musb_init(void); | 45 | extern void usb_musb_init(void); |
31 | 46 | ||
47 | extern void usb_ehci_init(struct ehci_hcd_omap_platform_data *pdata); | ||
48 | |||
32 | #endif | 49 | #endif |
33 | 50 | ||
34 | void omap_usb_init(struct omap_usb_config *pdata); | 51 | void omap_usb_init(struct omap_usb_config *pdata); |
diff --git a/arch/arm/plat-omap/io.c b/arch/arm/plat-omap/io.c index b6defa23e77e..11f5d7961c73 100644 --- a/arch/arm/plat-omap/io.c +++ b/arch/arm/plat-omap/io.c | |||
@@ -13,12 +13,12 @@ | |||
13 | #include <linux/io.h> | 13 | #include <linux/io.h> |
14 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
15 | 15 | ||
16 | #include <mach/omap730.h> | 16 | #include <plat/omap7xx.h> |
17 | #include <mach/omap1510.h> | 17 | #include <plat/omap1510.h> |
18 | #include <mach/omap16xx.h> | 18 | #include <plat/omap16xx.h> |
19 | #include <mach/omap24xx.h> | 19 | #include <plat/omap24xx.h> |
20 | #include <mach/omap34xx.h> | 20 | #include <plat/omap34xx.h> |
21 | #include <mach/omap44xx.h> | 21 | #include <plat/omap44xx.h> |
22 | 22 | ||
23 | #define BETWEEN(p,st,sz) ((p) >= (st) && (p) < ((st) + (sz))) | 23 | #define BETWEEN(p,st,sz) ((p) >= (st) && (p) < ((st) + (sz))) |
24 | #define XLATE(p,pst,vst) ((void __iomem *)((p) - (pst) + (vst))) | 24 | #define XLATE(p,pst,vst) ((void __iomem *)((p) - (pst) + (vst))) |
@@ -33,13 +33,13 @@ void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type) | |||
33 | if (BETWEEN(p, OMAP1_IO_PHYS, OMAP1_IO_SIZE)) | 33 | if (BETWEEN(p, OMAP1_IO_PHYS, OMAP1_IO_SIZE)) |
34 | return XLATE(p, OMAP1_IO_PHYS, OMAP1_IO_VIRT); | 34 | return XLATE(p, OMAP1_IO_PHYS, OMAP1_IO_VIRT); |
35 | } | 35 | } |
36 | if (cpu_is_omap730()) { | 36 | if (cpu_is_omap7xx()) { |
37 | if (BETWEEN(p, OMAP730_DSP_BASE, OMAP730_DSP_SIZE)) | 37 | if (BETWEEN(p, OMAP7XX_DSP_BASE, OMAP7XX_DSP_SIZE)) |
38 | return XLATE(p, OMAP730_DSP_BASE, OMAP730_DSP_START); | 38 | return XLATE(p, OMAP7XX_DSP_BASE, OMAP7XX_DSP_START); |
39 | 39 | ||
40 | if (BETWEEN(p, OMAP730_DSPREG_BASE, OMAP730_DSPREG_SIZE)) | 40 | if (BETWEEN(p, OMAP7XX_DSPREG_BASE, OMAP7XX_DSPREG_SIZE)) |
41 | return XLATE(p, OMAP730_DSPREG_BASE, | 41 | return XLATE(p, OMAP7XX_DSPREG_BASE, |
42 | OMAP730_DSPREG_START); | 42 | OMAP7XX_DSPREG_START); |
43 | } | 43 | } |
44 | if (cpu_is_omap15xx()) { | 44 | if (cpu_is_omap15xx()) { |
45 | if (BETWEEN(p, OMAP1510_DSP_BASE, OMAP1510_DSP_SIZE)) | 45 | if (BETWEEN(p, OMAP1510_DSP_BASE, OMAP1510_DSP_SIZE)) |
@@ -114,6 +114,14 @@ void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type) | |||
114 | return XLATE(p, L4_WK_44XX_PHYS, L4_WK_44XX_VIRT); | 114 | return XLATE(p, L4_WK_44XX_PHYS, L4_WK_44XX_VIRT); |
115 | if (BETWEEN(p, OMAP44XX_GPMC_PHYS, OMAP44XX_GPMC_SIZE)) | 115 | if (BETWEEN(p, OMAP44XX_GPMC_PHYS, OMAP44XX_GPMC_SIZE)) |
116 | return XLATE(p, OMAP44XX_GPMC_PHYS, OMAP44XX_GPMC_VIRT); | 116 | return XLATE(p, OMAP44XX_GPMC_PHYS, OMAP44XX_GPMC_VIRT); |
117 | if (BETWEEN(p, OMAP44XX_EMIF1_PHYS, OMAP44XX_EMIF1_SIZE)) | ||
118 | return XLATE(p, OMAP44XX_EMIF1_PHYS, \ | ||
119 | OMAP44XX_EMIF1_VIRT); | ||
120 | if (BETWEEN(p, OMAP44XX_EMIF2_PHYS, OMAP44XX_EMIF2_SIZE)) | ||
121 | return XLATE(p, OMAP44XX_EMIF2_PHYS, \ | ||
122 | OMAP44XX_EMIF2_VIRT); | ||
123 | if (BETWEEN(p, OMAP44XX_DMM_PHYS, OMAP44XX_DMM_SIZE)) | ||
124 | return XLATE(p, OMAP44XX_DMM_PHYS, OMAP44XX_DMM_VIRT); | ||
117 | if (BETWEEN(p, L4_PER_44XX_PHYS, L4_PER_44XX_SIZE)) | 125 | if (BETWEEN(p, L4_PER_44XX_PHYS, L4_PER_44XX_SIZE)) |
118 | return XLATE(p, L4_PER_44XX_PHYS, L4_PER_44XX_VIRT); | 126 | return XLATE(p, L4_PER_44XX_PHYS, L4_PER_44XX_VIRT); |
119 | if (BETWEEN(p, L4_EMU_44XX_PHYS, L4_EMU_44XX_SIZE)) | 127 | if (BETWEEN(p, L4_EMU_44XX_PHYS, L4_EMU_44XX_SIZE)) |
@@ -142,7 +150,7 @@ u8 omap_readb(u32 pa) | |||
142 | if (cpu_class_is_omap1()) | 150 | if (cpu_class_is_omap1()) |
143 | return __raw_readb(OMAP1_IO_ADDRESS(pa)); | 151 | return __raw_readb(OMAP1_IO_ADDRESS(pa)); |
144 | else | 152 | else |
145 | return __raw_readb(OMAP2_IO_ADDRESS(pa)); | 153 | return __raw_readb(OMAP2_L4_IO_ADDRESS(pa)); |
146 | } | 154 | } |
147 | EXPORT_SYMBOL(omap_readb); | 155 | EXPORT_SYMBOL(omap_readb); |
148 | 156 | ||
@@ -151,7 +159,7 @@ u16 omap_readw(u32 pa) | |||
151 | if (cpu_class_is_omap1()) | 159 | if (cpu_class_is_omap1()) |
152 | return __raw_readw(OMAP1_IO_ADDRESS(pa)); | 160 | return __raw_readw(OMAP1_IO_ADDRESS(pa)); |
153 | else | 161 | else |
154 | return __raw_readw(OMAP2_IO_ADDRESS(pa)); | 162 | return __raw_readw(OMAP2_L4_IO_ADDRESS(pa)); |
155 | } | 163 | } |
156 | EXPORT_SYMBOL(omap_readw); | 164 | EXPORT_SYMBOL(omap_readw); |
157 | 165 | ||
@@ -160,7 +168,7 @@ u32 omap_readl(u32 pa) | |||
160 | if (cpu_class_is_omap1()) | 168 | if (cpu_class_is_omap1()) |
161 | return __raw_readl(OMAP1_IO_ADDRESS(pa)); | 169 | return __raw_readl(OMAP1_IO_ADDRESS(pa)); |
162 | else | 170 | else |
163 | return __raw_readl(OMAP2_IO_ADDRESS(pa)); | 171 | return __raw_readl(OMAP2_L4_IO_ADDRESS(pa)); |
164 | } | 172 | } |
165 | EXPORT_SYMBOL(omap_readl); | 173 | EXPORT_SYMBOL(omap_readl); |
166 | 174 | ||
@@ -169,7 +177,7 @@ void omap_writeb(u8 v, u32 pa) | |||
169 | if (cpu_class_is_omap1()) | 177 | if (cpu_class_is_omap1()) |
170 | __raw_writeb(v, OMAP1_IO_ADDRESS(pa)); | 178 | __raw_writeb(v, OMAP1_IO_ADDRESS(pa)); |
171 | else | 179 | else |
172 | __raw_writeb(v, OMAP2_IO_ADDRESS(pa)); | 180 | __raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa)); |
173 | } | 181 | } |
174 | EXPORT_SYMBOL(omap_writeb); | 182 | EXPORT_SYMBOL(omap_writeb); |
175 | 183 | ||
@@ -178,7 +186,7 @@ void omap_writew(u16 v, u32 pa) | |||
178 | if (cpu_class_is_omap1()) | 186 | if (cpu_class_is_omap1()) |
179 | __raw_writew(v, OMAP1_IO_ADDRESS(pa)); | 187 | __raw_writew(v, OMAP1_IO_ADDRESS(pa)); |
180 | else | 188 | else |
181 | __raw_writew(v, OMAP2_IO_ADDRESS(pa)); | 189 | __raw_writew(v, OMAP2_L4_IO_ADDRESS(pa)); |
182 | } | 190 | } |
183 | EXPORT_SYMBOL(omap_writew); | 191 | EXPORT_SYMBOL(omap_writew); |
184 | 192 | ||
@@ -187,6 +195,6 @@ void omap_writel(u32 v, u32 pa) | |||
187 | if (cpu_class_is_omap1()) | 195 | if (cpu_class_is_omap1()) |
188 | __raw_writel(v, OMAP1_IO_ADDRESS(pa)); | 196 | __raw_writel(v, OMAP1_IO_ADDRESS(pa)); |
189 | else | 197 | else |
190 | __raw_writel(v, OMAP2_IO_ADDRESS(pa)); | 198 | __raw_writel(v, OMAP2_L4_IO_ADDRESS(pa)); |
191 | } | 199 | } |
192 | EXPORT_SYMBOL(omap_writel); | 200 | EXPORT_SYMBOL(omap_writel); |
diff --git a/arch/arm/plat-omap/iommu-debug.c b/arch/arm/plat-omap/iommu-debug.c index c799b3b0d709..afd1c27cff7c 100644 --- a/arch/arm/plat-omap/iommu-debug.c +++ b/arch/arm/plat-omap/iommu-debug.c | |||
@@ -17,8 +17,8 @@ | |||
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/debugfs.h> | 18 | #include <linux/debugfs.h> |
19 | 19 | ||
20 | #include <mach/iommu.h> | 20 | #include <plat/iommu.h> |
21 | #include <mach/iovmm.h> | 21 | #include <plat/iovmm.h> |
22 | 22 | ||
23 | #include "iopgtable.h" | 23 | #include "iopgtable.h" |
24 | 24 | ||
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c index 94584f167a82..c0ff1e39d893 100644 --- a/arch/arm/plat-omap/iommu.c +++ b/arch/arm/plat-omap/iommu.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | #include <asm/cacheflush.h> | 21 | #include <asm/cacheflush.h> |
22 | 22 | ||
23 | #include <mach/iommu.h> | 23 | #include <plat/iommu.h> |
24 | 24 | ||
25 | #include "iopgtable.h" | 25 | #include "iopgtable.h" |
26 | 26 | ||
diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c index dc3fac3dd0ea..936aef1971cd 100644 --- a/arch/arm/plat-omap/iovmm.c +++ b/arch/arm/plat-omap/iovmm.c | |||
@@ -18,8 +18,8 @@ | |||
18 | #include <asm/cacheflush.h> | 18 | #include <asm/cacheflush.h> |
19 | #include <asm/mach/map.h> | 19 | #include <asm/mach/map.h> |
20 | 20 | ||
21 | #include <mach/iommu.h> | 21 | #include <plat/iommu.h> |
22 | #include <mach/iovmm.h> | 22 | #include <plat/iovmm.h> |
23 | 23 | ||
24 | #include "iopgtable.h" | 24 | #include "iopgtable.h" |
25 | 25 | ||
@@ -392,7 +392,6 @@ static void sgtable_fill_vmalloc(struct sg_table *sgt, void *_va) | |||
392 | } | 392 | } |
393 | 393 | ||
394 | va_end = _va + PAGE_SIZE * i; | 394 | va_end = _va + PAGE_SIZE * i; |
395 | flush_cache_vmap((unsigned long)_va, (unsigned long)va_end); | ||
396 | } | 395 | } |
397 | 396 | ||
398 | static inline void sgtable_drain_vmalloc(struct sg_table *sgt) | 397 | static inline void sgtable_drain_vmalloc(struct sg_table *sgt) |
@@ -427,8 +426,6 @@ static void sgtable_fill_kmalloc(struct sg_table *sgt, u32 pa, size_t len) | |||
427 | len -= bytes; | 426 | len -= bytes; |
428 | } | 427 | } |
429 | BUG_ON(len); | 428 | BUG_ON(len); |
430 | |||
431 | clean_dcache_area(va, len); | ||
432 | } | 429 | } |
433 | 430 | ||
434 | static inline void sgtable_drain_kmalloc(struct sg_table *sgt) | 431 | static inline void sgtable_drain_kmalloc(struct sg_table *sgt) |
@@ -449,7 +446,7 @@ static int map_iovm_area(struct iommu *obj, struct iovm_struct *new, | |||
449 | struct scatterlist *sg; | 446 | struct scatterlist *sg; |
450 | u32 da = new->da_start; | 447 | u32 da = new->da_start; |
451 | 448 | ||
452 | if (!obj || !new || !sgt) | 449 | if (!obj || !sgt) |
453 | return -EINVAL; | 450 | return -EINVAL; |
454 | 451 | ||
455 | BUG_ON(!sgtable_ok(sgt)); | 452 | BUG_ON(!sgtable_ok(sgt)); |
@@ -617,7 +614,7 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt, | |||
617 | u32 flags) | 614 | u32 flags) |
618 | { | 615 | { |
619 | size_t bytes; | 616 | size_t bytes; |
620 | void *va; | 617 | void *va = NULL; |
621 | 618 | ||
622 | if (!obj || !obj->dev || !sgt) | 619 | if (!obj || !obj->dev || !sgt) |
623 | return -EINVAL; | 620 | return -EINVAL; |
@@ -627,9 +624,11 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt, | |||
627 | return -EINVAL; | 624 | return -EINVAL; |
628 | bytes = PAGE_ALIGN(bytes); | 625 | bytes = PAGE_ALIGN(bytes); |
629 | 626 | ||
630 | va = vmap_sg(sgt); | 627 | if (flags & IOVMF_MMIO) { |
631 | if (IS_ERR(va)) | 628 | va = vmap_sg(sgt); |
632 | return PTR_ERR(va); | 629 | if (IS_ERR(va)) |
630 | return PTR_ERR(va); | ||
631 | } | ||
633 | 632 | ||
634 | flags &= IOVMF_HW_MASK; | 633 | flags &= IOVMF_HW_MASK; |
635 | flags |= IOVMF_DISCONT; | 634 | flags |= IOVMF_DISCONT; |
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c index 40424edae939..8e90633e4cb9 100644 --- a/arch/arm/plat-omap/mailbox.c +++ b/arch/arm/plat-omap/mailbox.c | |||
@@ -26,55 +26,12 @@ | |||
26 | #include <linux/device.h> | 26 | #include <linux/device.h> |
27 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
28 | 28 | ||
29 | #include <mach/mailbox.h> | 29 | #include <plat/mailbox.h> |
30 | |||
31 | static int enable_seq_bit; | ||
32 | module_param(enable_seq_bit, bool, 0); | ||
33 | MODULE_PARM_DESC(enable_seq_bit, "Enable sequence bit checking."); | ||
34 | 30 | ||
35 | static struct omap_mbox *mboxes; | 31 | static struct omap_mbox *mboxes; |
36 | static DEFINE_RWLOCK(mboxes_lock); | 32 | static DEFINE_RWLOCK(mboxes_lock); |
37 | 33 | ||
38 | /* | 34 | static int mbox_configured; |
39 | * Mailbox sequence bit API | ||
40 | */ | ||
41 | |||
42 | /* seq_rcv should be initialized with any value other than | ||
43 | * 0 and 1 << 31, to allow either value for the first | ||
44 | * message. */ | ||
45 | static inline void mbox_seq_init(struct omap_mbox *mbox) | ||
46 | { | ||
47 | if (!enable_seq_bit) | ||
48 | return; | ||
49 | |||
50 | /* any value other than 0 and 1 << 31 */ | ||
51 | mbox->seq_rcv = 0xffffffff; | ||
52 | } | ||
53 | |||
54 | static inline void mbox_seq_toggle(struct omap_mbox *mbox, mbox_msg_t * msg) | ||
55 | { | ||
56 | if (!enable_seq_bit) | ||
57 | return; | ||
58 | |||
59 | /* add seq_snd to msg */ | ||
60 | *msg = (*msg & 0x7fffffff) | mbox->seq_snd; | ||
61 | /* flip seq_snd */ | ||
62 | mbox->seq_snd ^= 1 << 31; | ||
63 | } | ||
64 | |||
65 | static inline int mbox_seq_test(struct omap_mbox *mbox, mbox_msg_t msg) | ||
66 | { | ||
67 | mbox_msg_t seq; | ||
68 | |||
69 | if (!enable_seq_bit) | ||
70 | return 0; | ||
71 | |||
72 | seq = msg & (1 << 31); | ||
73 | if (seq == mbox->seq_rcv) | ||
74 | return -1; | ||
75 | mbox->seq_rcv = seq; | ||
76 | return 0; | ||
77 | } | ||
78 | 35 | ||
79 | /* Mailbox FIFO handle functions */ | 36 | /* Mailbox FIFO handle functions */ |
80 | static inline mbox_msg_t mbox_fifo_read(struct omap_mbox *mbox) | 37 | static inline mbox_msg_t mbox_fifo_read(struct omap_mbox *mbox) |
@@ -95,14 +52,6 @@ static inline int mbox_fifo_full(struct omap_mbox *mbox) | |||
95 | } | 52 | } |
96 | 53 | ||
97 | /* Mailbox IRQ handle functions */ | 54 | /* Mailbox IRQ handle functions */ |
98 | static inline void enable_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) | ||
99 | { | ||
100 | mbox->ops->enable_irq(mbox, irq); | ||
101 | } | ||
102 | static inline void disable_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) | ||
103 | { | ||
104 | mbox->ops->disable_irq(mbox, irq); | ||
105 | } | ||
106 | static inline void ack_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) | 55 | static inline void ack_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) |
107 | { | 56 | { |
108 | if (mbox->ops->ack_irq) | 57 | if (mbox->ops->ack_irq) |
@@ -113,17 +62,10 @@ static inline int is_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) | |||
113 | return mbox->ops->is_irq(mbox, irq); | 62 | return mbox->ops->is_irq(mbox, irq); |
114 | } | 63 | } |
115 | 64 | ||
116 | /* Mailbox Sequence Bit function */ | ||
117 | void omap_mbox_init_seq(struct omap_mbox *mbox) | ||
118 | { | ||
119 | mbox_seq_init(mbox); | ||
120 | } | ||
121 | EXPORT_SYMBOL(omap_mbox_init_seq); | ||
122 | |||
123 | /* | 65 | /* |
124 | * message sender | 66 | * message sender |
125 | */ | 67 | */ |
126 | static int __mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg, void *arg) | 68 | static int __mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg) |
127 | { | 69 | { |
128 | int ret = 0, i = 1000; | 70 | int ret = 0, i = 1000; |
129 | 71 | ||
@@ -134,89 +76,49 @@ static int __mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg, void *arg) | |||
134 | return -1; | 76 | return -1; |
135 | udelay(1); | 77 | udelay(1); |
136 | } | 78 | } |
137 | |||
138 | if (arg && mbox->txq->callback) { | ||
139 | ret = mbox->txq->callback(arg); | ||
140 | if (ret) | ||
141 | goto out; | ||
142 | } | ||
143 | |||
144 | mbox_seq_toggle(mbox, &msg); | ||
145 | mbox_fifo_write(mbox, msg); | 79 | mbox_fifo_write(mbox, msg); |
146 | out: | ||
147 | return ret; | 80 | return ret; |
148 | } | 81 | } |
149 | 82 | ||
150 | struct omap_msg_tx_data { | ||
151 | mbox_msg_t msg; | ||
152 | void *arg; | ||
153 | }; | ||
154 | 83 | ||
155 | static void omap_msg_tx_end_io(struct request *rq, int error) | 84 | int omap_mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg) |
156 | { | 85 | { |
157 | kfree(rq->special); | ||
158 | __blk_put_request(rq->q, rq); | ||
159 | } | ||
160 | 86 | ||
161 | int omap_mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg, void* arg) | ||
162 | { | ||
163 | struct omap_msg_tx_data *tx_data; | ||
164 | struct request *rq; | 87 | struct request *rq; |
165 | struct request_queue *q = mbox->txq->queue; | 88 | struct request_queue *q = mbox->txq->queue; |
166 | 89 | ||
167 | tx_data = kmalloc(sizeof(*tx_data), GFP_ATOMIC); | ||
168 | if (unlikely(!tx_data)) | ||
169 | return -ENOMEM; | ||
170 | |||
171 | rq = blk_get_request(q, WRITE, GFP_ATOMIC); | 90 | rq = blk_get_request(q, WRITE, GFP_ATOMIC); |
172 | if (unlikely(!rq)) { | 91 | if (unlikely(!rq)) |
173 | kfree(tx_data); | ||
174 | return -ENOMEM; | 92 | return -ENOMEM; |
175 | } | ||
176 | 93 | ||
177 | tx_data->msg = msg; | 94 | blk_insert_request(q, rq, 0, (void *) msg); |
178 | tx_data->arg = arg; | 95 | tasklet_schedule(&mbox->txq->tasklet); |
179 | rq->end_io = omap_msg_tx_end_io; | ||
180 | blk_insert_request(q, rq, 0, tx_data); | ||
181 | 96 | ||
182 | schedule_work(&mbox->txq->work); | ||
183 | return 0; | 97 | return 0; |
184 | } | 98 | } |
185 | EXPORT_SYMBOL(omap_mbox_msg_send); | 99 | EXPORT_SYMBOL(omap_mbox_msg_send); |
186 | 100 | ||
187 | static void mbox_tx_work(struct work_struct *work) | 101 | static void mbox_tx_tasklet(unsigned long tx_data) |
188 | { | 102 | { |
189 | int ret; | 103 | int ret; |
190 | struct request *rq; | 104 | struct request *rq; |
191 | struct omap_mbox_queue *mq = container_of(work, | 105 | struct omap_mbox *mbox = (struct omap_mbox *)tx_data; |
192 | struct omap_mbox_queue, work); | ||
193 | struct omap_mbox *mbox = mq->queue->queuedata; | ||
194 | struct request_queue *q = mbox->txq->queue; | 106 | struct request_queue *q = mbox->txq->queue; |
195 | 107 | ||
196 | while (1) { | 108 | while (1) { |
197 | struct omap_msg_tx_data *tx_data; | ||
198 | 109 | ||
199 | spin_lock(q->queue_lock); | ||
200 | rq = blk_fetch_request(q); | 110 | rq = blk_fetch_request(q); |
201 | spin_unlock(q->queue_lock); | ||
202 | 111 | ||
203 | if (!rq) | 112 | if (!rq) |
204 | break; | 113 | break; |
205 | 114 | ||
206 | tx_data = rq->special; | 115 | ret = __mbox_msg_send(mbox, (mbox_msg_t)rq->special); |
207 | |||
208 | ret = __mbox_msg_send(mbox, tx_data->msg, tx_data->arg); | ||
209 | if (ret) { | 116 | if (ret) { |
210 | enable_mbox_irq(mbox, IRQ_TX); | 117 | omap_mbox_enable_irq(mbox, IRQ_TX); |
211 | spin_lock(q->queue_lock); | ||
212 | blk_requeue_request(q, rq); | 118 | blk_requeue_request(q, rq); |
213 | spin_unlock(q->queue_lock); | ||
214 | return; | 119 | return; |
215 | } | 120 | } |
216 | 121 | blk_end_request_all(rq, 0); | |
217 | spin_lock(q->queue_lock); | ||
218 | __blk_end_request_all(rq, 0); | ||
219 | spin_unlock(q->queue_lock); | ||
220 | } | 122 | } |
221 | } | 123 | } |
222 | 124 | ||
@@ -233,11 +135,6 @@ static void mbox_rx_work(struct work_struct *work) | |||
233 | mbox_msg_t msg; | 135 | mbox_msg_t msg; |
234 | unsigned long flags; | 136 | unsigned long flags; |
235 | 137 | ||
236 | if (mbox->rxq->callback == NULL) { | ||
237 | sysfs_notify(&mbox->dev->kobj, NULL, "mbox"); | ||
238 | return; | ||
239 | } | ||
240 | |||
241 | while (1) { | 138 | while (1) { |
242 | spin_lock_irqsave(q->queue_lock, flags); | 139 | spin_lock_irqsave(q->queue_lock, flags); |
243 | rq = blk_fetch_request(q); | 140 | rq = blk_fetch_request(q); |
@@ -254,19 +151,19 @@ static void mbox_rx_work(struct work_struct *work) | |||
254 | /* | 151 | /* |
255 | * Mailbox interrupt handler | 152 | * Mailbox interrupt handler |
256 | */ | 153 | */ |
257 | static void mbox_txq_fn(struct request_queue * q) | 154 | static void mbox_txq_fn(struct request_queue *q) |
258 | { | 155 | { |
259 | } | 156 | } |
260 | 157 | ||
261 | static void mbox_rxq_fn(struct request_queue * q) | 158 | static void mbox_rxq_fn(struct request_queue *q) |
262 | { | 159 | { |
263 | } | 160 | } |
264 | 161 | ||
265 | static void __mbox_tx_interrupt(struct omap_mbox *mbox) | 162 | static void __mbox_tx_interrupt(struct omap_mbox *mbox) |
266 | { | 163 | { |
267 | disable_mbox_irq(mbox, IRQ_TX); | 164 | omap_mbox_disable_irq(mbox, IRQ_TX); |
268 | ack_mbox_irq(mbox, IRQ_TX); | 165 | ack_mbox_irq(mbox, IRQ_TX); |
269 | schedule_work(&mbox->txq->work); | 166 | tasklet_schedule(&mbox->txq->tasklet); |
270 | } | 167 | } |
271 | 168 | ||
272 | static void __mbox_rx_interrupt(struct omap_mbox *mbox) | 169 | static void __mbox_rx_interrupt(struct omap_mbox *mbox) |
@@ -275,8 +172,6 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox) | |||
275 | mbox_msg_t msg; | 172 | mbox_msg_t msg; |
276 | struct request_queue *q = mbox->rxq->queue; | 173 | struct request_queue *q = mbox->rxq->queue; |
277 | 174 | ||
278 | disable_mbox_irq(mbox, IRQ_RX); | ||
279 | |||
280 | while (!mbox_fifo_empty(mbox)) { | 175 | while (!mbox_fifo_empty(mbox)) { |
281 | rq = blk_get_request(q, WRITE, GFP_ATOMIC); | 176 | rq = blk_get_request(q, WRITE, GFP_ATOMIC); |
282 | if (unlikely(!rq)) | 177 | if (unlikely(!rq)) |
@@ -284,11 +179,6 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox) | |||
284 | 179 | ||
285 | msg = mbox_fifo_read(mbox); | 180 | msg = mbox_fifo_read(mbox); |
286 | 181 | ||
287 | if (unlikely(mbox_seq_test(mbox, msg))) { | ||
288 | pr_info("mbox: Illegal seq bit!(%08x)\n", msg); | ||
289 | if (mbox->err_notify) | ||
290 | mbox->err_notify(); | ||
291 | } | ||
292 | 182 | ||
293 | blk_insert_request(q, rq, 0, (void *)msg); | 183 | blk_insert_request(q, rq, 0, (void *)msg); |
294 | if (mbox->ops->type == OMAP_MBOX_TYPE1) | 184 | if (mbox->ops->type == OMAP_MBOX_TYPE1) |
@@ -297,7 +187,6 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox) | |||
297 | 187 | ||
298 | /* no more messages in the fifo. clear IRQ source. */ | 188 | /* no more messages in the fifo. clear IRQ source. */ |
299 | ack_mbox_irq(mbox, IRQ_RX); | 189 | ack_mbox_irq(mbox, IRQ_RX); |
300 | enable_mbox_irq(mbox, IRQ_RX); | ||
301 | nomem: | 190 | nomem: |
302 | schedule_work(&mbox->rxq->work); | 191 | schedule_work(&mbox->rxq->work); |
303 | } | 192 | } |
@@ -315,76 +204,10 @@ static irqreturn_t mbox_interrupt(int irq, void *p) | |||
315 | return IRQ_HANDLED; | 204 | return IRQ_HANDLED; |
316 | } | 205 | } |
317 | 206 | ||
318 | /* | ||
319 | * sysfs files | ||
320 | */ | ||
321 | static ssize_t | ||
322 | omap_mbox_write(struct device *dev, struct device_attribute *attr, | ||
323 | const char * buf, size_t count) | ||
324 | { | ||
325 | int ret; | ||
326 | mbox_msg_t *p = (mbox_msg_t *)buf; | ||
327 | struct omap_mbox *mbox = dev_get_drvdata(dev); | ||
328 | |||
329 | for (; count >= sizeof(mbox_msg_t); count -= sizeof(mbox_msg_t)) { | ||
330 | ret = omap_mbox_msg_send(mbox, be32_to_cpu(*p), NULL); | ||
331 | if (ret) | ||
332 | return -EAGAIN; | ||
333 | p++; | ||
334 | } | ||
335 | |||
336 | return (size_t)((char *)p - buf); | ||
337 | } | ||
338 | |||
339 | static ssize_t | ||
340 | omap_mbox_read(struct device *dev, struct device_attribute *attr, char *buf) | ||
341 | { | ||
342 | unsigned long flags; | ||
343 | struct request *rq; | ||
344 | mbox_msg_t *p = (mbox_msg_t *) buf; | ||
345 | struct omap_mbox *mbox = dev_get_drvdata(dev); | ||
346 | struct request_queue *q = mbox->rxq->queue; | ||
347 | |||
348 | while (1) { | ||
349 | spin_lock_irqsave(q->queue_lock, flags); | ||
350 | rq = blk_fetch_request(q); | ||
351 | spin_unlock_irqrestore(q->queue_lock, flags); | ||
352 | |||
353 | if (!rq) | ||
354 | break; | ||
355 | |||
356 | *p = (mbox_msg_t)rq->special; | ||
357 | |||
358 | blk_end_request_all(rq, 0); | ||
359 | |||
360 | if (unlikely(mbox_seq_test(mbox, *p))) { | ||
361 | pr_info("mbox: Illegal seq bit!(%08x) ignored\n", *p); | ||
362 | continue; | ||
363 | } | ||
364 | p++; | ||
365 | } | ||
366 | |||
367 | pr_debug("%02x %02x %02x %02x\n", buf[0], buf[1], buf[2], buf[3]); | ||
368 | |||
369 | return (size_t) ((char *)p - buf); | ||
370 | } | ||
371 | |||
372 | static DEVICE_ATTR(mbox, S_IRUGO | S_IWUSR, omap_mbox_read, omap_mbox_write); | ||
373 | |||
374 | static ssize_t mbox_show(struct class *class, char *buf) | ||
375 | { | ||
376 | return sprintf(buf, "mbox"); | ||
377 | } | ||
378 | |||
379 | static CLASS_ATTR(mbox, S_IRUGO, mbox_show, NULL); | ||
380 | |||
381 | static struct class omap_mbox_class = { | ||
382 | .name = "omap-mailbox", | ||
383 | }; | ||
384 | |||
385 | static struct omap_mbox_queue *mbox_queue_alloc(struct omap_mbox *mbox, | 207 | static struct omap_mbox_queue *mbox_queue_alloc(struct omap_mbox *mbox, |
386 | request_fn_proc * proc, | 208 | request_fn_proc *proc, |
387 | void (*work) (struct work_struct *)) | 209 | void (*work) (struct work_struct *), |
210 | void (*tasklet)(unsigned long)) | ||
388 | { | 211 | { |
389 | struct request_queue *q; | 212 | struct request_queue *q; |
390 | struct omap_mbox_queue *mq; | 213 | struct omap_mbox_queue *mq; |
@@ -401,8 +224,11 @@ static struct omap_mbox_queue *mbox_queue_alloc(struct omap_mbox *mbox, | |||
401 | q->queuedata = mbox; | 224 | q->queuedata = mbox; |
402 | mq->queue = q; | 225 | mq->queue = q; |
403 | 226 | ||
404 | INIT_WORK(&mq->work, work); | 227 | if (work) |
228 | INIT_WORK(&mq->work, work); | ||
405 | 229 | ||
230 | if (tasklet) | ||
231 | tasklet_init(&mq->tasklet, tasklet, (unsigned long)mbox); | ||
406 | return mq; | 232 | return mq; |
407 | error: | 233 | error: |
408 | kfree(mq); | 234 | kfree(mq); |
@@ -415,18 +241,25 @@ static void mbox_queue_free(struct omap_mbox_queue *q) | |||
415 | kfree(q); | 241 | kfree(q); |
416 | } | 242 | } |
417 | 243 | ||
418 | static int omap_mbox_init(struct omap_mbox *mbox) | 244 | static int omap_mbox_startup(struct omap_mbox *mbox) |
419 | { | 245 | { |
420 | int ret; | 246 | int ret = 0; |
421 | struct omap_mbox_queue *mq; | 247 | struct omap_mbox_queue *mq; |
422 | 248 | ||
423 | if (likely(mbox->ops->startup)) { | 249 | if (likely(mbox->ops->startup)) { |
424 | ret = mbox->ops->startup(mbox); | 250 | write_lock(&mboxes_lock); |
425 | if (unlikely(ret)) | 251 | if (!mbox_configured) |
252 | ret = mbox->ops->startup(mbox); | ||
253 | |||
254 | if (unlikely(ret)) { | ||
255 | write_unlock(&mboxes_lock); | ||
426 | return ret; | 256 | return ret; |
257 | } | ||
258 | mbox_configured++; | ||
259 | write_unlock(&mboxes_lock); | ||
427 | } | 260 | } |
428 | 261 | ||
429 | ret = request_irq(mbox->irq, mbox_interrupt, IRQF_DISABLED, | 262 | ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED, |
430 | mbox->name, mbox); | 263 | mbox->name, mbox); |
431 | if (unlikely(ret)) { | 264 | if (unlikely(ret)) { |
432 | printk(KERN_ERR | 265 | printk(KERN_ERR |
@@ -434,14 +267,14 @@ static int omap_mbox_init(struct omap_mbox *mbox) | |||
434 | goto fail_request_irq; | 267 | goto fail_request_irq; |
435 | } | 268 | } |
436 | 269 | ||
437 | mq = mbox_queue_alloc(mbox, mbox_txq_fn, mbox_tx_work); | 270 | mq = mbox_queue_alloc(mbox, mbox_txq_fn, NULL, mbox_tx_tasklet); |
438 | if (!mq) { | 271 | if (!mq) { |
439 | ret = -ENOMEM; | 272 | ret = -ENOMEM; |
440 | goto fail_alloc_txq; | 273 | goto fail_alloc_txq; |
441 | } | 274 | } |
442 | mbox->txq = mq; | 275 | mbox->txq = mq; |
443 | 276 | ||
444 | mq = mbox_queue_alloc(mbox, mbox_rxq_fn, mbox_rx_work); | 277 | mq = mbox_queue_alloc(mbox, mbox_rxq_fn, mbox_rx_work, NULL); |
445 | if (!mq) { | 278 | if (!mq) { |
446 | ret = -ENOMEM; | 279 | ret = -ENOMEM; |
447 | goto fail_alloc_rxq; | 280 | goto fail_alloc_rxq; |
@@ -468,8 +301,14 @@ static void omap_mbox_fini(struct omap_mbox *mbox) | |||
468 | 301 | ||
469 | free_irq(mbox->irq, mbox); | 302 | free_irq(mbox->irq, mbox); |
470 | 303 | ||
471 | if (unlikely(mbox->ops->shutdown)) | 304 | if (unlikely(mbox->ops->shutdown)) { |
472 | mbox->ops->shutdown(mbox); | 305 | write_lock(&mboxes_lock); |
306 | if (mbox_configured > 0) | ||
307 | mbox_configured--; | ||
308 | if (!mbox_configured) | ||
309 | mbox->ops->shutdown(mbox); | ||
310 | write_unlock(&mboxes_lock); | ||
311 | } | ||
473 | } | 312 | } |
474 | 313 | ||
475 | static struct omap_mbox **find_mboxes(const char *name) | 314 | static struct omap_mbox **find_mboxes(const char *name) |
@@ -498,7 +337,7 @@ struct omap_mbox *omap_mbox_get(const char *name) | |||
498 | 337 | ||
499 | read_unlock(&mboxes_lock); | 338 | read_unlock(&mboxes_lock); |
500 | 339 | ||
501 | ret = omap_mbox_init(mbox); | 340 | ret = omap_mbox_startup(mbox); |
502 | if (ret) | 341 | if (ret) |
503 | return ERR_PTR(-ENODEV); | 342 | return ERR_PTR(-ENODEV); |
504 | 343 | ||
@@ -522,15 +361,6 @@ int omap_mbox_register(struct device *parent, struct omap_mbox *mbox) | |||
522 | if (mbox->next) | 361 | if (mbox->next) |
523 | return -EBUSY; | 362 | return -EBUSY; |
524 | 363 | ||
525 | mbox->dev = device_create(&omap_mbox_class, | ||
526 | parent, 0, mbox, "%s", mbox->name); | ||
527 | if (IS_ERR(mbox->dev)) | ||
528 | return PTR_ERR(mbox->dev); | ||
529 | |||
530 | ret = device_create_file(mbox->dev, &dev_attr_mbox); | ||
531 | if (ret) | ||
532 | goto err_sysfs; | ||
533 | |||
534 | write_lock(&mboxes_lock); | 364 | write_lock(&mboxes_lock); |
535 | tmp = find_mboxes(mbox->name); | 365 | tmp = find_mboxes(mbox->name); |
536 | if (*tmp) { | 366 | if (*tmp) { |
@@ -544,9 +374,6 @@ int omap_mbox_register(struct device *parent, struct omap_mbox *mbox) | |||
544 | return 0; | 374 | return 0; |
545 | 375 | ||
546 | err_find: | 376 | err_find: |
547 | device_remove_file(mbox->dev, &dev_attr_mbox); | ||
548 | err_sysfs: | ||
549 | device_unregister(mbox->dev); | ||
550 | return ret; | 377 | return ret; |
551 | } | 378 | } |
552 | EXPORT_SYMBOL(omap_mbox_register); | 379 | EXPORT_SYMBOL(omap_mbox_register); |
@@ -562,8 +389,6 @@ int omap_mbox_unregister(struct omap_mbox *mbox) | |||
562 | *tmp = mbox->next; | 389 | *tmp = mbox->next; |
563 | mbox->next = NULL; | 390 | mbox->next = NULL; |
564 | write_unlock(&mboxes_lock); | 391 | write_unlock(&mboxes_lock); |
565 | device_remove_file(mbox->dev, &dev_attr_mbox); | ||
566 | device_unregister(mbox->dev); | ||
567 | return 0; | 392 | return 0; |
568 | } | 393 | } |
569 | tmp = &(*tmp)->next; | 394 | tmp = &(*tmp)->next; |
@@ -574,23 +399,16 @@ int omap_mbox_unregister(struct omap_mbox *mbox) | |||
574 | } | 399 | } |
575 | EXPORT_SYMBOL(omap_mbox_unregister); | 400 | EXPORT_SYMBOL(omap_mbox_unregister); |
576 | 401 | ||
577 | static int __init omap_mbox_class_init(void) | 402 | static int __init omap_mbox_init(void) |
578 | { | 403 | { |
579 | int ret = class_register(&omap_mbox_class); | 404 | return 0; |
580 | if (!ret) | ||
581 | ret = class_create_file(&omap_mbox_class, &class_attr_mbox); | ||
582 | |||
583 | return ret; | ||
584 | } | 405 | } |
406 | module_init(omap_mbox_init); | ||
585 | 407 | ||
586 | static void __exit omap_mbox_class_exit(void) | 408 | static void __exit omap_mbox_exit(void) |
587 | { | 409 | { |
588 | class_remove_file(&omap_mbox_class, &class_attr_mbox); | ||
589 | class_unregister(&omap_mbox_class); | ||
590 | } | 410 | } |
591 | 411 | module_exit(omap_mbox_exit); | |
592 | subsys_initcall(omap_mbox_class_init); | ||
593 | module_exit(omap_mbox_class_exit); | ||
594 | 412 | ||
595 | MODULE_LICENSE("GPL v2"); | 413 | MODULE_LICENSE("GPL v2"); |
596 | MODULE_DESCRIPTION("omap mailbox: interrupt driven messaging"); | 414 | MODULE_DESCRIPTION("omap mailbox: interrupt driven messaging"); |
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c index e664b912d7bb..2cc1cc328bac 100644 --- a/arch/arm/plat-omap/mcbsp.c +++ b/arch/arm/plat-omap/mcbsp.c | |||
@@ -24,8 +24,8 @@ | |||
24 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | 26 | ||
27 | #include <mach/dma.h> | 27 | #include <plat/dma.h> |
28 | #include <mach/mcbsp.h> | 28 | #include <plat/mcbsp.h> |
29 | 29 | ||
30 | struct omap_mcbsp **mcbsp_ptr; | 30 | struct omap_mcbsp **mcbsp_ptr; |
31 | int omap_mcbsp_count; | 31 | int omap_mcbsp_count; |
@@ -298,9 +298,7 @@ int omap_mcbsp_get_dma_op_mode(unsigned int id) | |||
298 | } | 298 | } |
299 | mcbsp = id_to_mcbsp_ptr(id); | 299 | mcbsp = id_to_mcbsp_ptr(id); |
300 | 300 | ||
301 | spin_lock_irq(&mcbsp->lock); | ||
302 | dma_op_mode = mcbsp->dma_op_mode; | 301 | dma_op_mode = mcbsp->dma_op_mode; |
303 | spin_unlock_irq(&mcbsp->lock); | ||
304 | 302 | ||
305 | return dma_op_mode; | 303 | return dma_op_mode; |
306 | } | 304 | } |
@@ -318,7 +316,6 @@ static inline void omap34xx_mcbsp_request(struct omap_mcbsp *mcbsp) | |||
318 | syscon = OMAP_MCBSP_READ(mcbsp->io_base, SYSCON); | 316 | syscon = OMAP_MCBSP_READ(mcbsp->io_base, SYSCON); |
319 | syscon &= ~(ENAWAKEUP | SIDLEMODE(0x03) | CLOCKACTIVITY(0x03)); | 317 | syscon &= ~(ENAWAKEUP | SIDLEMODE(0x03) | CLOCKACTIVITY(0x03)); |
320 | 318 | ||
321 | spin_lock_irq(&mcbsp->lock); | ||
322 | if (mcbsp->dma_op_mode == MCBSP_DMA_MODE_THRESHOLD) { | 319 | if (mcbsp->dma_op_mode == MCBSP_DMA_MODE_THRESHOLD) { |
323 | syscon |= (ENAWAKEUP | SIDLEMODE(0x02) | | 320 | syscon |= (ENAWAKEUP | SIDLEMODE(0x02) | |
324 | CLOCKACTIVITY(0x02)); | 321 | CLOCKACTIVITY(0x02)); |
@@ -327,7 +324,6 @@ static inline void omap34xx_mcbsp_request(struct omap_mcbsp *mcbsp) | |||
327 | } else { | 324 | } else { |
328 | syscon |= SIDLEMODE(0x01); | 325 | syscon |= SIDLEMODE(0x01); |
329 | } | 326 | } |
330 | spin_unlock_irq(&mcbsp->lock); | ||
331 | 327 | ||
332 | OMAP_MCBSP_WRITE(mcbsp->io_base, SYSCON, syscon); | 328 | OMAP_MCBSP_WRITE(mcbsp->io_base, SYSCON, syscon); |
333 | } | 329 | } |
@@ -1145,9 +1141,7 @@ static ssize_t dma_op_mode_show(struct device *dev, | |||
1145 | ssize_t len = 0; | 1141 | ssize_t len = 0; |
1146 | const char * const *s; | 1142 | const char * const *s; |
1147 | 1143 | ||
1148 | spin_lock_irq(&mcbsp->lock); | ||
1149 | dma_op_mode = mcbsp->dma_op_mode; | 1144 | dma_op_mode = mcbsp->dma_op_mode; |
1150 | spin_unlock_irq(&mcbsp->lock); | ||
1151 | 1145 | ||
1152 | for (s = &dma_op_modes[i]; i < ARRAY_SIZE(dma_op_modes); s++, i++) { | 1146 | for (s = &dma_op_modes[i]; i < ARRAY_SIZE(dma_op_modes); s++, i++) { |
1153 | if (dma_op_mode == i) | 1147 | if (dma_op_mode == i) |
diff --git a/arch/arm/plat-omap/mux.c b/arch/arm/plat-omap/mux.c index 8d329fb20740..05aebcad215b 100644 --- a/arch/arm/plat-omap/mux.c +++ b/arch/arm/plat-omap/mux.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <linux/io.h> | 28 | #include <linux/io.h> |
29 | #include <asm/system.h> | 29 | #include <asm/system.h> |
30 | #include <linux/spinlock.h> | 30 | #include <linux/spinlock.h> |
31 | #include <mach/mux.h> | 31 | #include <plat/mux.h> |
32 | 32 | ||
33 | #ifdef CONFIG_OMAP_MUX | 33 | #ifdef CONFIG_OMAP_MUX |
34 | 34 | ||
diff --git a/arch/arm/plat-omap/omap-pm-noop.c b/arch/arm/plat-omap/omap-pm-noop.c index e98f0a2a6c26..186bca82cfab 100644 --- a/arch/arm/plat-omap/omap-pm-noop.c +++ b/arch/arm/plat-omap/omap-pm-noop.c | |||
@@ -22,9 +22,9 @@ | |||
22 | #include <linux/device.h> | 22 | #include <linux/device.h> |
23 | 23 | ||
24 | /* Interface documentation is in mach/omap-pm.h */ | 24 | /* Interface documentation is in mach/omap-pm.h */ |
25 | #include <mach/omap-pm.h> | 25 | #include <plat/omap-pm.h> |
26 | 26 | ||
27 | #include <mach/powerdomain.h> | 27 | #include <plat/powerdomain.h> |
28 | 28 | ||
29 | struct omap_opp *dsp_opps; | 29 | struct omap_opp *dsp_opps; |
30 | struct omap_opp *mpu_opps; | 30 | struct omap_opp *mpu_opps; |
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index 2c409fc6dd21..bb16e624a557 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c | |||
@@ -82,8 +82,8 @@ | |||
82 | #include <linux/err.h> | 82 | #include <linux/err.h> |
83 | #include <linux/io.h> | 83 | #include <linux/io.h> |
84 | 84 | ||
85 | #include <mach/omap_device.h> | 85 | #include <plat/omap_device.h> |
86 | #include <mach/omap_hwmod.h> | 86 | #include <plat/omap_hwmod.h> |
87 | 87 | ||
88 | /* These parameters are passed to _omap_device_{de,}activate() */ | 88 | /* These parameters are passed to _omap_device_{de,}activate() */ |
89 | #define USE_WAKEUP_LAT 0 | 89 | #define USE_WAKEUP_LAT 0 |
@@ -103,21 +103,6 @@ | |||
103 | /* Private functions */ | 103 | /* Private functions */ |
104 | 104 | ||
105 | /** | 105 | /** |
106 | * _read_32ksynct - read the OMAP 32K sync timer | ||
107 | * | ||
108 | * Returns the current value of the 32KiHz synchronization counter. | ||
109 | * XXX this should be generalized to simply read the system clocksource. | ||
110 | * XXX this should be moved to a separate synctimer32k.c file | ||
111 | */ | ||
112 | static u32 _read_32ksynct(void) | ||
113 | { | ||
114 | if (!cpu_class_is_omap2()) | ||
115 | BUG(); | ||
116 | |||
117 | return __raw_readl(OMAP2_IO_ADDRESS(OMAP_32KSYNCT_BASE + 0x010)); | ||
118 | } | ||
119 | |||
120 | /** | ||
121 | * _omap_device_activate - increase device readiness | 106 | * _omap_device_activate - increase device readiness |
122 | * @od: struct omap_device * | 107 | * @od: struct omap_device * |
123 | * @ignore_lat: increase to latency target (0) or full readiness (1)? | 108 | * @ignore_lat: increase to latency target (0) or full readiness (1)? |
@@ -133,13 +118,13 @@ static u32 _read_32ksynct(void) | |||
133 | */ | 118 | */ |
134 | static int _omap_device_activate(struct omap_device *od, u8 ignore_lat) | 119 | static int _omap_device_activate(struct omap_device *od, u8 ignore_lat) |
135 | { | 120 | { |
136 | u32 a, b; | 121 | struct timespec a, b, c; |
137 | 122 | ||
138 | pr_debug("omap_device: %s: activating\n", od->pdev.name); | 123 | pr_debug("omap_device: %s: activating\n", od->pdev.name); |
139 | 124 | ||
140 | while (od->pm_lat_level > 0) { | 125 | while (od->pm_lat_level > 0) { |
141 | struct omap_device_pm_latency *odpl; | 126 | struct omap_device_pm_latency *odpl; |
142 | int act_lat = 0; | 127 | unsigned long long act_lat = 0; |
143 | 128 | ||
144 | od->pm_lat_level--; | 129 | od->pm_lat_level--; |
145 | 130 | ||
@@ -149,20 +134,22 @@ static int _omap_device_activate(struct omap_device *od, u8 ignore_lat) | |||
149 | (od->dev_wakeup_lat <= od->_dev_wakeup_lat_limit)) | 134 | (od->dev_wakeup_lat <= od->_dev_wakeup_lat_limit)) |
150 | break; | 135 | break; |
151 | 136 | ||
152 | a = _read_32ksynct(); | 137 | getnstimeofday(&a); |
153 | 138 | ||
154 | /* XXX check return code */ | 139 | /* XXX check return code */ |
155 | odpl->activate_func(od); | 140 | odpl->activate_func(od); |
156 | 141 | ||
157 | b = _read_32ksynct(); | 142 | getnstimeofday(&b); |
158 | 143 | ||
159 | act_lat = (b - a) >> 15; /* 32KiHz cycles to microseconds */ | 144 | c = timespec_sub(b, a); |
145 | act_lat = timespec_to_ns(&c) * NSEC_PER_USEC; | ||
160 | 146 | ||
161 | pr_debug("omap_device: %s: pm_lat %d: activate: elapsed time " | 147 | pr_debug("omap_device: %s: pm_lat %d: activate: elapsed time " |
162 | "%d usec\n", od->pdev.name, od->pm_lat_level, act_lat); | 148 | "%llu usec\n", od->pdev.name, od->pm_lat_level, |
149 | act_lat); | ||
163 | 150 | ||
164 | WARN(act_lat > odpl->activate_lat, "omap_device: %s.%d: " | 151 | WARN(act_lat > odpl->activate_lat, "omap_device: %s.%d: " |
165 | "activate step %d took longer than expected (%d > %d)\n", | 152 | "activate step %d took longer than expected (%llu > %d)\n", |
166 | od->pdev.name, od->pdev.id, od->pm_lat_level, | 153 | od->pdev.name, od->pdev.id, od->pm_lat_level, |
167 | act_lat, odpl->activate_lat); | 154 | act_lat, odpl->activate_lat); |
168 | 155 | ||
@@ -188,13 +175,13 @@ static int _omap_device_activate(struct omap_device *od, u8 ignore_lat) | |||
188 | */ | 175 | */ |
189 | static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat) | 176 | static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat) |
190 | { | 177 | { |
191 | u32 a, b; | 178 | struct timespec a, b, c; |
192 | 179 | ||
193 | pr_debug("omap_device: %s: deactivating\n", od->pdev.name); | 180 | pr_debug("omap_device: %s: deactivating\n", od->pdev.name); |
194 | 181 | ||
195 | while (od->pm_lat_level < od->pm_lats_cnt) { | 182 | while (od->pm_lat_level < od->pm_lats_cnt) { |
196 | struct omap_device_pm_latency *odpl; | 183 | struct omap_device_pm_latency *odpl; |
197 | int deact_lat = 0; | 184 | unsigned long long deact_lat = 0; |
198 | 185 | ||
199 | odpl = od->pm_lats + od->pm_lat_level; | 186 | odpl = od->pm_lats + od->pm_lat_level; |
200 | 187 | ||
@@ -203,23 +190,24 @@ static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat) | |||
203 | od->_dev_wakeup_lat_limit)) | 190 | od->_dev_wakeup_lat_limit)) |
204 | break; | 191 | break; |
205 | 192 | ||
206 | a = _read_32ksynct(); | 193 | getnstimeofday(&a); |
207 | 194 | ||
208 | /* XXX check return code */ | 195 | /* XXX check return code */ |
209 | odpl->deactivate_func(od); | 196 | odpl->deactivate_func(od); |
210 | 197 | ||
211 | b = _read_32ksynct(); | 198 | getnstimeofday(&b); |
212 | 199 | ||
213 | deact_lat = (b - a) >> 15; /* 32KiHz cycles to microseconds */ | 200 | c = timespec_sub(b, a); |
201 | deact_lat = timespec_to_ns(&c) * NSEC_PER_USEC; | ||
214 | 202 | ||
215 | pr_debug("omap_device: %s: pm_lat %d: deactivate: elapsed time " | 203 | pr_debug("omap_device: %s: pm_lat %d: deactivate: elapsed time " |
216 | "%d usec\n", od->pdev.name, od->pm_lat_level, | 204 | "%llu usec\n", od->pdev.name, od->pm_lat_level, |
217 | deact_lat); | 205 | deact_lat); |
218 | 206 | ||
219 | WARN(deact_lat > odpl->deactivate_lat, "omap_device: %s.%d: " | 207 | WARN(deact_lat > odpl->deactivate_lat, "omap_device: %s.%d: " |
220 | "deactivate step %d took longer than expected (%d > %d)\n", | 208 | "deactivate step %d took longer than expected " |
221 | od->pdev.name, od->pdev.id, od->pm_lat_level, | 209 | "(%llu > %d)\n", od->pdev.name, od->pdev.id, |
222 | deact_lat, odpl->deactivate_lat); | 210 | od->pm_lat_level, deact_lat, odpl->deactivate_lat); |
223 | 211 | ||
224 | od->dev_wakeup_lat += odpl->activate_lat; | 212 | od->dev_wakeup_lat += odpl->activate_lat; |
225 | 213 | ||
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c index 75d1f26e5b17..3e923668778d 100644 --- a/arch/arm/plat-omap/sram.c +++ b/arch/arm/plat-omap/sram.c | |||
@@ -25,11 +25,11 @@ | |||
25 | 25 | ||
26 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
27 | 27 | ||
28 | #include <mach/sram.h> | 28 | #include <plat/sram.h> |
29 | #include <mach/board.h> | 29 | #include <plat/board.h> |
30 | #include <mach/cpu.h> | 30 | #include <plat/cpu.h> |
31 | 31 | ||
32 | #include <mach/control.h> | 32 | #include <plat/control.h> |
33 | 33 | ||
34 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) | 34 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) |
35 | # include "../mach-omap2/prm.h" | 35 | # include "../mach-omap2/prm.h" |
@@ -41,14 +41,14 @@ | |||
41 | #define OMAP1_SRAM_VA VMALLOC_END | 41 | #define OMAP1_SRAM_VA VMALLOC_END |
42 | #define OMAP2_SRAM_PA 0x40200000 | 42 | #define OMAP2_SRAM_PA 0x40200000 |
43 | #define OMAP2_SRAM_PUB_PA 0x4020f800 | 43 | #define OMAP2_SRAM_PUB_PA 0x4020f800 |
44 | #define OMAP2_SRAM_VA 0xe3000000 | 44 | #define OMAP2_SRAM_VA 0xfe400000 |
45 | #define OMAP2_SRAM_PUB_VA (OMAP2_SRAM_VA + 0x800) | 45 | #define OMAP2_SRAM_PUB_VA (OMAP2_SRAM_VA + 0x800) |
46 | #define OMAP3_SRAM_PA 0x40200000 | 46 | #define OMAP3_SRAM_PA 0x40200000 |
47 | #define OMAP3_SRAM_VA 0xe3000000 | 47 | #define OMAP3_SRAM_VA 0xfe400000 |
48 | #define OMAP3_SRAM_PUB_PA 0x40208000 | 48 | #define OMAP3_SRAM_PUB_PA 0x40208000 |
49 | #define OMAP3_SRAM_PUB_VA (OMAP3_SRAM_VA + 0x8000) | 49 | #define OMAP3_SRAM_PUB_VA (OMAP3_SRAM_VA + 0x8000) |
50 | #define OMAP4_SRAM_PA 0x40200000 /*0x402f0000*/ | 50 | #define OMAP4_SRAM_PA 0x40200000 /*0x402f0000*/ |
51 | #define OMAP4_SRAM_VA 0xd7000000 /*0xd70f0000*/ | 51 | #define OMAP4_SRAM_VA 0xfe400000 /*0xfe4f0000*/ |
52 | 52 | ||
53 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) | 53 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) |
54 | #define SRAM_BOOTLOADER_SZ 0x00 | 54 | #define SRAM_BOOTLOADER_SZ 0x00 |
@@ -56,16 +56,16 @@ | |||
56 | #define SRAM_BOOTLOADER_SZ 0x80 | 56 | #define SRAM_BOOTLOADER_SZ 0x80 |
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | #define OMAP24XX_VA_REQINFOPERM0 OMAP2_IO_ADDRESS(0x68005048) | 59 | #define OMAP24XX_VA_REQINFOPERM0 OMAP2_L3_IO_ADDRESS(0x68005048) |
60 | #define OMAP24XX_VA_READPERM0 OMAP2_IO_ADDRESS(0x68005050) | 60 | #define OMAP24XX_VA_READPERM0 OMAP2_L3_IO_ADDRESS(0x68005050) |
61 | #define OMAP24XX_VA_WRITEPERM0 OMAP2_IO_ADDRESS(0x68005058) | 61 | #define OMAP24XX_VA_WRITEPERM0 OMAP2_L3_IO_ADDRESS(0x68005058) |
62 | 62 | ||
63 | #define OMAP34XX_VA_REQINFOPERM0 OMAP2_IO_ADDRESS(0x68012848) | 63 | #define OMAP34XX_VA_REQINFOPERM0 OMAP2_L3_IO_ADDRESS(0x68012848) |
64 | #define OMAP34XX_VA_READPERM0 OMAP2_IO_ADDRESS(0x68012850) | 64 | #define OMAP34XX_VA_READPERM0 OMAP2_L3_IO_ADDRESS(0x68012850) |
65 | #define OMAP34XX_VA_WRITEPERM0 OMAP2_IO_ADDRESS(0x68012858) | 65 | #define OMAP34XX_VA_WRITEPERM0 OMAP2_L3_IO_ADDRESS(0x68012858) |
66 | #define OMAP34XX_VA_ADDR_MATCH2 OMAP2_IO_ADDRESS(0x68012880) | 66 | #define OMAP34XX_VA_ADDR_MATCH2 OMAP2_L3_IO_ADDRESS(0x68012880) |
67 | #define OMAP34XX_VA_SMS_RG_ATT0 OMAP2_IO_ADDRESS(0x6C000048) | 67 | #define OMAP34XX_VA_SMS_RG_ATT0 OMAP2_L3_IO_ADDRESS(0x6C000048) |
68 | #define OMAP34XX_VA_CONTROL_STAT OMAP2_IO_ADDRESS(0x480022F0) | 68 | #define OMAP34XX_VA_CONTROL_STAT OMAP2_L4_IO_ADDRESS(0x480022F0) |
69 | 69 | ||
70 | #define GP_DEVICE 0x300 | 70 | #define GP_DEVICE 0x300 |
71 | 71 | ||
@@ -396,22 +396,24 @@ u32 omap3_configure_core_dpll(u32 m2, u32 unlock_dll, u32 f, u32 inc, | |||
396 | sdrc_actim_ctrl_b_1, sdrc_mr_1); | 396 | sdrc_actim_ctrl_b_1, sdrc_mr_1); |
397 | } | 397 | } |
398 | 398 | ||
399 | /* REVISIT: Should this be same as omap34xx_sram_init() after off-idle? */ | 399 | #ifdef CONFIG_PM |
400 | void restore_sram_functions(void) | 400 | void omap3_sram_restore_context(void) |
401 | { | 401 | { |
402 | omap_sram_ceil = omap_sram_base + omap_sram_size; | 402 | omap_sram_ceil = omap_sram_base + omap_sram_size; |
403 | 403 | ||
404 | _omap3_sram_configure_core_dpll = | 404 | _omap3_sram_configure_core_dpll = |
405 | omap_sram_push(omap3_sram_configure_core_dpll, | 405 | omap_sram_push(omap3_sram_configure_core_dpll, |
406 | omap3_sram_configure_core_dpll_sz); | 406 | omap3_sram_configure_core_dpll_sz); |
407 | omap_push_sram_idle(); | ||
407 | } | 408 | } |
409 | #endif /* CONFIG_PM */ | ||
408 | 410 | ||
409 | int __init omap34xx_sram_init(void) | 411 | int __init omap34xx_sram_init(void) |
410 | { | 412 | { |
411 | _omap3_sram_configure_core_dpll = | 413 | _omap3_sram_configure_core_dpll = |
412 | omap_sram_push(omap3_sram_configure_core_dpll, | 414 | omap_sram_push(omap3_sram_configure_core_dpll, |
413 | omap3_sram_configure_core_dpll_sz); | 415 | omap3_sram_configure_core_dpll_sz); |
414 | 416 | omap_push_sram_idle(); | |
415 | return 0; | 417 | return 0; |
416 | } | 418 | } |
417 | #else | 419 | #else |
diff --git a/arch/arm/plat-omap/usb.c b/arch/arm/plat-omap/usb.c index 509f2ed99e21..51033a4503c3 100644 --- a/arch/arm/plat-omap/usb.c +++ b/arch/arm/plat-omap/usb.c | |||
@@ -33,10 +33,10 @@ | |||
33 | #include <asm/system.h> | 33 | #include <asm/system.h> |
34 | #include <mach/hardware.h> | 34 | #include <mach/hardware.h> |
35 | 35 | ||
36 | #include <mach/control.h> | 36 | #include <plat/control.h> |
37 | #include <mach/mux.h> | 37 | #include <plat/mux.h> |
38 | #include <mach/usb.h> | 38 | #include <plat/usb.h> |
39 | #include <mach/board.h> | 39 | #include <plat/board.h> |
40 | 40 | ||
41 | #ifdef CONFIG_ARCH_OMAP1 | 41 | #ifdef CONFIG_ARCH_OMAP1 |
42 | 42 | ||
@@ -159,11 +159,14 @@ static u32 __init omap_usb0_init(unsigned nwires, unsigned is_device) | |||
159 | * - OTG support on this port not yet written | 159 | * - OTG support on this port not yet written |
160 | */ | 160 | */ |
161 | 161 | ||
162 | l = omap_readl(USB_TRANSCEIVER_CTRL); | 162 | /* Don't do this for omap7xx -- it causes USB to not work correctly */ |
163 | l &= ~(7 << 4); | 163 | if (!cpu_is_omap7xx()) { |
164 | if (!is_device) | 164 | l = omap_readl(USB_TRANSCEIVER_CTRL); |
165 | l |= (3 << 1); | 165 | l &= ~(7 << 4); |
166 | omap_writel(l, USB_TRANSCEIVER_CTRL); | 166 | if (!is_device) |
167 | l |= (3 << 1); | ||
168 | omap_writel(l, USB_TRANSCEIVER_CTRL); | ||
169 | } | ||
167 | 170 | ||
168 | return 3 << 16; | 171 | return 3 << 16; |
169 | } | 172 | } |
@@ -603,7 +606,12 @@ omap_otg_init(struct omap_usb_config *config) | |||
603 | if (config->otg || config->register_dev) { | 606 | if (config->otg || config->register_dev) { |
604 | syscon &= ~DEV_IDLE_EN; | 607 | syscon &= ~DEV_IDLE_EN; |
605 | udc_device.dev.platform_data = config; | 608 | udc_device.dev.platform_data = config; |
606 | /* FIXME patch IRQ numbers for omap730 */ | 609 | /* IRQ numbers for omap7xx */ |
610 | if(cpu_is_omap7xx()) { | ||
611 | udc_resources[1].start = INT_7XX_USB_GENI; | ||
612 | udc_resources[2].start = INT_7XX_USB_NON_ISO; | ||
613 | udc_resources[3].start = INT_7XX_USB_ISO; | ||
614 | } | ||
607 | status = platform_device_register(&udc_device); | 615 | status = platform_device_register(&udc_device); |
608 | if (status) | 616 | if (status) |
609 | pr_debug("can't register UDC device, %d\n", status); | 617 | pr_debug("can't register UDC device, %d\n", status); |
@@ -614,8 +622,8 @@ omap_otg_init(struct omap_usb_config *config) | |||
614 | if (config->otg || config->register_host) { | 622 | if (config->otg || config->register_host) { |
615 | syscon &= ~HST_IDLE_EN; | 623 | syscon &= ~HST_IDLE_EN; |
616 | ohci_device.dev.platform_data = config; | 624 | ohci_device.dev.platform_data = config; |
617 | if (cpu_is_omap730()) | 625 | if (cpu_is_omap7xx()) |
618 | ohci_resources[1].start = INT_730_USB_HHC_1; | 626 | ohci_resources[1].start = INT_7XX_USB_HHC_1; |
619 | status = platform_device_register(&ohci_device); | 627 | status = platform_device_register(&ohci_device); |
620 | if (status) | 628 | if (status) |
621 | pr_debug("can't register OHCI device, %d\n", status); | 629 | pr_debug("can't register OHCI device, %d\n", status); |
@@ -626,8 +634,8 @@ omap_otg_init(struct omap_usb_config *config) | |||
626 | if (config->otg) { | 634 | if (config->otg) { |
627 | syscon &= ~OTG_IDLE_EN; | 635 | syscon &= ~OTG_IDLE_EN; |
628 | otg_device.dev.platform_data = config; | 636 | otg_device.dev.platform_data = config; |
629 | if (cpu_is_omap730()) | 637 | if (cpu_is_omap7xx()) |
630 | otg_resources[1].start = INT_730_USB_OTG; | 638 | otg_resources[1].start = INT_7XX_USB_OTG; |
631 | status = platform_device_register(&otg_device); | 639 | status = platform_device_register(&otg_device); |
632 | if (status) | 640 | if (status) |
633 | pr_debug("can't register OTG device, %d\n", status); | 641 | pr_debug("can't register OTG device, %d\n", status); |
@@ -731,7 +739,7 @@ static inline void omap_1510_usb_init(struct omap_usb_config *config) {} | |||
731 | 739 | ||
732 | void __init omap_usb_init(struct omap_usb_config *pdata) | 740 | void __init omap_usb_init(struct omap_usb_config *pdata) |
733 | { | 741 | { |
734 | if (cpu_is_omap730() || cpu_is_omap16xx() || cpu_is_omap24xx()) | 742 | if (cpu_is_omap7xx() || cpu_is_omap16xx() || cpu_is_omap24xx()) |
735 | omap_otg_init(pdata); | 743 | omap_otg_init(pdata); |
736 | else if (cpu_is_omap15xx()) | 744 | else if (cpu_is_omap15xx()) |
737 | omap_1510_usb_init(pdata); | 745 | omap_1510_usb_init(pdata); |