diff options
author | Kevin Hilman <khilman@deeprootsystems.com> | 2009-05-15 14:29:28 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-05-28 13:59:11 -0400 |
commit | c912f7e1eae169aaca333b4c5da3f36c98f2ccb0 (patch) | |
tree | 15c4164798bcc95211df2dedb09badf9af0b39c6 /arch | |
parent | d3fd3290c4d9f0e40d06fa3a1a8cf164d8cde801 (diff) |
OMAP1: PM: update and decouple from OMAP2/3 PM core
Update OMAP1-specific PM infrastructure. This is a sync of what is in
linux-omap for OMAP1.
This mostly de-couples OMAP1 PM from OMAP2/3 PM and renames things
accordingly, and removes omap2/3 specific code from OMAP1 specific
headers.
Original OMAP1 decoupling patch for OMAP PM branch by Paul Walmsley.
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap1/pm.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-omap1/pm.h | 85 | ||||
-rw-r--r-- | arch/arm/mach-omap1/serial.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-omap1/sleep.S | 2 |
4 files changed, 17 insertions, 84 deletions
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c index 9774c1f5311e..5218943c91c0 100644 --- a/arch/arm/mach-omap1/pm.c +++ b/arch/arm/mach-omap1/pm.c | |||
@@ -53,11 +53,12 @@ | |||
53 | #include <mach/clock.h> | 53 | #include <mach/clock.h> |
54 | #include <mach/sram.h> | 54 | #include <mach/sram.h> |
55 | #include <mach/tc.h> | 55 | #include <mach/tc.h> |
56 | #include <mach/pm.h> | ||
57 | #include <mach/mux.h> | 56 | #include <mach/mux.h> |
58 | #include <mach/dma.h> | 57 | #include <mach/dma.h> |
59 | #include <mach/dmtimer.h> | 58 | #include <mach/dmtimer.h> |
60 | 59 | ||
60 | #include "pm.h" | ||
61 | |||
61 | static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; | 62 | static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; |
62 | static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE]; | 63 | static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE]; |
63 | static unsigned short ulpd_sleep_save[ULPD_SLEEP_SAVE_SIZE]; | 64 | static unsigned short ulpd_sleep_save[ULPD_SLEEP_SAVE_SIZE]; |
@@ -101,7 +102,7 @@ static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL; | |||
101 | * going idle we continue to do idle even if we get | 102 | * going idle we continue to do idle even if we get |
102 | * a clock tick interrupt . . | 103 | * a clock tick interrupt . . |
103 | */ | 104 | */ |
104 | void omap_pm_idle(void) | 105 | void omap1_pm_idle(void) |
105 | { | 106 | { |
106 | extern __u32 arm_idlect1_mask; | 107 | extern __u32 arm_idlect1_mask; |
107 | __u32 use_idlect1 = arm_idlect1_mask; | 108 | __u32 use_idlect1 = arm_idlect1_mask; |
@@ -222,7 +223,7 @@ static void omap_pm_wakeup_setup(void) | |||
222 | #define EN_APICK 6 /* ARM_IDLECT2 */ | 223 | #define EN_APICK 6 /* ARM_IDLECT2 */ |
223 | #define DSP_EN 1 /* ARM_RSTCT1 */ | 224 | #define DSP_EN 1 /* ARM_RSTCT1 */ |
224 | 225 | ||
225 | void omap_pm_suspend(void) | 226 | void omap1_pm_suspend(void) |
226 | { | 227 | { |
227 | unsigned long arg0 = 0, arg1 = 0; | 228 | unsigned long arg0 = 0, arg1 = 0; |
228 | 229 | ||
@@ -610,7 +611,7 @@ static int omap_pm_enter(suspend_state_t state) | |||
610 | { | 611 | { |
611 | case PM_SUSPEND_STANDBY: | 612 | case PM_SUSPEND_STANDBY: |
612 | case PM_SUSPEND_MEM: | 613 | case PM_SUSPEND_MEM: |
613 | omap_pm_suspend(); | 614 | omap1_pm_suspend(); |
614 | break; | 615 | break; |
615 | default: | 616 | default: |
616 | return -EINVAL; | 617 | return -EINVAL; |
@@ -683,7 +684,7 @@ static int __init omap_pm_init(void) | |||
683 | return -ENODEV; | 684 | return -ENODEV; |
684 | } | 685 | } |
685 | 686 | ||
686 | pm_idle = omap_pm_idle; | 687 | pm_idle = omap1_pm_idle; |
687 | 688 | ||
688 | if (cpu_is_omap730()) | 689 | if (cpu_is_omap730()) |
689 | setup_irq(INT_730_WAKE_UP_REQ, &omap_wakeup_irq); | 690 | setup_irq(INT_730_WAKE_UP_REQ, &omap_wakeup_irq); |
diff --git a/arch/arm/mach-omap1/pm.h b/arch/arm/mach-omap1/pm.h index ce6ee7927537..9ed5e2c1de4d 100644 --- a/arch/arm/mach-omap1/pm.h +++ b/arch/arm/mach-omap1/pm.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/plat-omap/include/mach/pm.h | 2 | * arch/arm/mach-omap1/pm.h |
3 | * | 3 | * |
4 | * Header file for OMAP Power Management Routines | 4 | * Header file for OMAP1 Power Management Routines |
5 | * | 5 | * |
6 | * Author: MontaVista Software, Inc. | 6 | * Author: MontaVista Software, Inc. |
7 | * support@mvista.com | 7 | * support@mvista.com |
@@ -31,8 +31,8 @@ | |||
31 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 31 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
32 | */ | 32 | */ |
33 | 33 | ||
34 | #ifndef __ASM_ARCH_OMAP_PM_H | 34 | #ifndef __ARCH_ARM_MACH_OMAP1_PM_H |
35 | #define __ASM_ARCH_OMAP_PM_H | 35 | #define __ARCH_ARM_MACH_OMAP1_PM_H |
36 | 36 | ||
37 | /* | 37 | /* |
38 | * ---------------------------------------------------------------------------- | 38 | * ---------------------------------------------------------------------------- |
@@ -106,8 +106,7 @@ | |||
106 | 106 | ||
107 | #if !defined(CONFIG_ARCH_OMAP730) && \ | 107 | #if !defined(CONFIG_ARCH_OMAP730) && \ |
108 | !defined(CONFIG_ARCH_OMAP15XX) && \ | 108 | !defined(CONFIG_ARCH_OMAP15XX) && \ |
109 | !defined(CONFIG_ARCH_OMAP16XX) && \ | 109 | !defined(CONFIG_ARCH_OMAP16XX) |
110 | !defined(CONFIG_ARCH_OMAP24XX) | ||
111 | #warning "Power management for this processor not implemented yet" | 110 | #warning "Power management for this processor not implemented yet" |
112 | #endif | 111 | #endif |
113 | 112 | ||
@@ -115,29 +114,27 @@ | |||
115 | 114 | ||
116 | #include <linux/clk.h> | 115 | #include <linux/clk.h> |
117 | 116 | ||
117 | extern struct kset power_subsys; | ||
118 | |||
118 | extern void prevent_idle_sleep(void); | 119 | extern void prevent_idle_sleep(void); |
119 | extern void allow_idle_sleep(void); | 120 | extern void allow_idle_sleep(void); |
120 | 121 | ||
121 | extern void omap_pm_idle(void); | 122 | extern void omap1_pm_idle(void); |
122 | extern void omap_pm_suspend(void); | 123 | extern void omap1_pm_suspend(void); |
124 | |||
123 | extern void omap730_cpu_suspend(unsigned short, unsigned short); | 125 | extern void omap730_cpu_suspend(unsigned short, unsigned short); |
124 | extern void omap1510_cpu_suspend(unsigned short, unsigned short); | 126 | extern void omap1510_cpu_suspend(unsigned short, unsigned short); |
125 | extern void omap1610_cpu_suspend(unsigned short, unsigned short); | 127 | extern void omap1610_cpu_suspend(unsigned short, unsigned short); |
126 | extern void omap24xx_cpu_suspend(u32 dll_ctrl, void __iomem *sdrc_dlla_ctrl, | ||
127 | void __iomem *sdrc_power); | ||
128 | extern void omap730_idle_loop_suspend(void); | 128 | extern void omap730_idle_loop_suspend(void); |
129 | extern void omap1510_idle_loop_suspend(void); | 129 | extern void omap1510_idle_loop_suspend(void); |
130 | extern void omap1610_idle_loop_suspend(void); | 130 | extern void omap1610_idle_loop_suspend(void); |
131 | extern void omap24xx_idle_loop_suspend(void); | ||
132 | 131 | ||
133 | extern unsigned int omap730_cpu_suspend_sz; | 132 | extern unsigned int omap730_cpu_suspend_sz; |
134 | extern unsigned int omap1510_cpu_suspend_sz; | 133 | extern unsigned int omap1510_cpu_suspend_sz; |
135 | extern unsigned int omap1610_cpu_suspend_sz; | 134 | extern unsigned int omap1610_cpu_suspend_sz; |
136 | extern unsigned int omap24xx_cpu_suspend_sz; | ||
137 | extern unsigned int omap730_idle_loop_suspend_sz; | 135 | extern unsigned int omap730_idle_loop_suspend_sz; |
138 | extern unsigned int omap1510_idle_loop_suspend_sz; | 136 | extern unsigned int omap1510_idle_loop_suspend_sz; |
139 | extern unsigned int omap1610_idle_loop_suspend_sz; | 137 | extern unsigned int omap1610_idle_loop_suspend_sz; |
140 | extern unsigned int omap24xx_idle_loop_suspend_sz; | ||
141 | 138 | ||
142 | #ifdef CONFIG_OMAP_SERIAL_WAKE | 139 | #ifdef CONFIG_OMAP_SERIAL_WAKE |
143 | extern void omap_serial_wake_trigger(int enable); | 140 | extern void omap_serial_wake_trigger(int enable); |
@@ -170,10 +167,6 @@ extern void omap_serial_wake_trigger(int enable); | |||
170 | #define MPUI1610_RESTORE(x) omap_writel((mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x]), (x)) | 167 | #define MPUI1610_RESTORE(x) omap_writel((mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x]), (x)) |
171 | #define MPUI1610_SHOW(x) mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x] | 168 | #define MPUI1610_SHOW(x) mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_##x] |
172 | 169 | ||
173 | #define OMAP24XX_SAVE(x) omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_##x] = x | ||
174 | #define OMAP24XX_RESTORE(x) x = omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_##x] | ||
175 | #define OMAP24XX_SHOW(x) omap24xx_sleep_save[OMAP24XX_SLEEP_SAVE_##x] | ||
176 | |||
177 | /* | 170 | /* |
178 | * List of global OMAP registers to preserve. | 171 | * List of global OMAP registers to preserve. |
179 | * More ones like CP and general purpose register values are preserved | 172 | * More ones like CP and general purpose register values are preserved |
@@ -283,63 +276,5 @@ enum mpui1610_save_state { | |||
283 | #endif | 276 | #endif |
284 | }; | 277 | }; |
285 | 278 | ||
286 | enum omap24xx_save_state { | ||
287 | OMAP24XX_SLEEP_SAVE_START = 0, | ||
288 | OMAP24XX_SLEEP_SAVE_INTC_MIR0, | ||
289 | OMAP24XX_SLEEP_SAVE_INTC_MIR1, | ||
290 | OMAP24XX_SLEEP_SAVE_INTC_MIR2, | ||
291 | |||
292 | OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_MPU, | ||
293 | OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_CORE, | ||
294 | OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_GFX, | ||
295 | OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_DSP, | ||
296 | OMAP24XX_SLEEP_SAVE_CM_CLKSTCTRL_MDM, | ||
297 | |||
298 | OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_MPU, | ||
299 | OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_CORE, | ||
300 | OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_GFX, | ||
301 | OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_DSP, | ||
302 | OMAP24XX_SLEEP_SAVE_PM_PWSTCTRL_MDM, | ||
303 | |||
304 | OMAP24XX_SLEEP_SAVE_CM_IDLEST1_CORE, | ||
305 | OMAP24XX_SLEEP_SAVE_CM_IDLEST2_CORE, | ||
306 | OMAP24XX_SLEEP_SAVE_CM_IDLEST3_CORE, | ||
307 | OMAP24XX_SLEEP_SAVE_CM_IDLEST4_CORE, | ||
308 | OMAP24XX_SLEEP_SAVE_CM_IDLEST_GFX, | ||
309 | OMAP24XX_SLEEP_SAVE_CM_IDLEST_WKUP, | ||
310 | OMAP24XX_SLEEP_SAVE_CM_IDLEST_CKGEN, | ||
311 | OMAP24XX_SLEEP_SAVE_CM_IDLEST_DSP, | ||
312 | OMAP24XX_SLEEP_SAVE_CM_IDLEST_MDM, | ||
313 | |||
314 | OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE1_CORE, | ||
315 | OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE2_CORE, | ||
316 | OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE3_CORE, | ||
317 | OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE4_CORE, | ||
318 | OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE_WKUP, | ||
319 | OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE_PLL, | ||
320 | OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE_DSP, | ||
321 | OMAP24XX_SLEEP_SAVE_CM_AUTOIDLE_MDM, | ||
322 | |||
323 | OMAP24XX_SLEEP_SAVE_CM_FCLKEN1_CORE, | ||
324 | OMAP24XX_SLEEP_SAVE_CM_FCLKEN2_CORE, | ||
325 | OMAP24XX_SLEEP_SAVE_CM_ICLKEN1_CORE, | ||
326 | OMAP24XX_SLEEP_SAVE_CM_ICLKEN2_CORE, | ||
327 | OMAP24XX_SLEEP_SAVE_CM_ICLKEN3_CORE, | ||
328 | OMAP24XX_SLEEP_SAVE_CM_ICLKEN4_CORE, | ||
329 | OMAP24XX_SLEEP_SAVE_GPIO1_IRQENABLE1, | ||
330 | OMAP24XX_SLEEP_SAVE_GPIO2_IRQENABLE1, | ||
331 | OMAP24XX_SLEEP_SAVE_GPIO3_IRQENABLE1, | ||
332 | OMAP24XX_SLEEP_SAVE_GPIO4_IRQENABLE1, | ||
333 | OMAP24XX_SLEEP_SAVE_GPIO3_OE, | ||
334 | OMAP24XX_SLEEP_SAVE_GPIO4_OE, | ||
335 | OMAP24XX_SLEEP_SAVE_GPIO3_RISINGDETECT, | ||
336 | OMAP24XX_SLEEP_SAVE_GPIO3_FALLINGDETECT, | ||
337 | OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_SPI1_NCS2, | ||
338 | OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_MCBSP1_DX, | ||
339 | OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_SSI1_FLAG_TX, | ||
340 | OMAP24XX_SLEEP_SAVE_CONTROL_PADCONF_SYS_NIRQW0, | ||
341 | OMAP24XX_SLEEP_SAVE_SIZE | ||
342 | }; | ||
343 | |||
344 | #endif /* ASSEMBLER */ | 279 | #endif /* ASSEMBLER */ |
345 | #endif /* __ASM_ARCH_OMAP_PM_H */ | 280 | #endif /* __ASM_ARCH_OMAP_PM_H */ |
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c index 842090b148f1..f754cee4f3c3 100644 --- a/arch/arm/mach-omap1/serial.c +++ b/arch/arm/mach-omap1/serial.c | |||
@@ -26,9 +26,6 @@ | |||
26 | #include <mach/mux.h> | 26 | #include <mach/mux.h> |
27 | #include <mach/gpio.h> | 27 | #include <mach/gpio.h> |
28 | #include <mach/fpga.h> | 28 | #include <mach/fpga.h> |
29 | #ifdef CONFIG_PM | ||
30 | #include <mach/pm.h> | ||
31 | #endif | ||
32 | 29 | ||
33 | static struct clk * uart1_ck; | 30 | static struct clk * uart1_ck; |
34 | static struct clk * uart2_ck; | 31 | static struct clk * uart2_ck; |
diff --git a/arch/arm/mach-omap1/sleep.S b/arch/arm/mach-omap1/sleep.S index f3eac932092d..22e8568339b0 100644 --- a/arch/arm/mach-omap1/sleep.S +++ b/arch/arm/mach-omap1/sleep.S | |||
@@ -35,7 +35,7 @@ | |||
35 | #include <linux/linkage.h> | 35 | #include <linux/linkage.h> |
36 | #include <asm/assembler.h> | 36 | #include <asm/assembler.h> |
37 | #include <mach/io.h> | 37 | #include <mach/io.h> |
38 | #include <mach/pm.h> | 38 | #include "pm.h" |
39 | 39 | ||
40 | .text | 40 | .text |
41 | 41 | ||