aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/52xx/lite5200.c
diff options
context:
space:
mode:
authorDomen Puncer <domen.puncer@telargo.com>2007-05-06 11:38:52 -0400
committerPaul Mackerras <paulus@samba.org>2007-05-07 06:31:15 -0400
commit2e1ee1f76684c5d4dd8e5a08cbf22d57f88769ed (patch)
tree0c69d52b8fb2cf82f257944d182ce1f8973ab9f9 /arch/powerpc/platforms/52xx/lite5200.c
parenta3481197783c187707090504062488862768260a (diff)
[POWERPC] mpc52xx suspend to deep-sleep
Implement deep-sleep on MPC52xx. SDRAM is put into self-refresh with help of SRAM code (alternatives would be code in FLASH, I-cache). Interrupt code must also not be in SDRAM, so put it in I-cache. MPC52xx core is static, so contents will remain intact even with clocks turned off. Signed-off-by: Domen Puncer <domen.puncer@telargo.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/52xx/lite5200.c')
-rw-r--r--arch/powerpc/platforms/52xx/lite5200.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c
index 8e2646ac417b..1cfc00dfb99a 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -85,6 +85,28 @@ error:
85 iounmap(gpio); 85 iounmap(gpio);
86} 86}
87 87
88#ifdef CONFIG_PM
89static u32 descr_a;
90static void lite5200_suspend_prepare(void __iomem *mbar)
91{
92 u8 pin = 1; /* GPIO_WKUP_1 (GPIO_PSC2_4) */
93 u8 level = 0; /* wakeup on low level */
94 mpc52xx_set_wakeup_gpio(pin, level);
95
96 /*
97 * power down usb port
98 * this needs to be called before of-ohci suspend code
99 */
100 descr_a = in_be32(mbar + 0x1048);
101 out_be32(mbar + 0x1048, (descr_a & ~0x200) | 0x100);
102}
103
104static void lite5200_resume_finish(void __iomem *mbar)
105{
106 out_be32(mbar + 0x1048, descr_a);
107}
108#endif
109
88static void __init lite5200_setup_arch(void) 110static void __init lite5200_setup_arch(void)
89{ 111{
90 struct device_node *np; 112 struct device_node *np;
@@ -107,6 +129,12 @@ static void __init lite5200_setup_arch(void)
107 mpc52xx_setup_cpu(); /* Generic */ 129 mpc52xx_setup_cpu(); /* Generic */
108 lite5200_setup_cpu(); /* Platorm specific */ 130 lite5200_setup_cpu(); /* Platorm specific */
109 131
132#ifdef CONFIG_PM
133 mpc52xx_suspend.board_suspend_prepare = lite5200_suspend_prepare;
134 mpc52xx_suspend.board_resume_finish = lite5200_resume_finish;
135 mpc52xx_pm_init();
136#endif
137
110#ifdef CONFIG_PCI 138#ifdef CONFIG_PCI
111 np = of_find_node_by_type(NULL, "pci"); 139 np = of_find_node_by_type(NULL, "pci");
112 if (np) { 140 if (np) {