diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-06 22:13:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-06 22:13:58 -0500 |
commit | 01539ba2a706ab7d35fc0667dff919ade7f87d63 (patch) | |
tree | 5a4bd0cf78007d06690fe4ac06bbd49a5a70bc47 /arch/arm/mach-omap2/io.c | |
parent | 9e9bc9736756f25d6c47b4eba0ebf25b20a6f153 (diff) | |
parent | dc69d1af9e8d9cbbabff88bb35a6782187a22229 (diff) |
Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6
* 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: (243 commits)
omap2: Make OMAP2PLUS select OMAP_DM_TIMER
OMAP4: hwmod data: Fix alignment and end of line in structurefields
OMAP4: hwmod data: Move the DMA structures
OMAP4: hwmod data: Move the smartreflex structures
OMAP4: hwmod data: Fix missing SIDLE_SMART_WKUP in smartreflexsysc
arm: omap: tusb6010: add name for MUSB IRQ
arm: omap: craneboard: Add USB EHCI support
omap2+: Initialize serial port for dynamic remuxing for n8x0
omap2+: Add struct omap_board_data and use it for platform level serial init
omap2+: Allow hwmod state changes to mux pads based on the state changes
omap2+: Add support for hwmod specific muxing of devices
omap2+: Add omap_mux_get_by_name
OMAP2: PM: fix compile error when !CONFIG_SUSPEND
MAINTAINERS: OMAP: hwmod: update hwmod code, data maintainership
OMAP4: Smartreflex framework extensions
OMAP4: hwmod: Add inital data for smartreflex modules.
OMAP4: PM: Program correct init voltages for scalable VDDs
OMAP4: Adding voltage driver support
OMAP4: Register voltage PMIC parameters with the voltage layer
OMAP3: PM: Program correct init voltages for VDD1 and VDD2
...
Fix up trivial conflict in arch/arm/plat-omap/Kconfig
Diffstat (limited to 'arch/arm/mach-omap2/io.c')
-rw-r--r-- | arch/arm/mach-omap2/io.c | 141 |
1 files changed, 120 insertions, 21 deletions
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index a1939b1e6f82..e66687b0b9de 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -39,13 +39,11 @@ | |||
39 | #include "io.h" | 39 | #include "io.h" |
40 | 40 | ||
41 | #include <plat/omap-pm.h> | 41 | #include <plat/omap-pm.h> |
42 | #include <plat/powerdomain.h> | 42 | #include "powerdomain.h" |
43 | #include "powerdomains.h" | ||
44 | |||
45 | #include <plat/clockdomain.h> | ||
46 | #include "clockdomains.h" | ||
47 | 43 | ||
44 | #include "clockdomain.h" | ||
48 | #include <plat/omap_hwmod.h> | 45 | #include <plat/omap_hwmod.h> |
46 | #include <plat/multi.h> | ||
49 | 47 | ||
50 | /* | 48 | /* |
51 | * The machine specific code may provide the extra mapping besides the | 49 | * The machine specific code may provide the extra mapping besides the |
@@ -311,24 +309,81 @@ static int __init _omap2_init_reprogram_sdrc(void) | |||
311 | return v; | 309 | return v; |
312 | } | 310 | } |
313 | 311 | ||
314 | void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, | 312 | static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data) |
315 | struct omap_sdrc_params *sdrc_cs1) | 313 | { |
314 | return omap_hwmod_set_postsetup_state(oh, *(u8 *)data); | ||
315 | } | ||
316 | |||
317 | /* | ||
318 | * Initialize asm_irq_base for entry-macro.S | ||
319 | */ | ||
320 | static inline void omap_irq_base_init(void) | ||
321 | { | ||
322 | extern void __iomem *omap_irq_base; | ||
323 | |||
324 | #ifdef MULTI_OMAP2 | ||
325 | if (cpu_is_omap24xx()) | ||
326 | omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE); | ||
327 | else if (cpu_is_omap34xx()) | ||
328 | omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE); | ||
329 | else if (cpu_is_omap44xx()) | ||
330 | omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE); | ||
331 | else | ||
332 | pr_err("Could not initialize omap_irq_base\n"); | ||
333 | #endif | ||
334 | } | ||
335 | |||
336 | void __init omap2_init_common_infrastructure(void) | ||
316 | { | 337 | { |
317 | u8 skip_setup_idle = 0; | 338 | u8 postsetup_state; |
318 | 339 | ||
319 | pwrdm_init(powerdomains_omap); | 340 | if (cpu_is_omap242x()) { |
320 | clkdm_init(clockdomains_omap, clkdm_autodeps); | 341 | omap2xxx_powerdomains_init(); |
321 | if (cpu_is_omap242x()) | 342 | omap2_clockdomains_init(); |
322 | omap2420_hwmod_init(); | 343 | omap2420_hwmod_init(); |
323 | else if (cpu_is_omap243x()) | 344 | } else if (cpu_is_omap243x()) { |
345 | omap2xxx_powerdomains_init(); | ||
346 | omap2_clockdomains_init(); | ||
324 | omap2430_hwmod_init(); | 347 | omap2430_hwmod_init(); |
325 | else if (cpu_is_omap34xx()) | 348 | } else if (cpu_is_omap34xx()) { |
349 | omap3xxx_powerdomains_init(); | ||
350 | omap2_clockdomains_init(); | ||
326 | omap3xxx_hwmod_init(); | 351 | omap3xxx_hwmod_init(); |
327 | else if (cpu_is_omap44xx()) | 352 | } else if (cpu_is_omap44xx()) { |
353 | omap44xx_powerdomains_init(); | ||
354 | omap44xx_clockdomains_init(); | ||
328 | omap44xx_hwmod_init(); | 355 | omap44xx_hwmod_init(); |
356 | } else { | ||
357 | pr_err("Could not init hwmod data - unknown SoC\n"); | ||
358 | } | ||
359 | |||
360 | /* Set the default postsetup state for all hwmods */ | ||
361 | #ifdef CONFIG_PM_RUNTIME | ||
362 | postsetup_state = _HWMOD_STATE_IDLE; | ||
363 | #else | ||
364 | postsetup_state = _HWMOD_STATE_ENABLED; | ||
365 | #endif | ||
366 | omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state); | ||
367 | |||
368 | /* | ||
369 | * Set the default postsetup state for unusual modules (like | ||
370 | * MPU WDT). | ||
371 | * | ||
372 | * The postsetup_state is not actually used until | ||
373 | * omap_hwmod_late_init(), so boards that desire full watchdog | ||
374 | * coverage of kernel initialization can reprogram the | ||
375 | * postsetup_state between the calls to | ||
376 | * omap2_init_common_infra() and omap2_init_common_devices(). | ||
377 | * | ||
378 | * XXX ideally we could detect whether the MPU WDT was currently | ||
379 | * enabled here and make this conditional | ||
380 | */ | ||
381 | postsetup_state = _HWMOD_STATE_DISABLED; | ||
382 | omap_hwmod_for_each_by_class("wd_timer", | ||
383 | _set_hwmod_postsetup_state, | ||
384 | &postsetup_state); | ||
329 | 385 | ||
330 | /* The OPP tables have to be registered before a clk init */ | 386 | omap_pm_if_early_init(); |
331 | omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps); | ||
332 | 387 | ||
333 | if (cpu_is_omap2420()) | 388 | if (cpu_is_omap2420()) |
334 | omap2420_clk_init(); | 389 | omap2420_clk_init(); |
@@ -339,17 +394,61 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, | |||
339 | else if (cpu_is_omap44xx()) | 394 | else if (cpu_is_omap44xx()) |
340 | omap4xxx_clk_init(); | 395 | omap4xxx_clk_init(); |
341 | else | 396 | else |
342 | pr_err("Could not init clock framework - unknown CPU\n"); | 397 | pr_err("Could not init clock framework - unknown SoC\n"); |
398 | } | ||
343 | 399 | ||
400 | void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0, | ||
401 | struct omap_sdrc_params *sdrc_cs1) | ||
402 | { | ||
344 | omap_serial_early_init(); | 403 | omap_serial_early_init(); |
345 | 404 | ||
346 | #ifndef CONFIG_PM_RUNTIME | 405 | omap_hwmod_late_init(); |
347 | skip_setup_idle = 1; | 406 | |
348 | #endif | ||
349 | omap_hwmod_late_init(skip_setup_idle); | ||
350 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) { | 407 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) { |
351 | omap2_sdrc_init(sdrc_cs0, sdrc_cs1); | 408 | omap2_sdrc_init(sdrc_cs0, sdrc_cs1); |
352 | _omap2_init_reprogram_sdrc(); | 409 | _omap2_init_reprogram_sdrc(); |
353 | } | 410 | } |
354 | gpmc_init(); | 411 | gpmc_init(); |
412 | |||
413 | omap_irq_base_init(); | ||
414 | } | ||
415 | |||
416 | /* | ||
417 | * NOTE: Please use ioremap + __raw_read/write where possible instead of these | ||
418 | */ | ||
419 | |||
420 | u8 omap_readb(u32 pa) | ||
421 | { | ||
422 | return __raw_readb(OMAP2_L4_IO_ADDRESS(pa)); | ||
423 | } | ||
424 | EXPORT_SYMBOL(omap_readb); | ||
425 | |||
426 | u16 omap_readw(u32 pa) | ||
427 | { | ||
428 | return __raw_readw(OMAP2_L4_IO_ADDRESS(pa)); | ||
429 | } | ||
430 | EXPORT_SYMBOL(omap_readw); | ||
431 | |||
432 | u32 omap_readl(u32 pa) | ||
433 | { | ||
434 | return __raw_readl(OMAP2_L4_IO_ADDRESS(pa)); | ||
435 | } | ||
436 | EXPORT_SYMBOL(omap_readl); | ||
437 | |||
438 | void omap_writeb(u8 v, u32 pa) | ||
439 | { | ||
440 | __raw_writeb(v, OMAP2_L4_IO_ADDRESS(pa)); | ||
441 | } | ||
442 | EXPORT_SYMBOL(omap_writeb); | ||
443 | |||
444 | void omap_writew(u16 v, u32 pa) | ||
445 | { | ||
446 | __raw_writew(v, OMAP2_L4_IO_ADDRESS(pa)); | ||
447 | } | ||
448 | EXPORT_SYMBOL(omap_writew); | ||
449 | |||
450 | void omap_writel(u32 v, u32 pa) | ||
451 | { | ||
452 | __raw_writel(v, OMAP2_L4_IO_ADDRESS(pa)); | ||
355 | } | 453 | } |
454 | EXPORT_SYMBOL(omap_writel); | ||