1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#include <linux/kernel.h>
24#include <linux/init.h>
25
26#include "powerdomain.h"
27
28#include "prcm-common.h"
29#include "prcm44xx.h"
30#include "prm7xx.h"
31#include "prcm_mpu7xx.h"
32#include "soc.h"
33
34
35static struct powerdomain iva_7xx_pwrdm = {
36 .name = "iva_pwrdm",
37 .prcm_offs = DRA7XX_PRM_IVA_INST,
38 .prcm_partition = DRA7XX_PRM_PARTITION,
39 .pwrsts = PWRSTS_OFF_ON,
40 .banks = 4,
41 .pwrsts_mem_on = {
42 [0] = PWRSTS_ON,
43 [1] = PWRSTS_ON,
44 [2] = PWRSTS_ON,
45 [3] = PWRSTS_ON,
46 },
47 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
48};
49
50
51static struct powerdomain rtc_7xx_pwrdm = {
52 .name = "rtc_pwrdm",
53 .prcm_offs = DRA7XX_PRM_RTC_INST,
54 .prcm_partition = DRA7XX_PRM_PARTITION,
55 .pwrsts = PWRSTS_ON,
56};
57
58
59static struct powerdomain custefuse_7xx_pwrdm = {
60 .name = "custefuse_pwrdm",
61 .prcm_offs = DRA7XX_PRM_CUSTEFUSE_INST,
62 .prcm_partition = DRA7XX_PRM_PARTITION,
63 .pwrsts = PWRSTS_OFF_ON,
64 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
65};
66
67
68static struct powerdomain custefuse_aon_7xx_pwrdm = {
69 .name = "custefuse_pwrdm",
70 .prcm_offs = DRA7XX_PRM_CUSTEFUSE_INST,
71 .prcm_partition = DRA7XX_PRM_PARTITION,
72 .pwrsts = PWRSTS_ON,
73};
74
75
76static struct powerdomain ipu_7xx_pwrdm = {
77 .name = "ipu_pwrdm",
78 .prcm_offs = DRA7XX_PRM_IPU_INST,
79 .prcm_partition = DRA7XX_PRM_PARTITION,
80 .pwrsts = PWRSTS_OFF_ON,
81 .banks = 2,
82 .pwrsts_mem_on = {
83 [0] = PWRSTS_ON,
84 [1] = PWRSTS_ON,
85 },
86 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
87};
88
89
90static struct powerdomain dss_7xx_pwrdm = {
91 .name = "dss_pwrdm",
92 .prcm_offs = DRA7XX_PRM_DSS_INST,
93 .prcm_partition = DRA7XX_PRM_PARTITION,
94 .pwrsts = PWRSTS_OFF_ON,
95 .banks = 1,
96 .pwrsts_mem_on = {
97 [0] = PWRSTS_ON,
98 },
99 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
100};
101
102
103static struct powerdomain l4per_7xx_pwrdm = {
104 .name = "l4per_pwrdm",
105 .prcm_offs = DRA7XX_PRM_L4PER_INST,
106 .prcm_partition = DRA7XX_PRM_PARTITION,
107 .pwrsts = PWRSTS_ON,
108 .banks = 2,
109 .pwrsts_mem_on = {
110 [0] = PWRSTS_ON,
111 [1] = PWRSTS_ON,
112 },
113 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
114};
115
116
117static struct powerdomain gpu_7xx_pwrdm = {
118 .name = "gpu_pwrdm",
119 .prcm_offs = DRA7XX_PRM_GPU_INST,
120 .prcm_partition = DRA7XX_PRM_PARTITION,
121 .pwrsts = PWRSTS_OFF_ON,
122 .banks = 1,
123 .pwrsts_mem_on = {
124 [0] = PWRSTS_ON,
125 },
126 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
127};
128
129
130static struct powerdomain wkupaon_7xx_pwrdm = {
131 .name = "wkupaon_pwrdm",
132 .prcm_offs = DRA7XX_PRM_WKUPAON_INST,
133 .prcm_partition = DRA7XX_PRM_PARTITION,
134 .pwrsts = PWRSTS_ON,
135 .banks = 1,
136 .pwrsts_mem_on = {
137 [0] = PWRSTS_ON,
138 },
139};
140
141
142static struct powerdomain core_7xx_pwrdm = {
143 .name = "core_pwrdm",
144 .prcm_offs = DRA7XX_PRM_CORE_INST,
145 .prcm_partition = DRA7XX_PRM_PARTITION,
146 .pwrsts = PWRSTS_ON,
147 .banks = 5,
148 .pwrsts_mem_on = {
149 [0] = PWRSTS_ON,
150 [1] = PWRSTS_ON,
151 [2] = PWRSTS_ON,
152 [3] = PWRSTS_ON,
153 [4] = PWRSTS_ON,
154 },
155 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
156};
157
158
159static struct powerdomain coreaon_7xx_pwrdm = {
160 .name = "coreaon_pwrdm",
161 .prcm_offs = DRA7XX_PRM_COREAON_INST,
162 .prcm_partition = DRA7XX_PRM_PARTITION,
163 .pwrsts = PWRSTS_ON,
164};
165
166
167static struct powerdomain cpu0_7xx_pwrdm = {
168 .name = "cpu0_pwrdm",
169 .prcm_offs = DRA7XX_MPU_PRCM_PRM_C0_INST,
170 .prcm_partition = DRA7XX_MPU_PRCM_PARTITION,
171 .pwrsts = PWRSTS_RET_ON,
172 .pwrsts_logic_ret = PWRSTS_RET,
173 .banks = 1,
174 .pwrsts_mem_ret = {
175 [0] = PWRSTS_OFF_RET,
176 },
177 .pwrsts_mem_on = {
178 [0] = PWRSTS_ON,
179 },
180};
181
182
183static struct powerdomain cpu1_7xx_pwrdm = {
184 .name = "cpu1_pwrdm",
185 .prcm_offs = DRA7XX_MPU_PRCM_PRM_C1_INST,
186 .prcm_partition = DRA7XX_MPU_PRCM_PARTITION,
187 .pwrsts = PWRSTS_RET_ON,
188 .pwrsts_logic_ret = PWRSTS_RET,
189 .banks = 1,
190 .pwrsts_mem_ret = {
191 [0] = PWRSTS_OFF_RET,
192 },
193 .pwrsts_mem_on = {
194 [0] = PWRSTS_ON,
195 },
196};
197
198
199static struct powerdomain vpe_7xx_pwrdm = {
200 .name = "vpe_pwrdm",
201 .prcm_offs = DRA7XX_PRM_VPE_INST,
202 .prcm_partition = DRA7XX_PRM_PARTITION,
203 .pwrsts = PWRSTS_OFF_ON,
204 .banks = 1,
205 .pwrsts_mem_on = {
206 [0] = PWRSTS_ON,
207 },
208 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
209};
210
211
212static struct powerdomain mpu_7xx_pwrdm = {
213 .name = "mpu_pwrdm",
214 .prcm_offs = DRA7XX_PRM_MPU_INST,
215 .prcm_partition = DRA7XX_PRM_PARTITION,
216 .pwrsts = PWRSTS_RET_ON,
217 .pwrsts_logic_ret = PWRSTS_RET,
218 .banks = 2,
219 .pwrsts_mem_ret = {
220 [0] = PWRSTS_OFF_RET,
221 [1] = PWRSTS_RET,
222 },
223 .pwrsts_mem_on = {
224 [0] = PWRSTS_ON,
225 [1] = PWRSTS_ON,
226 },
227};
228
229
230static struct powerdomain l3init_7xx_pwrdm = {
231 .name = "l3init_pwrdm",
232 .prcm_offs = DRA7XX_PRM_L3INIT_INST,
233 .prcm_partition = DRA7XX_PRM_PARTITION,
234 .pwrsts = PWRSTS_ON,
235 .banks = 3,
236 .pwrsts_mem_on = {
237 [0] = PWRSTS_ON,
238 [1] = PWRSTS_ON,
239 [2] = PWRSTS_ON,
240 },
241 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
242};
243
244
245static struct powerdomain eve3_7xx_pwrdm = {
246 .name = "eve3_pwrdm",
247 .prcm_offs = DRA7XX_PRM_EVE3_INST,
248 .prcm_partition = DRA7XX_PRM_PARTITION,
249 .pwrsts = PWRSTS_OFF_ON,
250 .banks = 1,
251 .pwrsts_mem_on = {
252 [0] = PWRSTS_ON,
253 },
254 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
255};
256
257
258static struct powerdomain emu_7xx_pwrdm = {
259 .name = "emu_pwrdm",
260 .prcm_offs = DRA7XX_PRM_EMU_INST,
261 .prcm_partition = DRA7XX_PRM_PARTITION,
262 .pwrsts = PWRSTS_OFF_ON,
263 .banks = 1,
264 .pwrsts_mem_on = {
265 [0] = PWRSTS_ON,
266 },
267};
268
269
270static struct powerdomain dsp2_7xx_pwrdm = {
271 .name = "dsp2_pwrdm",
272 .prcm_offs = DRA7XX_PRM_DSP2_INST,
273 .prcm_partition = DRA7XX_PRM_PARTITION,
274 .pwrsts = PWRSTS_OFF_ON,
275 .banks = 3,
276 .pwrsts_mem_on = {
277 [0] = PWRSTS_ON,
278 [1] = PWRSTS_ON,
279 [2] = PWRSTS_ON,
280 },
281 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
282};
283
284
285static struct powerdomain dsp1_7xx_pwrdm = {
286 .name = "dsp1_pwrdm",
287 .prcm_offs = DRA7XX_PRM_DSP1_INST,
288 .prcm_partition = DRA7XX_PRM_PARTITION,
289 .pwrsts = PWRSTS_OFF_ON,
290 .banks = 3,
291 .pwrsts_mem_on = {
292 [0] = PWRSTS_ON,
293 [1] = PWRSTS_ON,
294 [2] = PWRSTS_ON,
295 },
296 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
297};
298
299
300static struct powerdomain cam_7xx_pwrdm = {
301 .name = "cam_pwrdm",
302 .prcm_offs = DRA7XX_PRM_CAM_INST,
303 .prcm_partition = DRA7XX_PRM_PARTITION,
304 .pwrsts = PWRSTS_OFF_ON,
305 .banks = 1,
306 .pwrsts_mem_on = {
307 [0] = PWRSTS_ON,
308 },
309 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
310};
311
312
313static struct powerdomain eve4_7xx_pwrdm = {
314 .name = "eve4_pwrdm",
315 .prcm_offs = DRA7XX_PRM_EVE4_INST,
316 .prcm_partition = DRA7XX_PRM_PARTITION,
317 .pwrsts = PWRSTS_OFF_ON,
318 .banks = 1,
319 .pwrsts_mem_on = {
320 [0] = PWRSTS_ON,
321 },
322 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
323};
324
325
326static struct powerdomain eve2_7xx_pwrdm = {
327 .name = "eve2_pwrdm",
328 .prcm_offs = DRA7XX_PRM_EVE2_INST,
329 .prcm_partition = DRA7XX_PRM_PARTITION,
330 .pwrsts = PWRSTS_OFF_ON,
331 .banks = 1,
332 .pwrsts_mem_on = {
333 [0] = PWRSTS_ON,
334 },
335 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
336};
337
338
339static struct powerdomain eve1_7xx_pwrdm = {
340 .name = "eve1_pwrdm",
341 .prcm_offs = DRA7XX_PRM_EVE1_INST,
342 .prcm_partition = DRA7XX_PRM_PARTITION,
343 .pwrsts = PWRSTS_OFF_ON,
344 .banks = 1,
345 .pwrsts_mem_on = {
346 [0] = PWRSTS_ON,
347 },
348 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
349};
350
351
352
353
354
355
356
357
358
359static struct powerdomain *powerdomains_dra7xx[] __initdata = {
360 &iva_7xx_pwrdm,
361 &rtc_7xx_pwrdm,
362 &ipu_7xx_pwrdm,
363 &dss_7xx_pwrdm,
364 &l4per_7xx_pwrdm,
365 &gpu_7xx_pwrdm,
366 &wkupaon_7xx_pwrdm,
367 &core_7xx_pwrdm,
368 &coreaon_7xx_pwrdm,
369 &cpu0_7xx_pwrdm,
370 &cpu1_7xx_pwrdm,
371 &vpe_7xx_pwrdm,
372 &mpu_7xx_pwrdm,
373 &l3init_7xx_pwrdm,
374 &eve3_7xx_pwrdm,
375 &emu_7xx_pwrdm,
376 &dsp2_7xx_pwrdm,
377 &dsp1_7xx_pwrdm,
378 &cam_7xx_pwrdm,
379 &eve4_7xx_pwrdm,
380 &eve2_7xx_pwrdm,
381 &eve1_7xx_pwrdm,
382 NULL
383};
384
385static struct powerdomain *powerdomains_dra76x[] __initdata = {
386 &custefuse_aon_7xx_pwrdm,
387 NULL
388};
389
390static struct powerdomain *powerdomains_dra74x[] __initdata = {
391 &custefuse_7xx_pwrdm,
392 NULL
393};
394
395static struct powerdomain *powerdomains_dra72x[] __initdata = {
396 &custefuse_aon_7xx_pwrdm,
397 NULL
398};
399
400void __init dra7xx_powerdomains_init(void)
401{
402 pwrdm_register_platform_funcs(&omap4_pwrdm_operations);
403 pwrdm_register_pwrdms(powerdomains_dra7xx);
404
405 if (soc_is_dra76x())
406 pwrdm_register_pwrdms(powerdomains_dra76x);
407 else if (soc_is_dra74x())
408 pwrdm_register_pwrdms(powerdomains_dra74x);
409 else if (soc_is_dra72x())
410 pwrdm_register_pwrdms(powerdomains_dra72x);
411
412 pwrdm_complete_init();
413}
414