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>
19 #include "powerdomain.h"
20 #include "powerdomains2xxx_3xxx_data.h"
22 #include "prcm-common.h"
23 #include "prm2xxx_3xxx.h"
24 #include "prm-regbits-34xx.h"
25 #include "cm2xxx_3xxx.h"
26 #include "cm-regbits-34xx.h"
29 * 34XX-specific powerdomains, dependencies
36 static struct powerdomain iva2_pwrdm = {
38 .prcm_offs = OMAP3430_IVA2_MOD,
39 .pwrsts = PWRSTS_OFF_RET_ON,
40 .pwrsts_logic_ret = PWRSTS_OFF_RET,
56 static struct powerdomain mpu_3xxx_pwrdm = {
59 .pwrsts = PWRSTS_OFF_RET_ON,
60 .pwrsts_logic_ret = PWRSTS_OFF_RET,
61 .flags = PWRDM_HAS_MPU_QUIRK,
72 * The USBTLL Save-and-Restore mechanism is broken on
73 * 3430s up to ES3.0 and 3630ES1.0. Hence this feature
74 * needs to be disabled on these chips.
75 * Refer: 3430 errata ID i459 and 3630 errata ID i579
77 * Note: setting the SAR flag could help for errata ID i478
78 * which applies to 3430 <= ES3.1, but since the SAR feature
79 * is broken, do not use it.
81 static struct powerdomain core_3xxx_pre_es3_1_pwrdm = {
83 .prcm_offs = CORE_MOD,
84 .pwrsts = PWRSTS_OFF_RET_ON,
85 .pwrsts_logic_ret = PWRSTS_OFF_RET,
88 [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */
89 [1] = PWRSTS_OFF_RET, /* MEM2RETSTATE */
92 [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */
93 [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */
97 static struct powerdomain core_3xxx_es3_1_pwrdm = {
99 .prcm_offs = CORE_MOD,
100 .pwrsts = PWRSTS_OFF_RET_ON,
101 .pwrsts_logic_ret = PWRSTS_OFF_RET,
103 * Setting the SAR flag for errata ID i478 which applies
106 .flags = PWRDM_HAS_HDWR_SAR, /* for USBTLL only */
109 [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */
110 [1] = PWRSTS_OFF_RET, /* MEM2RETSTATE */
113 [0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */
114 [1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */
118 static struct powerdomain dss_pwrdm = {
120 .prcm_offs = OMAP3430_DSS_MOD,
121 .pwrsts = PWRSTS_OFF_RET_ON,
122 .pwrsts_logic_ret = PWRSTS_RET,
125 [0] = PWRSTS_RET, /* MEMRETSTATE */
128 [0] = PWRSTS_ON, /* MEMONSTATE */
133 * Although the 34XX TRM Rev K Table 4-371 notes that retention is a
134 * possible SGX powerstate, the SGX device itself does not support
137 static struct powerdomain sgx_pwrdm = {
139 .prcm_offs = OMAP3430ES2_SGX_MOD,
140 /* XXX This is accurate for 3430 SGX, but what about GFX? */
141 .pwrsts = PWRSTS_OFF_ON,
142 .pwrsts_logic_ret = PWRSTS_RET,
145 [0] = PWRSTS_RET, /* MEMRETSTATE */
148 [0] = PWRSTS_ON, /* MEMONSTATE */
152 static struct powerdomain cam_pwrdm = {
154 .prcm_offs = OMAP3430_CAM_MOD,
155 .pwrsts = PWRSTS_OFF_RET_ON,
156 .pwrsts_logic_ret = PWRSTS_RET,
159 [0] = PWRSTS_RET, /* MEMRETSTATE */
162 [0] = PWRSTS_ON, /* MEMONSTATE */
166 static struct powerdomain per_pwrdm = {
168 .prcm_offs = OMAP3430_PER_MOD,
169 .pwrsts = PWRSTS_OFF_RET_ON,
170 .pwrsts_logic_ret = PWRSTS_OFF_RET,
173 [0] = PWRSTS_RET, /* MEMRETSTATE */
176 [0] = PWRSTS_ON, /* MEMONSTATE */
180 static struct powerdomain emu_pwrdm = {
182 .prcm_offs = OMAP3430_EMU_MOD,
185 static struct powerdomain neon_pwrdm = {
186 .name = "neon_pwrdm",
187 .prcm_offs = OMAP3430_NEON_MOD,
188 .pwrsts = PWRSTS_OFF_RET_ON,
189 .pwrsts_logic_ret = PWRSTS_RET,
192 static struct powerdomain usbhost_pwrdm = {
193 .name = "usbhost_pwrdm",
194 .prcm_offs = OMAP3430ES2_USBHOST_MOD,
195 .pwrsts = PWRSTS_OFF_RET_ON,
196 .pwrsts_logic_ret = PWRSTS_RET,
198 * REVISIT: Enabling usb host save and restore mechanism seems to
199 * leave the usb host domain permanently in ACTIVE mode after
200 * changing the usb host power domain state from OFF to active once.
203 /*.flags = PWRDM_HAS_HDWR_SAR,*/ /* for USBHOST ctrlr only */
206 [0] = PWRSTS_RET, /* MEMRETSTATE */
209 [0] = PWRSTS_ON, /* MEMONSTATE */
213 static struct powerdomain dpll1_pwrdm = {
214 .name = "dpll1_pwrdm",
215 .prcm_offs = MPU_MOD,
218 static struct powerdomain dpll2_pwrdm = {
219 .name = "dpll2_pwrdm",
220 .prcm_offs = OMAP3430_IVA2_MOD,
223 static struct powerdomain dpll3_pwrdm = {
224 .name = "dpll3_pwrdm",
225 .prcm_offs = PLL_MOD,
228 static struct powerdomain dpll4_pwrdm = {
229 .name = "dpll4_pwrdm",
230 .prcm_offs = PLL_MOD,
233 static struct powerdomain dpll5_pwrdm = {
234 .name = "dpll5_pwrdm",
235 .prcm_offs = PLL_MOD,
238 /* As powerdomains are added or removed above, this list must also be changed */
239 static struct powerdomain *powerdomains_omap3430_common[] __initdata = {
255 static struct powerdomain *powerdomains_omap3430es1[] __initdata = {
257 &core_3xxx_pre_es3_1_pwrdm,
261 /* also includes 3630ES1.0 */
262 static struct powerdomain *powerdomains_omap3430es2_es3_0[] __initdata = {
263 &core_3xxx_pre_es3_1_pwrdm,
270 /* also includes 3630ES1.1+ */
271 static struct powerdomain *powerdomains_omap3430es3_1plus[] __initdata = {
272 &core_3xxx_es3_1_pwrdm,
279 void __init omap3xxx_powerdomains_init(void)
283 if (!cpu_is_omap34xx())
286 pwrdm_register_platform_funcs(&omap3_pwrdm_operations);
287 pwrdm_register_pwrdms(powerdomains_omap3430_common);
291 if (rev == OMAP3430_REV_ES1_0)
292 pwrdm_register_pwrdms(powerdomains_omap3430es1);
293 else if (rev == OMAP3430_REV_ES2_0 || rev == OMAP3430_REV_ES2_1 ||
294 rev == OMAP3430_REV_ES3_0 || rev == OMAP3630_REV_ES1_0)
295 pwrdm_register_pwrdms(powerdomains_omap3430es2_es3_0);
296 else if (rev == OMAP3430_REV_ES3_1 || rev == OMAP3430_REV_ES3_1_2 ||
297 rev == OMAP3517_REV_ES1_0 || rev == OMAP3517_REV_ES1_1 ||
298 rev == OMAP3630_REV_ES1_1 || rev == OMAP3630_REV_ES1_2)
299 pwrdm_register_pwrdms(powerdomains_omap3430es3_1plus);
301 WARN(1, "OMAP3 powerdomain init: unknown chip type\n");
303 pwrdm_complete_init();