2 * OMAP3 powerdomain definitions
4 * Copyright (C) 2007-2008, 2011 Texas Instruments, Inc.
5 * Copyright (C) 2007-2011 Nokia Corporation
7 * Paul Walmsley, Jouni Högander
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <linux/bug.h>
20 #include "powerdomain.h"
21 #include "powerdomains2xxx_3xxx_data.h"
23 #include "prcm-common.h"
24 #include "prm2xxx_3xxx.h"
25 #include "prm-regbits-34xx.h"
26 #include "cm2xxx_3xxx.h"
27 #include "cm-regbits-34xx.h"
30 * 34XX-specific powerdomains, dependencies
37 static struct powerdomain iva2_pwrdm
= {
39 .prcm_offs
= OMAP3430_IVA2_MOD
,
40 .pwrsts
= PWRSTS_OFF_RET_ON
,
41 .pwrsts_logic_ret
= PWRSTS_OFF_RET
,
55 .voltdm
= { .name
= "mpu_iva" },
58 static struct powerdomain mpu_3xxx_pwrdm
= {
61 .pwrsts
= PWRSTS_OFF_RET_ON
,
62 .pwrsts_logic_ret
= PWRSTS_OFF_RET
,
63 .flags
= PWRDM_HAS_MPU_QUIRK
,
71 .voltdm
= { .name
= "mpu_iva" },
74 static struct powerdomain mpu_am35x_pwrdm
= {
78 .pwrsts_logic_ret
= PWRSTS_ON
,
79 .flags
= PWRDM_HAS_MPU_QUIRK
,
87 .voltdm
= { .name
= "mpu_iva" },
91 * The USBTLL Save-and-Restore mechanism is broken on
92 * 3430s up to ES3.0 and 3630ES1.0. Hence this feature
93 * needs to be disabled on these chips.
94 * Refer: 3430 errata ID i459 and 3630 errata ID i579
96 * Note: setting the SAR flag could help for errata ID i478
97 * which applies to 3430 <= ES3.1, but since the SAR feature
98 * is broken, do not use it.
100 static struct powerdomain core_3xxx_pre_es3_1_pwrdm
= {
101 .name
= "core_pwrdm",
102 .prcm_offs
= CORE_MOD
,
103 .pwrsts
= PWRSTS_OFF_RET_ON
,
104 .pwrsts_logic_ret
= PWRSTS_OFF_RET
,
107 [0] = PWRSTS_OFF_RET
, /* MEM1RETSTATE */
108 [1] = PWRSTS_OFF_RET
, /* MEM2RETSTATE */
111 [0] = PWRSTS_OFF_RET_ON
, /* MEM1ONSTATE */
112 [1] = PWRSTS_OFF_RET_ON
, /* MEM2ONSTATE */
114 .voltdm
= { .name
= "core" },
117 static struct powerdomain core_3xxx_es3_1_pwrdm
= {
118 .name
= "core_pwrdm",
119 .prcm_offs
= CORE_MOD
,
120 .pwrsts
= PWRSTS_OFF_RET_ON
,
121 .pwrsts_logic_ret
= PWRSTS_OFF_RET
,
123 * Setting the SAR flag for errata ID i478 which applies
126 .flags
= PWRDM_HAS_HDWR_SAR
, /* for USBTLL only */
129 [0] = PWRSTS_OFF_RET
, /* MEM1RETSTATE */
130 [1] = PWRSTS_OFF_RET
, /* MEM2RETSTATE */
133 [0] = PWRSTS_OFF_RET_ON
, /* MEM1ONSTATE */
134 [1] = PWRSTS_OFF_RET_ON
, /* MEM2ONSTATE */
136 .voltdm
= { .name
= "core" },
139 static struct powerdomain core_am35x_pwrdm
= {
140 .name
= "core_pwrdm",
141 .prcm_offs
= CORE_MOD
,
143 .pwrsts_logic_ret
= PWRSTS_ON
,
146 [0] = PWRSTS_ON
, /* MEM1RETSTATE */
147 [1] = PWRSTS_ON
, /* MEM2RETSTATE */
150 [0] = PWRSTS_ON
, /* MEM1ONSTATE */
151 [1] = PWRSTS_ON
, /* MEM2ONSTATE */
153 .voltdm
= { .name
= "core" },
156 static struct powerdomain dss_pwrdm
= {
158 .prcm_offs
= OMAP3430_DSS_MOD
,
159 .pwrsts
= PWRSTS_OFF_RET_ON
,
160 .pwrsts_logic_ret
= PWRSTS_RET
,
163 [0] = PWRSTS_RET
, /* MEMRETSTATE */
166 [0] = PWRSTS_ON
, /* MEMONSTATE */
168 .voltdm
= { .name
= "core" },
171 static struct powerdomain dss_am35x_pwrdm
= {
173 .prcm_offs
= OMAP3430_DSS_MOD
,
175 .pwrsts_logic_ret
= PWRSTS_ON
,
178 [0] = PWRSTS_ON
, /* MEMRETSTATE */
181 [0] = PWRSTS_ON
, /* MEMONSTATE */
183 .voltdm
= { .name
= "core" },
187 * Although the 34XX TRM Rev K Table 4-371 notes that retention is a
188 * possible SGX powerstate, the SGX device itself does not support
191 static struct powerdomain sgx_pwrdm
= {
193 .prcm_offs
= OMAP3430ES2_SGX_MOD
,
194 /* XXX This is accurate for 3430 SGX, but what about GFX? */
195 .pwrsts
= PWRSTS_OFF_ON
,
196 .pwrsts_logic_ret
= PWRSTS_RET
,
199 [0] = PWRSTS_RET
, /* MEMRETSTATE */
202 [0] = PWRSTS_ON
, /* MEMONSTATE */
204 .voltdm
= { .name
= "core" },
207 static struct powerdomain sgx_am35x_pwrdm
= {
209 .prcm_offs
= OMAP3430ES2_SGX_MOD
,
211 .pwrsts_logic_ret
= PWRSTS_ON
,
214 [0] = PWRSTS_ON
, /* MEMRETSTATE */
217 [0] = PWRSTS_ON
, /* MEMONSTATE */
219 .voltdm
= { .name
= "core" },
222 static struct powerdomain cam_pwrdm
= {
224 .prcm_offs
= OMAP3430_CAM_MOD
,
225 .pwrsts
= PWRSTS_OFF_RET_ON
,
226 .pwrsts_logic_ret
= PWRSTS_RET
,
229 [0] = PWRSTS_RET
, /* MEMRETSTATE */
232 [0] = PWRSTS_ON
, /* MEMONSTATE */
234 .voltdm
= { .name
= "core" },
237 static struct powerdomain per_pwrdm
= {
239 .prcm_offs
= OMAP3430_PER_MOD
,
240 .pwrsts
= PWRSTS_OFF_RET_ON
,
241 .pwrsts_logic_ret
= PWRSTS_OFF_RET
,
244 [0] = PWRSTS_RET
, /* MEMRETSTATE */
247 [0] = PWRSTS_ON
, /* MEMONSTATE */
249 .voltdm
= { .name
= "core" },
252 static struct powerdomain per_am35x_pwrdm
= {
254 .prcm_offs
= OMAP3430_PER_MOD
,
256 .pwrsts_logic_ret
= PWRSTS_ON
,
259 [0] = PWRSTS_ON
, /* MEMRETSTATE */
262 [0] = PWRSTS_ON
, /* MEMONSTATE */
264 .voltdm
= { .name
= "core" },
267 static struct powerdomain emu_pwrdm
= {
269 .prcm_offs
= OMAP3430_EMU_MOD
,
270 .voltdm
= { .name
= "core" },
273 static struct powerdomain neon_pwrdm
= {
274 .name
= "neon_pwrdm",
275 .prcm_offs
= OMAP3430_NEON_MOD
,
276 .pwrsts
= PWRSTS_OFF_RET_ON
,
277 .pwrsts_logic_ret
= PWRSTS_RET
,
278 .voltdm
= { .name
= "mpu_iva" },
281 static struct powerdomain neon_am35x_pwrdm
= {
282 .name
= "neon_pwrdm",
283 .prcm_offs
= OMAP3430_NEON_MOD
,
285 .pwrsts_logic_ret
= PWRSTS_ON
,
286 .voltdm
= { .name
= "mpu_iva" },
289 static struct powerdomain usbhost_pwrdm
= {
290 .name
= "usbhost_pwrdm",
291 .prcm_offs
= OMAP3430ES2_USBHOST_MOD
,
292 .pwrsts
= PWRSTS_OFF_RET_ON
,
293 .pwrsts_logic_ret
= PWRSTS_RET
,
295 * REVISIT: Enabling usb host save and restore mechanism seems to
296 * leave the usb host domain permanently in ACTIVE mode after
297 * changing the usb host power domain state from OFF to active once.
300 /*.flags = PWRDM_HAS_HDWR_SAR,*/ /* for USBHOST ctrlr only */
303 [0] = PWRSTS_RET
, /* MEMRETSTATE */
306 [0] = PWRSTS_ON
, /* MEMONSTATE */
308 .voltdm
= { .name
= "core" },
311 static struct powerdomain dpll1_pwrdm
= {
312 .name
= "dpll1_pwrdm",
313 .prcm_offs
= MPU_MOD
,
314 .voltdm
= { .name
= "mpu_iva" },
317 static struct powerdomain dpll2_pwrdm
= {
318 .name
= "dpll2_pwrdm",
319 .prcm_offs
= OMAP3430_IVA2_MOD
,
320 .voltdm
= { .name
= "mpu_iva" },
323 static struct powerdomain dpll3_pwrdm
= {
324 .name
= "dpll3_pwrdm",
325 .prcm_offs
= PLL_MOD
,
326 .voltdm
= { .name
= "core" },
329 static struct powerdomain dpll4_pwrdm
= {
330 .name
= "dpll4_pwrdm",
331 .prcm_offs
= PLL_MOD
,
332 .voltdm
= { .name
= "core" },
335 static struct powerdomain dpll5_pwrdm
= {
336 .name
= "dpll5_pwrdm",
337 .prcm_offs
= PLL_MOD
,
338 .voltdm
= { .name
= "core" },
341 /* As powerdomains are added or removed above, this list must also be changed */
342 static struct powerdomain
*powerdomains_omap3430_common
[] __initdata
= {
358 static struct powerdomain
*powerdomains_omap3430es1
[] __initdata
= {
360 &core_3xxx_pre_es3_1_pwrdm
,
364 /* also includes 3630ES1.0 */
365 static struct powerdomain
*powerdomains_omap3430es2_es3_0
[] __initdata
= {
366 &core_3xxx_pre_es3_1_pwrdm
,
373 /* also includes 3630ES1.1+ */
374 static struct powerdomain
*powerdomains_omap3430es3_1plus
[] __initdata
= {
375 &core_3xxx_es3_1_pwrdm
,
382 static struct powerdomain
*powerdomains_am35x
[] __initdata
= {
398 void __init
omap3xxx_powerdomains_init(void)
402 if (!cpu_is_omap34xx())
405 pwrdm_register_platform_funcs(&omap3_pwrdm_operations
);
409 if (rev
== AM35XX_REV_ES1_0
|| rev
== AM35XX_REV_ES1_1
) {
410 pwrdm_register_pwrdms(powerdomains_am35x
);
412 pwrdm_register_pwrdms(powerdomains_omap3430_common
);
415 case OMAP3430_REV_ES1_0
:
416 pwrdm_register_pwrdms(powerdomains_omap3430es1
);
418 case OMAP3430_REV_ES2_0
:
419 case OMAP3430_REV_ES2_1
:
420 case OMAP3430_REV_ES3_0
:
421 case OMAP3630_REV_ES1_0
:
422 pwrdm_register_pwrdms(powerdomains_omap3430es2_es3_0
);
424 case OMAP3430_REV_ES3_1
:
425 case OMAP3430_REV_ES3_1_2
:
426 case OMAP3630_REV_ES1_1
:
427 case OMAP3630_REV_ES1_2
:
428 pwrdm_register_pwrdms(powerdomains_omap3430es3_1plus
);
431 WARN(1, "OMAP3 powerdomain init: unknown chip type\n");
435 pwrdm_complete_init();