4 * Author: David Burrage
6 * 2005 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
12 #include <linux/linkage.h>
13 #include <asm/assembler.h>
14 #include <asm/hardware.h>
16 #include <asm/arch/pxa-regs.h>
21 ENTRY(pxa_cpu_standby)
23 mov r1, #(PSSR_PH | PSSR_STS)
24 mov r2, #PWRMODE_STANDBY
25 mov r3, #UNCACHED_PHYS_0 @ Read mem context in.
30 1: mcr p14, 0, r2, c7, c0, 0 @ put the system into Standby
31 str r1, [r0] @ make sure PSSR_PH/STS are clear
39 #define MDCNFG_DMCEN (1 << 30)
40 #define DDR_HCAL 0x0060
41 #define DDR_HCAL_HCRNG 0x1f
42 #define DDR_HCAL_HCPROG (1 << 28)
43 #define DDR_HCAL_HCEN (1 << 31)
45 #define DMCIER_EDLP (1 << 29)
48 #define RCOMP_SWEVAL (1 << 31)
50 ENTRY(pm_enter_standby_start)
51 mov r1, #0xf6000000 @ DMEMC_REG_BASE (MDCNFG)
52 add r1, r1, #0x00100000
55 * Preload the TLB entry for accessing the dynamic memory
56 * controller registers. Note that page table lookups will
57 * fail until the dynamic memory controller has been
58 * reinitialised - and that includes MMU page table walks.
59 * This also means that only the dynamic memory controller
60 * can be reliably accessed in the code following standby.
62 ldr r2, [r1] @ Dummy read MDCNFG
64 mcr p14, 0, r0, c7, c0, 0
69 ldr r0, [r1, #DDR_HCAL] @ Clear (and wait for) HCEN
70 bic r0, r0, #DDR_HCAL_HCEN
71 str r0, [r1, #DDR_HCAL]
72 1: ldr r0, [r1, #DDR_HCAL]
73 tst r0, #DDR_HCAL_HCEN
76 ldr r0, [r1, #RCOMP] @ Initiate RCOMP
77 orr r0, r0, #RCOMP_SWEVAL
80 mov r0, #~0 @ Clear interrupts
83 ldr r0, [r1, #DMCIER] @ set DMIER[EDLP]
84 orr r0, r0, #DMCIER_EDLP
87 ldr r0, [r1, #DDR_HCAL] @ clear HCRNG, set HCPROG, HCEN
88 bic r0, r0, #DDR_HCAL_HCRNG
89 orr r0, r0, #DDR_HCAL_HCEN | DDR_HCAL_HCPROG
90 str r0, [r1, #DDR_HCAL]
92 1: ldr r0, [r1, #DMCISR]
96 ldr r0, [r1, #MDCNFG] @ set MDCNFG[DMCEN]
97 orr r0, r0, #MDCNFG_DMCEN
99 1: ldr r0, [r1, #MDCNFG]
100 tst r0, #MDCNFG_DMCEN
103 ldr r0, [r1, #DDR_HCAL] @ set DDR_HCAL[HCRNG]
104 orr r0, r0, #2 @ HCRNG
105 str r0, [r1, #DDR_HCAL]
107 ldr r0, [r1, #DMCIER] @ Clear the interrupt
108 bic r0, r0, #0x20000000
109 str r0, [r1, #DMCIER]
112 ENTRY(pm_enter_standby_end)