1 #include <linux/linkage.h>
2 #include <asm/blackfin.h>
5 #include <asm/context.S>
7 #define PM_STACK (COREA_L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12)
10 ENTRY(_enter_hibernate)
11 /* switch stack to L1 scratch, prepare for ddr srfr */
17 call _bfin_hibernate_syscontrol;
19 P0.H = HI(DPM0_RESTORE4);
20 P0.L = LO(DPM0_RESTORE4);
21 P1.H = _bf609_pm_data;
22 P1.L = _bf609_pm_data;
27 R3.H = HI(0x00000010);
28 R3.L = LO(0x00000010);
30 bfin_init_pm_bench_cycles;
35 ENDPROC(_enter_hibernate)
37 /* DPM wake up interrupt won't wake up core on bf60x if its core IMASK
38 * is disabled. This behavior differ from bf5xx serial processor.
40 ENTRY(_dummy_deepsleep)
45 /* get wake up interrupt ID */
46 P0.l = LO(SEC_SCI_BASE + SEC_CSID);
47 P0.h = HI(SEC_SCI_BASE + SEC_CSID);
50 /* ACK wake up interrupt in SEC */
57 /* restore EVT 11 entry */
69 ENDPROC(_dummy_deepsleep)
71 ENTRY(_enter_deepsleep)
75 /* Change EVT 11 entry to dummy handler for wake up event */
78 p1.h = _dummy_deepsleep;
79 p1.l = _dummy_deepsleep;
91 /* should put ddr to self refresh mode before sleep */
94 /* Set DPM controller to deep sleep mode */
97 R3.H = HI(0x00000008);
98 R3.L = LO(0x00000008);
102 /* Enable evt 11 in IMASK before idle, otherwise core doesn't wake up. */
108 bfin_init_pm_bench_cycles;
110 /* Fall into deep sleep in idle*/
114 /* Restore PLL after wake up from deep sleep */
115 call _bf609_resume_ccbuf;
117 /* turn ddr out of self refresh mode */
118 call _bf609_ddr_sr_exit;
122 (R7:0,P5:0) = [SP++];
125 ENDPROC(_enter_deepsleep)
128 ENTRY(_bf609_hibernate)
132 P0.H = _bf609_pm_data;
133 P0.L = _bf609_pm_data;
136 R2.H = .Lpm_resume_here;
137 R2.L = .Lpm_resume_here;
142 P1.H = _enter_hibernate;
143 P1.L = _enter_hibernate;
148 bfin_core_mmr_restore;
149 bfin_cpu_reg_restore;
151 [--sp] = RETI; /* Clear Global Interrupt Disable */
156 ENDPROC(_bf609_hibernate)