diff options
| author | Nishanth Menon <nm@ti.com> | 2015-06-22 11:12:14 -0400 |
|---|---|---|
| committer | Tony Lindgren <tony@atomide.com> | 2015-07-16 03:06:05 -0400 |
| commit | ea827ad5ffbb78812f6dbdee005e1f364b6bdc58 (patch) | |
| tree | 8e9fedbbee63efdd317e5ca20531cea152593bdd | |
| parent | d1dabab2841d546f8b946b4940fc63c15e35a739 (diff) | |
ARM: DRA7: Provide proper IO map table
DRA7 uses OMAP5 IO table at the moment. This is purely spurious since
the OMAP5 and DRA7 register maps are different in many aspects.
AM57xx/DRA7 TRM Reference: http://www.ti.com/lit/ug/spruhz6/spruhz6.pdf
NOTE: Most of the drivers are already doing ioremap, so, there should'nt
be any functional improvement involved here, other than making the
initial iotable more accurate.
Fixes: a3a9384a1157 ("ARM: DRA7: Reuse io tables and add a new .init_early")
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
| -rw-r--r-- | arch/arm/mach-omap2/board-generic.c | 4 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/common.h | 1 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/io.c | 58 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/iomap.h | 63 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/omap54xx.h | 8 |
5 files changed, 130 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 34ff14b7beab..b4fbe50672a3 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
| @@ -297,7 +297,7 @@ static const char *const dra74x_boards_compat[] __initconst = { | |||
| 297 | DT_MACHINE_START(DRA74X_DT, "Generic DRA74X (Flattened Device Tree)") | 297 | DT_MACHINE_START(DRA74X_DT, "Generic DRA74X (Flattened Device Tree)") |
| 298 | .reserve = omap_reserve, | 298 | .reserve = omap_reserve, |
| 299 | .smp = smp_ops(omap4_smp_ops), | 299 | .smp = smp_ops(omap4_smp_ops), |
| 300 | .map_io = omap5_map_io, | 300 | .map_io = dra7xx_map_io, |
| 301 | .init_early = dra7xx_init_early, | 301 | .init_early = dra7xx_init_early, |
| 302 | .init_late = dra7xx_init_late, | 302 | .init_late = dra7xx_init_late, |
| 303 | .init_irq = omap_gic_of_init, | 303 | .init_irq = omap_gic_of_init, |
| @@ -316,7 +316,7 @@ static const char *const dra72x_boards_compat[] __initconst = { | |||
| 316 | 316 | ||
| 317 | DT_MACHINE_START(DRA72X_DT, "Generic DRA72X (Flattened Device Tree)") | 317 | DT_MACHINE_START(DRA72X_DT, "Generic DRA72X (Flattened Device Tree)") |
| 318 | .reserve = omap_reserve, | 318 | .reserve = omap_reserve, |
| 319 | .map_io = omap5_map_io, | 319 | .map_io = dra7xx_map_io, |
| 320 | .init_early = dra7xx_init_early, | 320 | .init_early = dra7xx_init_early, |
| 321 | .init_late = dra7xx_init_late, | 321 | .init_late = dra7xx_init_late, |
| 322 | .init_irq = omap_gic_of_init, | 322 | .init_irq = omap_gic_of_init, |
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index cf3cf22ecd42..749d50bb4ca5 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h | |||
| @@ -198,6 +198,7 @@ void __init omap3_map_io(void); | |||
| 198 | void __init am33xx_map_io(void); | 198 | void __init am33xx_map_io(void); |
| 199 | void __init omap4_map_io(void); | 199 | void __init omap4_map_io(void); |
| 200 | void __init omap5_map_io(void); | 200 | void __init omap5_map_io(void); |
| 201 | void __init dra7xx_map_io(void); | ||
| 201 | void __init ti81xx_map_io(void); | 202 | void __init ti81xx_map_io(void); |
| 202 | 203 | ||
| 203 | /** | 204 | /** |
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 820dde8b5b04..c10fb291b99f 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
| @@ -236,7 +236,7 @@ static struct map_desc omap44xx_io_desc[] __initdata = { | |||
| 236 | }; | 236 | }; |
| 237 | #endif | 237 | #endif |
| 238 | 238 | ||
| 239 | #if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX) | 239 | #ifdef CONFIG_SOC_OMAP5 |
| 240 | static struct map_desc omap54xx_io_desc[] __initdata = { | 240 | static struct map_desc omap54xx_io_desc[] __initdata = { |
| 241 | { | 241 | { |
| 242 | .virtual = L3_54XX_VIRT, | 242 | .virtual = L3_54XX_VIRT, |
| @@ -265,6 +265,53 @@ static struct map_desc omap54xx_io_desc[] __initdata = { | |||
| 265 | }; | 265 | }; |
| 266 | #endif | 266 | #endif |
| 267 | 267 | ||
| 268 | #ifdef CONFIG_SOC_DRA7XX | ||
| 269 | static struct map_desc dra7xx_io_desc[] __initdata = { | ||
| 270 | { | ||
| 271 | .virtual = L4_CFG_MPU_DRA7XX_VIRT, | ||
| 272 | .pfn = __phys_to_pfn(L4_CFG_MPU_DRA7XX_PHYS), | ||
| 273 | .length = L4_CFG_MPU_DRA7XX_SIZE, | ||
| 274 | .type = MT_DEVICE, | ||
| 275 | }, | ||
| 276 | { | ||
| 277 | .virtual = L3_MAIN_SN_DRA7XX_VIRT, | ||
| 278 | .pfn = __phys_to_pfn(L3_MAIN_SN_DRA7XX_PHYS), | ||
| 279 | .length = L3_MAIN_SN_DRA7XX_SIZE, | ||
| 280 | .type = MT_DEVICE, | ||
| 281 | }, | ||
| 282 | { | ||
| 283 | .virtual = L4_PER1_DRA7XX_VIRT, | ||
| 284 | .pfn = __phys_to_pfn(L4_PER1_DRA7XX_PHYS), | ||
| 285 | .length = L4_PER1_DRA7XX_SIZE, | ||
| 286 | .type = MT_DEVICE, | ||
| 287 | }, | ||
| 288 | { | ||
| 289 | .virtual = L4_PER2_DRA7XX_VIRT, | ||
| 290 | .pfn = __phys_to_pfn(L4_PER2_DRA7XX_PHYS), | ||
| 291 | .length = L4_PER2_DRA7XX_SIZE, | ||
| 292 | .type = MT_DEVICE, | ||
| 293 | }, | ||
| 294 | { | ||
| 295 | .virtual = L4_PER3_DRA7XX_VIRT, | ||
| 296 | .pfn = __phys_to_pfn(L4_PER3_DRA7XX_PHYS), | ||
| 297 | .length = L4_PER3_DRA7XX_SIZE, | ||
| 298 | .type = MT_DEVICE, | ||
| 299 | }, | ||
| 300 | { | ||
| 301 | .virtual = L4_CFG_DRA7XX_VIRT, | ||
| 302 | .pfn = __phys_to_pfn(L4_CFG_DRA7XX_PHYS), | ||
| 303 | .length = L4_CFG_DRA7XX_SIZE, | ||
| 304 | .type = MT_DEVICE, | ||
| 305 | }, | ||
| 306 | { | ||
| 307 | .virtual = L4_WKUP_DRA7XX_VIRT, | ||
| 308 | .pfn = __phys_to_pfn(L4_WKUP_DRA7XX_PHYS), | ||
| 309 | .length = L4_WKUP_DRA7XX_SIZE, | ||
| 310 | .type = MT_DEVICE, | ||
| 311 | }, | ||
| 312 | }; | ||
| 313 | #endif | ||
| 314 | |||
| 268 | #ifdef CONFIG_SOC_OMAP2420 | 315 | #ifdef CONFIG_SOC_OMAP2420 |
| 269 | void __init omap242x_map_io(void) | 316 | void __init omap242x_map_io(void) |
| 270 | { | 317 | { |
| @@ -309,12 +356,19 @@ void __init omap4_map_io(void) | |||
| 309 | } | 356 | } |
| 310 | #endif | 357 | #endif |
| 311 | 358 | ||
| 312 | #if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX) | 359 | #ifdef CONFIG_SOC_OMAP5 |
| 313 | void __init omap5_map_io(void) | 360 | void __init omap5_map_io(void) |
| 314 | { | 361 | { |
| 315 | iotable_init(omap54xx_io_desc, ARRAY_SIZE(omap54xx_io_desc)); | 362 | iotable_init(omap54xx_io_desc, ARRAY_SIZE(omap54xx_io_desc)); |
| 316 | } | 363 | } |
| 317 | #endif | 364 | #endif |
| 365 | |||
| 366 | #ifdef CONFIG_SOC_DRA7XX | ||
| 367 | void __init dra7xx_map_io(void) | ||
| 368 | { | ||
| 369 | iotable_init(dra7xx_io_desc, ARRAY_SIZE(dra7xx_io_desc)); | ||
| 370 | } | ||
| 371 | #endif | ||
| 318 | /* | 372 | /* |
| 319 | * omap2_init_reprogram_sdrc - reprogram SDRC timing parameters | 373 | * omap2_init_reprogram_sdrc - reprogram SDRC timing parameters |
| 320 | * | 374 | * |
diff --git a/arch/arm/mach-omap2/iomap.h b/arch/arm/mach-omap2/iomap.h index cce2b65039f1..6191d244438a 100644 --- a/arch/arm/mach-omap2/iomap.h +++ b/arch/arm/mach-omap2/iomap.h | |||
| @@ -194,3 +194,66 @@ | |||
| 194 | #define L4_PER_54XX_PHYS L4_PER_54XX_BASE /* 0x48000000 --> 0xfa000000 */ | 194 | #define L4_PER_54XX_PHYS L4_PER_54XX_BASE /* 0x48000000 --> 0xfa000000 */ |
| 195 | #define L4_PER_54XX_VIRT (L4_PER_54XX_PHYS + OMAP2_L4_IO_OFFSET) | 195 | #define L4_PER_54XX_VIRT (L4_PER_54XX_PHYS + OMAP2_L4_IO_OFFSET) |
| 196 | #define L4_PER_54XX_SIZE SZ_4M | 196 | #define L4_PER_54XX_SIZE SZ_4M |
| 197 | |||
| 198 | /* | ||
| 199 | * ---------------------------------------------------------------------------- | ||
| 200 | * DRA7xx specific IO mapping | ||
| 201 | * ---------------------------------------------------------------------------- | ||
| 202 | */ | ||
| 203 | /* | ||
| 204 | * L3_MAIN_SN_DRA7XX_PHYS 0x44000000 --> 0xf8000000 | ||
| 205 | * The overall space is 24MiB (0x4400_0000<->0x457F_FFFF), but mapping | ||
| 206 | * everything is just inefficient, since, there are too many address holes. | ||
| 207 | */ | ||
| 208 | #define L3_MAIN_SN_DRA7XX_PHYS L3_MAIN_SN_DRA7XX_BASE | ||
| 209 | #define L3_MAIN_SN_DRA7XX_VIRT (L3_MAIN_SN_DRA7XX_PHYS + OMAP4_L3_IO_OFFSET) | ||
| 210 | #define L3_MAIN_SN_DRA7XX_SIZE SZ_1M | ||
| 211 | |||
| 212 | /* | ||
| 213 | * L4_PER1_DRA7XX_PHYS (0x4800_000<>0x480D_2FFF) -> 0.82MiB (alloc 1MiB) | ||
| 214 | * (0x48000000<->0x48100000) <=> (0xFA000000<->0xFA100000) | ||
| 215 | */ | ||
| 216 | #define L4_PER1_DRA7XX_PHYS L4_PER1_DRA7XX_BASE | ||
| 217 | #define L4_PER1_DRA7XX_VIRT (L4_PER1_DRA7XX_PHYS + OMAP2_L4_IO_OFFSET) | ||
| 218 | #define L4_PER1_DRA7XX_SIZE SZ_1M | ||
| 219 | |||
| 220 | /* | ||
| 221 | * L4_CFG_MPU_DRA7XX_PHYS (0x48210000<>0x482A_F2FF) -> 0.62MiB (alloc 1MiB) | ||
| 222 | * (0x48210000<->0x48310000) <=> (0xFA210000<->0xFA310000) | ||
| 223 | * NOTE: This is a bit of an orphan memory map sitting isolated in TRM | ||
| 224 | */ | ||
| 225 | #define L4_CFG_MPU_DRA7XX_PHYS L4_CFG_MPU_DRA7XX_BASE | ||
| 226 | #define L4_CFG_MPU_DRA7XX_VIRT (L4_CFG_MPU_DRA7XX_PHYS + OMAP2_L4_IO_OFFSET) | ||
| 227 | #define L4_CFG_MPU_DRA7XX_SIZE SZ_1M | ||
| 228 | |||
| 229 | /* | ||
| 230 | * L4_PER2_DRA7XX_PHYS (0x4840_0000<>0x4848_8FFF) -> .53MiB (alloc 1MiB) | ||
| 231 | * (0x48400000<->0x48500000) <=> (0xFA400000<->0xFA500000) | ||
| 232 | */ | ||
| 233 | #define L4_PER2_DRA7XX_PHYS L4_PER2_DRA7XX_BASE | ||
| 234 | #define L4_PER2_DRA7XX_VIRT (L4_PER2_DRA7XX_PHYS + OMAP2_L4_IO_OFFSET) | ||
| 235 | #define L4_PER2_DRA7XX_SIZE SZ_1M | ||
| 236 | |||
| 237 | /* | ||
| 238 | * L4_PER3_DRA7XX_PHYS (0x4880_0000<>0x489E_0FFF) -> 1.87MiB (alloc 2MiB) | ||
| 239 | * (0x48800000<->0x48A00000) <=> (0xFA800000<->0xFAA00000) | ||
| 240 | */ | ||
| 241 | #define L4_PER3_DRA7XX_PHYS L4_PER3_DRA7XX_BASE | ||
| 242 | #define L4_PER3_DRA7XX_VIRT (L4_PER3_DRA7XX_PHYS + OMAP2_L4_IO_OFFSET) | ||
| 243 | #define L4_PER3_DRA7XX_SIZE SZ_2M | ||
| 244 | |||
| 245 | /* | ||
| 246 | * L4_CFG_DRA7XX_PHYS (0x4A00_0000<>0x4A22_BFFF) ->2.17MiB (alloc 3MiB)? | ||
| 247 | * (0x4A000000<->0x4A300000) <=> (0xFC000000<->0xFC300000) | ||
| 248 | */ | ||
| 249 | #define L4_CFG_DRA7XX_PHYS L4_CFG_DRA7XX_BASE | ||
| 250 | #define L4_CFG_DRA7XX_VIRT (L4_CFG_DRA7XX_PHYS + OMAP2_L4_IO_OFFSET) | ||
| 251 | #define L4_CFG_DRA7XX_SIZE (SZ_1M + SZ_2M) | ||
| 252 | |||
| 253 | /* | ||
| 254 | * L4_WKUP_DRA7XX_PHYS (0x4AE0_0000<>0x4AE3_EFFF) -> .24 mb (alloc 1MiB)? | ||
| 255 | * (0x4AE00000<->4AF00000) <=> (0xFCE00000<->0xFCF00000) | ||
| 256 | */ | ||
| 257 | #define L4_WKUP_DRA7XX_PHYS L4_WKUP_DRA7XX_BASE | ||
| 258 | #define L4_WKUP_DRA7XX_VIRT (L4_WKUP_DRA7XX_PHYS + OMAP2_L4_IO_OFFSET) | ||
| 259 | #define L4_WKUP_DRA7XX_SIZE SZ_1M | ||
diff --git a/arch/arm/mach-omap2/omap54xx.h b/arch/arm/mach-omap2/omap54xx.h index 2d35c5709408..0ca8e938096b 100644 --- a/arch/arm/mach-omap2/omap54xx.h +++ b/arch/arm/mach-omap2/omap54xx.h | |||
| @@ -30,6 +30,14 @@ | |||
| 30 | #define OMAP54XX_CTRL_BASE 0x4a002800 | 30 | #define OMAP54XX_CTRL_BASE 0x4a002800 |
| 31 | #define OMAP54XX_SAR_RAM_BASE 0x4ae26000 | 31 | #define OMAP54XX_SAR_RAM_BASE 0x4ae26000 |
| 32 | 32 | ||
| 33 | /* DRA7 specific base addresses */ | ||
| 34 | #define L3_MAIN_SN_DRA7XX_BASE 0x44000000 | ||
| 35 | #define L4_PER1_DRA7XX_BASE 0x48000000 | ||
| 36 | #define L4_CFG_MPU_DRA7XX_BASE 0x48210000 | ||
| 37 | #define L4_PER2_DRA7XX_BASE 0x48400000 | ||
| 38 | #define L4_PER3_DRA7XX_BASE 0x48800000 | ||
| 39 | #define L4_CFG_DRA7XX_BASE 0x4A000000 | ||
| 40 | #define L4_WKUP_DRA7XX_BASE 0x4ae00000 | ||
| 33 | #define DRA7XX_CM_CORE_AON_BASE 0x4a005000 | 41 | #define DRA7XX_CM_CORE_AON_BASE 0x4a005000 |
| 34 | #define DRA7XX_CTRL_BASE 0x4a003400 | 42 | #define DRA7XX_CTRL_BASE 0x4a003400 |
| 35 | #define DRA7XX_TAP_BASE 0x4ae0c000 | 43 | #define DRA7XX_TAP_BASE 0x4ae0c000 |
