diff options
Diffstat (limited to 'arch/arm/mach-omap2/io.c')
-rw-r--r-- | arch/arm/mach-omap2/io.c | 129 |
1 files changed, 64 insertions, 65 deletions
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index f01273006e4d..a5d8dce2a70b 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -34,8 +34,8 @@ | |||
34 | #include "clock2xxx.h" | 34 | #include "clock2xxx.h" |
35 | #include "clock3xxx.h" | 35 | #include "clock3xxx.h" |
36 | #include "clock44xx.h" | 36 | #include "clock44xx.h" |
37 | #include "io.h" | ||
38 | 37 | ||
38 | #include <plat/common.h> | ||
39 | #include <plat/omap-pm.h> | 39 | #include <plat/omap-pm.h> |
40 | #include "voltage.h" | 40 | #include "voltage.h" |
41 | #include "powerdomain.h" | 41 | #include "powerdomain.h" |
@@ -43,6 +43,7 @@ | |||
43 | #include "clockdomain.h" | 43 | #include "clockdomain.h" |
44 | #include <plat/omap_hwmod.h> | 44 | #include <plat/omap_hwmod.h> |
45 | #include <plat/multi.h> | 45 | #include <plat/multi.h> |
46 | #include <plat/common.h> | ||
46 | 47 | ||
47 | /* | 48 | /* |
48 | * The machine specific code may provide the extra mapping besides the | 49 | * The machine specific code may provide the extra mapping besides the |
@@ -239,26 +240,11 @@ static struct map_desc omap44xx_io_desc[] __initdata = { | |||
239 | }; | 240 | }; |
240 | #endif | 241 | #endif |
241 | 242 | ||
242 | static void __init _omap2_map_common_io(void) | ||
243 | { | ||
244 | /* Normally devicemaps_init() would flush caches and tlb after | ||
245 | * mdesc->map_io(), but we must also do it here because of the CPU | ||
246 | * revision check below. | ||
247 | */ | ||
248 | local_flush_tlb_all(); | ||
249 | flush_cache_all(); | ||
250 | |||
251 | omap2_check_revision(); | ||
252 | omap_sram_init(); | ||
253 | omap_init_consistent_dma_size(); | ||
254 | } | ||
255 | |||
256 | #ifdef CONFIG_SOC_OMAP2420 | 243 | #ifdef CONFIG_SOC_OMAP2420 |
257 | void __init omap242x_map_common_io(void) | 244 | void __init omap242x_map_common_io(void) |
258 | { | 245 | { |
259 | iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); | 246 | iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); |
260 | iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc)); | 247 | iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc)); |
261 | _omap2_map_common_io(); | ||
262 | } | 248 | } |
263 | #endif | 249 | #endif |
264 | 250 | ||
@@ -267,7 +253,6 @@ void __init omap243x_map_common_io(void) | |||
267 | { | 253 | { |
268 | iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); | 254 | iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); |
269 | iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc)); | 255 | iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc)); |
270 | _omap2_map_common_io(); | ||
271 | } | 256 | } |
272 | #endif | 257 | #endif |
273 | 258 | ||
@@ -275,7 +260,6 @@ void __init omap243x_map_common_io(void) | |||
275 | void __init omap34xx_map_common_io(void) | 260 | void __init omap34xx_map_common_io(void) |
276 | { | 261 | { |
277 | iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc)); | 262 | iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc)); |
278 | _omap2_map_common_io(); | ||
279 | } | 263 | } |
280 | #endif | 264 | #endif |
281 | 265 | ||
@@ -283,7 +267,6 @@ void __init omap34xx_map_common_io(void) | |||
283 | void __init omapti816x_map_common_io(void) | 267 | void __init omapti816x_map_common_io(void) |
284 | { | 268 | { |
285 | iotable_init(omapti816x_io_desc, ARRAY_SIZE(omapti816x_io_desc)); | 269 | iotable_init(omapti816x_io_desc, ARRAY_SIZE(omapti816x_io_desc)); |
286 | _omap2_map_common_io(); | ||
287 | } | 270 | } |
288 | #endif | 271 | #endif |
289 | 272 | ||
@@ -291,7 +274,6 @@ void __init omapti816x_map_common_io(void) | |||
291 | void __init omap44xx_map_common_io(void) | 274 | void __init omap44xx_map_common_io(void) |
292 | { | 275 | { |
293 | iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc)); | 276 | iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc)); |
294 | _omap2_map_common_io(); | ||
295 | } | 277 | } |
296 | #endif | 278 | #endif |
297 | 279 | ||
@@ -337,33 +319,16 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data) | |||
337 | /* See irq.c, omap4-common.c and entry-macro.S */ | 319 | /* See irq.c, omap4-common.c and entry-macro.S */ |
338 | void __iomem *omap_irq_base; | 320 | void __iomem *omap_irq_base; |
339 | 321 | ||
340 | void __init omap2_init_common_infrastructure(void) | 322 | static void __init omap_common_init_early(void) |
341 | { | 323 | { |
342 | u8 postsetup_state; | 324 | omap2_check_revision(); |
325 | omap_ioremap_init(); | ||
326 | omap_init_consistent_dma_size(); | ||
327 | } | ||
343 | 328 | ||
344 | if (cpu_is_omap242x()) { | 329 | static void __init omap_hwmod_init_postsetup(void) |
345 | omap2xxx_voltagedomains_init(); | 330 | { |
346 | omap242x_powerdomains_init(); | 331 | u8 postsetup_state; |
347 | omap242x_clockdomains_init(); | ||
348 | omap2420_hwmod_init(); | ||
349 | } else if (cpu_is_omap243x()) { | ||
350 | omap2xxx_voltagedomains_init(); | ||
351 | omap243x_powerdomains_init(); | ||
352 | omap243x_clockdomains_init(); | ||
353 | omap2430_hwmod_init(); | ||
354 | } else if (cpu_is_omap34xx()) { | ||
355 | omap3xxx_voltagedomains_init(); | ||
356 | omap3xxx_powerdomains_init(); | ||
357 | omap3xxx_clockdomains_init(); | ||
358 | omap3xxx_hwmod_init(); | ||
359 | } else if (cpu_is_omap44xx()) { | ||
360 | omap44xx_voltagedomains_init(); | ||
361 | omap44xx_powerdomains_init(); | ||
362 | omap44xx_clockdomains_init(); | ||
363 | omap44xx_hwmod_init(); | ||
364 | } else { | ||
365 | pr_err("Could not init hwmod data - unknown SoC\n"); | ||
366 | } | ||
367 | 332 | ||
368 | /* Set the default postsetup state for all hwmods */ | 333 | /* Set the default postsetup state for all hwmods */ |
369 | #ifdef CONFIG_PM_RUNTIME | 334 | #ifdef CONFIG_PM_RUNTIME |
@@ -392,67 +357,101 @@ void __init omap2_init_common_infrastructure(void) | |||
392 | &postsetup_state); | 357 | &postsetup_state); |
393 | 358 | ||
394 | omap_pm_if_early_init(); | 359 | omap_pm_if_early_init(); |
395 | |||
396 | if (cpu_is_omap2420()) | ||
397 | omap2420_clk_init(); | ||
398 | else if (cpu_is_omap2430()) | ||
399 | omap2430_clk_init(); | ||
400 | else if (cpu_is_omap34xx()) | ||
401 | omap3xxx_clk_init(); | ||
402 | else if (cpu_is_omap44xx()) | ||
403 | omap4xxx_clk_init(); | ||
404 | else | ||
405 | pr_err("Could not init clock framework - unknown SoC\n"); | ||
406 | } | 360 | } |
407 | 361 | ||
408 | void __init omap2420_init_early(void) | 362 | void __init omap2420_init_early(void) |
409 | { | 363 | { |
410 | omap2_init_common_infrastructure(); | 364 | omap2_set_globals_242x(); |
365 | omap_common_init_early(); | ||
366 | omap2xxx_voltagedomains_init(); | ||
367 | omap242x_powerdomains_init(); | ||
368 | omap242x_clockdomains_init(); | ||
369 | omap2420_hwmod_init(); | ||
370 | omap_hwmod_init_postsetup(); | ||
371 | omap2420_clk_init(); | ||
411 | } | 372 | } |
412 | 373 | ||
413 | void __init omap2430_init_early(void) | 374 | void __init omap2430_init_early(void) |
414 | { | 375 | { |
415 | omap2_init_common_infrastructure(); | 376 | omap2_set_globals_243x(); |
377 | omap_common_init_early(); | ||
378 | omap2xxx_voltagedomains_init(); | ||
379 | omap243x_powerdomains_init(); | ||
380 | omap243x_clockdomains_init(); | ||
381 | omap2430_hwmod_init(); | ||
382 | omap_hwmod_init_postsetup(); | ||
383 | omap2430_clk_init(); | ||
384 | } | ||
385 | |||
386 | /* | ||
387 | * Currently only board-omap3beagle.c should call this because of the | ||
388 | * same machine_id for 34xx and 36xx beagle.. Will get fixed with DT. | ||
389 | */ | ||
390 | void __init omap3_init_early(void) | ||
391 | { | ||
392 | omap2_set_globals_3xxx(); | ||
393 | omap_common_init_early(); | ||
394 | omap3xxx_voltagedomains_init(); | ||
395 | omap3xxx_powerdomains_init(); | ||
396 | omap3xxx_clockdomains_init(); | ||
397 | omap3xxx_hwmod_init(); | ||
398 | omap_hwmod_init_postsetup(); | ||
399 | omap3xxx_clk_init(); | ||
416 | } | 400 | } |
417 | 401 | ||
418 | void __init omap3430_init_early(void) | 402 | void __init omap3430_init_early(void) |
419 | { | 403 | { |
420 | omap2_init_common_infrastructure(); | 404 | omap3_init_early(); |
421 | } | 405 | } |
422 | 406 | ||
423 | void __init omap35xx_init_early(void) | 407 | void __init omap35xx_init_early(void) |
424 | { | 408 | { |
425 | omap2_init_common_infrastructure(); | 409 | omap3_init_early(); |
426 | } | 410 | } |
427 | 411 | ||
428 | void __init omap3630_init_early(void) | 412 | void __init omap3630_init_early(void) |
429 | { | 413 | { |
430 | omap2_init_common_infrastructure(); | 414 | omap3_init_early(); |
431 | } | 415 | } |
432 | 416 | ||
433 | void __init am35xx_init_early(void) | 417 | void __init am35xx_init_early(void) |
434 | { | 418 | { |
435 | omap2_init_common_infrastructure(); | 419 | omap3_init_early(); |
436 | } | 420 | } |
437 | 421 | ||
438 | void __init ti816x_init_early(void) | 422 | void __init ti816x_init_early(void) |
439 | { | 423 | { |
440 | omap2_init_common_infrastructure(); | 424 | omap2_set_globals_ti816x(); |
425 | omap_common_init_early(); | ||
426 | omap3xxx_voltagedomains_init(); | ||
427 | omap3xxx_powerdomains_init(); | ||
428 | omap3xxx_clockdomains_init(); | ||
429 | omap3xxx_hwmod_init(); | ||
430 | omap_hwmod_init_postsetup(); | ||
431 | omap3xxx_clk_init(); | ||
441 | } | 432 | } |
442 | 433 | ||
443 | void __init omap4430_init_early(void) | 434 | void __init omap4430_init_early(void) |
444 | { | 435 | { |
445 | omap2_init_common_infrastructure(); | 436 | omap2_set_globals_443x(); |
437 | omap_common_init_early(); | ||
438 | omap44xx_voltagedomains_init(); | ||
439 | omap44xx_powerdomains_init(); | ||
440 | omap44xx_clockdomains_init(); | ||
441 | omap44xx_hwmod_init(); | ||
442 | omap_hwmod_init_postsetup(); | ||
443 | omap4xxx_clk_init(); | ||
446 | } | 444 | } |
447 | 445 | ||
448 | void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, | 446 | void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, |
449 | struct omap_sdrc_params *sdrc_cs1) | 447 | struct omap_sdrc_params *sdrc_cs1) |
450 | { | 448 | { |
449 | omap_sram_init(); | ||
450 | |||
451 | if (cpu_is_omap24xx() || omap3_has_sdrc()) { | 451 | if (cpu_is_omap24xx() || omap3_has_sdrc()) { |
452 | omap2_sdrc_init(sdrc_cs0, sdrc_cs1); | 452 | omap2_sdrc_init(sdrc_cs0, sdrc_cs1); |
453 | _omap2_init_reprogram_sdrc(); | 453 | _omap2_init_reprogram_sdrc(); |
454 | } | 454 | } |
455 | |||
456 | } | 455 | } |
457 | 456 | ||
458 | /* | 457 | /* |