1
2
3
4
5
6
7
8
9
10
11
12
13#include <linux/io.h>
14#include <linux/kernel.h>
15
16#include <mach/regs-clock.h>
17#include <mach/pmu.h>
18
19static void __iomem *sys_powerdown_reg[] = {
20 S5P_ARM_CORE0_LOWPWR,
21 S5P_DIS_IRQ_CORE0,
22 S5P_DIS_IRQ_CENTRAL0,
23 S5P_ARM_CORE1_LOWPWR,
24 S5P_DIS_IRQ_CORE1,
25 S5P_DIS_IRQ_CENTRAL1,
26 S5P_ARM_COMMON_LOWPWR,
27 S5P_L2_0_LOWPWR,
28 S5P_L2_1_LOWPWR,
29 S5P_CMU_ACLKSTOP_LOWPWR,
30 S5P_CMU_SCLKSTOP_LOWPWR,
31 S5P_CMU_RESET_LOWPWR,
32 S5P_APLL_SYSCLK_LOWPWR,
33 S5P_MPLL_SYSCLK_LOWPWR,
34 S5P_VPLL_SYSCLK_LOWPWR,
35 S5P_EPLL_SYSCLK_LOWPWR,
36 S5P_CMU_CLKSTOP_GPS_ALIVE_LOWPWR,
37 S5P_CMU_RESET_GPSALIVE_LOWPWR,
38 S5P_CMU_CLKSTOP_CAM_LOWPWR,
39 S5P_CMU_CLKSTOP_TV_LOWPWR,
40 S5P_CMU_CLKSTOP_MFC_LOWPWR,
41 S5P_CMU_CLKSTOP_G3D_LOWPWR,
42 S5P_CMU_CLKSTOP_LCD0_LOWPWR,
43 S5P_CMU_CLKSTOP_LCD1_LOWPWR,
44 S5P_CMU_CLKSTOP_MAUDIO_LOWPWR,
45 S5P_CMU_CLKSTOP_GPS_LOWPWR,
46 S5P_CMU_RESET_CAM_LOWPWR,
47 S5P_CMU_RESET_TV_LOWPWR,
48 S5P_CMU_RESET_MFC_LOWPWR,
49 S5P_CMU_RESET_G3D_LOWPWR,
50 S5P_CMU_RESET_LCD0_LOWPWR,
51 S5P_CMU_RESET_LCD1_LOWPWR,
52 S5P_CMU_RESET_MAUDIO_LOWPWR,
53 S5P_CMU_RESET_GPS_LOWPWR,
54 S5P_TOP_BUS_LOWPWR,
55 S5P_TOP_RETENTION_LOWPWR,
56 S5P_TOP_PWR_LOWPWR,
57 S5P_LOGIC_RESET_LOWPWR,
58 S5P_ONENAND_MEM_LOWPWR,
59 S5P_MODIMIF_MEM_LOWPWR,
60 S5P_G2D_ACP_MEM_LOWPWR,
61 S5P_USBOTG_MEM_LOWPWR,
62 S5P_HSMMC_MEM_LOWPWR,
63 S5P_CSSYS_MEM_LOWPWR,
64 S5P_SECSS_MEM_LOWPWR,
65 S5P_PCIE_MEM_LOWPWR,
66 S5P_SATA_MEM_LOWPWR,
67 S5P_PAD_RETENTION_DRAM_LOWPWR,
68 S5P_PAD_RETENTION_MAUDIO_LOWPWR,
69 S5P_PAD_RETENTION_GPIO_LOWPWR,
70 S5P_PAD_RETENTION_UART_LOWPWR,
71 S5P_PAD_RETENTION_MMCA_LOWPWR,
72 S5P_PAD_RETENTION_MMCB_LOWPWR,
73 S5P_PAD_RETENTION_EBIA_LOWPWR,
74 S5P_PAD_RETENTION_EBIB_LOWPWR,
75 S5P_PAD_RETENTION_ISOLATION_LOWPWR,
76 S5P_PAD_RETENTION_ALV_SEL_LOWPWR,
77 S5P_XUSBXTI_LOWPWR,
78 S5P_XXTI_LOWPWR,
79 S5P_EXT_REGULATOR_LOWPWR,
80 S5P_GPIO_MODE_LOWPWR,
81 S5P_GPIO_MODE_MAUDIO_LOWPWR,
82 S5P_CAM_LOWPWR,
83 S5P_TV_LOWPWR,
84 S5P_MFC_LOWPWR,
85 S5P_G3D_LOWPWR,
86 S5P_LCD0_LOWPWR,
87 S5P_LCD1_LOWPWR,
88 S5P_MAUDIO_LOWPWR,
89 S5P_GPS_LOWPWR,
90 S5P_GPS_ALIVE_LOWPWR,
91};
92
93static const unsigned int sys_powerdown_val[][NUM_SYS_POWERDOWN] = {
94
95 { 0, 0, 2 },
96 { 0, 0, 0 },
97 { 0, 0, 0 },
98 { 0, 0, 2 },
99 { 0, 0, 0 },
100 { 0, 0, 0 },
101 { 0, 0, 2 },
102 { 2, 2, 3 },
103 { 2, 2, 3 },
104 { 1, 0, 0 },
105 { 1, 0, 0 },
106 { 1, 1, 0 },
107 { 1, 0, 0 },
108 { 1, 0, 0 },
109 { 1, 0, 0 },
110 { 1, 1, 0 },
111 { 1, 1, 0 },
112 { 1, 1, 0 },
113 { 1, 1, 0 },
114 { 1, 1, 0 },
115 { 1, 1, 0 },
116 { 1, 1, 0 },
117 { 1, 1, 0 },
118 { 1, 1, 0 },
119 { 1, 1, 0 },
120 { 1, 1, 0 },
121 { 1, 1, 0 },
122 { 1, 1, 0 },
123 { 1, 1, 0 },
124 { 1, 1, 0 },
125 { 1, 1, 0 },
126 { 1, 1, 0 },
127 { 1, 1, 0 },
128 { 1, 1, 0 },
129 { 3, 0, 0 },
130 { 1, 0, 1 },
131 { 3, 0, 3 },
132 { 1, 1, 0 },
133 { 3, 0, 0 },
134 { 3, 0, 0 },
135 { 3, 0, 0 },
136 { 3, 0, 0 },
137 { 3, 0, 0 },
138 { 3, 0, 0 },
139 { 3, 0, 0 },
140 { 3, 0, 0 },
141 { 3, 0, 0 },
142 { 1, 0, 0 },
143 { 1, 1, 0 },
144 { 1, 0, 0 },
145 { 1, 0, 0 },
146 { 1, 0, 0 },
147 { 1, 0, 0 },
148 { 1, 0, 0 },
149 { 1, 0, 0 },
150 { 1, 0, 0 },
151 { 1, 0, 0 },
152 { 1, 1, 0 },
153 { 1, 1, 0 },
154 { 1, 1, 0 },
155 { 1, 0, 0 },
156 { 1, 1, 0 },
157 { 7, 0, 0 },
158 { 7, 0, 0 },
159 { 7, 0, 0 },
160 { 7, 0, 0 },
161 { 7, 0, 0 },
162 { 7, 0, 0 },
163 { 7, 7, 0 },
164 { 7, 0, 0 },
165 { 7, 0, 0 },
166};
167
168void exynos4_sys_powerdown_conf(enum sys_powerdown mode)
169{
170 unsigned int count = ARRAY_SIZE(sys_powerdown_reg);
171
172 for (; count > 0; count--)
173 __raw_writel(sys_powerdown_val[count - 1][mode],
174 sys_powerdown_reg[count - 1]);
175}
176