aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/pm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-omap/pm.c')
-rw-r--r--arch/arm/plat-omap/pm.c103
1 files changed, 82 insertions, 21 deletions
diff --git a/arch/arm/plat-omap/pm.c b/arch/arm/plat-omap/pm.c
index e15c6c1ddec9..966cca031ca7 100644
--- a/arch/arm/plat-omap/pm.c
+++ b/arch/arm/plat-omap/pm.c
@@ -54,11 +54,12 @@
54#include <asm/arch/tps65010.h> 54#include <asm/arch/tps65010.h>
55#include <asm/arch/dsp_common.h> 55#include <asm/arch/dsp_common.h>
56 56
57#include "clock.h" 57#include <asm/arch/clock.h>
58#include "sram.h" 58#include <asm/arch/sram.h>
59 59
60static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; 60static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE];
61static unsigned short ulpd_sleep_save[ULPD_SLEEP_SAVE_SIZE]; 61static unsigned short ulpd_sleep_save[ULPD_SLEEP_SAVE_SIZE];
62static unsigned int mpui730_sleep_save[MPUI730_SLEEP_SAVE_SIZE];
62static unsigned int mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE]; 63static unsigned int mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE];
63static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE]; 64static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE];
64 65
@@ -120,8 +121,8 @@ void omap_pm_idle(void)
120 */ 121 */
121static void omap_pm_wakeup_setup(void) 122static void omap_pm_wakeup_setup(void)
122{ 123{
123 u32 level1_wake = OMAP_IRQ_BIT(INT_IH2_IRQ); 124 u32 level1_wake = 0;
124 u32 level2_wake = OMAP_IRQ_BIT(INT_UART2) | OMAP_IRQ_BIT(INT_KEYBOARD); 125 u32 level2_wake = OMAP_IRQ_BIT(INT_UART2);
125 126
126 /* 127 /*
127 * Turn off all interrupts except GPIO bank 1, L1-2nd level cascade, 128 * Turn off all interrupts except GPIO bank 1, L1-2nd level cascade,
@@ -129,19 +130,29 @@ static void omap_pm_wakeup_setup(void)
129 * drivers must still separately call omap_set_gpio_wakeup() to 130 * drivers must still separately call omap_set_gpio_wakeup() to
130 * wake up to a GPIO interrupt. 131 * wake up to a GPIO interrupt.
131 */ 132 */
132 if (cpu_is_omap1510() || cpu_is_omap16xx()) 133 if (cpu_is_omap730())
133 level1_wake |= OMAP_IRQ_BIT(INT_GPIO_BANK1); 134 level1_wake = OMAP_IRQ_BIT(INT_730_GPIO_BANK1) |
134 else if (cpu_is_omap730()) 135 OMAP_IRQ_BIT(INT_730_IH2_IRQ);
135 level1_wake |= OMAP_IRQ_BIT(INT_730_GPIO_BANK1); 136 else if (cpu_is_omap1510())
137 level1_wake = OMAP_IRQ_BIT(INT_GPIO_BANK1) |
138 OMAP_IRQ_BIT(INT_1510_IH2_IRQ);
139 else if (cpu_is_omap16xx())
140 level1_wake = OMAP_IRQ_BIT(INT_GPIO_BANK1) |
141 OMAP_IRQ_BIT(INT_1610_IH2_IRQ);
136 142
137 omap_writel(~level1_wake, OMAP_IH1_MIR); 143 omap_writel(~level1_wake, OMAP_IH1_MIR);
138 144
139 if (cpu_is_omap1510()) 145 if (cpu_is_omap730()) {
146 omap_writel(~level2_wake, OMAP_IH2_0_MIR);
147 omap_writel(~(OMAP_IRQ_BIT(INT_730_WAKE_UP_REQ) | OMAP_IRQ_BIT(INT_730_MPUIO_KEYPAD)), OMAP_IH2_1_MIR);
148 } else if (cpu_is_omap1510()) {
149 level2_wake |= OMAP_IRQ_BIT(INT_KEYBOARD);
140 omap_writel(~level2_wake, OMAP_IH2_MIR); 150 omap_writel(~level2_wake, OMAP_IH2_MIR);
141 151 } else if (cpu_is_omap16xx()) {
142 /* INT_1610_WAKE_UP_REQ is needed for GPIO wakeup... */ 152 level2_wake |= OMAP_IRQ_BIT(INT_KEYBOARD);
143 if (cpu_is_omap16xx()) {
144 omap_writel(~level2_wake, OMAP_IH2_0_MIR); 153 omap_writel(~level2_wake, OMAP_IH2_0_MIR);
154
155 /* INT_1610_WAKE_UP_REQ is needed for GPIO wakeup... */
145 omap_writel(~OMAP_IRQ_BIT(INT_1610_WAKE_UP_REQ), OMAP_IH2_1_MIR); 156 omap_writel(~OMAP_IRQ_BIT(INT_1610_WAKE_UP_REQ), OMAP_IH2_1_MIR);
146 omap_writel(~0x0, OMAP_IH2_2_MIR); 157 omap_writel(~0x0, OMAP_IH2_2_MIR);
147 omap_writel(~0x0, OMAP_IH2_3_MIR); 158 omap_writel(~0x0, OMAP_IH2_3_MIR);
@@ -185,7 +196,17 @@ void omap_pm_suspend(void)
185 * Save interrupt, MPUI, ARM and UPLD control registers. 196 * Save interrupt, MPUI, ARM and UPLD control registers.
186 */ 197 */
187 198
188 if (cpu_is_omap1510()) { 199 if (cpu_is_omap730()) {
200 MPUI730_SAVE(OMAP_IH1_MIR);
201 MPUI730_SAVE(OMAP_IH2_0_MIR);
202 MPUI730_SAVE(OMAP_IH2_1_MIR);
203 MPUI730_SAVE(MPUI_CTRL);
204 MPUI730_SAVE(MPUI_DSP_BOOT_CONFIG);
205 MPUI730_SAVE(MPUI_DSP_API_CONFIG);
206 MPUI730_SAVE(EMIFS_CONFIG);
207 MPUI730_SAVE(EMIFF_SDRAM_CONFIG);
208
209 } else if (cpu_is_omap1510()) {
189 MPUI1510_SAVE(OMAP_IH1_MIR); 210 MPUI1510_SAVE(OMAP_IH1_MIR);
190 MPUI1510_SAVE(OMAP_IH2_MIR); 211 MPUI1510_SAVE(OMAP_IH2_MIR);
191 MPUI1510_SAVE(MPUI_CTRL); 212 MPUI1510_SAVE(MPUI_CTRL);
@@ -280,7 +301,13 @@ void omap_pm_suspend(void)
280 ULPD_RESTORE(ULPD_CLOCK_CTRL); 301 ULPD_RESTORE(ULPD_CLOCK_CTRL);
281 ULPD_RESTORE(ULPD_STATUS_REQ); 302 ULPD_RESTORE(ULPD_STATUS_REQ);
282 303
283 if (cpu_is_omap1510()) { 304 if (cpu_is_omap730()) {
305 MPUI730_RESTORE(EMIFS_CONFIG);
306 MPUI730_RESTORE(EMIFF_SDRAM_CONFIG);
307 MPUI730_RESTORE(OMAP_IH1_MIR);
308 MPUI730_RESTORE(OMAP_IH2_0_MIR);
309 MPUI730_RESTORE(OMAP_IH2_1_MIR);
310 } else if (cpu_is_omap1510()) {
284 MPUI1510_RESTORE(MPUI_CTRL); 311 MPUI1510_RESTORE(MPUI_CTRL);
285 MPUI1510_RESTORE(MPUI_DSP_BOOT_CONFIG); 312 MPUI1510_RESTORE(MPUI_DSP_BOOT_CONFIG);
286 MPUI1510_RESTORE(MPUI_DSP_API_CONFIG); 313 MPUI1510_RESTORE(MPUI_DSP_API_CONFIG);
@@ -355,7 +382,14 @@ static int omap_pm_read_proc(
355 ULPD_SAVE(ULPD_DPLL_CTRL); 382 ULPD_SAVE(ULPD_DPLL_CTRL);
356 ULPD_SAVE(ULPD_POWER_CTRL); 383 ULPD_SAVE(ULPD_POWER_CTRL);
357 384
358 if (cpu_is_omap1510()) { 385 if (cpu_is_omap730()) {
386 MPUI730_SAVE(MPUI_CTRL);
387 MPUI730_SAVE(MPUI_DSP_STATUS);
388 MPUI730_SAVE(MPUI_DSP_BOOT_CONFIG);
389 MPUI730_SAVE(MPUI_DSP_API_CONFIG);
390 MPUI730_SAVE(EMIFF_SDRAM_CONFIG);
391 MPUI730_SAVE(EMIFS_CONFIG);
392 } else if (cpu_is_omap1510()) {
359 MPUI1510_SAVE(MPUI_CTRL); 393 MPUI1510_SAVE(MPUI_CTRL);
360 MPUI1510_SAVE(MPUI_DSP_STATUS); 394 MPUI1510_SAVE(MPUI_DSP_STATUS);
361 MPUI1510_SAVE(MPUI_DSP_BOOT_CONFIG); 395 MPUI1510_SAVE(MPUI_DSP_BOOT_CONFIG);
@@ -404,7 +438,21 @@ static int omap_pm_read_proc(
404 ULPD_SHOW(ULPD_STATUS_REQ), 438 ULPD_SHOW(ULPD_STATUS_REQ),
405 ULPD_SHOW(ULPD_POWER_CTRL)); 439 ULPD_SHOW(ULPD_POWER_CTRL));
406 440
407 if (cpu_is_omap1510()) { 441 if (cpu_is_omap730()) {
442 my_buffer_offset += sprintf(my_base + my_buffer_offset,
443 "MPUI730_CTRL_REG 0x%-8x \n"
444 "MPUI730_DSP_STATUS_REG: 0x%-8x \n"
445 "MPUI730_DSP_BOOT_CONFIG_REG: 0x%-8x \n"
446 "MPUI730_DSP_API_CONFIG_REG: 0x%-8x \n"
447 "MPUI730_SDRAM_CONFIG_REG: 0x%-8x \n"
448 "MPUI730_EMIFS_CONFIG_REG: 0x%-8x \n",
449 MPUI730_SHOW(MPUI_CTRL),
450 MPUI730_SHOW(MPUI_DSP_STATUS),
451 MPUI730_SHOW(MPUI_DSP_BOOT_CONFIG),
452 MPUI730_SHOW(MPUI_DSP_API_CONFIG),
453 MPUI730_SHOW(EMIFF_SDRAM_CONFIG),
454 MPUI730_SHOW(EMIFS_CONFIG));
455 } else if (cpu_is_omap1510()) {
408 my_buffer_offset += sprintf(my_base + my_buffer_offset, 456 my_buffer_offset += sprintf(my_base + my_buffer_offset,
409 "MPUI1510_CTRL_REG 0x%-8x \n" 457 "MPUI1510_CTRL_REG 0x%-8x \n"
410 "MPUI1510_DSP_STATUS_REG: 0x%-8x \n" 458 "MPUI1510_DSP_STATUS_REG: 0x%-8x \n"
@@ -553,7 +601,12 @@ static int __init omap_pm_init(void)
553 * These routines need to be in SRAM as that's the only 601 * These routines need to be in SRAM as that's the only
554 * memory the MPU can see when it wakes up. 602 * memory the MPU can see when it wakes up.
555 */ 603 */
556 if (cpu_is_omap1510()) { 604 if (cpu_is_omap730()) {
605 omap_sram_idle = omap_sram_push(omap730_idle_loop_suspend,
606 omap730_idle_loop_suspend_sz);
607 omap_sram_suspend = omap_sram_push(omap730_cpu_suspend,
608 omap730_cpu_suspend_sz);
609 } else if (cpu_is_omap1510()) {
557 omap_sram_idle = omap_sram_push(omap1510_idle_loop_suspend, 610 omap_sram_idle = omap_sram_push(omap1510_idle_loop_suspend,
558 omap1510_idle_loop_suspend_sz); 611 omap1510_idle_loop_suspend_sz);
559 omap_sram_suspend = omap_sram_push(omap1510_cpu_suspend, 612 omap_sram_suspend = omap_sram_push(omap1510_cpu_suspend,
@@ -572,7 +625,11 @@ static int __init omap_pm_init(void)
572 625
573 pm_idle = omap_pm_idle; 626 pm_idle = omap_pm_idle;
574 627
575 setup_irq(INT_1610_WAKE_UP_REQ, &omap_wakeup_irq); 628 if (cpu_is_omap730())
629 setup_irq(INT_730_WAKE_UP_REQ, &omap_wakeup_irq);
630 else if (cpu_is_omap16xx())
631 setup_irq(INT_1610_WAKE_UP_REQ, &omap_wakeup_irq);
632
576#if 0 633#if 0
577 /* --- BEGIN BOARD-DEPENDENT CODE --- */ 634 /* --- BEGIN BOARD-DEPENDENT CODE --- */
578 /* Sleepx mask direction */ 635 /* Sleepx mask direction */
@@ -591,7 +648,9 @@ static int __init omap_pm_init(void)
591 omap_writew(ULPD_POWER_CTRL_REG_VAL, ULPD_POWER_CTRL); 648 omap_writew(ULPD_POWER_CTRL_REG_VAL, ULPD_POWER_CTRL);
592 649
593 /* Configure IDLECT3 */ 650 /* Configure IDLECT3 */
594 if (cpu_is_omap16xx()) 651 if (cpu_is_omap730())
652 omap_writel(OMAP730_IDLECT3_VAL, OMAP730_IDLECT3);
653 else if (cpu_is_omap16xx())
595 omap_writel(OMAP1610_IDLECT3_VAL, OMAP1610_IDLECT3); 654 omap_writel(OMAP1610_IDLECT3_VAL, OMAP1610_IDLECT3);
596 655
597 pm_set_ops(&omap_pm_ops); 656 pm_set_ops(&omap_pm_ops);
@@ -600,8 +659,10 @@ static int __init omap_pm_init(void)
600 omap_pm_init_proc(); 659 omap_pm_init_proc();
601#endif 660#endif
602 661
603 /* configure LOW_PWR pin */ 662 if (cpu_is_omap16xx()) {
604 omap_cfg_reg(T20_1610_LOW_PWR); 663 /* configure LOW_PWR pin */
664 omap_cfg_reg(T20_1610_LOW_PWR);
665 }
605 666
606 return 0; 667 return 0;
607} 668}