diff options
author | Tony Lindgren <tony@atomide.com> | 2009-08-28 13:50:33 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2009-08-28 13:50:33 -0400 |
commit | 941132606c7611246d2034cb7b01f9270c2d1ede (patch) | |
tree | e53a618c4e98d3716551afa2e6cfae2be81056a0 /arch/arm/plat-omap | |
parent | 326ba5010a5429a5a528b268b36a5900d4ab0eba (diff) |
OMAP: Remove OMAP_IO_ADDRESS, use OMAP1_IO_ADDRESS and OMAP2_IO_ADDRESS instead
Search and replace OMAP_IO_ADDRESS with OMAP1_IO_ADDRESS and OMAP2_IO_ADDRESS,
and convert omap_read/write into a functions instead of a macros.
Also rename OMAP_MPUIO_VBASE to OMAP1_MPUIO_VBASE.
In the long run, most code should use ioremap + __raw_read/write instead.
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r-- | arch/arm/plat-omap/dma.c | 8 | ||||
-rw-r--r-- | arch/arm/plat-omap/dmtimer.c | 5 | ||||
-rw-r--r-- | arch/arm/plat-omap/gpio.c | 86 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/control.h | 12 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/entry-macro.S | 8 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/io.h | 64 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/mtd-xip.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/omap44xx.h | 8 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/sdrc.h | 6 | ||||
-rw-r--r-- | arch/arm/plat-omap/io.c | 58 | ||||
-rw-r--r-- | arch/arm/plat-omap/sram.c | 20 |
11 files changed, 158 insertions, 119 deletions
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index e3ac94f09006..bf0863462101 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c | |||
@@ -2337,16 +2337,16 @@ static int __init omap_init_dma(void) | |||
2337 | int ch, r; | 2337 | int ch, r; |
2338 | 2338 | ||
2339 | if (cpu_class_is_omap1()) { | 2339 | if (cpu_class_is_omap1()) { |
2340 | omap_dma_base = IO_ADDRESS(OMAP1_DMA_BASE); | 2340 | omap_dma_base = OMAP1_IO_ADDRESS(OMAP1_DMA_BASE); |
2341 | dma_lch_count = OMAP1_LOGICAL_DMA_CH_COUNT; | 2341 | dma_lch_count = OMAP1_LOGICAL_DMA_CH_COUNT; |
2342 | } else if (cpu_is_omap24xx()) { | 2342 | } else if (cpu_is_omap24xx()) { |
2343 | omap_dma_base = IO_ADDRESS(OMAP24XX_DMA4_BASE); | 2343 | omap_dma_base = OMAP2_IO_ADDRESS(OMAP24XX_DMA4_BASE); |
2344 | dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; | 2344 | dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; |
2345 | } else if (cpu_is_omap34xx()) { | 2345 | } else if (cpu_is_omap34xx()) { |
2346 | omap_dma_base = IO_ADDRESS(OMAP34XX_DMA4_BASE); | 2346 | omap_dma_base = OMAP2_IO_ADDRESS(OMAP34XX_DMA4_BASE); |
2347 | dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; | 2347 | dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; |
2348 | } else if (cpu_is_omap44xx()) { | 2348 | } else if (cpu_is_omap44xx()) { |
2349 | omap_dma_base = IO_ADDRESS(OMAP44XX_DMA4_BASE); | 2349 | omap_dma_base = OMAP2_IO_ADDRESS(OMAP44XX_DMA4_BASE); |
2350 | dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; | 2350 | dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT; |
2351 | } else { | 2351 | } else { |
2352 | pr_err("DMA init failed for unsupported omap\n"); | 2352 | pr_err("DMA init failed for unsupported omap\n"); |
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index 7f50b6103dee..d325b54daeb5 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c | |||
@@ -774,7 +774,10 @@ int __init omap_dm_timer_init(void) | |||
774 | 774 | ||
775 | for (i = 0; i < dm_timer_count; i++) { | 775 | for (i = 0; i < dm_timer_count; i++) { |
776 | timer = &dm_timers[i]; | 776 | timer = &dm_timers[i]; |
777 | timer->io_base = IO_ADDRESS(timer->phys_base); | 777 | if (cpu_class_is_omap1()) |
778 | timer->io_base = OMAP1_IO_ADDRESS(timer->phys_base); | ||
779 | else | ||
780 | timer->io_base = OMAP2_IO_ADDRESS(timer->phys_base); | ||
778 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \ | 781 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \ |
779 | defined(CONFIG_ARCH_OMAP4) | 782 | defined(CONFIG_ARCH_OMAP4) |
780 | if (cpu_class_is_omap2()) { | 783 | if (cpu_class_is_omap2()) { |
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index 9298bc0ab171..fd63dd3bf4cd 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 IO_ADDRESS(0xfffce000) | 34 | #define OMAP1510_GPIO_BASE OMAP1_IO_ADDRESS(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 IO_ADDRESS(0xfffbe400) | 48 | #define OMAP1610_GPIO1_BASE OMAP1_IO_ADDRESS(0xfffbe400) |
49 | #define OMAP1610_GPIO2_BASE IO_ADDRESS(0xfffbec00) | 49 | #define OMAP1610_GPIO2_BASE OMAP1_IO_ADDRESS(0xfffbec00) |
50 | #define OMAP1610_GPIO3_BASE IO_ADDRESS(0xfffbb400) | 50 | #define OMAP1610_GPIO3_BASE OMAP1_IO_ADDRESS(0xfffbb400) |
51 | #define OMAP1610_GPIO4_BASE IO_ADDRESS(0xfffbbc00) | 51 | #define OMAP1610_GPIO4_BASE OMAP1_IO_ADDRESS(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 |
@@ -70,12 +70,12 @@ | |||
70 | /* | 70 | /* |
71 | * OMAP730 specific GPIO registers | 71 | * OMAP730 specific GPIO registers |
72 | */ | 72 | */ |
73 | #define OMAP730_GPIO1_BASE IO_ADDRESS(0xfffbc000) | 73 | #define OMAP730_GPIO1_BASE OMAP1_IO_ADDRESS(0xfffbc000) |
74 | #define OMAP730_GPIO2_BASE IO_ADDRESS(0xfffbc800) | 74 | #define OMAP730_GPIO2_BASE OMAP1_IO_ADDRESS(0xfffbc800) |
75 | #define OMAP730_GPIO3_BASE IO_ADDRESS(0xfffbd000) | 75 | #define OMAP730_GPIO3_BASE OMAP1_IO_ADDRESS(0xfffbd000) |
76 | #define OMAP730_GPIO4_BASE IO_ADDRESS(0xfffbd800) | 76 | #define OMAP730_GPIO4_BASE OMAP1_IO_ADDRESS(0xfffbd800) |
77 | #define OMAP730_GPIO5_BASE IO_ADDRESS(0xfffbe000) | 77 | #define OMAP730_GPIO5_BASE OMAP1_IO_ADDRESS(0xfffbe000) |
78 | #define OMAP730_GPIO6_BASE IO_ADDRESS(0xfffbe800) | 78 | #define OMAP730_GPIO6_BASE OMAP1_IO_ADDRESS(0xfffbe800) |
79 | #define OMAP730_GPIO_DATA_INPUT 0x00 | 79 | #define OMAP730_GPIO_DATA_INPUT 0x00 |
80 | #define OMAP730_GPIO_DATA_OUTPUT 0x04 | 80 | #define OMAP730_GPIO_DATA_OUTPUT 0x04 |
81 | #define OMAP730_GPIO_DIR_CONTROL 0x08 | 81 | #define OMAP730_GPIO_DIR_CONTROL 0x08 |
@@ -86,12 +86,12 @@ | |||
86 | /* | 86 | /* |
87 | * OMAP850 specific GPIO registers | 87 | * OMAP850 specific GPIO registers |
88 | */ | 88 | */ |
89 | #define OMAP850_GPIO1_BASE IO_ADDRESS(0xfffbc000) | 89 | #define OMAP850_GPIO1_BASE OMAP1_IO_ADDRESS(0xfffbc000) |
90 | #define OMAP850_GPIO2_BASE IO_ADDRESS(0xfffbc800) | 90 | #define OMAP850_GPIO2_BASE OMAP1_IO_ADDRESS(0xfffbc800) |
91 | #define OMAP850_GPIO3_BASE IO_ADDRESS(0xfffbd000) | 91 | #define OMAP850_GPIO3_BASE OMAP1_IO_ADDRESS(0xfffbd000) |
92 | #define OMAP850_GPIO4_BASE IO_ADDRESS(0xfffbd800) | 92 | #define OMAP850_GPIO4_BASE OMAP1_IO_ADDRESS(0xfffbd800) |
93 | #define OMAP850_GPIO5_BASE IO_ADDRESS(0xfffbe000) | 93 | #define OMAP850_GPIO5_BASE OMAP1_IO_ADDRESS(0xfffbe000) |
94 | #define OMAP850_GPIO6_BASE IO_ADDRESS(0xfffbe800) | 94 | #define OMAP850_GPIO6_BASE OMAP1_IO_ADDRESS(0xfffbe800) |
95 | #define OMAP850_GPIO_DATA_INPUT 0x00 | 95 | #define OMAP850_GPIO_DATA_INPUT 0x00 |
96 | #define OMAP850_GPIO_DATA_OUTPUT 0x04 | 96 | #define OMAP850_GPIO_DATA_OUTPUT 0x04 |
97 | #define OMAP850_GPIO_DIR_CONTROL 0x08 | 97 | #define OMAP850_GPIO_DIR_CONTROL 0x08 |
@@ -99,19 +99,21 @@ | |||
99 | #define OMAP850_GPIO_INT_MASK 0x10 | 99 | #define OMAP850_GPIO_INT_MASK 0x10 |
100 | #define OMAP850_GPIO_INT_STATUS 0x14 | 100 | #define OMAP850_GPIO_INT_STATUS 0x14 |
101 | 101 | ||
102 | #define OMAP1_MPUIO_VBASE OMAP1_IO_ADDRESS(OMAP_MPUIO_BASE) | ||
103 | |||
102 | /* | 104 | /* |
103 | * omap24xx specific GPIO registers | 105 | * omap24xx specific GPIO registers |
104 | */ | 106 | */ |
105 | #define OMAP242X_GPIO1_BASE IO_ADDRESS(0x48018000) | 107 | #define OMAP242X_GPIO1_BASE OMAP2_IO_ADDRESS(0x48018000) |
106 | #define OMAP242X_GPIO2_BASE IO_ADDRESS(0x4801a000) | 108 | #define OMAP242X_GPIO2_BASE OMAP2_IO_ADDRESS(0x4801a000) |
107 | #define OMAP242X_GPIO3_BASE IO_ADDRESS(0x4801c000) | 109 | #define OMAP242X_GPIO3_BASE OMAP2_IO_ADDRESS(0x4801c000) |
108 | #define OMAP242X_GPIO4_BASE IO_ADDRESS(0x4801e000) | 110 | #define OMAP242X_GPIO4_BASE OMAP2_IO_ADDRESS(0x4801e000) |
109 | 111 | ||
110 | #define OMAP243X_GPIO1_BASE IO_ADDRESS(0x4900C000) | 112 | #define OMAP243X_GPIO1_BASE OMAP2_IO_ADDRESS(0x4900C000) |
111 | #define OMAP243X_GPIO2_BASE IO_ADDRESS(0x4900E000) | 113 | #define OMAP243X_GPIO2_BASE OMAP2_IO_ADDRESS(0x4900E000) |
112 | #define OMAP243X_GPIO3_BASE IO_ADDRESS(0x49010000) | 114 | #define OMAP243X_GPIO3_BASE OMAP2_IO_ADDRESS(0x49010000) |
113 | #define OMAP243X_GPIO4_BASE IO_ADDRESS(0x49012000) | 115 | #define OMAP243X_GPIO4_BASE OMAP2_IO_ADDRESS(0x49012000) |
114 | #define OMAP243X_GPIO5_BASE IO_ADDRESS(0x480B6000) | 116 | #define OMAP243X_GPIO5_BASE OMAP2_IO_ADDRESS(0x480B6000) |
115 | 117 | ||
116 | #define OMAP24XX_GPIO_REVISION 0x0000 | 118 | #define OMAP24XX_GPIO_REVISION 0x0000 |
117 | #define OMAP24XX_GPIO_SYSCONFIG 0x0010 | 119 | #define OMAP24XX_GPIO_SYSCONFIG 0x0010 |
@@ -142,24 +144,22 @@ | |||
142 | * omap34xx specific GPIO registers | 144 | * omap34xx specific GPIO registers |
143 | */ | 145 | */ |
144 | 146 | ||
145 | #define OMAP34XX_GPIO1_BASE IO_ADDRESS(0x48310000) | 147 | #define OMAP34XX_GPIO1_BASE OMAP2_IO_ADDRESS(0x48310000) |
146 | #define OMAP34XX_GPIO2_BASE IO_ADDRESS(0x49050000) | 148 | #define OMAP34XX_GPIO2_BASE OMAP2_IO_ADDRESS(0x49050000) |
147 | #define OMAP34XX_GPIO3_BASE IO_ADDRESS(0x49052000) | 149 | #define OMAP34XX_GPIO3_BASE OMAP2_IO_ADDRESS(0x49052000) |
148 | #define OMAP34XX_GPIO4_BASE IO_ADDRESS(0x49054000) | 150 | #define OMAP34XX_GPIO4_BASE OMAP2_IO_ADDRESS(0x49054000) |
149 | #define OMAP34XX_GPIO5_BASE IO_ADDRESS(0x49056000) | 151 | #define OMAP34XX_GPIO5_BASE OMAP2_IO_ADDRESS(0x49056000) |
150 | #define OMAP34XX_GPIO6_BASE IO_ADDRESS(0x49058000) | 152 | #define OMAP34XX_GPIO6_BASE OMAP2_IO_ADDRESS(0x49058000) |
151 | 153 | ||
152 | /* | 154 | /* |
153 | * OMAP44XX specific GPIO registers | 155 | * OMAP44XX specific GPIO registers |
154 | */ | 156 | */ |
155 | #define OMAP44XX_GPIO1_BASE IO_ADDRESS(0x4a310000) | 157 | #define OMAP44XX_GPIO1_BASE OMAP2_IO_ADDRESS(0x4a310000) |
156 | #define OMAP44XX_GPIO2_BASE IO_ADDRESS(0x48055000) | 158 | #define OMAP44XX_GPIO2_BASE OMAP2_IO_ADDRESS(0x48055000) |
157 | #define OMAP44XX_GPIO3_BASE IO_ADDRESS(0x48057000) | 159 | #define OMAP44XX_GPIO3_BASE OMAP2_IO_ADDRESS(0x48057000) |
158 | #define OMAP44XX_GPIO4_BASE IO_ADDRESS(0x48059000) | 160 | #define OMAP44XX_GPIO4_BASE OMAP2_IO_ADDRESS(0x48059000) |
159 | #define OMAP44XX_GPIO5_BASE IO_ADDRESS(0x4805B000) | 161 | #define OMAP44XX_GPIO5_BASE OMAP2_IO_ADDRESS(0x4805B000) |
160 | #define OMAP44XX_GPIO6_BASE IO_ADDRESS(0x4805D000) | 162 | #define OMAP44XX_GPIO6_BASE OMAP2_IO_ADDRESS(0x4805D000) |
161 | |||
162 | #define OMAP_MPUIO_VBASE IO_ADDRESS(OMAP_MPUIO_BASE) | ||
163 | 163 | ||
164 | struct gpio_bank { | 164 | struct gpio_bank { |
165 | void __iomem *base; | 165 | void __iomem *base; |
@@ -195,7 +195,7 @@ struct gpio_bank { | |||
195 | 195 | ||
196 | #ifdef CONFIG_ARCH_OMAP16XX | 196 | #ifdef CONFIG_ARCH_OMAP16XX |
197 | static struct gpio_bank gpio_bank_1610[5] = { | 197 | static struct gpio_bank gpio_bank_1610[5] = { |
198 | { OMAP_MPUIO_VBASE, INT_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO}, | 198 | { OMAP1_MPUIO_VBASE, INT_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO}, |
199 | { OMAP1610_GPIO1_BASE, INT_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_1610 }, | 199 | { OMAP1610_GPIO1_BASE, INT_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_1610 }, |
200 | { OMAP1610_GPIO2_BASE, INT_1610_GPIO_BANK2, IH_GPIO_BASE + 16, METHOD_GPIO_1610 }, | 200 | { OMAP1610_GPIO2_BASE, INT_1610_GPIO_BANK2, IH_GPIO_BASE + 16, METHOD_GPIO_1610 }, |
201 | { OMAP1610_GPIO3_BASE, INT_1610_GPIO_BANK3, IH_GPIO_BASE + 32, METHOD_GPIO_1610 }, | 201 | { OMAP1610_GPIO3_BASE, INT_1610_GPIO_BANK3, IH_GPIO_BASE + 32, METHOD_GPIO_1610 }, |
@@ -205,14 +205,14 @@ static struct gpio_bank gpio_bank_1610[5] = { | |||
205 | 205 | ||
206 | #ifdef CONFIG_ARCH_OMAP15XX | 206 | #ifdef CONFIG_ARCH_OMAP15XX |
207 | static struct gpio_bank gpio_bank_1510[2] = { | 207 | static struct gpio_bank gpio_bank_1510[2] = { |
208 | { OMAP_MPUIO_VBASE, INT_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO }, | 208 | { OMAP1_MPUIO_VBASE, INT_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO }, |
209 | { OMAP1510_GPIO_BASE, INT_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_1510 } | 209 | { OMAP1510_GPIO_BASE, INT_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_1510 } |
210 | }; | 210 | }; |
211 | #endif | 211 | #endif |
212 | 212 | ||
213 | #ifdef CONFIG_ARCH_OMAP730 | 213 | #ifdef CONFIG_ARCH_OMAP730 |
214 | static struct gpio_bank gpio_bank_730[7] = { | 214 | static struct gpio_bank gpio_bank_730[7] = { |
215 | { OMAP_MPUIO_VBASE, INT_730_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO }, | 215 | { OMAP1_MPUIO_VBASE, INT_730_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO }, |
216 | { OMAP730_GPIO1_BASE, INT_730_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_730 }, | 216 | { OMAP730_GPIO1_BASE, INT_730_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_730 }, |
217 | { OMAP730_GPIO2_BASE, INT_730_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_730 }, | 217 | { OMAP730_GPIO2_BASE, INT_730_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_730 }, |
218 | { OMAP730_GPIO3_BASE, INT_730_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_730 }, | 218 | { OMAP730_GPIO3_BASE, INT_730_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_730 }, |
diff --git a/arch/arm/plat-omap/include/mach/control.h b/arch/arm/plat-omap/include/mach/control.h index 8140dbccb7bc..826d317cdbec 100644 --- a/arch/arm/plat-omap/include/mach/control.h +++ b/arch/arm/plat-omap/include/mach/control.h | |||
@@ -20,15 +20,15 @@ | |||
20 | 20 | ||
21 | #ifndef __ASSEMBLY__ | 21 | #ifndef __ASSEMBLY__ |
22 | #define OMAP242X_CTRL_REGADDR(reg) \ | 22 | #define OMAP242X_CTRL_REGADDR(reg) \ |
23 | IO_ADDRESS(OMAP242X_CTRL_BASE + (reg)) | 23 | OMAP2_IO_ADDRESS(OMAP242X_CTRL_BASE + (reg)) |
24 | #define OMAP243X_CTRL_REGADDR(reg) \ | 24 | #define OMAP243X_CTRL_REGADDR(reg) \ |
25 | IO_ADDRESS(OMAP243X_CTRL_BASE + (reg)) | 25 | OMAP2_IO_ADDRESS(OMAP243X_CTRL_BASE + (reg)) |
26 | #define OMAP343X_CTRL_REGADDR(reg) \ | 26 | #define OMAP343X_CTRL_REGADDR(reg) \ |
27 | IO_ADDRESS(OMAP343X_CTRL_BASE + (reg)) | 27 | OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE + (reg)) |
28 | #else | 28 | #else |
29 | #define OMAP242X_CTRL_REGADDR(reg) IO_ADDRESS(OMAP242X_CTRL_BASE + (reg)) | 29 | #define OMAP242X_CTRL_REGADDR(reg) OMAP2_IO_ADDRESS(OMAP242X_CTRL_BASE + (reg)) |
30 | #define OMAP243X_CTRL_REGADDR(reg) IO_ADDRESS(OMAP243X_CTRL_BASE + (reg)) | 30 | #define OMAP243X_CTRL_REGADDR(reg) OMAP2_IO_ADDRESS(OMAP243X_CTRL_BASE + (reg)) |
31 | #define OMAP343X_CTRL_REGADDR(reg) IO_ADDRESS(OMAP343X_CTRL_BASE + (reg)) | 31 | #define OMAP343X_CTRL_REGADDR(reg) OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE + (reg)) |
32 | #endif /* __ASSEMBLY__ */ | 32 | #endif /* __ASSEMBLY__ */ |
33 | 33 | ||
34 | /* | 34 | /* |
diff --git a/arch/arm/plat-omap/include/mach/entry-macro.S b/arch/arm/plat-omap/include/mach/entry-macro.S index 56426ed45ef4..a5592991634d 100644 --- a/arch/arm/plat-omap/include/mach/entry-macro.S +++ b/arch/arm/plat-omap/include/mach/entry-macro.S | |||
@@ -41,7 +41,7 @@ | |||
41 | .endm | 41 | .endm |
42 | 42 | ||
43 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 43 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
44 | ldr \base, =IO_ADDRESS(OMAP_IH1_BASE) | 44 | ldr \base, =OMAP1_IO_ADDRESS(OMAP_IH1_BASE) |
45 | ldr \irqnr, [\base, #IRQ_ITR_REG_OFFSET] | 45 | ldr \irqnr, [\base, #IRQ_ITR_REG_OFFSET] |
46 | ldr \tmp, [\base, #IRQ_MIR_REG_OFFSET] | 46 | ldr \tmp, [\base, #IRQ_MIR_REG_OFFSET] |
47 | mov \irqstat, #0xffffffff | 47 | mov \irqstat, #0xffffffff |
@@ -53,7 +53,7 @@ | |||
53 | cmp \irqnr, #0 | 53 | cmp \irqnr, #0 |
54 | ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET] | 54 | ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET] |
55 | cmpeq \irqnr, #INT_IH2_IRQ | 55 | cmpeq \irqnr, #INT_IH2_IRQ |
56 | ldreq \base, =IO_ADDRESS(OMAP_IH2_BASE) | 56 | ldreq \base, =OMAP1_IO_ADDRESS(OMAP_IH2_BASE) |
57 | ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET] | 57 | ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET] |
58 | addeqs \irqnr, \irqnr, #32 | 58 | addeqs \irqnr, \irqnr, #32 |
59 | 1510: | 59 | 1510: |
@@ -68,9 +68,9 @@ | |||
68 | 68 | ||
69 | /* REVISIT: This should be set dynamically if CONFIG_MULTI_OMAP2 is selected */ | 69 | /* REVISIT: This should be set dynamically if CONFIG_MULTI_OMAP2 is selected */ |
70 | #if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) | 70 | #if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) |
71 | #define OMAP2_VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE) | 71 | #define OMAP2_VA_IC_BASE OMAP2_IO_ADDRESS(OMAP24XX_IC_BASE) |
72 | #elif defined(CONFIG_ARCH_OMAP34XX) | 72 | #elif defined(CONFIG_ARCH_OMAP34XX) |
73 | #define OMAP2_VA_IC_BASE IO_ADDRESS(OMAP34XX_IC_BASE) | 73 | #define OMAP2_VA_IC_BASE OMAP2_IO_ADDRESS(OMAP34XX_IC_BASE) |
74 | #endif | 74 | #endif |
75 | #if defined(CONFIG_ARCH_OMAP4) | 75 | #if defined(CONFIG_ARCH_OMAP4) |
76 | #include <mach/omap44xx.h> | 76 | #include <mach/omap44xx.h> |
diff --git a/arch/arm/plat-omap/include/mach/io.h b/arch/arm/plat-omap/include/mach/io.h index 21fb0efdda86..55659809478e 100644 --- a/arch/arm/plat-omap/include/mach/io.h +++ b/arch/arm/plat-omap/include/mach/io.h | |||
@@ -54,15 +54,23 @@ | |||
54 | * ---------------------------------------------------------------------------- | 54 | * ---------------------------------------------------------------------------- |
55 | */ | 55 | */ |
56 | 56 | ||
57 | #ifdef __ASSEMBLER__ | ||
58 | #define IOMEM(x) (x) | ||
59 | #else | ||
60 | #define IOMEM(x) ((void __force __iomem *)(x)) | ||
61 | #endif | ||
62 | |||
63 | #define OMAP1_IO_OFFSET 0x01000000 /* Virtual IO = 0xfefb0000 */ | ||
64 | #define OMAP1_IO_ADDRESS(pa) IOMEM((pa) - OMAP1_IO_OFFSET) | ||
65 | |||
66 | #define OMAP2_IO_OFFSET 0x90000000 | ||
67 | #define OMAP2_IO_ADDRESS(pa) IOMEM((pa) + OMAP2_IO_OFFSET) /* L3 and L4 */ | ||
68 | |||
57 | #if defined(CONFIG_ARCH_OMAP1) | 69 | #if defined(CONFIG_ARCH_OMAP1) |
58 | 70 | ||
59 | #define IO_PHYS 0xFFFB0000 | 71 | #define IO_PHYS 0xFFFB0000 |
60 | #define IO_OFFSET 0x01000000 /* Virtual IO = 0xfefb0000 */ | ||
61 | #define IO_SIZE 0x40000 | 72 | #define IO_SIZE 0x40000 |
62 | #define IO_VIRT (IO_PHYS - IO_OFFSET) | 73 | #define IO_VIRT (IO_PHYS - OMAP1_IO_OFFSET) |
63 | #define __IO_ADDRESS(pa) ((pa) - IO_OFFSET) | ||
64 | #define __OMAP1_IO_ADDRESS(pa) ((pa) - IO_OFFSET) | ||
65 | #define io_v2p(va) ((va) + IO_OFFSET) | ||
66 | 74 | ||
67 | #elif defined(CONFIG_ARCH_OMAP2) | 75 | #elif defined(CONFIG_ARCH_OMAP2) |
68 | 76 | ||
@@ -87,11 +95,6 @@ | |||
87 | #define OMAP243X_SMS_VIRT 0xFC000000 | 95 | #define OMAP243X_SMS_VIRT 0xFC000000 |
88 | #define OMAP243X_SMS_SIZE SZ_1M | 96 | #define OMAP243X_SMS_SIZE SZ_1M |
89 | 97 | ||
90 | #define IO_OFFSET 0x90000000 | ||
91 | #define __IO_ADDRESS(pa) ((pa) + IO_OFFSET) /* Works for L3 and L4 */ | ||
92 | #define __OMAP2_IO_ADDRESS(pa) ((pa) + IO_OFFSET) /* Works for L3 and L4 */ | ||
93 | #define io_v2p(va) ((va) - IO_OFFSET) /* Works for L3 and L4 */ | ||
94 | |||
95 | /* DSP */ | 98 | /* DSP */ |
96 | #define DSP_MEM_24XX_PHYS OMAP2420_DSP_MEM_BASE /* 0x58000000 */ | 99 | #define DSP_MEM_24XX_PHYS OMAP2420_DSP_MEM_BASE /* 0x58000000 */ |
97 | #define DSP_MEM_24XX_VIRT 0xe0000000 | 100 | #define DSP_MEM_24XX_VIRT 0xe0000000 |
@@ -143,12 +146,6 @@ | |||
143 | #define OMAP343X_SDRC_VIRT 0xFD000000 | 146 | #define OMAP343X_SDRC_VIRT 0xFD000000 |
144 | #define OMAP343X_SDRC_SIZE SZ_1M | 147 | #define OMAP343X_SDRC_SIZE SZ_1M |
145 | 148 | ||
146 | |||
147 | #define IO_OFFSET 0x90000000 | ||
148 | #define __IO_ADDRESS(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */ | ||
149 | #define __OMAP2_IO_ADDRESS(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */ | ||
150 | #define io_v2p(va) ((va) - IO_OFFSET)/* Works for L3 and L4 */ | ||
151 | |||
152 | /* DSP */ | 149 | /* DSP */ |
153 | #define DSP_MEM_34XX_PHYS OMAP34XX_DSP_MEM_BASE /* 0x58000000 */ | 150 | #define DSP_MEM_34XX_PHYS OMAP34XX_DSP_MEM_BASE /* 0x58000000 */ |
154 | #define DSP_MEM_34XX_VIRT 0xe0000000 | 151 | #define DSP_MEM_34XX_VIRT 0xe0000000 |
@@ -188,39 +185,20 @@ | |||
188 | #define OMAP44XX_GPMC_VIRT 0xe0000000 | 185 | #define OMAP44XX_GPMC_VIRT 0xe0000000 |
189 | #define OMAP44XX_GPMC_SIZE SZ_1M | 186 | #define OMAP44XX_GPMC_SIZE SZ_1M |
190 | 187 | ||
191 | |||
192 | #define IO_OFFSET 0x90000000 | ||
193 | #define __IO_ADDRESS(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */ | ||
194 | #define __OMAP2_IO_ADDRESS(pa) ((pa) + IO_OFFSET)/* Works for L3 and L4 */ | ||
195 | #define io_v2p(va) ((va) - IO_OFFSET)/* Works for L3 and L4 */ | ||
196 | |||
197 | #endif | 188 | #endif |
198 | 189 | ||
199 | #define IO_ADDRESS(pa) IOMEM(__IO_ADDRESS(pa)) | 190 | #ifndef __ASSEMBLER__ |
200 | #define OMAP1_IO_ADDRESS(pa) IOMEM(__OMAP1_IO_ADDRESS(pa)) | ||
201 | #define OMAP2_IO_ADDRESS(pa) IOMEM(__OMAP2_IO_ADDRESS(pa)) | ||
202 | |||
203 | #ifdef __ASSEMBLER__ | ||
204 | #define IOMEM(x) (x) | ||
205 | #else | ||
206 | #define IOMEM(x) ((void __force __iomem *)(x)) | ||
207 | 191 | ||
208 | /* | 192 | /* |
209 | * Functions to access the OMAP IO region | 193 | * NOTE: Please use ioremap + __raw_read/write where possible instead of these |
210 | * | ||
211 | * NOTE: - Use omap_read/write[bwl] for physical register addresses | ||
212 | * - Use __raw_read/write[bwl]() for virtual register addresses | ||
213 | * - Use IO_ADDRESS(phys_addr) to convert registers to virtual addresses | ||
214 | * - DO NOT use hardcoded virtual addresses to allow changing the | ||
215 | * IO address space again if needed | ||
216 | */ | 194 | */ |
217 | #define omap_readb(a) __raw_readb(IO_ADDRESS(a)) | ||
218 | #define omap_readw(a) __raw_readw(IO_ADDRESS(a)) | ||
219 | #define omap_readl(a) __raw_readl(IO_ADDRESS(a)) | ||
220 | 195 | ||
221 | #define omap_writeb(v,a) __raw_writeb(v, IO_ADDRESS(a)) | 196 | extern u8 omap_readb(u32 pa); |
222 | #define omap_writew(v,a) __raw_writew(v, IO_ADDRESS(a)) | 197 | extern u16 omap_readw(u32 pa); |
223 | #define omap_writel(v,a) __raw_writel(v, IO_ADDRESS(a)) | 198 | extern u32 omap_readl(u32 pa); |
199 | extern void omap_writeb(u8 v, u32 pa); | ||
200 | extern void omap_writew(u16 v, u32 pa); | ||
201 | extern void omap_writel(u32 v, u32 pa); | ||
224 | 202 | ||
225 | struct omap_sdrc_params; | 203 | struct omap_sdrc_params; |
226 | 204 | ||
diff --git a/arch/arm/plat-omap/include/mach/mtd-xip.h b/arch/arm/plat-omap/include/mach/mtd-xip.h index 39b591ff54bb..f82a8dcaad94 100644 --- a/arch/arm/plat-omap/include/mach/mtd-xip.h +++ b/arch/arm/plat-omap/include/mach/mtd-xip.h | |||
@@ -25,7 +25,7 @@ typedef struct { | |||
25 | } xip_omap_mpu_timer_regs_t; | 25 | } xip_omap_mpu_timer_regs_t; |
26 | 26 | ||
27 | #define xip_omap_mpu_timer_base(n) \ | 27 | #define xip_omap_mpu_timer_base(n) \ |
28 | ((volatile xip_omap_mpu_timer_regs_t*)IO_ADDRESS(OMAP_MPU_TIMER_BASE + \ | 28 | ((volatile xip_omap_mpu_timer_regs_t*)OMAP1_IO_ADDRESS(OMAP_MPU_TIMER_BASE + \ |
29 | (n)*OMAP_MPU_TIMER_OFFSET)) | 29 | (n)*OMAP_MPU_TIMER_OFFSET)) |
30 | 30 | ||
31 | static inline unsigned long xip_omap_mpu_timer_read(int nr) | 31 | static inline unsigned long xip_omap_mpu_timer_read(int nr) |
diff --git a/arch/arm/plat-omap/include/mach/omap44xx.h b/arch/arm/plat-omap/include/mach/omap44xx.h index 15dec7f1c7c0..b3ba5ac7b4a4 100644 --- a/arch/arm/plat-omap/include/mach/omap44xx.h +++ b/arch/arm/plat-omap/include/mach/omap44xx.h | |||
@@ -33,14 +33,14 @@ | |||
33 | #define IRQ_SIR_IRQ 0x0040 | 33 | #define IRQ_SIR_IRQ 0x0040 |
34 | #define OMAP44XX_GIC_DIST_BASE 0x48241000 | 34 | #define OMAP44XX_GIC_DIST_BASE 0x48241000 |
35 | #define OMAP44XX_GIC_CPU_BASE 0x48240100 | 35 | #define OMAP44XX_GIC_CPU_BASE 0x48240100 |
36 | #define OMAP44XX_VA_GIC_CPU_BASE IO_ADDRESS(OMAP44XX_GIC_CPU_BASE) | 36 | #define OMAP44XX_VA_GIC_CPU_BASE OMAP2_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE) |
37 | #define OMAP44XX_SCU_BASE 0x48240000 | 37 | #define OMAP44XX_SCU_BASE 0x48240000 |
38 | #define OMAP44XX_VA_SCU_BASE IO_ADDRESS(OMAP44XX_SCU_BASE) | 38 | #define OMAP44XX_VA_SCU_BASE OMAP2_IO_ADDRESS(OMAP44XX_SCU_BASE) |
39 | #define OMAP44XX_LOCAL_TWD_BASE 0x48240600 | 39 | #define OMAP44XX_LOCAL_TWD_BASE 0x48240600 |
40 | #define OMAP44XX_VA_LOCAL_TWD_BASE IO_ADDRESS(OMAP44XX_LOCAL_TWD_BASE) | 40 | #define OMAP44XX_VA_LOCAL_TWD_BASE OMAP2_IO_ADDRESS(OMAP44XX_LOCAL_TWD_BASE) |
41 | #define OMAP44XX_LOCAL_TWD_SIZE 0x00000100 | 41 | #define OMAP44XX_LOCAL_TWD_SIZE 0x00000100 |
42 | #define OMAP44XX_WKUPGEN_BASE 0x48281000 | 42 | #define OMAP44XX_WKUPGEN_BASE 0x48281000 |
43 | #define OMAP44XX_VA_WKUPGEN_BASE IO_ADDRESS(OMAP44XX_WKUPGEN_BASE) | 43 | #define OMAP44XX_VA_WKUPGEN_BASE OMAP2_IO_ADDRESS(OMAP44XX_WKUPGEN_BASE) |
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/sdrc.h b/arch/arm/plat-omap/include/mach/sdrc.h index 0be18e4ff182..93f70d2cbce1 100644 --- a/arch/arm/plat-omap/include/mach/sdrc.h +++ b/arch/arm/plat-omap/include/mach/sdrc.h | |||
@@ -71,11 +71,11 @@ | |||
71 | */ | 71 | */ |
72 | 72 | ||
73 | #define OMAP242X_SMS_REGADDR(reg) \ | 73 | #define OMAP242X_SMS_REGADDR(reg) \ |
74 | (void __iomem *)IO_ADDRESS(OMAP2420_SMS_BASE + reg) | 74 | (void __iomem *)OMAP2_IO_ADDRESS(OMAP2420_SMS_BASE + reg) |
75 | #define OMAP243X_SMS_REGADDR(reg) \ | 75 | #define OMAP243X_SMS_REGADDR(reg) \ |
76 | (void __iomem *)IO_ADDRESS(OMAP243X_SMS_BASE + reg) | 76 | (void __iomem *)OMAP2_IO_ADDRESS(OMAP243X_SMS_BASE + reg) |
77 | #define OMAP343X_SMS_REGADDR(reg) \ | 77 | #define OMAP343X_SMS_REGADDR(reg) \ |
78 | (void __iomem *)IO_ADDRESS(OMAP343X_SMS_BASE + reg) | 78 | (void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE + reg) |
79 | 79 | ||
80 | /* SMS register offsets - read/write with sms_{read,write}_reg() */ | 80 | /* SMS register offsets - read/write with sms_{read,write}_reg() */ |
81 | 81 | ||
diff --git a/arch/arm/plat-omap/io.c b/arch/arm/plat-omap/io.c index 9b42d72d96cf..d491ad15f198 100644 --- a/arch/arm/plat-omap/io.c +++ b/arch/arm/plat-omap/io.c | |||
@@ -132,3 +132,61 @@ void omap_iounmap(volatile void __iomem *addr) | |||
132 | __iounmap(addr); | 132 | __iounmap(addr); |
133 | } | 133 | } |
134 | EXPORT_SYMBOL(omap_iounmap); | 134 | EXPORT_SYMBOL(omap_iounmap); |
135 | |||
136 | /* | ||
137 | * NOTE: Please use ioremap + __raw_read/write where possible instead of these | ||
138 | */ | ||
139 | |||
140 | u8 omap_readb(u32 pa) | ||
141 | { | ||
142 | if (cpu_class_is_omap1()) | ||
143 | return __raw_readb(OMAP1_IO_ADDRESS(pa)); | ||
144 | else | ||
145 | return __raw_readb(OMAP2_IO_ADDRESS(pa)); | ||
146 | } | ||
147 | EXPORT_SYMBOL(omap_readb); | ||
148 | |||
149 | u16 omap_readw(u32 pa) | ||
150 | { | ||
151 | if (cpu_class_is_omap1()) | ||
152 | return __raw_readw(OMAP1_IO_ADDRESS(pa)); | ||
153 | else | ||
154 | return __raw_readw(OMAP2_IO_ADDRESS(pa)); | ||
155 | } | ||
156 | EXPORT_SYMBOL(omap_readw); | ||
157 | |||
158 | u32 omap_readl(u32 pa) | ||
159 | { | ||
160 | if (cpu_class_is_omap1()) | ||
161 | return __raw_readl(OMAP1_IO_ADDRESS(pa)); | ||
162 | else | ||
163 | return __raw_readl(OMAP2_IO_ADDRESS(pa)); | ||
164 | } | ||
165 | EXPORT_SYMBOL(omap_readl); | ||
166 | |||
167 | void omap_writeb(u8 v, u32 pa) | ||
168 | { | ||
169 | if (cpu_class_is_omap1()) | ||
170 | __raw_writeb(v, OMAP1_IO_ADDRESS(pa)); | ||
171 | else | ||
172 | __raw_writeb(v, OMAP2_IO_ADDRESS(pa)); | ||
173 | } | ||
174 | EXPORT_SYMBOL(omap_writeb); | ||
175 | |||
176 | void omap_writew(u16 v, u32 pa) | ||
177 | { | ||
178 | if (cpu_class_is_omap1()) | ||
179 | __raw_writew(v, OMAP1_IO_ADDRESS(pa)); | ||
180 | else | ||
181 | __raw_writew(v, OMAP2_IO_ADDRESS(pa)); | ||
182 | } | ||
183 | EXPORT_SYMBOL(omap_writew); | ||
184 | |||
185 | void omap_writel(u32 v, u32 pa) | ||
186 | { | ||
187 | if (cpu_class_is_omap1()) | ||
188 | __raw_writel(v, OMAP1_IO_ADDRESS(pa)); | ||
189 | else | ||
190 | __raw_writel(v, OMAP2_IO_ADDRESS(pa)); | ||
191 | } | ||
192 | EXPORT_SYMBOL(omap_writel); | ||
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c index 5eae7876979c..925f64711c37 100644 --- a/arch/arm/plat-omap/sram.c +++ b/arch/arm/plat-omap/sram.c | |||
@@ -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 IO_ADDRESS(0x68005048) | 59 | #define OMAP24XX_VA_REQINFOPERM0 OMAP2_IO_ADDRESS(0x68005048) |
60 | #define OMAP24XX_VA_READPERM0 IO_ADDRESS(0x68005050) | 60 | #define OMAP24XX_VA_READPERM0 OMAP2_IO_ADDRESS(0x68005050) |
61 | #define OMAP24XX_VA_WRITEPERM0 IO_ADDRESS(0x68005058) | 61 | #define OMAP24XX_VA_WRITEPERM0 OMAP2_IO_ADDRESS(0x68005058) |
62 | 62 | ||
63 | #define OMAP34XX_VA_REQINFOPERM0 IO_ADDRESS(0x68012848) | 63 | #define OMAP34XX_VA_REQINFOPERM0 OMAP2_IO_ADDRESS(0x68012848) |
64 | #define OMAP34XX_VA_READPERM0 IO_ADDRESS(0x68012850) | 64 | #define OMAP34XX_VA_READPERM0 OMAP2_IO_ADDRESS(0x68012850) |
65 | #define OMAP34XX_VA_WRITEPERM0 IO_ADDRESS(0x68012858) | 65 | #define OMAP34XX_VA_WRITEPERM0 OMAP2_IO_ADDRESS(0x68012858) |
66 | #define OMAP34XX_VA_ADDR_MATCH2 IO_ADDRESS(0x68012880) | 66 | #define OMAP34XX_VA_ADDR_MATCH2 OMAP2_IO_ADDRESS(0x68012880) |
67 | #define OMAP34XX_VA_SMS_RG_ATT0 IO_ADDRESS(0x6C000048) | 67 | #define OMAP34XX_VA_SMS_RG_ATT0 OMAP2_IO_ADDRESS(0x6C000048) |
68 | #define OMAP34XX_VA_CONTROL_STAT IO_ADDRESS(0x480022F0) | 68 | #define OMAP34XX_VA_CONTROL_STAT OMAP2_IO_ADDRESS(0x480022F0) |
69 | 69 | ||
70 | #define GP_DEVICE 0x300 | 70 | #define GP_DEVICE 0x300 |
71 | 71 | ||