diff options
Diffstat (limited to 'arch/arm/mach-omap2')
| -rw-r--r-- | arch/arm/mach-omap2/Kconfig | 2 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/board-igep0020.c | 2 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/board-n8x0.c | 1 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/board-omap3evm.c | 1 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/clock3xxx_data.c | 14 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/common-board-devices.c | 11 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/common-board-devices.h | 1 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/cpuidle44xx.c | 148 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/display.c | 25 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/hsmmc.c | 1 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/mux.h | 1 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/omap-smp.c | 2 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/opp4xxx_data.c | 2 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/pm34xx.c | 19 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/sleep44xx.S | 8 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/timer.c | 4 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/twl-common.c | 1 |
17 files changed, 150 insertions, 93 deletions
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index dd0fbf76ac79..fcd4e85c4ddc 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig | |||
| @@ -62,12 +62,14 @@ config ARCH_OMAP4 | |||
| 62 | select PM_OPP if PM | 62 | select PM_OPP if PM |
| 63 | select USB_ARCH_HAS_EHCI if USB_SUPPORT | 63 | select USB_ARCH_HAS_EHCI if USB_SUPPORT |
| 64 | select ARM_CPU_SUSPEND if PM | 64 | select ARM_CPU_SUSPEND if PM |
| 65 | select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP | ||
| 65 | 66 | ||
| 66 | config SOC_OMAP5 | 67 | config SOC_OMAP5 |
| 67 | bool "TI OMAP5" | 68 | bool "TI OMAP5" |
| 68 | select CPU_V7 | 69 | select CPU_V7 |
| 69 | select ARM_GIC | 70 | select ARM_GIC |
| 70 | select HAVE_SMP | 71 | select HAVE_SMP |
| 72 | select ARM_CPU_SUSPEND if PM | ||
| 71 | 73 | ||
| 72 | comment "OMAP Core Type" | 74 | comment "OMAP Core Type" |
| 73 | depends on ARCH_OMAP2 | 75 | depends on ARCH_OMAP2 |
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index 74915295482e..28214483aaba 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c | |||
| @@ -554,6 +554,8 @@ static const struct usbhs_omap_board_data igep3_usbhs_bdata __initconst = { | |||
| 554 | 554 | ||
| 555 | #ifdef CONFIG_OMAP_MUX | 555 | #ifdef CONFIG_OMAP_MUX |
| 556 | static struct omap_board_mux board_mux[] __initdata = { | 556 | static struct omap_board_mux board_mux[] __initdata = { |
| 557 | /* SMSC9221 LAN Controller ETH IRQ (GPIO_176) */ | ||
| 558 | OMAP3_MUX(MCSPI1_CS2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), | ||
| 557 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 559 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
| 558 | }; | 560 | }; |
| 559 | #endif | 561 | #endif |
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c index 2c5d0ed75285..677357ff61ac 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c | |||
| @@ -468,7 +468,6 @@ static struct omap_mmc_platform_data mmc1_data = { | |||
| 468 | .cleanup = n8x0_mmc_cleanup, | 468 | .cleanup = n8x0_mmc_cleanup, |
| 469 | .shutdown = n8x0_mmc_shutdown, | 469 | .shutdown = n8x0_mmc_shutdown, |
| 470 | .max_freq = 24000000, | 470 | .max_freq = 24000000, |
| 471 | .dma_mask = 0xffffffff, | ||
| 472 | .slots[0] = { | 471 | .slots[0] = { |
| 473 | .wires = 4, | 472 | .wires = 4, |
| 474 | .set_power = n8x0_mmc_set_power, | 473 | .set_power = n8x0_mmc_set_power, |
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index ef230a0eb5eb..0d362e9f9cb9 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c | |||
| @@ -58,6 +58,7 @@ | |||
| 58 | #include "hsmmc.h" | 58 | #include "hsmmc.h" |
| 59 | #include "common-board-devices.h" | 59 | #include "common-board-devices.h" |
| 60 | 60 | ||
| 61 | #define OMAP3_EVM_TS_GPIO 175 | ||
| 61 | #define OMAP3_EVM_EHCI_VBUS 22 | 62 | #define OMAP3_EVM_EHCI_VBUS 22 |
| 62 | #define OMAP3_EVM_EHCI_SELECT 61 | 63 | #define OMAP3_EVM_EHCI_SELECT 61 |
| 63 | 64 | ||
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c index 91b3d5c60bfe..83bed9ad3017 100644 --- a/arch/arm/mach-omap2/clock3xxx_data.c +++ b/arch/arm/mach-omap2/clock3xxx_data.c | |||
| @@ -3376,15 +3376,15 @@ static struct omap_clk omap3xxx_clks[] = { | |||
| 3376 | CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), | 3376 | CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), |
| 3377 | CLK(NULL, "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), | 3377 | CLK(NULL, "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), |
| 3378 | CLK("usbhs_omap", "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), | 3378 | CLK("usbhs_omap", "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), |
| 3379 | CLK("usbhs_omap", "utmi_p1_gfclk", &dummy_ck, CK_3XXX), | 3379 | CLK(NULL, "utmi_p1_gfclk", &dummy_ck, CK_3XXX), |
| 3380 | CLK("usbhs_omap", "utmi_p2_gfclk", &dummy_ck, CK_3XXX), | 3380 | CLK(NULL, "utmi_p2_gfclk", &dummy_ck, CK_3XXX), |
| 3381 | CLK("usbhs_omap", "xclk60mhsp1_ck", &dummy_ck, CK_3XXX), | 3381 | CLK(NULL, "xclk60mhsp1_ck", &dummy_ck, CK_3XXX), |
| 3382 | CLK("usbhs_omap", "xclk60mhsp2_ck", &dummy_ck, CK_3XXX), | 3382 | CLK(NULL, "xclk60mhsp2_ck", &dummy_ck, CK_3XXX), |
| 3383 | CLK("usbhs_omap", "usb_host_hs_utmi_p1_clk", &dummy_ck, CK_3XXX), | 3383 | CLK(NULL, "usb_host_hs_utmi_p1_clk", &dummy_ck, CK_3XXX), |
| 3384 | CLK("usbhs_omap", "usb_host_hs_utmi_p2_clk", &dummy_ck, CK_3XXX), | 3384 | CLK(NULL, "usb_host_hs_utmi_p2_clk", &dummy_ck, CK_3XXX), |
| 3385 | CLK("usbhs_omap", "usb_tll_hs_usb_ch0_clk", &dummy_ck, CK_3XXX), | 3385 | CLK("usbhs_omap", "usb_tll_hs_usb_ch0_clk", &dummy_ck, CK_3XXX), |
| 3386 | CLK("usbhs_omap", "usb_tll_hs_usb_ch1_clk", &dummy_ck, CK_3XXX), | 3386 | CLK("usbhs_omap", "usb_tll_hs_usb_ch1_clk", &dummy_ck, CK_3XXX), |
| 3387 | CLK("usbhs_omap", "init_60m_fclk", &dummy_ck, CK_3XXX), | 3387 | CLK(NULL, "init_60m_fclk", &dummy_ck, CK_3XXX), |
| 3388 | CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2PLUS | CK_36XX), | 3388 | CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2PLUS | CK_36XX), |
| 3389 | CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX), | 3389 | CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX), |
| 3390 | CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_3XXX), | 3390 | CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_3XXX), |
diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c index 14734746457c..c1875862679f 100644 --- a/arch/arm/mach-omap2/common-board-devices.c +++ b/arch/arm/mach-omap2/common-board-devices.c | |||
| @@ -35,16 +35,6 @@ static struct omap2_mcspi_device_config ads7846_mcspi_config = { | |||
| 35 | .turbo_mode = 0, | 35 | .turbo_mode = 0, |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | /* | ||
| 39 | * ADS7846 driver maybe request a gpio according to the value | ||
| 40 | * of pdata->get_pendown_state, but we have done this. So set | ||
| 41 | * get_pendown_state to avoid twice gpio requesting. | ||
| 42 | */ | ||
| 43 | static int omap3_get_pendown_state(void) | ||
| 44 | { | ||
| 45 | return !gpio_get_value(OMAP3_EVM_TS_GPIO); | ||
| 46 | } | ||
| 47 | |||
| 48 | static struct ads7846_platform_data ads7846_config = { | 38 | static struct ads7846_platform_data ads7846_config = { |
| 49 | .x_max = 0x0fff, | 39 | .x_max = 0x0fff, |
| 50 | .y_max = 0x0fff, | 40 | .y_max = 0x0fff, |
| @@ -55,7 +45,6 @@ static struct ads7846_platform_data ads7846_config = { | |||
| 55 | .debounce_rep = 1, | 45 | .debounce_rep = 1, |
| 56 | .gpio_pendown = -EINVAL, | 46 | .gpio_pendown = -EINVAL, |
| 57 | .keep_vref_on = 1, | 47 | .keep_vref_on = 1, |
| 58 | .get_pendown_state = &omap3_get_pendown_state, | ||
| 59 | }; | 48 | }; |
| 60 | 49 | ||
| 61 | static struct spi_board_info ads7846_spi_board_info __initdata = { | 50 | static struct spi_board_info ads7846_spi_board_info __initdata = { |
diff --git a/arch/arm/mach-omap2/common-board-devices.h b/arch/arm/mach-omap2/common-board-devices.h index 4c4ef6a6166b..a0b4a42836ab 100644 --- a/arch/arm/mach-omap2/common-board-devices.h +++ b/arch/arm/mach-omap2/common-board-devices.h | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | #include "twl-common.h" | 4 | #include "twl-common.h" |
| 5 | 5 | ||
| 6 | #define NAND_BLOCK_SIZE SZ_128K | 6 | #define NAND_BLOCK_SIZE SZ_128K |
| 7 | #define OMAP3_EVM_TS_GPIO 175 | ||
| 8 | 7 | ||
| 9 | struct mtd_partition; | 8 | struct mtd_partition; |
| 10 | struct ads7846_platform_data; | 9 | struct ads7846_platform_data; |
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c index 02d15bbd4e35..288bee6cbb76 100644 --- a/arch/arm/mach-omap2/cpuidle44xx.c +++ b/arch/arm/mach-omap2/cpuidle44xx.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include "common.h" | 21 | #include "common.h" |
| 22 | #include "pm.h" | 22 | #include "pm.h" |
| 23 | #include "prm.h" | 23 | #include "prm.h" |
| 24 | #include "clockdomain.h" | ||
| 24 | 25 | ||
| 25 | /* Machine specific information */ | 26 | /* Machine specific information */ |
| 26 | struct omap4_idle_statedata { | 27 | struct omap4_idle_statedata { |
| @@ -47,10 +48,14 @@ static struct omap4_idle_statedata omap4_idle_data[] = { | |||
| 47 | }, | 48 | }, |
| 48 | }; | 49 | }; |
| 49 | 50 | ||
| 50 | static struct powerdomain *mpu_pd, *cpu0_pd, *cpu1_pd; | 51 | static struct powerdomain *mpu_pd, *cpu_pd[NR_CPUS]; |
| 52 | static struct clockdomain *cpu_clkdm[NR_CPUS]; | ||
| 53 | |||
| 54 | static atomic_t abort_barrier; | ||
| 55 | static bool cpu_done[NR_CPUS]; | ||
| 51 | 56 | ||
| 52 | /** | 57 | /** |
| 53 | * omap4_enter_idle - Programs OMAP4 to enter the specified state | 58 | * omap4_enter_idle_coupled_[simple/coupled] - OMAP4 cpuidle entry functions |
| 54 | * @dev: cpuidle device | 59 | * @dev: cpuidle device |
| 55 | * @drv: cpuidle driver | 60 | * @drv: cpuidle driver |
| 56 | * @index: the index of state to be entered | 61 | * @index: the index of state to be entered |
| @@ -59,60 +64,84 @@ static struct powerdomain *mpu_pd, *cpu0_pd, *cpu1_pd; | |||
| 59 | * specified low power state selected by the governor. | 64 | * specified low power state selected by the governor. |
| 60 | * Returns the amount of time spent in the low power state. | 65 | * Returns the amount of time spent in the low power state. |
| 61 | */ | 66 | */ |
| 62 | static int omap4_enter_idle(struct cpuidle_device *dev, | 67 | static int omap4_enter_idle_simple(struct cpuidle_device *dev, |
| 68 | struct cpuidle_driver *drv, | ||
| 69 | int index) | ||
| 70 | { | ||
| 71 | local_fiq_disable(); | ||
| 72 | omap_do_wfi(); | ||
| 73 | local_fiq_enable(); | ||
| 74 | |||
| 75 | return index; | ||
| 76 | } | ||
| 77 | |||
| 78 | static int omap4_enter_idle_coupled(struct cpuidle_device *dev, | ||
| 63 | struct cpuidle_driver *drv, | 79 | struct cpuidle_driver *drv, |
| 64 | int index) | 80 | int index) |
| 65 | { | 81 | { |
| 66 | struct omap4_idle_statedata *cx = &omap4_idle_data[index]; | 82 | struct omap4_idle_statedata *cx = &omap4_idle_data[index]; |
| 67 | u32 cpu1_state; | ||
| 68 | int cpu_id = smp_processor_id(); | 83 | int cpu_id = smp_processor_id(); |
| 69 | 84 | ||
| 70 | local_fiq_disable(); | 85 | local_fiq_disable(); |
| 71 | 86 | ||
| 72 | /* | 87 | /* |
| 73 | * CPU0 has to stay ON (i.e in C1) until CPU1 is OFF state. | 88 | * CPU0 has to wait and stay ON until CPU1 is OFF state. |
| 74 | * This is necessary to honour hardware recommondation | 89 | * This is necessary to honour hardware recommondation |
| 75 | * of triggeing all the possible low power modes once CPU1 is | 90 | * of triggeing all the possible low power modes once CPU1 is |
| 76 | * out of coherency and in OFF mode. | 91 | * out of coherency and in OFF mode. |
| 77 | * Update dev->last_state so that governor stats reflects right | ||
| 78 | * data. | ||
| 79 | */ | 92 | */ |
| 80 | cpu1_state = pwrdm_read_pwrst(cpu1_pd); | 93 | if (dev->cpu == 0 && cpumask_test_cpu(1, cpu_online_mask)) { |
| 81 | if (cpu1_state != PWRDM_POWER_OFF) { | 94 | while (pwrdm_read_pwrst(cpu_pd[1]) != PWRDM_POWER_OFF) { |
| 82 | index = drv->safe_state_index; | 95 | cpu_relax(); |
| 83 | cx = &omap4_idle_data[index]; | 96 | |
| 97 | /* | ||
| 98 | * CPU1 could have already entered & exited idle | ||
| 99 | * without hitting off because of a wakeup | ||
| 100 | * or a failed attempt to hit off mode. Check for | ||
| 101 | * that here, otherwise we could spin forever | ||
| 102 | * waiting for CPU1 off. | ||
| 103 | */ | ||
| 104 | if (cpu_done[1]) | ||
| 105 | goto fail; | ||
| 106 | |||
| 107 | } | ||
| 84 | } | 108 | } |
| 85 | 109 | ||
| 86 | if (index > 0) | 110 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu_id); |
| 87 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu_id); | ||
| 88 | 111 | ||
| 89 | /* | 112 | /* |
| 90 | * Call idle CPU PM enter notifier chain so that | 113 | * Call idle CPU PM enter notifier chain so that |
| 91 | * VFP and per CPU interrupt context is saved. | 114 | * VFP and per CPU interrupt context is saved. |
| 92 | */ | 115 | */ |
| 93 | if (cx->cpu_state == PWRDM_POWER_OFF) | 116 | cpu_pm_enter(); |
| 94 | cpu_pm_enter(); | 117 | |
| 95 | 118 | if (dev->cpu == 0) { | |
| 96 | pwrdm_set_logic_retst(mpu_pd, cx->mpu_logic_state); | 119 | pwrdm_set_logic_retst(mpu_pd, cx->mpu_logic_state); |
| 97 | omap_set_pwrdm_state(mpu_pd, cx->mpu_state); | 120 | omap_set_pwrdm_state(mpu_pd, cx->mpu_state); |
| 98 | 121 | ||
| 99 | /* | 122 | /* |
| 100 | * Call idle CPU cluster PM enter notifier chain | 123 | * Call idle CPU cluster PM enter notifier chain |
| 101 | * to save GIC and wakeupgen context. | 124 | * to save GIC and wakeupgen context. |
| 102 | */ | 125 | */ |
| 103 | if ((cx->mpu_state == PWRDM_POWER_RET) && | 126 | if ((cx->mpu_state == PWRDM_POWER_RET) && |
| 104 | (cx->mpu_logic_state == PWRDM_POWER_OFF)) | 127 | (cx->mpu_logic_state == PWRDM_POWER_OFF)) |
| 105 | cpu_cluster_pm_enter(); | 128 | cpu_cluster_pm_enter(); |
| 129 | } | ||
| 106 | 130 | ||
| 107 | omap4_enter_lowpower(dev->cpu, cx->cpu_state); | 131 | omap4_enter_lowpower(dev->cpu, cx->cpu_state); |
| 132 | cpu_done[dev->cpu] = true; | ||
| 133 | |||
| 134 | /* Wakeup CPU1 only if it is not offlined */ | ||
| 135 | if (dev->cpu == 0 && cpumask_test_cpu(1, cpu_online_mask)) { | ||
| 136 | clkdm_wakeup(cpu_clkdm[1]); | ||
| 137 | clkdm_allow_idle(cpu_clkdm[1]); | ||
| 138 | } | ||
| 108 | 139 | ||
| 109 | /* | 140 | /* |
| 110 | * Call idle CPU PM exit notifier chain to restore | 141 | * Call idle CPU PM exit notifier chain to restore |
| 111 | * VFP and per CPU IRQ context. Only CPU0 state is | 142 | * VFP and per CPU IRQ context. |
| 112 | * considered since CPU1 is managed by CPU hotplug. | ||
| 113 | */ | 143 | */ |
| 114 | if (pwrdm_read_prev_pwrst(cpu0_pd) == PWRDM_POWER_OFF) | 144 | cpu_pm_exit(); |
| 115 | cpu_pm_exit(); | ||
| 116 | 145 | ||
| 117 | /* | 146 | /* |
| 118 | * Call idle CPU cluster PM exit notifier chain | 147 | * Call idle CPU cluster PM exit notifier chain |
| @@ -121,8 +150,11 @@ static int omap4_enter_idle(struct cpuidle_device *dev, | |||
| 121 | if (omap4_mpuss_read_prev_context_state()) | 150 | if (omap4_mpuss_read_prev_context_state()) |
| 122 | cpu_cluster_pm_exit(); | 151 | cpu_cluster_pm_exit(); |
| 123 | 152 | ||
| 124 | if (index > 0) | 153 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu_id); |
| 125 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu_id); | 154 | |
| 155 | fail: | ||
| 156 | cpuidle_coupled_parallel_barrier(dev, &abort_barrier); | ||
| 157 | cpu_done[dev->cpu] = false; | ||
| 126 | 158 | ||
| 127 | local_fiq_enable(); | 159 | local_fiq_enable(); |
| 128 | 160 | ||
| @@ -141,7 +173,7 @@ struct cpuidle_driver omap4_idle_driver = { | |||
| 141 | .exit_latency = 2 + 2, | 173 | .exit_latency = 2 + 2, |
| 142 | .target_residency = 5, | 174 | .target_residency = 5, |
| 143 | .flags = CPUIDLE_FLAG_TIME_VALID, | 175 | .flags = CPUIDLE_FLAG_TIME_VALID, |
| 144 | .enter = omap4_enter_idle, | 176 | .enter = omap4_enter_idle_simple, |
| 145 | .name = "C1", | 177 | .name = "C1", |
| 146 | .desc = "MPUSS ON" | 178 | .desc = "MPUSS ON" |
| 147 | }, | 179 | }, |
| @@ -149,8 +181,8 @@ struct cpuidle_driver omap4_idle_driver = { | |||
| 149 | /* C2 - CPU0 OFF + CPU1 OFF + MPU CSWR */ | 181 | /* C2 - CPU0 OFF + CPU1 OFF + MPU CSWR */ |
| 150 | .exit_latency = 328 + 440, | 182 | .exit_latency = 328 + 440, |
| 151 | .target_residency = 960, | 183 | .target_residency = 960, |
| 152 | .flags = CPUIDLE_FLAG_TIME_VALID, | 184 | .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_COUPLED, |
| 153 | .enter = omap4_enter_idle, | 185 | .enter = omap4_enter_idle_coupled, |
| 154 | .name = "C2", | 186 | .name = "C2", |
| 155 | .desc = "MPUSS CSWR", | 187 | .desc = "MPUSS CSWR", |
| 156 | }, | 188 | }, |
| @@ -158,8 +190,8 @@ struct cpuidle_driver omap4_idle_driver = { | |||
| 158 | /* C3 - CPU0 OFF + CPU1 OFF + MPU OSWR */ | 190 | /* C3 - CPU0 OFF + CPU1 OFF + MPU OSWR */ |
| 159 | .exit_latency = 460 + 518, | 191 | .exit_latency = 460 + 518, |
| 160 | .target_residency = 1100, | 192 | .target_residency = 1100, |
| 161 | .flags = CPUIDLE_FLAG_TIME_VALID, | 193 | .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_COUPLED, |
| 162 | .enter = omap4_enter_idle, | 194 | .enter = omap4_enter_idle_coupled, |
| 163 | .name = "C3", | 195 | .name = "C3", |
| 164 | .desc = "MPUSS OSWR", | 196 | .desc = "MPUSS OSWR", |
| 165 | }, | 197 | }, |
| @@ -168,6 +200,16 @@ struct cpuidle_driver omap4_idle_driver = { | |||
| 168 | .safe_state_index = 0, | 200 | .safe_state_index = 0, |
| 169 | }; | 201 | }; |
| 170 | 202 | ||
| 203 | /* | ||
| 204 | * For each cpu, setup the broadcast timer because local timers | ||
| 205 | * stops for the states above C1. | ||
| 206 | */ | ||
| 207 | static void omap_setup_broadcast_timer(void *arg) | ||
| 208 | { | ||
| 209 | int cpu = smp_processor_id(); | ||
| 210 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &cpu); | ||
| 211 | } | ||
| 212 | |||
| 171 | /** | 213 | /** |
| 172 | * omap4_idle_init - Init routine for OMAP4 idle | 214 | * omap4_idle_init - Init routine for OMAP4 idle |
| 173 | * | 215 | * |
| @@ -180,19 +222,31 @@ int __init omap4_idle_init(void) | |||
| 180 | unsigned int cpu_id = 0; | 222 | unsigned int cpu_id = 0; |
| 181 | 223 | ||
| 182 | mpu_pd = pwrdm_lookup("mpu_pwrdm"); | 224 | mpu_pd = pwrdm_lookup("mpu_pwrdm"); |
| 183 | cpu0_pd = pwrdm_lookup("cpu0_pwrdm"); | 225 | cpu_pd[0] = pwrdm_lookup("cpu0_pwrdm"); |
| 184 | cpu1_pd = pwrdm_lookup("cpu1_pwrdm"); | 226 | cpu_pd[1] = pwrdm_lookup("cpu1_pwrdm"); |
| 185 | if ((!mpu_pd) || (!cpu0_pd) || (!cpu1_pd)) | 227 | if ((!mpu_pd) || (!cpu_pd[0]) || (!cpu_pd[1])) |
| 186 | return -ENODEV; | 228 | return -ENODEV; |
| 187 | 229 | ||
| 188 | dev = &per_cpu(omap4_idle_dev, cpu_id); | 230 | cpu_clkdm[0] = clkdm_lookup("mpu0_clkdm"); |
| 189 | dev->cpu = cpu_id; | 231 | cpu_clkdm[1] = clkdm_lookup("mpu1_clkdm"); |
| 190 | 232 | if (!cpu_clkdm[0] || !cpu_clkdm[1]) | |
| 191 | cpuidle_register_driver(&omap4_idle_driver); | 233 | return -ENODEV; |
| 192 | 234 | ||
| 193 | if (cpuidle_register_device(dev)) { | 235 | /* Configure the broadcast timer on each cpu */ |
| 194 | pr_err("%s: CPUidle register device failed\n", __func__); | 236 | on_each_cpu(omap_setup_broadcast_timer, NULL, 1); |
| 195 | return -EIO; | 237 | |
| 238 | for_each_cpu(cpu_id, cpu_online_mask) { | ||
| 239 | dev = &per_cpu(omap4_idle_dev, cpu_id); | ||
| 240 | dev->cpu = cpu_id; | ||
| 241 | #ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED | ||
| 242 | dev->coupled_cpus = *cpu_online_mask; | ||
| 243 | #endif | ||
| 244 | cpuidle_register_driver(&omap4_idle_driver); | ||
| 245 | |||
| 246 | if (cpuidle_register_device(dev)) { | ||
| 247 | pr_err("%s: CPUidle register failed\n", __func__); | ||
| 248 | return -EIO; | ||
| 249 | } | ||
| 196 | } | 250 | } |
| 197 | 251 | ||
| 198 | return 0; | 252 | return 0; |
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index 5fb47a14f4ba..af1ed7d24a1f 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | 37 | ||
| 38 | #define DISPC_CONTROL 0x0040 | 38 | #define DISPC_CONTROL 0x0040 |
| 39 | #define DISPC_CONTROL2 0x0238 | 39 | #define DISPC_CONTROL2 0x0238 |
| 40 | #define DISPC_CONTROL3 0x0848 | ||
| 40 | #define DISPC_IRQSTATUS 0x0018 | 41 | #define DISPC_IRQSTATUS 0x0018 |
| 41 | 42 | ||
| 42 | #define DSS_SYSCONFIG 0x10 | 43 | #define DSS_SYSCONFIG 0x10 |
| @@ -52,6 +53,7 @@ | |||
| 52 | #define EVSYNC_EVEN_IRQ_SHIFT 2 | 53 | #define EVSYNC_EVEN_IRQ_SHIFT 2 |
| 53 | #define EVSYNC_ODD_IRQ_SHIFT 3 | 54 | #define EVSYNC_ODD_IRQ_SHIFT 3 |
| 54 | #define FRAMEDONE2_IRQ_SHIFT 22 | 55 | #define FRAMEDONE2_IRQ_SHIFT 22 |
| 56 | #define FRAMEDONE3_IRQ_SHIFT 30 | ||
| 55 | #define FRAMEDONETV_IRQ_SHIFT 24 | 57 | #define FRAMEDONETV_IRQ_SHIFT 24 |
| 56 | 58 | ||
| 57 | /* | 59 | /* |
| @@ -376,7 +378,7 @@ int __init omap_display_init(struct omap_dss_board_info *board_data) | |||
| 376 | static void dispc_disable_outputs(void) | 378 | static void dispc_disable_outputs(void) |
| 377 | { | 379 | { |
| 378 | u32 v, irq_mask = 0; | 380 | u32 v, irq_mask = 0; |
| 379 | bool lcd_en, digit_en, lcd2_en = false; | 381 | bool lcd_en, digit_en, lcd2_en = false, lcd3_en = false; |
| 380 | int i; | 382 | int i; |
| 381 | struct omap_dss_dispc_dev_attr *da; | 383 | struct omap_dss_dispc_dev_attr *da; |
| 382 | struct omap_hwmod *oh; | 384 | struct omap_hwmod *oh; |
| @@ -405,7 +407,13 @@ static void dispc_disable_outputs(void) | |||
| 405 | lcd2_en = v & LCD_EN_MASK; | 407 | lcd2_en = v & LCD_EN_MASK; |
| 406 | } | 408 | } |
| 407 | 409 | ||
| 408 | if (!(lcd_en | digit_en | lcd2_en)) | 410 | /* store value of LCDENABLE for LCD3 */ |
| 411 | if (da->manager_count > 3) { | ||
| 412 | v = omap_hwmod_read(oh, DISPC_CONTROL3); | ||
| 413 | lcd3_en = v & LCD_EN_MASK; | ||
| 414 | } | ||
| 415 | |||
| 416 | if (!(lcd_en | digit_en | lcd2_en | lcd3_en)) | ||
| 409 | return; /* no managers currently enabled */ | 417 | return; /* no managers currently enabled */ |
| 410 | 418 | ||
| 411 | /* | 419 | /* |
| @@ -426,10 +434,12 @@ static void dispc_disable_outputs(void) | |||
| 426 | 434 | ||
| 427 | if (lcd2_en) | 435 | if (lcd2_en) |
| 428 | irq_mask |= 1 << FRAMEDONE2_IRQ_SHIFT; | 436 | irq_mask |= 1 << FRAMEDONE2_IRQ_SHIFT; |
| 437 | if (lcd3_en) | ||
| 438 | irq_mask |= 1 << FRAMEDONE3_IRQ_SHIFT; | ||
| 429 | 439 | ||
| 430 | /* | 440 | /* |
| 431 | * clear any previous FRAMEDONE, FRAMEDONETV, | 441 | * clear any previous FRAMEDONE, FRAMEDONETV, |
| 432 | * EVSYNC_EVEN/ODD or FRAMEDONE2 interrupts | 442 | * EVSYNC_EVEN/ODD, FRAMEDONE2 or FRAMEDONE3 interrupts |
| 433 | */ | 443 | */ |
| 434 | omap_hwmod_write(irq_mask, oh, DISPC_IRQSTATUS); | 444 | omap_hwmod_write(irq_mask, oh, DISPC_IRQSTATUS); |
| 435 | 445 | ||
| @@ -445,12 +455,19 @@ static void dispc_disable_outputs(void) | |||
| 445 | omap_hwmod_write(v, oh, DISPC_CONTROL2); | 455 | omap_hwmod_write(v, oh, DISPC_CONTROL2); |
| 446 | } | 456 | } |
| 447 | 457 | ||
| 458 | /* disable LCD3 manager */ | ||
| 459 | if (da->manager_count > 3) { | ||
| 460 | v = omap_hwmod_read(oh, DISPC_CONTROL3); | ||
| 461 | v &= ~LCD_EN_MASK; | ||
| 462 | omap_hwmod_write(v, oh, DISPC_CONTROL3); | ||
| 463 | } | ||
| 464 | |||
| 448 | i = 0; | 465 | i = 0; |
| 449 | while ((omap_hwmod_read(oh, DISPC_IRQSTATUS) & irq_mask) != | 466 | while ((omap_hwmod_read(oh, DISPC_IRQSTATUS) & irq_mask) != |
| 450 | irq_mask) { | 467 | irq_mask) { |
| 451 | i++; | 468 | i++; |
| 452 | if (i > FRAMEDONE_IRQ_TIMEOUT) { | 469 | if (i > FRAMEDONE_IRQ_TIMEOUT) { |
| 453 | pr_err("didn't get FRAMEDONE1/2 or TV interrupt\n"); | 470 | pr_err("didn't get FRAMEDONE1/2/3 or TV interrupt\n"); |
| 454 | break; | 471 | break; |
| 455 | } | 472 | } |
| 456 | mdelay(1); | 473 | mdelay(1); |
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c index be697d4e0843..a9675d8d1822 100644 --- a/arch/arm/mach-omap2/hsmmc.c +++ b/arch/arm/mach-omap2/hsmmc.c | |||
| @@ -315,7 +315,6 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c, | |||
| 315 | mmc->slots[0].caps = c->caps; | 315 | mmc->slots[0].caps = c->caps; |
| 316 | mmc->slots[0].pm_caps = c->pm_caps; | 316 | mmc->slots[0].pm_caps = c->pm_caps; |
| 317 | mmc->slots[0].internal_clock = !c->ext_clock; | 317 | mmc->slots[0].internal_clock = !c->ext_clock; |
| 318 | mmc->dma_mask = 0xffffffff; | ||
| 319 | mmc->max_freq = c->max_freq; | 318 | mmc->max_freq = c->max_freq; |
| 320 | if (cpu_is_omap44xx()) | 319 | if (cpu_is_omap44xx()) |
| 321 | mmc->reg_offset = OMAP4_MMC_REG_OFFSET; | 320 | mmc->reg_offset = OMAP4_MMC_REG_OFFSET; |
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h index 471e62a74a16..76f9b3c2f586 100644 --- a/arch/arm/mach-omap2/mux.h +++ b/arch/arm/mach-omap2/mux.h | |||
| @@ -127,7 +127,6 @@ struct omap_mux_partition { | |||
| 127 | * @gpio: GPIO number | 127 | * @gpio: GPIO number |
| 128 | * @muxnames: available signal modes for a ball | 128 | * @muxnames: available signal modes for a ball |
| 129 | * @balls: available balls on the package | 129 | * @balls: available balls on the package |
| 130 | * @partition: mux partition | ||
| 131 | */ | 130 | */ |
| 132 | struct omap_mux { | 131 | struct omap_mux { |
| 133 | u16 reg_offset; | 132 | u16 reg_offset; |
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c index 7d118b9bdd5f..9a35adf91232 100644 --- a/arch/arm/mach-omap2/omap-smp.c +++ b/arch/arm/mach-omap2/omap-smp.c | |||
| @@ -125,7 +125,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
| 125 | booted = true; | 125 | booted = true; |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | gic_raise_softirq(cpumask_of(cpu), 1); | 128 | gic_raise_softirq(cpumask_of(cpu), 0); |
| 129 | 129 | ||
| 130 | /* | 130 | /* |
| 131 | * Now the secondary core is starting up let it run its | 131 | * Now the secondary core is starting up let it run its |
diff --git a/arch/arm/mach-omap2/opp4xxx_data.c b/arch/arm/mach-omap2/opp4xxx_data.c index 2293ba27101b..c95415da23c2 100644 --- a/arch/arm/mach-omap2/opp4xxx_data.c +++ b/arch/arm/mach-omap2/opp4xxx_data.c | |||
| @@ -94,7 +94,7 @@ int __init omap4_opp_init(void) | |||
| 94 | { | 94 | { |
| 95 | int r = -ENODEV; | 95 | int r = -ENODEV; |
| 96 | 96 | ||
| 97 | if (!cpu_is_omap44xx()) | 97 | if (!cpu_is_omap443x()) |
| 98 | return r; | 98 | return r; |
| 99 | 99 | ||
| 100 | r = omap_init_opp_table(omap44xx_opp_def_list, | 100 | r = omap_init_opp_table(omap44xx_opp_def_list, |
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index e4fc88c65dbd..05bd8f02723f 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
| @@ -272,21 +272,16 @@ void omap_sram_idle(void) | |||
| 272 | per_next_state = pwrdm_read_next_pwrst(per_pwrdm); | 272 | per_next_state = pwrdm_read_next_pwrst(per_pwrdm); |
| 273 | core_next_state = pwrdm_read_next_pwrst(core_pwrdm); | 273 | core_next_state = pwrdm_read_next_pwrst(core_pwrdm); |
| 274 | 274 | ||
| 275 | if (mpu_next_state < PWRDM_POWER_ON) { | 275 | pwrdm_pre_transition(NULL); |
| 276 | pwrdm_pre_transition(mpu_pwrdm); | ||
| 277 | pwrdm_pre_transition(neon_pwrdm); | ||
| 278 | } | ||
| 279 | 276 | ||
| 280 | /* PER */ | 277 | /* PER */ |
| 281 | if (per_next_state < PWRDM_POWER_ON) { | 278 | if (per_next_state < PWRDM_POWER_ON) { |
| 282 | pwrdm_pre_transition(per_pwrdm); | ||
| 283 | per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0; | 279 | per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0; |
| 284 | omap2_gpio_prepare_for_idle(per_going_off); | 280 | omap2_gpio_prepare_for_idle(per_going_off); |
| 285 | } | 281 | } |
| 286 | 282 | ||
| 287 | /* CORE */ | 283 | /* CORE */ |
| 288 | if (core_next_state < PWRDM_POWER_ON) { | 284 | if (core_next_state < PWRDM_POWER_ON) { |
| 289 | pwrdm_pre_transition(core_pwrdm); | ||
| 290 | if (core_next_state == PWRDM_POWER_OFF) { | 285 | if (core_next_state == PWRDM_POWER_OFF) { |
| 291 | omap3_core_save_context(); | 286 | omap3_core_save_context(); |
| 292 | omap3_cm_save_context(); | 287 | omap3_cm_save_context(); |
| @@ -339,20 +334,14 @@ void omap_sram_idle(void) | |||
| 339 | omap2_prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF_MASK, | 334 | omap2_prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF_MASK, |
| 340 | OMAP3430_GR_MOD, | 335 | OMAP3430_GR_MOD, |
| 341 | OMAP3_PRM_VOLTCTRL_OFFSET); | 336 | OMAP3_PRM_VOLTCTRL_OFFSET); |
| 342 | pwrdm_post_transition(core_pwrdm); | ||
| 343 | } | 337 | } |
| 344 | omap3_intc_resume_idle(); | 338 | omap3_intc_resume_idle(); |
| 345 | 339 | ||
| 340 | pwrdm_post_transition(NULL); | ||
| 341 | |||
| 346 | /* PER */ | 342 | /* PER */ |
| 347 | if (per_next_state < PWRDM_POWER_ON) { | 343 | if (per_next_state < PWRDM_POWER_ON) |
| 348 | omap2_gpio_resume_after_idle(); | 344 | omap2_gpio_resume_after_idle(); |
| 349 | pwrdm_post_transition(per_pwrdm); | ||
| 350 | } | ||
| 351 | |||
| 352 | if (mpu_next_state < PWRDM_POWER_ON) { | ||
| 353 | pwrdm_post_transition(mpu_pwrdm); | ||
| 354 | pwrdm_post_transition(neon_pwrdm); | ||
| 355 | } | ||
| 356 | } | 345 | } |
| 357 | 346 | ||
| 358 | static void omap3_pm_idle(void) | 347 | static void omap3_pm_idle(void) |
diff --git a/arch/arm/mach-omap2/sleep44xx.S b/arch/arm/mach-omap2/sleep44xx.S index 9f6b83d1b193..91e71d8f46f0 100644 --- a/arch/arm/mach-omap2/sleep44xx.S +++ b/arch/arm/mach-omap2/sleep44xx.S | |||
| @@ -56,9 +56,13 @@ ppa_por_params: | |||
| 56 | * The restore function pointer is stored at CPUx_WAKEUP_NS_PA_ADDR_OFFSET. | 56 | * The restore function pointer is stored at CPUx_WAKEUP_NS_PA_ADDR_OFFSET. |
| 57 | * It returns to the caller for CPU INACTIVE and ON power states or in case | 57 | * It returns to the caller for CPU INACTIVE and ON power states or in case |
| 58 | * CPU failed to transition to targeted OFF/DORMANT state. | 58 | * CPU failed to transition to targeted OFF/DORMANT state. |
| 59 | * | ||
| 60 | * omap4_finish_suspend() calls v7_flush_dcache_all() which doesn't save | ||
| 61 | * stack frame and it expects the caller to take care of it. Hence the entire | ||
| 62 | * stack frame is saved to avoid possible stack corruption. | ||
| 59 | */ | 63 | */ |
| 60 | ENTRY(omap4_finish_suspend) | 64 | ENTRY(omap4_finish_suspend) |
| 61 | stmfd sp!, {lr} | 65 | stmfd sp!, {r4-r12, lr} |
| 62 | cmp r0, #0x0 | 66 | cmp r0, #0x0 |
| 63 | beq do_WFI @ No lowpower state, jump to WFI | 67 | beq do_WFI @ No lowpower state, jump to WFI |
| 64 | 68 | ||
| @@ -226,7 +230,7 @@ scu_gp_clear: | |||
| 226 | skip_scu_gp_clear: | 230 | skip_scu_gp_clear: |
| 227 | isb | 231 | isb |
| 228 | dsb | 232 | dsb |
| 229 | ldmfd sp!, {pc} | 233 | ldmfd sp!, {r4-r12, pc} |
| 230 | ENDPROC(omap4_finish_suspend) | 234 | ENDPROC(omap4_finish_suspend) |
| 231 | 235 | ||
| 232 | /* | 236 | /* |
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 13d20c8a283d..2ff6d41ec6c6 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c | |||
| @@ -130,6 +130,7 @@ static struct clock_event_device clockevent_gpt = { | |||
| 130 | .name = "gp_timer", | 130 | .name = "gp_timer", |
| 131 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | 131 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, |
| 132 | .shift = 32, | 132 | .shift = 32, |
| 133 | .rating = 300, | ||
| 133 | .set_next_event = omap2_gp_timer_set_next_event, | 134 | .set_next_event = omap2_gp_timer_set_next_event, |
| 134 | .set_mode = omap2_gp_timer_set_mode, | 135 | .set_mode = omap2_gp_timer_set_mode, |
| 135 | }; | 136 | }; |
| @@ -223,7 +224,8 @@ static void __init omap2_gp_clockevent_init(int gptimer_id, | |||
| 223 | clockevent_delta2ns(3, &clockevent_gpt); | 224 | clockevent_delta2ns(3, &clockevent_gpt); |
| 224 | /* Timer internal resynch latency. */ | 225 | /* Timer internal resynch latency. */ |
| 225 | 226 | ||
| 226 | clockevent_gpt.cpumask = cpumask_of(0); | 227 | clockevent_gpt.cpumask = cpu_possible_mask; |
| 228 | clockevent_gpt.irq = omap_dm_timer_get_irq(&clkev); | ||
| 227 | clockevents_register_device(&clockevent_gpt); | 229 | clockevents_register_device(&clockevent_gpt); |
| 228 | 230 | ||
| 229 | pr_info("OMAP clockevent source: GPTIMER%d at %lu Hz\n", | 231 | pr_info("OMAP clockevent source: GPTIMER%d at %lu Hz\n", |
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index de47f170ba50..db5ff6642375 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c | |||
| @@ -67,6 +67,7 @@ void __init omap_pmic_init(int bus, u32 clkrate, | |||
| 67 | const char *pmic_type, int pmic_irq, | 67 | const char *pmic_type, int pmic_irq, |
| 68 | struct twl4030_platform_data *pmic_data) | 68 | struct twl4030_platform_data *pmic_data) |
| 69 | { | 69 | { |
| 70 | omap_mux_init_signal("sys_nirq", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE); | ||
| 70 | strncpy(pmic_i2c_board_info.type, pmic_type, | 71 | strncpy(pmic_i2c_board_info.type, pmic_type, |
| 71 | sizeof(pmic_i2c_board_info.type)); | 72 | sizeof(pmic_i2c_board_info.type)); |
| 72 | pmic_i2c_board_info.irq = pmic_irq; | 73 | pmic_i2c_board_info.irq = pmic_irq; |
