aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2012-11-09 17:58:01 -0500
committerTony Lindgren <tony@atomide.com>2012-11-09 17:58:01 -0500
commitedf8dde393f879fc2d8c22d4bc01ff8d37b80e1a (patch)
tree61425adc8b2059a9c12a3ce66ba7361fea1b0bb3 /arch/arm/mach-omap2
parent6ba54ab4a49bbad736b0254aa6bdf0cb83013815 (diff)
parent3d70f8c617a436c7146ecb81df2265b4626dfe89 (diff)
Merge branch 'linus' into omap-for-v3.8/cleanup-headers-prepare-multiplatform-v3
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/Kconfig1
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c22
-rw-r--r--arch/arm/mach-omap2/clock33xx_data.c2
-rw-r--r--arch/arm/mach-omap2/mux34xx.c8
-rw-r--r--arch/arm/mach-omap2/pm.h1
-rw-r--r--arch/arm/mach-omap2/pm34xx.c30
-rw-r--r--arch/arm/mach-omap2/serial.c5
7 files changed, 53 insertions, 16 deletions
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 2a1a898c7f90..d669e227e00c 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -11,7 +11,6 @@ config ARCH_OMAP2PLUS_TYPICAL
11 select I2C_OMAP 11 select I2C_OMAP
12 select MENELAUS if ARCH_OMAP2 12 select MENELAUS if ARCH_OMAP2
13 select NEON if ARCH_OMAP3 || ARCH_OMAP4 || SOC_OMAP5 13 select NEON if ARCH_OMAP3 || ARCH_OMAP4 || SOC_OMAP5
14 select PINCTRL
15 select PM_RUNTIME 14 select PM_RUNTIME
16 select REGULATOR 15 select REGULATOR
17 select SERIAL_OMAP 16 select SERIAL_OMAP
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 85c09a09c5e3..5a3800da903f 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>
@@ -447,27 +448,31 @@ static struct omap_board_mux board_mux[] __initdata = {
447}; 448};
448#endif 449#endif
449 450
450static void __init beagle_opp_init(void) 451static int __init beagle_opp_init(void)
451{ 452{
452 int r = 0; 453 int r = 0;
453 454
454 /* Initialize the omap3 opp table */ 455 if (!machine_is_omap3_beagle())
455 if (omap3_opp_init()) { 456 return 0;
457
458 /* Initialize the omap3 opp table if not already created. */
459 r = omap3_opp_init();
460 if (IS_ERR_VALUE(r) && (r != -EEXIST)) {
456 pr_err("%s: opp default init failed\n", __func__); 461 pr_err("%s: opp default init failed\n", __func__);
457 return; 462 return r;
458 } 463 }
459 464
460 /* Custom OPP enabled for all xM versions */ 465 /* Custom OPP enabled for all xM versions */
461 if (cpu_is_omap3630()) { 466 if (cpu_is_omap3630()) {
462 struct device *mpu_dev, *iva_dev; 467 struct device *mpu_dev, *iva_dev;
463 468
464 mpu_dev = omap_device_get_by_hwmod_name("mpu"); 469 mpu_dev = get_cpu_device(0);
465 iva_dev = omap_device_get_by_hwmod_name("iva"); 470 iva_dev = omap_device_get_by_hwmod_name("iva");
466 471
467 if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) { 472 if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) {
468 pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", 473 pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
469 __func__, mpu_dev, iva_dev); 474 __func__, mpu_dev, iva_dev);
470 return; 475 return -ENODEV;
471 } 476 }
472 /* Enable MPU 1GHz and lower opps */ 477 /* Enable MPU 1GHz and lower opps */
473 r = opp_enable(mpu_dev, 800000000); 478 r = opp_enable(mpu_dev, 800000000);
@@ -487,8 +492,9 @@ static void __init beagle_opp_init(void)
487 opp_disable(iva_dev, 660000000); 492 opp_disable(iva_dev, 660000000);
488 } 493 }
489 } 494 }
490 return; 495 return 0;
491} 496}
497device_initcall(beagle_opp_init);
492 498
493static void __init omap3_beagle_init(void) 499static void __init omap3_beagle_init(void)
494{ 500{
@@ -526,8 +532,6 @@ static void __init omap3_beagle_init(void)
526 /* Ensure SDRC pins are mux'd for self-refresh */ 532 /* Ensure SDRC pins are mux'd for self-refresh */
527 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 533 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
528 omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); 534 omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
529
530 beagle_opp_init();
531} 535}
532 536
533MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") 537MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
diff --git a/arch/arm/mach-omap2/clock33xx_data.c b/arch/arm/mach-omap2/clock33xx_data.c
index 1cb79cc58089..17e3de51bcba 100644
--- a/arch/arm/mach-omap2/clock33xx_data.c
+++ b/arch/arm/mach-omap2/clock33xx_data.c
@@ -1072,6 +1072,8 @@ static struct omap_clk am33xx_clks[] = {
1072 CLK(NULL, "gfx_fck_div_ck", &gfx_fck_div_ck, CK_AM33XX), 1072 CLK(NULL, "gfx_fck_div_ck", &gfx_fck_div_ck, CK_AM33XX),
1073 CLK(NULL, "sysclkout_pre_ck", &sysclkout_pre_ck, CK_AM33XX), 1073 CLK(NULL, "sysclkout_pre_ck", &sysclkout_pre_ck, CK_AM33XX),
1074 CLK(NULL, "clkout2_ck", &clkout2_ck, CK_AM33XX), 1074 CLK(NULL, "clkout2_ck", &clkout2_ck, CK_AM33XX),
1075 CLK(NULL, "timer_32k_ck", &clkdiv32k_ick, CK_AM33XX),
1076 CLK(NULL, "timer_sys_ck", &sys_clkin_ck, CK_AM33XX),
1075}; 1077};
1076 1078
1077int __init am33xx_clk_init(void) 1079int __init am33xx_clk_init(void)
diff --git a/arch/arm/mach-omap2/mux34xx.c b/arch/arm/mach-omap2/mux34xx.c
index 17f80e4ab162..c47140bbbec4 100644
--- a/arch/arm/mach-omap2/mux34xx.c
+++ b/arch/arm/mach-omap2/mux34xx.c
@@ -614,16 +614,16 @@ static struct omap_mux __initdata omap3_muxmodes[] = {
614 "sys_off_mode", NULL, NULL, NULL, 614 "sys_off_mode", NULL, NULL, NULL,
615 "gpio_9", NULL, NULL, "safe_mode"), 615 "gpio_9", NULL, NULL, "safe_mode"),
616 _OMAP3_MUXENTRY(UART1_CTS, 150, 616 _OMAP3_MUXENTRY(UART1_CTS, 150,
617 "uart1_cts", NULL, NULL, NULL, 617 "uart1_cts", "ssi1_rdy_tx", NULL, NULL,
618 "gpio_150", "hsusb3_tll_clk", NULL, "safe_mode"), 618 "gpio_150", "hsusb3_tll_clk", NULL, "safe_mode"),
619 _OMAP3_MUXENTRY(UART1_RTS, 149, 619 _OMAP3_MUXENTRY(UART1_RTS, 149,
620 "uart1_rts", NULL, NULL, NULL, 620 "uart1_rts", "ssi1_flag_tx", NULL, NULL,
621 "gpio_149", NULL, NULL, "safe_mode"), 621 "gpio_149", NULL, NULL, "safe_mode"),
622 _OMAP3_MUXENTRY(UART1_RX, 151, 622 _OMAP3_MUXENTRY(UART1_RX, 151,
623 "uart1_rx", NULL, "mcbsp1_clkr", "mcspi4_clk", 623 "uart1_rx", "ss1_wake_tx", "mcbsp1_clkr", "mcspi4_clk",
624 "gpio_151", NULL, NULL, "safe_mode"), 624 "gpio_151", NULL, NULL, "safe_mode"),
625 _OMAP3_MUXENTRY(UART1_TX, 148, 625 _OMAP3_MUXENTRY(UART1_TX, 148,
626 "uart1_tx", NULL, NULL, NULL, 626 "uart1_tx", "ssi1_dat_tx", NULL, NULL,
627 "gpio_148", NULL, NULL, "safe_mode"), 627 "gpio_148", NULL, NULL, "safe_mode"),
628 _OMAP3_MUXENTRY(UART2_CTS, 144, 628 _OMAP3_MUXENTRY(UART2_CTS, 144,
629 "uart2_cts", "mcbsp3_dx", "gpt9_pwm_evt", NULL, 629 "uart2_cts", "mcbsp3_dx", "gpt9_pwm_evt", NULL,
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)
96extern u16 pm34xx_errata; 97extern u16 pm34xx_errata;
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 4c85762107bd..11f9669eb7ed 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -653,14 +653,17 @@ static void __init pm_errata_configure(void)
653 /* Enable the l2 cache toggling in sleep logic */ 653 /* Enable the l2 cache toggling in sleep logic */
654 enable_omap3630_toggle_l2_on_restore(); 654 enable_omap3630_toggle_l2_on_restore();
655 if (omap_rev() < OMAP3630_REV_ES1_2) 655 if (omap_rev() < OMAP3630_REV_ES1_2)
656 pm34xx_errata |= PM_SDRC_WAKEUP_ERRATUM_i583; 656 pm34xx_errata |= (PM_SDRC_WAKEUP_ERRATUM_i583 |
657 PM_PER_MEMORIES_ERRATUM_i582);
658 } else if (cpu_is_omap34xx()) {
659 pm34xx_errata |= PM_PER_MEMORIES_ERRATUM_i582;
657 } 660 }
658} 661}
659 662
660int __init omap3_pm_init(void) 663int __init omap3_pm_init(void)
661{ 664{
662 struct power_state *pwrst, *tmp; 665 struct power_state *pwrst, *tmp;
663 struct clockdomain *neon_clkdm, *mpu_clkdm; 666 struct clockdomain *neon_clkdm, *mpu_clkdm, *per_clkdm, *wkup_clkdm;
664 int ret; 667 int ret;
665 668
666 if (!omap3_has_io_chain_ctrl()) 669 if (!omap3_has_io_chain_ctrl())
@@ -712,6 +715,8 @@ int __init omap3_pm_init(void)
712 715
713 neon_clkdm = clkdm_lookup("neon_clkdm"); 716 neon_clkdm = clkdm_lookup("neon_clkdm");
714 mpu_clkdm = clkdm_lookup("mpu_clkdm"); 717 mpu_clkdm = clkdm_lookup("mpu_clkdm");
718 per_clkdm = clkdm_lookup("per_clkdm");
719 wkup_clkdm = clkdm_lookup("wkup_clkdm");
715 720
716#ifdef CONFIG_SUSPEND 721#ifdef CONFIG_SUSPEND
717 omap_pm_suspend = omap3_pm_suspend; 722 omap_pm_suspend = omap3_pm_suspend;
@@ -728,6 +733,27 @@ int __init omap3_pm_init(void)
728 if (IS_PM34XX_ERRATUM(PM_RTA_ERRATUM_i608)) 733 if (IS_PM34XX_ERRATUM(PM_RTA_ERRATUM_i608))
729 omap3630_ctrl_disable_rta(); 734 omap3630_ctrl_disable_rta();
730 735
736 /*
737 * The UART3/4 FIFO and the sidetone memory in McBSP2/3 are
738 * not correctly reset when the PER powerdomain comes back
739 * from OFF or OSWR when the CORE powerdomain is kept active.
740 * See OMAP36xx Erratum i582 "PER Domain reset issue after
741 * Domain-OFF/OSWR Wakeup". This wakeup dependency is not a
742 * complete workaround. The kernel must also prevent the PER
743 * powerdomain from going to OSWR/OFF while the CORE
744 * powerdomain is not going to OSWR/OFF. And if PER last
745 * power state was off while CORE last power state was ON, the
746 * UART3/4 and McBSP2/3 SIDETONE devices need to run a
747 * self-test using their loopback tests; if that fails, those
748 * devices are unusable until the PER/CORE can complete a transition
749 * from ON to OSWR/OFF and then back to ON.
750 *
751 * XXX Technically this workaround is only needed if off-mode
752 * or OSWR is enabled.
753 */
754 if (IS_PM34XX_ERRATUM(PM_PER_MEMORIES_ERRATUM_i582))
755 clkdm_add_wkdep(per_clkdm, wkup_clkdm);
756
731 clkdm_add_wkdep(neon_clkdm, mpu_clkdm); 757 clkdm_add_wkdep(neon_clkdm, mpu_clkdm);
732 if (omap_type() != OMAP2_DEVICE_TYPE_GP) { 758 if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
733 omap3_secure_ram_storage = 759 omap3_secure_ram_storage =
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 812976eac536..aa30a3c20883 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -330,6 +330,11 @@ void __init omap_serial_init_port(struct omap_board_data *bdata,
330 330
331 oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt); 331 oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt);
332 332
333 if (console_uart_id == bdata->id) {
334 omap_device_enable(pdev);
335 pm_runtime_set_active(&pdev->dev);
336 }
337
333 oh->dev_attr = uart; 338 oh->dev_attr = uart;
334 339
335 if (((cpu_is_omap34xx() || cpu_is_omap44xx()) && bdata->pads) 340 if (((cpu_is_omap34xx() || cpu_is_omap44xx()) && bdata->pads)