diff options
author | Tony Lindgren <tony@atomide.com> | 2008-10-06 08:49:15 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2008-10-06 08:49:15 -0400 |
commit | 1835f1d720786138c43147448f4527dd380c1e33 (patch) | |
tree | 4b37f611a33d69a6a479d181b06b2ed617e7280d | |
parent | 6e81176dc8b7ec20da9f48b9be076e83f5d7d2ec (diff) |
ARM: OMAP2: Move sleep.S into sleep24xx.S
Some register offsets are different for 242x and 243x. This
will allow compiling sleep code for both chips into the same
kernel. Pass the addresses for SDRC_DDLA_CTRL and SDRC_POWER to the
omap24xx_cpu_suspend instead of loading the values since the only.
Also fix a bug to call omap2_sram_suspend with the value of SDRC_DLLA_CTRL
instead of the address as that's what omap24xx_cpu_suspend expects to
determine between DDR and SDR. This bug has not been noticed as
the boards seem to have DDR instead of SDR.
Note that some PM patches are still missing. The PM patches will
be added later on once the base files are in sync with linux-omap
tree.
Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r-- | arch/arm/mach-omap2/Makefile | 5 | ||||
-rw-r--r-- | arch/arm/mach-omap2/sleep24xx.S (renamed from arch/arm/mach-omap2/sleep.S) | 32 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/pm.h | 3 |
3 files changed, 21 insertions, 19 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index e7cf1b4357ce..800639e7c6a4 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -14,7 +14,10 @@ obj-$(CONFIG_ARCH_OMAP2420) += sram242x.o | |||
14 | obj-$(CONFIG_ARCH_OMAP2430) += sram243x.o | 14 | obj-$(CONFIG_ARCH_OMAP2430) += sram243x.o |
15 | 15 | ||
16 | # Power Management | 16 | # Power Management |
17 | obj-$(CONFIG_PM) += pm.o sleep.o | 17 | ifeq ($(CONFIG_PM),y) |
18 | obj-y += pm.o | ||
19 | obj-$(CONFIG_ARCH_OMAP24XX) += sleep24xx.o | ||
20 | endif | ||
18 | 21 | ||
19 | # Clock framework | 22 | # Clock framework |
20 | obj-$(CONFIG_ARCH_OMAP2) += clock24xx.o | 23 | obj-$(CONFIG_ARCH_OMAP2) += clock24xx.o |
diff --git a/arch/arm/mach-omap2/sleep.S b/arch/arm/mach-omap2/sleep24xx.S index 87a706fd5f82..43336b93b21c 100644 --- a/arch/arm/mach-omap2/sleep.S +++ b/arch/arm/mach-omap2/sleep24xx.S | |||
@@ -5,6 +5,10 @@ | |||
5 | * Texas Instruments, <www.ti.com> | 5 | * Texas Instruments, <www.ti.com> |
6 | * Richard Woodruff <r-woodruff2@ti.com> | 6 | * Richard Woodruff <r-woodruff2@ti.com> |
7 | * | 7 | * |
8 | * (C) Copyright 2006 Nokia Corporation | ||
9 | * Fixed idle loop sleep | ||
10 | * Igor Stoppa <igor.stoppa@nokia.com> | ||
11 | * | ||
8 | * This program is free software; you can redistribute it and/or | 12 | * This program is free software; you can redistribute it and/or |
9 | * modify it under the terms of the GNU General Public License as | 13 | * modify it under the terms of the GNU General Public License as |
10 | * published by the Free Software Foundation; either version 2 of | 14 | * published by the Free Software Foundation; either version 2 of |
@@ -26,6 +30,8 @@ | |||
26 | #include <mach/io.h> | 30 | #include <mach/io.h> |
27 | #include <mach/pm.h> | 31 | #include <mach/pm.h> |
28 | 32 | ||
33 | #include <mach/omap24xx.h> | ||
34 | |||
29 | #include "sdrc.h" | 35 | #include "sdrc.h" |
30 | 36 | ||
31 | /* First address of reserved address space? apparently valid for OMAP2 & 3 */ | 37 | /* First address of reserved address space? apparently valid for OMAP2 & 3 */ |
@@ -52,15 +58,14 @@ ENTRY(omap24xx_idle_loop_suspend_sz) | |||
52 | .word . - omap24xx_idle_loop_suspend | 58 | .word . - omap24xx_idle_loop_suspend |
53 | 59 | ||
54 | /* | 60 | /* |
55 | * omap242x_cpu_suspend() - Forces OMAP into deep sleep state by completing | 61 | * omap24xx_cpu_suspend() - Forces OMAP into deep sleep state by completing |
56 | * SDRC shutdown then ARM shutdown. Upon wake MPU is back on so just restore | 62 | * SDRC shutdown then ARM shutdown. Upon wake MPU is back on so just restore |
57 | * SDRC. | 63 | * SDRC. |
58 | * | 64 | * |
59 | * Input: | 65 | * Input: |
60 | * R0 : DLL ctrl value pre-Sleep | 66 | * R0 : DLL ctrl value pre-Sleep |
61 | * R1 : Processor+Revision | 67 | * R1 : SDRC_DLLA_CTRL |
62 | * 2420: 0x21 = 242xES1, 0x26 = 242xES2.2 | 68 | * R2 : SDRC_POWER |
63 | * 2430: 0x31 = 2430ES1, 0x32 = 2430ES2 | ||
64 | * | 69 | * |
65 | * The if the DPLL is going to AutoIdle. It seems like the DPLL may be back on | 70 | * The if the DPLL is going to AutoIdle. It seems like the DPLL may be back on |
66 | * when we get called, but the DLL probably isn't. We will wait a bit more in | 71 | * when we get called, but the DLL probably isn't. We will wait a bit more in |
@@ -80,15 +85,14 @@ ENTRY(omap24xx_idle_loop_suspend_sz) | |||
80 | */ | 85 | */ |
81 | ENTRY(omap24xx_cpu_suspend) | 86 | ENTRY(omap24xx_cpu_suspend) |
82 | stmfd sp!, {r0 - r12, lr} @ save registers on stack | 87 | stmfd sp!, {r0 - r12, lr} @ save registers on stack |
83 | mov r3, #0x0 @ clear for mrc call | 88 | mov r3, #0x0 @ clear for mcr call |
84 | mcr p15, 0, r3, c7, c10, 4 @ memory barrier, hope SDR/DDR finished | 89 | mcr p15, 0, r3, c7, c10, 4 @ memory barrier, hope SDR/DDR finished |
85 | nop | 90 | nop |
86 | nop | 91 | nop |
87 | ldr r3, A_SDRC_POWER @ addr of sdrc power | 92 | ldr r4, [r2] @ read SDRC_POWER |
88 | ldr r4, [r3] @ value of sdrc power | ||
89 | orr r4, r4, #0x40 @ enable self refresh on idle req | 93 | orr r4, r4, #0x40 @ enable self refresh on idle req |
90 | mov r5, #0x2000 @ set delay (DPLL relock + DLL relock) | 94 | mov r5, #0x2000 @ set delay (DPLL relock + DLL relock) |
91 | str r4, [r3] @ make it so | 95 | str r4, [r2] @ make it so |
92 | mov r2, #0 | 96 | mov r2, #0 |
93 | nop | 97 | nop |
94 | mcr p15, 0, r2, c7, c0, 4 @ wait for interrupt | 98 | mcr p15, 0, r2, c7, c0, 4 @ wait for interrupt |
@@ -97,14 +101,13 @@ loop: | |||
97 | subs r5, r5, #0x1 @ awake, wait just a bit | 101 | subs r5, r5, #0x1 @ awake, wait just a bit |
98 | bne loop | 102 | bne loop |
99 | 103 | ||
100 | /* The DPLL has on before we take the DDR out of self refresh */ | 104 | /* The DPLL has to be on before we take the DDR out of self refresh */ |
101 | bic r4, r4, #0x40 @ now clear self refresh bit. | 105 | bic r4, r4, #0x40 @ now clear self refresh bit. |
102 | str r4, [r3] @ put vlaue back. | 106 | str r4, [r2] @ write to SDRC_POWER |
103 | ldr r4, A_SDRC0 @ make a clock happen | 107 | ldr r4, A_SDRC0 @ make a clock happen |
104 | ldr r4, [r4] | 108 | ldr r4, [r4] @ read A_SDRC0 |
105 | nop @ start auto refresh only after clk ok | 109 | nop @ start auto refresh only after clk ok |
106 | movs r0, r0 @ see if DDR or SDR | 110 | movs r0, r0 @ see if DDR or SDR |
107 | ldrne r1, A_SDRC_DLLA_CTRL_S @ get addr of DLL ctrl | ||
108 | strne r0, [r1] @ rewrite DLLA to force DLL reload | 111 | strne r0, [r1] @ rewrite DLLA to force DLL reload |
109 | addne r1, r1, #0x8 @ move to DLLB | 112 | addne r1, r1, #0x8 @ move to DLLB |
110 | strne r0, [r1] @ rewrite DLLB to force DLL reload | 113 | strne r0, [r1] @ rewrite DLLB to force DLL reload |
@@ -116,13 +119,8 @@ loop2: | |||
116 | /* resume*/ | 119 | /* resume*/ |
117 | ldmfd sp!, {r0 - r12, pc} @ restore regs and return | 120 | ldmfd sp!, {r0 - r12, pc} @ restore regs and return |
118 | 121 | ||
119 | A_SDRC_POWER: | ||
120 | .word OMAP242X_SDRC_REGADDR(SDRC_POWER) | ||
121 | A_SDRC0: | 122 | A_SDRC0: |
122 | .word A_SDRC0_V | 123 | .word A_SDRC0_V |
123 | A_SDRC_DLLA_CTRL_S: | ||
124 | .word OMAP242X_SDRC_REGADDR(SDRC_DLLA_CTRL) | ||
125 | 124 | ||
126 | ENTRY(omap24xx_cpu_suspend_sz) | 125 | ENTRY(omap24xx_cpu_suspend_sz) |
127 | .word . - omap24xx_cpu_suspend | 126 | .word . - omap24xx_cpu_suspend |
128 | |||
diff --git a/arch/arm/plat-omap/include/mach/pm.h b/arch/arm/plat-omap/include/mach/pm.h index 6063e9681de2..768eb6e7abcf 100644 --- a/arch/arm/plat-omap/include/mach/pm.h +++ b/arch/arm/plat-omap/include/mach/pm.h | |||
@@ -135,7 +135,8 @@ extern void omap_pm_suspend(void); | |||
135 | extern void omap730_cpu_suspend(unsigned short, unsigned short); | 135 | extern void omap730_cpu_suspend(unsigned short, unsigned short); |
136 | extern void omap1510_cpu_suspend(unsigned short, unsigned short); | 136 | extern void omap1510_cpu_suspend(unsigned short, unsigned short); |
137 | extern void omap1610_cpu_suspend(unsigned short, unsigned short); | 137 | extern void omap1610_cpu_suspend(unsigned short, unsigned short); |
138 | extern void omap24xx_cpu_suspend(u32 dll_ctrl, u32 cpu_revision); | 138 | extern void omap24xx_cpu_suspend(u32 dll_ctrl, void __iomem *sdrc_dlla_ctrl, |
139 | void __iomem *sdrc_power); | ||
139 | extern void omap730_idle_loop_suspend(void); | 140 | extern void omap730_idle_loop_suspend(void); |
140 | extern void omap1510_idle_loop_suspend(void); | 141 | extern void omap1510_idle_loop_suspend(void); |
141 | extern void omap1610_idle_loop_suspend(void); | 142 | extern void omap1610_idle_loop_suspend(void); |