2 #include <asm/ppc_asm.h>
3 #include <asm/processor.h>
8 _GLOBAL(mpc52xx_deep_sleep)
9 mpc52xx_deep_sleep: /* args r3-r6: SRAM, SDRAM regs, CDM regs, INTR regs */
11 /* enable interrupts */
13 ori r7, r7, 0x8000 /* EE */
17 li r10, 0 /* flag that irq handler sets */
19 /* enable tmr7 (or any other) interrupt */
20 lwz r8, 0x14(r6) /* intr->main_mask */
26 /* emulate tmr7 interrupt */
28 stw r8, 0x40(r6) /* intr->main_emulate */
31 /* wait for it to happen */
50 mtlr r9 /* restore LR */
61 /* return to C code */
65 _GLOBAL(mpc52xx_ds_sram)
67 /* put SDRAM into self-refresh */
68 lwz r8, 0x4(r4) /* sdram->ctrl */
70 oris r8, r8, 0x8000 /* mode_en */
74 ori r8, r8, 0x0002 /* soft_pre */
79 xoris r8, r8, 0x8000 /* !mode_en */
84 xoris r8, r8, 0x4000 /* ref_en !cke */
88 /* disable SDRAM clock */
89 lwz r8, 0x14(r5) /* cdm->clkenable */
96 /* put mpc5200 to sleep */
98 oris r10, r10, 0x0004 /* POW = 1 */
110 /* get ram out of self-refresh */
112 oris r8, r8, 0x5000 /* cke ref_en */
117 _GLOBAL(mpc52xx_ds_sram_size)
118 mpc52xx_ds_sram_size:
119 .long $-mpc52xx_ds_sram
122 /* ### interrupt handler for wakeup from deep-sleep ### */
123 _GLOBAL(mpc52xx_ds_cached)
128 /* disable emulated interrupt */
129 mfspr r7, 311 /* MBAR */
130 addi r7, r7, 0x540 /* intr->main_emul */
136 /* acknowledge wakeup, so CCS releases power pown */
137 mfspr r7, 311 /* MBAR */
138 addi r7, r7, 0x524 /* intr->enc_status */
145 /* flag - we handled the interrupt */
152 _GLOBAL(mpc52xx_ds_cached_size)
153 mpc52xx_ds_cached_size:
154 .long $-mpc52xx_ds_cached