diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-01-07 17:18:30 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-01-26 10:07:56 -0500 |
commit | 7b5dea12346f98b0624e00ef585246bfec8b0959 (patch) | |
tree | a0a04aa5101b716915e7256fca79d8db0d7fbe07 /arch/arm/mach-pxa/standby.S | |
parent | a10476d4ca52039a9240ac26376e15308b748b19 (diff) |
[ARM] pxa: Add PXA3 standby code hooked into the IRQ wake scheme
Wakeup sources on PXA3 are enabled at two levels. First, the MFP
configuration has to be set to enable which edges a specific pin
will trigger a wakeup. The pin also has to be routed to a functional
unit. Lastly, the functional unit must be enabled as a wakeup source
in the appropriate AD*ER registers (AD2D0ER for standby resume.)
This doesn't fit well with the IRQ wake scheme - we currently do a
best effort conversion from IRQ numbers to functional unit wake enable
bits. For instance, there's several USB client related enable bits but
there's no corresponding IRQs to determine which you'd want. Conversely,
there's a single enable bit covering several functional units.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa/standby.S')
-rw-r--r-- | arch/arm/mach-pxa/standby.S | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/standby.S b/arch/arm/mach-pxa/standby.S index 434a6ab0eca5..167412e6bec8 100644 --- a/arch/arm/mach-pxa/standby.S +++ b/arch/arm/mach-pxa/standby.S | |||
@@ -32,3 +32,83 @@ ENTRY(pxa_cpu_standby) | |||
32 | mov pc, lr | 32 | mov pc, lr |
33 | 33 | ||
34 | #endif | 34 | #endif |
35 | |||
36 | #ifdef CONFIG_PXA3xx | ||
37 | |||
38 | #define MDCNFG 0x0000 | ||
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) | ||
44 | #define DMCIER 0x0070 | ||
45 | #define DMCIER_EDLP (1 << 29) | ||
46 | #define DMCISR 0x0078 | ||
47 | #define RCOMP 0x0100 | ||
48 | #define RCOMP_SWEVAL (1 << 31) | ||
49 | |||
50 | ENTRY(pm_enter_standby_start) | ||
51 | mov r1, #0xf6000000 @ DMEMC_REG_BASE (MDCNFG) | ||
52 | add r1, r1, #0x00100000 | ||
53 | |||
54 | /* | ||
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. | ||
61 | */ | ||
62 | ldr r2, [r1] @ Dummy read MDCNFG | ||
63 | |||
64 | mcr p14, 0, r0, c7, c0, 0 | ||
65 | .rept 8 | ||
66 | nop | ||
67 | .endr | ||
68 | |||
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 | ||
74 | bne 1b | ||
75 | |||
76 | ldr r0, [r1, #RCOMP] @ Initiate RCOMP | ||
77 | orr r0, r0, #RCOMP_SWEVAL | ||
78 | str r0, [r1, #RCOMP] | ||
79 | |||
80 | mov r0, #~0 @ Clear interrupts | ||
81 | str r0, [r1, #DMCISR] | ||
82 | |||
83 | ldr r0, [r1, #DMCIER] @ set DMIER[EDLP] | ||
84 | orr r0, r0, #DMCIER_EDLP | ||
85 | str r0, [r1, #DMCIER] | ||
86 | |||
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] | ||
91 | |||
92 | 1: ldr r0, [r1, #DMCISR] | ||
93 | tst r0, #DMCIER_EDLP | ||
94 | beq 1b | ||
95 | |||
96 | ldr r0, [r1, #MDCNFG] @ set MDCNFG[DMCEN] | ||
97 | orr r0, r0, #MDCNFG_DMCEN | ||
98 | str r0, [r1, #MDCNFG] | ||
99 | 1: ldr r0, [r1, #MDCNFG] | ||
100 | tst r0, #MDCNFG_DMCEN | ||
101 | beq 1b | ||
102 | |||
103 | ldr r0, [r1, #DDR_HCAL] @ set DDR_HCAL[HCRNG] | ||
104 | orr r0, r0, #2 @ HCRNG | ||
105 | str r0, [r1, #DDR_HCAL] | ||
106 | |||
107 | ldr r0, [r1, #DMCIER] @ Clear the interrupt | ||
108 | bic r0, r0, #0x20000000 | ||
109 | str r0, [r1, #DMCIER] | ||
110 | |||
111 | mov pc, lr | ||
112 | ENTRY(pm_enter_standby_end) | ||
113 | |||
114 | #endif | ||