diff options
author | Tony Lindgren <tony@atomide.com> | 2012-10-23 21:31:32 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-10-23 21:31:32 -0400 |
commit | 126c414a22cad4c54c6deb03cc4eafa9fd08c4ec (patch) | |
tree | 486eb54e546648e57d51b0d65a71f957e02e7f35 /arch/arm | |
parent | 1d8643dd0548e8cb9114e53c353b09da016a72fb (diff) | |
parent | 65bf7ca0005d7d827596d5df28583c83c9158da6 (diff) |
Merge tag 'for_3.7-rc3-fixes-pm' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into omap-for-v3.7-rc2/fixes
Misc. OMAP PM-related fixes for v3.7-rc
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/board-omap3beagle.c | 22 | ||||
-rw-r--r-- | arch/arm/mach-omap2/pm.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/pm34xx.c | 30 | ||||
-rw-r--r-- | arch/arm/mach-omap2/serial.c | 5 |
4 files changed, 47 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 388c431c745a..d41ab98890ff 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/input.h> | 24 | #include <linux/input.h> |
25 | #include <linux/gpio_keys.h> | 25 | #include <linux/gpio_keys.h> |
26 | #include <linux/opp.h> | 26 | #include <linux/opp.h> |
27 | #include <linux/cpu.h> | ||
27 | 28 | ||
28 | #include <linux/mtd/mtd.h> | 29 | #include <linux/mtd/mtd.h> |
29 | #include <linux/mtd/partitions.h> | 30 | #include <linux/mtd/partitions.h> |
@@ -444,27 +445,31 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
444 | }; | 445 | }; |
445 | #endif | 446 | #endif |
446 | 447 | ||
447 | static void __init beagle_opp_init(void) | 448 | static int __init beagle_opp_init(void) |
448 | { | 449 | { |
449 | int r = 0; | 450 | int r = 0; |
450 | 451 | ||
451 | /* Initialize the omap3 opp table */ | 452 | if (!machine_is_omap3_beagle()) |
452 | if (omap3_opp_init()) { | 453 | return 0; |
454 | |||
455 | /* Initialize the omap3 opp table if not already created. */ | ||
456 | r = omap3_opp_init(); | ||
457 | if (IS_ERR_VALUE(r) && (r != -EEXIST)) { | ||
453 | pr_err("%s: opp default init failed\n", __func__); | 458 | pr_err("%s: opp default init failed\n", __func__); |
454 | return; | 459 | return r; |
455 | } | 460 | } |
456 | 461 | ||
457 | /* Custom OPP enabled for all xM versions */ | 462 | /* Custom OPP enabled for all xM versions */ |
458 | if (cpu_is_omap3630()) { | 463 | if (cpu_is_omap3630()) { |
459 | struct device *mpu_dev, *iva_dev; | 464 | struct device *mpu_dev, *iva_dev; |
460 | 465 | ||
461 | mpu_dev = omap_device_get_by_hwmod_name("mpu"); | 466 | mpu_dev = get_cpu_device(0); |
462 | iva_dev = omap_device_get_by_hwmod_name("iva"); | 467 | iva_dev = omap_device_get_by_hwmod_name("iva"); |
463 | 468 | ||
464 | if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) { | 469 | if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) { |
465 | pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", | 470 | pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", |
466 | __func__, mpu_dev, iva_dev); | 471 | __func__, mpu_dev, iva_dev); |
467 | return; | 472 | return -ENODEV; |
468 | } | 473 | } |
469 | /* Enable MPU 1GHz and lower opps */ | 474 | /* Enable MPU 1GHz and lower opps */ |
470 | r = opp_enable(mpu_dev, 800000000); | 475 | r = opp_enable(mpu_dev, 800000000); |
@@ -484,8 +489,9 @@ static void __init beagle_opp_init(void) | |||
484 | opp_disable(iva_dev, 660000000); | 489 | opp_disable(iva_dev, 660000000); |
485 | } | 490 | } |
486 | } | 491 | } |
487 | return; | 492 | return 0; |
488 | } | 493 | } |
494 | device_initcall(beagle_opp_init); | ||
489 | 495 | ||
490 | static void __init omap3_beagle_init(void) | 496 | static void __init omap3_beagle_init(void) |
491 | { | 497 | { |
@@ -522,8 +528,6 @@ static void __init omap3_beagle_init(void) | |||
522 | /* Ensure SDRC pins are mux'd for self-refresh */ | 528 | /* Ensure SDRC pins are mux'd for self-refresh */ |
523 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); | 529 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); |
524 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); | 530 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); |
525 | |||
526 | beagle_opp_init(); | ||
527 | } | 531 | } |
528 | 532 | ||
529 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") | 533 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") |
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index 686137d164da..67d66131cfa7 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h | |||
@@ -91,6 +91,7 @@ extern void omap3_save_scratchpad_contents(void); | |||
91 | 91 | ||
92 | #define PM_RTA_ERRATUM_i608 (1 << 0) | 92 | #define PM_RTA_ERRATUM_i608 (1 << 0) |
93 | #define PM_SDRC_WAKEUP_ERRATUM_i583 (1 << 1) | 93 | #define PM_SDRC_WAKEUP_ERRATUM_i583 (1 << 1) |
94 | #define PM_PER_MEMORIES_ERRATUM_i582 (1 << 2) | ||
94 | 95 | ||
95 | #if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) | 96 | #if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) |
96 | extern u16 pm34xx_errata; | 97 | extern u16 pm34xx_errata; |
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index ba670db1fd37..3a904de4313e 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -652,14 +652,17 @@ static void __init pm_errata_configure(void) | |||
652 | /* Enable the l2 cache toggling in sleep logic */ | 652 | /* Enable the l2 cache toggling in sleep logic */ |
653 | enable_omap3630_toggle_l2_on_restore(); | 653 | enable_omap3630_toggle_l2_on_restore(); |
654 | if (omap_rev() < OMAP3630_REV_ES1_2) | 654 | if (omap_rev() < OMAP3630_REV_ES1_2) |
655 | pm34xx_errata |= PM_SDRC_WAKEUP_ERRATUM_i583; | 655 | pm34xx_errata |= (PM_SDRC_WAKEUP_ERRATUM_i583 | |
656 | PM_PER_MEMORIES_ERRATUM_i582); | ||
657 | } else if (cpu_is_omap34xx()) { | ||
658 | pm34xx_errata |= PM_PER_MEMORIES_ERRATUM_i582; | ||
656 | } | 659 | } |
657 | } | 660 | } |
658 | 661 | ||
659 | int __init omap3_pm_init(void) | 662 | int __init omap3_pm_init(void) |
660 | { | 663 | { |
661 | struct power_state *pwrst, *tmp; | 664 | struct power_state *pwrst, *tmp; |
662 | struct clockdomain *neon_clkdm, *mpu_clkdm; | 665 | struct clockdomain *neon_clkdm, *mpu_clkdm, *per_clkdm, *wkup_clkdm; |
663 | int ret; | 666 | int ret; |
664 | 667 | ||
665 | if (!omap3_has_io_chain_ctrl()) | 668 | if (!omap3_has_io_chain_ctrl()) |
@@ -711,6 +714,8 @@ int __init omap3_pm_init(void) | |||
711 | 714 | ||
712 | neon_clkdm = clkdm_lookup("neon_clkdm"); | 715 | neon_clkdm = clkdm_lookup("neon_clkdm"); |
713 | mpu_clkdm = clkdm_lookup("mpu_clkdm"); | 716 | mpu_clkdm = clkdm_lookup("mpu_clkdm"); |
717 | per_clkdm = clkdm_lookup("per_clkdm"); | ||
718 | wkup_clkdm = clkdm_lookup("wkup_clkdm"); | ||
714 | 719 | ||
715 | #ifdef CONFIG_SUSPEND | 720 | #ifdef CONFIG_SUSPEND |
716 | omap_pm_suspend = omap3_pm_suspend; | 721 | omap_pm_suspend = omap3_pm_suspend; |
@@ -727,6 +732,27 @@ int __init omap3_pm_init(void) | |||
727 | if (IS_PM34XX_ERRATUM(PM_RTA_ERRATUM_i608)) | 732 | if (IS_PM34XX_ERRATUM(PM_RTA_ERRATUM_i608)) |
728 | omap3630_ctrl_disable_rta(); | 733 | omap3630_ctrl_disable_rta(); |
729 | 734 | ||
735 | /* | ||
736 | * The UART3/4 FIFO and the sidetone memory in McBSP2/3 are | ||
737 | * not correctly reset when the PER powerdomain comes back | ||
738 | * from OFF or OSWR when the CORE powerdomain is kept active. | ||
739 | * See OMAP36xx Erratum i582 "PER Domain reset issue after | ||
740 | * Domain-OFF/OSWR Wakeup". This wakeup dependency is not a | ||
741 | * complete workaround. The kernel must also prevent the PER | ||
742 | * powerdomain from going to OSWR/OFF while the CORE | ||
743 | * powerdomain is not going to OSWR/OFF. And if PER last | ||
744 | * power state was off while CORE last power state was ON, the | ||
745 | * UART3/4 and McBSP2/3 SIDETONE devices need to run a | ||
746 | * self-test using their loopback tests; if that fails, those | ||
747 | * devices are unusable until the PER/CORE can complete a transition | ||
748 | * from ON to OSWR/OFF and then back to ON. | ||
749 | * | ||
750 | * XXX Technically this workaround is only needed if off-mode | ||
751 | * or OSWR is enabled. | ||
752 | */ | ||
753 | if (IS_PM34XX_ERRATUM(PM_PER_MEMORIES_ERRATUM_i582)) | ||
754 | clkdm_add_wkdep(per_clkdm, wkup_clkdm); | ||
755 | |||
730 | clkdm_add_wkdep(neon_clkdm, mpu_clkdm); | 756 | clkdm_add_wkdep(neon_clkdm, mpu_clkdm); |
731 | if (omap_type() != OMAP2_DEVICE_TYPE_GP) { | 757 | if (omap_type() != OMAP2_DEVICE_TYPE_GP) { |
732 | omap3_secure_ram_storage = | 758 | omap3_secure_ram_storage = |
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 0405c8190803..a507cd6cf4f1 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c | |||
@@ -329,6 +329,11 @@ void __init omap_serial_init_port(struct omap_board_data *bdata, | |||
329 | 329 | ||
330 | oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt); | 330 | oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt); |
331 | 331 | ||
332 | if (console_uart_id == bdata->id) { | ||
333 | omap_device_enable(pdev); | ||
334 | pm_runtime_set_active(&pdev->dev); | ||
335 | } | ||
336 | |||
332 | oh->dev_attr = uart; | 337 | oh->dev_attr = uart; |
333 | 338 | ||
334 | if (((cpu_is_omap34xx() || cpu_is_omap44xx()) && bdata->pads) | 339 | if (((cpu_is_omap34xx() || cpu_is_omap44xx()) && bdata->pads) |