aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf609/hibernate.S
diff options
context:
space:
mode:
authorSteven Miao <realmz6@gmail.com>2012-05-16 06:26:10 -0400
committerBob Liu <lliubbo@gmail.com>2012-05-21 02:54:24 -0400
commit93f89519fd31c21e5d606faf4091f5905db38412 (patch)
tree642d8605e14281e8f69a54e2130a7898754289ba /arch/blackfin/mach-bf609/hibernate.S
parentb2cfc653a513f347114c85ed8e75456ea0159c18 (diff)
blackfin: bf60x: add power management support
Add bf60x cpu pm callbacks and change blackfin pm framework to support bf60x. Signed-off-by: Steven Miao <realmz6@gmail.com> Signed-off-by: Bob Liu <lliubbo@gmail.com>
Diffstat (limited to 'arch/blackfin/mach-bf609/hibernate.S')
-rw-r--r--arch/blackfin/mach-bf609/hibernate.S62
1 files changed, 62 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf609/hibernate.S b/arch/blackfin/mach-bf609/hibernate.S
new file mode 100644
index 000000000000..baedd6e6abf4
--- /dev/null
+++ b/arch/blackfin/mach-bf609/hibernate.S
@@ -0,0 +1,62 @@
1#include <linux/linkage.h>
2#include <asm/blackfin.h>
3#include <asm/dpmc.h>
4
5#define PM_STACK (COREA_L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12)
6
7.section .l1.text
8ENTRY(_enter_hibernate)
9 /* switch stack to L1 scratch, prepare for ddr srfr */
10 P0.H = HI(PM_STACK);
11 P0.L = LO(PM_STACK);
12 SP = P0;
13
14 call _bf609_ddr_sr;
15 call _bfin_hibernate_syscontrol;
16
17 P0.H = HI(DPM0_RESTORE4);
18 P0.L = LO(DPM0_RESTORE4);
19 P1.H = _bf609_pm_data;
20 P1.L = _bf609_pm_data;
21 [P0] = P1;
22
23 P0.H = HI(DPM0_CTL);
24 P0.L = LO(DPM0_CTL);
25 R3.H = HI(0x00000010);
26 R3.L = LO(0x00000010);
27 [P0] = R3;
28
29 SSYNC;
30ENDPROC(_enter_hibernate_mode)
31
32.section .text
33ENTRY(_bf609_hibernate)
34 bfin_cpu_reg_save;
35 bfin_core_mmr_save;
36
37 P0.H = _bf609_pm_data;
38 P0.L = _bf609_pm_data;
39 R1.H = 0xDEAD;
40 R1.L = 0xBEEF;
41 R2.H = .Lpm_resume_here;
42 R2.L = .Lpm_resume_here;
43 [P0++] = R1;
44 [P0++] = R2;
45 [P0++] = SP;
46
47 P1.H = _enter_hibernate;
48 P1.L = _enter_hibernate;
49
50 call (P1);
51.Lpm_resume_here:
52
53 bfin_core_mmr_restore;
54 bfin_cpu_reg_restore;
55
56 [--sp] = RETI; /* Clear Global Interrupt Disable */
57 SP += 4;
58
59 RTS;
60
61ENDPROC(_bf609_hibernate)
62