aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/sleep34xx.S
diff options
context:
space:
mode:
authorPeter 'p2' De Schrijver <peter.de-schrijver@nokia.com>2009-01-16 11:53:48 -0500
committerKevin Hilman <khilman@deeprootsystems.com>2009-11-11 17:42:27 -0500
commit89139dce8a0060d97a46cebde570a8f55c314712 (patch)
tree9490675c8f1f88c1ab37248082cb1c2e2230091e /arch/arm/mach-omap2/sleep34xx.S
parent867d320b6c30d2478358eafeca0e1a6c60cf06c3 (diff)
OMAP3: PM: Wait for SDRC ready iso a blind delay
This patch improves the wakeup SRAM code polling the SDRC to become ready instead of just waiting for a fixed amount of time. Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2/sleep34xx.S')
-rw-r--r--arch/arm/mach-omap2/sleep34xx.S48
1 files changed, 36 insertions, 12 deletions
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index dedfa0e6c639..15268f8b61de 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -29,6 +29,7 @@
29#include <mach/io.h> 29#include <mach/io.h>
30#include <plat/control.h> 30#include <plat/control.h>
31 31
32#include "cm.h"
32#include "prm.h" 33#include "prm.h"
33#include "sdrc.h" 34#include "sdrc.h"
34 35
@@ -38,6 +39,7 @@
38#define PM_PREPWSTST_MPU_V OMAP34XX_PRM_REGADDR(MPU_MOD, \ 39#define PM_PREPWSTST_MPU_V OMAP34XX_PRM_REGADDR(MPU_MOD, \
39 OMAP3430_PM_PREPWSTST) 40 OMAP3430_PM_PREPWSTST)
40#define PM_PWSTCTRL_MPU_P OMAP3430_PRM_BASE + MPU_MOD + PM_PWSTCTRL 41#define PM_PWSTCTRL_MPU_P OMAP3430_PRM_BASE + MPU_MOD + PM_PWSTCTRL
42#define CM_IDLEST1_CORE_V OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST1)
41#define SRAM_BASE_P 0x40200000 43#define SRAM_BASE_P 0x40200000
42#define CONTROL_STAT 0x480022F0 44#define CONTROL_STAT 0x480022F0
43#define SCRATCHPAD_MEM_OFFS 0x310 /* Move this as correct place is 45#define SCRATCHPAD_MEM_OFFS 0x310 /* Move this as correct place is
@@ -52,6 +54,8 @@
52#define SDRC_MR_1_P (OMAP343X_SDRC_BASE + SDRC_MR_1) 54#define SDRC_MR_1_P (OMAP343X_SDRC_BASE + SDRC_MR_1)
53#define SDRC_EMR2_1_P (OMAP343X_SDRC_BASE + SDRC_EMR2_1) 55#define SDRC_EMR2_1_P (OMAP343X_SDRC_BASE + SDRC_EMR2_1)
54#define SDRC_MANUAL_1_P (OMAP343X_SDRC_BASE + SDRC_MANUAL_1) 56#define SDRC_MANUAL_1_P (OMAP343X_SDRC_BASE + SDRC_MANUAL_1)
57#define SDRC_DLLA_STATUS_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS)
58#define SDRC_DLLA_CTRL_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL)
55 59
56 .text 60 .text
57/* Function call to get the restore pointer for resume from OFF */ 61/* Function call to get the restore pointer for resume from OFF */
@@ -187,7 +191,7 @@ loop:
187 nop 191 nop
188 nop 192 nop
189 nop 193 nop
190 bl i_dll_wait 194 bl wait_sdrc_ok
191 195
192 ldmfd sp!, {r0-r12, pc} @ restore regs and return 196 ldmfd sp!, {r0-r12, pc} @ restore regs and return
193restore_es3: 197restore_es3:
@@ -539,21 +543,41 @@ skip_l2_inval:
539 nop 543 nop
540 nop 544 nop
541 nop 545 nop
542 bl i_dll_wait 546 bl wait_sdrc_ok
543 /* restore regs and return */ 547 /* restore regs and return */
544 ldmfd sp!, {r0-r12, pc} 548 ldmfd sp!, {r0-r12, pc}
545 549
546i_dll_wait: 550/* Make sure SDRC accesses are ok */
547 ldr r4, clk_stabilize_delay 551wait_sdrc_ok:
552 ldr r4, cm_idlest1_core
553 ldr r5, [r4]
554 and r5, r5, #0x2
555 cmp r5, #0
556 bne wait_sdrc_ok
557 ldr r4, sdrc_power
558 ldr r5, [r4]
559 bic r5, r5, #0x40
560 str r5, [r4]
561wait_dll_lock:
562 /* Is dll in lock mode? */
563 ldr r4, sdrc_dlla_ctrl
564 ldr r5, [r4]
565 tst r5, #0x4
566 bxne lr
567 /* wait till dll locks */
568 ldr r4, sdrc_dlla_status
569 ldr r5, [r4]
570 and r5, r5, #0x4
571 cmp r5, #0x4
572 bne wait_dll_lock
573 bx lr
548 574
549i_dll_delay: 575cm_idlest1_core:
550 subs r4, r4, #0x1 576 .word CM_IDLEST1_CORE_V
551 bne i_dll_delay 577sdrc_dlla_status:
552 ldr r4, sdrc_power 578 .word SDRC_DLLA_STATUS_V
553 ldr r5, [r4] 579sdrc_dlla_ctrl:
554 bic r5, r5, #0x40 580 .word SDRC_DLLA_CTRL_V
555 str r5, [r4]
556 bx lr
557pm_prepwstst_core: 581pm_prepwstst_core:
558 .word PM_PREPWSTST_CORE_V 582 .word PM_PREPWSTST_CORE_V
559pm_prepwstst_core_p: 583pm_prepwstst_core_p: