This source file includes following definitions.
- pxa3xx_smemc_suspend
- pxa3xx_smemc_resume
- smemc_init
1
2
3
4
5
6 #include <linux/module.h>
7 #include <linux/kernel.h>
8 #include <linux/init.h>
9 #include <linux/io.h>
10 #include <linux/syscore_ops.h>
11
12 #include <mach/hardware.h>
13 #include <mach/smemc.h>
14
15 #ifdef CONFIG_PM
16 static unsigned long msc[2];
17 static unsigned long sxcnfg, memclkcfg;
18 static unsigned long csadrcfg[4];
19
20 static int pxa3xx_smemc_suspend(void)
21 {
22 msc[0] = __raw_readl(MSC0);
23 msc[1] = __raw_readl(MSC1);
24 sxcnfg = __raw_readl(SXCNFG);
25 memclkcfg = __raw_readl(MEMCLKCFG);
26 csadrcfg[0] = __raw_readl(CSADRCFG0);
27 csadrcfg[1] = __raw_readl(CSADRCFG1);
28 csadrcfg[2] = __raw_readl(CSADRCFG2);
29 csadrcfg[3] = __raw_readl(CSADRCFG3);
30
31 return 0;
32 }
33
34 static void pxa3xx_smemc_resume(void)
35 {
36 __raw_writel(msc[0], MSC0);
37 __raw_writel(msc[1], MSC1);
38 __raw_writel(sxcnfg, SXCNFG);
39 __raw_writel(memclkcfg, MEMCLKCFG);
40 __raw_writel(csadrcfg[0], CSADRCFG0);
41 __raw_writel(csadrcfg[1], CSADRCFG1);
42 __raw_writel(csadrcfg[2], CSADRCFG2);
43 __raw_writel(csadrcfg[3], CSADRCFG3);
44
45 __raw_writel(0x2, CSMSADRCFG);
46 }
47
48 static struct syscore_ops smemc_syscore_ops = {
49 .suspend = pxa3xx_smemc_suspend,
50 .resume = pxa3xx_smemc_resume,
51 };
52
53 static int __init smemc_init(void)
54 {
55 if (cpu_is_pxa3xx()) {
56
57
58
59
60
61
62
63
64 __raw_writel(0x2, CSMSADRCFG);
65
66 register_syscore_ops(&smemc_syscore_ops);
67 }
68
69 return 0;
70 }
71 subsys_initcall(smemc_init);
72 #endif