aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/clockdomains.h
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2010-01-26 22:12:59 -0500
committerPaul Walmsley <paul@pwsan.com>2010-01-26 22:12:59 -0500
commit55ed96945b1f3d0f4ad21a27b32ce4bd99d8c268 (patch)
tree0bec60498742922a9c00f39ff63eb48549d391fc /arch/arm/mach-omap2/clockdomains.h
parent6b04e0d99d4113ede24e263e3df246a17f490339 (diff)
OMAP2/3 clkdm/pwrdm: move wkdep/sleepdep handling from pwrdm to clkdm
Move clockdomain wakeup dependency and sleep dependency data structures from the powerdomain layer to the clockdomain layer, where they belong. These dependencies were originally placed in the powerdomain layer due to unclear documentation; however, it is clear now that these dependencies are between clockdomains. For OMAP2/3, this is not such a big problem, but for OMAP4 this needs to be fixed. Thanks to Benoît Cousson <b-cousson@ti.com> for his advice on this patch. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Benoît Cousson <b-cousson@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/clockdomains.h')
-rw-r--r--arch/arm/mach-omap2/clockdomains.h378
1 files changed, 367 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/clockdomains.h b/arch/arm/mach-omap2/clockdomains.h
index 6dc5ddc9a3a4..ff216f24f1a0 100644
--- a/arch/arm/mach-omap2/clockdomains.h
+++ b/arch/arm/mach-omap2/clockdomains.h
@@ -2,9 +2,28 @@
2 * OMAP2/3 clockdomains 2 * OMAP2/3 clockdomains
3 * 3 *
4 * Copyright (C) 2008 Texas Instruments, Inc. 4 * Copyright (C) 2008 Texas Instruments, Inc.
5 * Copyright (C) 2008 Nokia Corporation 5 * Copyright (C) 2008-2009 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley 7 * Written by Paul Walmsley and Jouni Högander
8 *
9 * This file contains clockdomains and clockdomain wakeup/sleep
10 * dependencies for the OMAP2/3 chips. Some notes:
11 *
12 * A useful validation rule for struct clockdomain: Any clockdomain
13 * referenced by a wkdep_srcs or sleepdep_srcs array must have a
14 * dep_bit assigned. So wkdep_srcs/sleepdep_srcs are really just
15 * software-controllable dependencies. Non-software-controllable
16 * dependencies do exist, but they are not encoded below (yet).
17 *
18 * 24xx does not support programmable sleep dependencies (SLEEPDEP)
19 *
20 * The overly-specific dep_bit names are due to a bit name collision
21 * with CM_FCLKEN_{DSP,IVA2}. The DSP/IVA2 PM_WKDEP and CM_SLEEPDEP shift
22 * value are the same for all powerdomains: 2
23 *
24 * XXX should dep_bit be a mask, so we can test to see if it is 0 as a
25 * sanity check?
26 * XXX encode hardware fixed wakeup dependencies -- esp. for 3430 CORE
8 */ 27 */
9 28
10/* 29/*
@@ -21,6 +40,287 @@
21#include "prm.h" 40#include "prm.h"
22 41
23/* 42/*
43 * Clockdomain dependencies for wkdeps/sleepdeps
44 *
45 * XXX Hardware dependencies (e.g., dependencies that cannot be
46 * changed in software) are not included here yet, but should be.
47 */
48
49/* OMAP2/3-common wakeup dependencies */
50
51/*
52 * 2420/2430 PM_WKDEP_GFX: CORE, MPU, WKUP
53 * 3430ES1 PM_WKDEP_GFX: adds IVA2, removes CORE
54 * 3430ES2 PM_WKDEP_SGX: adds IVA2, removes CORE
55 */
56static struct clkdm_dep gfx_sgx_wkdeps[] = {
57 {
58 .clkdm_name = "core_l3_clkdm",
59 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
60 },
61 {
62 .clkdm_name = "core_l4_clkdm",
63 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
64 },
65 {
66 .clkdm_name = "iva2_clkdm",
67 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
68 },
69 {
70 .clkdm_name = "mpu_clkdm",
71 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
72 CHIP_IS_OMAP3430)
73 },
74 {
75 .clkdm_name = "wkup_clkdm",
76 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
77 CHIP_IS_OMAP3430)
78 },
79 { NULL },
80};
81
82
83/* 24XX-specific possible dependencies */
84
85#ifdef CONFIG_ARCH_OMAP24XX
86
87/* Wakeup dependency source arrays */
88
89/*
90 * 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP
91 * 2420/2430 PM_WKDEP_MDM: same as DSP
92 */
93static struct clkdm_dep dsp_mdm_24xx_wkdeps[] = {
94 {
95 .clkdm_name = "core_l3_clkdm",
96 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
97 },
98 {
99 .clkdm_name = "core_l4_clkdm",
100 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
101 },
102 {
103 .clkdm_name = "mpu_clkdm",
104 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
105 },
106 {
107 .clkdm_name = "wkup_clkdm",
108 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
109 },
110 { NULL },
111};
112
113/*
114 * 2420 PM_WKDEP_MPU: CORE, DSP, WKUP
115 * 2430 adds MDM
116 */
117static struct clkdm_dep mpu_24xx_wkdeps[] = {
118 {
119 .clkdm_name = "core_l3_clkdm",
120 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
121 },
122 {
123 .clkdm_name = "core_l4_clkdm",
124 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
125 },
126 {
127 .clkdm_name = "dsp_clkdm",
128 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
129 },
130 {
131 .clkdm_name = "wkup_clkdm",
132 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
133 },
134 {
135 .clkdm_name = "mdm_clkdm",
136 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
137 },
138 { NULL },
139};
140
141/*
142 * 2420 PM_WKDEP_CORE: DSP, GFX, MPU, WKUP
143 * 2430 adds MDM
144 */
145static struct clkdm_dep core_24xx_wkdeps[] = {
146 {
147 .clkdm_name = "dsp_clkdm",
148 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
149 },
150 {
151 .clkdm_name = "gfx_clkdm",
152 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
153 },
154 {
155 .clkdm_name = "mpu_clkdm",
156 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
157 },
158 {
159 .clkdm_name = "wkup_clkdm",
160 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
161 },
162 {
163 .clkdm_name = "mdm_clkdm",
164 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
165 },
166 { NULL },
167};
168
169#endif
170
171/* 34XX-specific possible dependencies */
172
173#ifdef CONFIG_ARCH_OMAP34XX
174
175/*
176 * 3430: PM_WKDEP_{PER,USBHOST}: CORE, IVA2, MPU, WKUP
177 * (USBHOST is ES2 only)
178 */
179static struct clkdm_dep per_usbhost_wkdeps[] = {
180 {
181 .clkdm_name = "core_l3_clkdm",
182 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
183 },
184 {
185 .clkdm_name = "core_l4_clkdm",
186 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
187 },
188 {
189 .clkdm_name = "iva2_clkdm",
190 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
191 },
192 {
193 .clkdm_name = "mpu_clkdm",
194 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
195 },
196 {
197 .clkdm_name = "wkup_clkdm",
198 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
199 },
200 { NULL },
201};
202
203/*
204 * 3430 PM_WKDEP_MPU: CORE, IVA2, DSS, PER
205 */
206static struct clkdm_dep mpu_34xx_wkdeps[] = {
207 {
208 .clkdm_name = "core_l3_clkdm",
209 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
210 },
211 {
212 .clkdm_name = "core_l4_clkdm",
213 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
214 },
215 {
216 .clkdm_name = "iva2_clkdm",
217 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
218 },
219 {
220 .clkdm_name = "dss_clkdm",
221 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
222 },
223 {
224 .clkdm_name = "per_clkdm",
225 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
226 },
227 { NULL },
228};
229
230/*
231 * 3430 PM_WKDEP_IVA2: CORE, MPU, WKUP, DSS, PER
232 */
233static struct clkdm_dep iva2_wkdeps[] = {
234 {
235 .clkdm_name = "core_l3_clkdm",
236 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
237 },
238 {
239 .clkdm_name = "core_l4_clkdm",
240 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
241 },
242 {
243 .clkdm_name = "mpu_clkdm",
244 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
245 },
246 {
247 .clkdm_name = "wkup_clkdm",
248 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
249 },
250 {
251 .clkdm_name = "dss_clkdm",
252 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
253 },
254 {
255 .clkdm_name = "per_clkdm",
256 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
257 },
258 { NULL },
259};
260
261
262/* 3430 PM_WKDEP_{CAM,DSS}: IVA2, MPU, WKUP */
263static struct clkdm_dep cam_dss_wkdeps[] = {
264 {
265 .clkdm_name = "iva2_clkdm",
266 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
267 },
268 {
269 .clkdm_name = "mpu_clkdm",
270 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
271 },
272 {
273 .clkdm_name = "wkup_clkdm",
274 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
275 },
276 { NULL },
277};
278
279/* 3430: PM_WKDEP_NEON: MPU */
280static struct clkdm_dep neon_wkdeps[] = {
281 {
282 .clkdm_name = "mpu_clkdm",
283 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
284 },
285 { NULL },
286};
287
288
289/* Sleep dependency source arrays for 34xx-specific clkdms - 34XX only */
290
291/*
292 * 3430: CM_SLEEPDEP_{DSS,PER}: MPU, IVA
293 * 3430ES2: CM_SLEEPDEP_USBHOST: MPU, IVA
294 */
295static struct clkdm_dep dss_per_usbhost_sleepdeps[] = {
296 {
297 .clkdm_name = "mpu_clkdm",
298 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
299 },
300 {
301 .clkdm_name = "iva2_clkdm",
302 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
303 },
304 { NULL },
305};
306
307/*
308 * 3430: CM_SLEEPDEP_CAM: MPU
309 * 3430ES1: CM_SLEEPDEP_GFX: MPU
310 * 3430ES2: CM_SLEEPDEP_SGX: MPU
311 */
312static struct clkdm_dep cam_gfx_sleepdeps[] = {
313 {
314 .clkdm_name = "mpu_clkdm",
315 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
316 },
317 { NULL },
318};
319
320#endif /* CONFIG_ARCH_OMAP34XX */
321
322
323/*
24 * OMAP2/3-common clockdomains 324 * OMAP2/3-common clockdomains
25 * 325 *
26 * Even though the 2420 has a single PRCM module from the 326 * Even though the 2420 has a single PRCM module from the
@@ -35,6 +335,7 @@
35static struct clockdomain wkup_clkdm = { 335static struct clockdomain wkup_clkdm = {
36 .name = "wkup_clkdm", 336 .name = "wkup_clkdm",
37 .pwrdm = { .name = "wkup_pwrdm" }, 337 .pwrdm = { .name = "wkup_pwrdm" },
338 .dep_bit = OMAP_EN_WKUP_SHIFT,
38 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), 339 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
39}; 340};
40 341
@@ -63,6 +364,7 @@ static struct clockdomain mpu_2420_clkdm = {
63 .pwrdm = { .name = "mpu_pwrdm" }, 364 .pwrdm = { .name = "mpu_pwrdm" },
64 .flags = CLKDM_CAN_HWSUP, 365 .flags = CLKDM_CAN_HWSUP,
65 .clkstctrl_reg = OMAP2420_CM_REGADDR(MPU_MOD, OMAP2_CM_CLKSTCTRL), 366 .clkstctrl_reg = OMAP2420_CM_REGADDR(MPU_MOD, OMAP2_CM_CLKSTCTRL),
367 .wkdep_srcs = mpu_24xx_wkdeps,
66 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, 368 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
67 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 369 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
68}; 370};
@@ -73,6 +375,8 @@ static struct clockdomain iva1_2420_clkdm = {
73 .flags = CLKDM_CAN_HWSUP_SWSUP, 375 .flags = CLKDM_CAN_HWSUP_SWSUP,
74 .clkstctrl_reg = OMAP2420_CM_REGADDR(OMAP24XX_DSP_MOD, 376 .clkstctrl_reg = OMAP2420_CM_REGADDR(OMAP24XX_DSP_MOD,
75 OMAP2_CM_CLKSTCTRL), 377 OMAP2_CM_CLKSTCTRL),
378 .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT,
379 .wkdep_srcs = dsp_mdm_24xx_wkdeps,
76 .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK, 380 .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK,
77 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 381 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
78}; 382};
@@ -92,6 +396,7 @@ static struct clockdomain gfx_2420_clkdm = {
92 .pwrdm = { .name = "gfx_pwrdm" }, 396 .pwrdm = { .name = "gfx_pwrdm" },
93 .flags = CLKDM_CAN_HWSUP_SWSUP, 397 .flags = CLKDM_CAN_HWSUP_SWSUP,
94 .clkstctrl_reg = OMAP2420_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL), 398 .clkstctrl_reg = OMAP2420_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL),
399 .wkdep_srcs = gfx_sgx_wkdeps,
95 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, 400 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
96 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 401 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
97}; 402};
@@ -101,6 +406,7 @@ static struct clockdomain core_l3_2420_clkdm = {
101 .pwrdm = { .name = "core_pwrdm" }, 406 .pwrdm = { .name = "core_pwrdm" },
102 .flags = CLKDM_CAN_HWSUP, 407 .flags = CLKDM_CAN_HWSUP,
103 .clkstctrl_reg = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), 408 .clkstctrl_reg = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
409 .wkdep_srcs = core_24xx_wkdeps,
104 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, 410 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
105 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 411 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
106}; 412};
@@ -110,6 +416,7 @@ static struct clockdomain core_l4_2420_clkdm = {
110 .pwrdm = { .name = "core_pwrdm" }, 416 .pwrdm = { .name = "core_pwrdm" },
111 .flags = CLKDM_CAN_HWSUP, 417 .flags = CLKDM_CAN_HWSUP,
112 .clkstctrl_reg = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), 418 .clkstctrl_reg = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
419 .wkdep_srcs = core_24xx_wkdeps,
113 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, 420 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
114 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 421 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
115}; 422};
@@ -138,16 +445,20 @@ static struct clockdomain mpu_2430_clkdm = {
138 .flags = CLKDM_CAN_HWSUP_SWSUP, 445 .flags = CLKDM_CAN_HWSUP_SWSUP,
139 .clkstctrl_reg = OMAP2430_CM_REGADDR(MPU_MOD, 446 .clkstctrl_reg = OMAP2430_CM_REGADDR(MPU_MOD,
140 OMAP2_CM_CLKSTCTRL), 447 OMAP2_CM_CLKSTCTRL),
448 .wkdep_srcs = mpu_24xx_wkdeps,
141 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, 449 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
142 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 450 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
143}; 451};
144 452
453/* Another case of bit name collisions between several registers: EN_MDM */
145static struct clockdomain mdm_clkdm = { 454static struct clockdomain mdm_clkdm = {
146 .name = "mdm_clkdm", 455 .name = "mdm_clkdm",
147 .pwrdm = { .name = "mdm_pwrdm" }, 456 .pwrdm = { .name = "mdm_pwrdm" },
148 .flags = CLKDM_CAN_HWSUP_SWSUP, 457 .flags = CLKDM_CAN_HWSUP_SWSUP,
149 .clkstctrl_reg = OMAP2430_CM_REGADDR(OMAP2430_MDM_MOD, 458 .clkstctrl_reg = OMAP2430_CM_REGADDR(OMAP2430_MDM_MOD,
150 OMAP2_CM_CLKSTCTRL), 459 OMAP2_CM_CLKSTCTRL),
460 .dep_bit = OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT,
461 .wkdep_srcs = dsp_mdm_24xx_wkdeps,
151 .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK, 462 .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK,
152 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 463 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
153}; 464};
@@ -158,6 +469,8 @@ static struct clockdomain dsp_2430_clkdm = {
158 .flags = CLKDM_CAN_HWSUP_SWSUP, 469 .flags = CLKDM_CAN_HWSUP_SWSUP,
159 .clkstctrl_reg = OMAP2430_CM_REGADDR(OMAP24XX_DSP_MOD, 470 .clkstctrl_reg = OMAP2430_CM_REGADDR(OMAP24XX_DSP_MOD,
160 OMAP2_CM_CLKSTCTRL), 471 OMAP2_CM_CLKSTCTRL),
472 .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT,
473 .wkdep_srcs = dsp_mdm_24xx_wkdeps,
161 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, 474 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK,
162 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 475 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
163}; 476};
@@ -167,24 +480,39 @@ static struct clockdomain gfx_2430_clkdm = {
167 .pwrdm = { .name = "gfx_pwrdm" }, 480 .pwrdm = { .name = "gfx_pwrdm" },
168 .flags = CLKDM_CAN_HWSUP_SWSUP, 481 .flags = CLKDM_CAN_HWSUP_SWSUP,
169 .clkstctrl_reg = OMAP2430_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL), 482 .clkstctrl_reg = OMAP2430_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL),
483 .wkdep_srcs = gfx_sgx_wkdeps,
170 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, 484 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
171 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 485 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
172}; 486};
173 487
488/*
489 * XXX add usecounting for clkdm dependencies, otherwise the presence
490 * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm
491 * could cause trouble
492 */
174static struct clockdomain core_l3_2430_clkdm = { 493static struct clockdomain core_l3_2430_clkdm = {
175 .name = "core_l3_clkdm", 494 .name = "core_l3_clkdm",
176 .pwrdm = { .name = "core_pwrdm" }, 495 .pwrdm = { .name = "core_pwrdm" },
177 .flags = CLKDM_CAN_HWSUP, 496 .flags = CLKDM_CAN_HWSUP,
178 .clkstctrl_reg = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), 497 .clkstctrl_reg = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
498 .dep_bit = OMAP24XX_EN_CORE_SHIFT,
499 .wkdep_srcs = core_24xx_wkdeps,
179 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, 500 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
180 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 501 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
181}; 502};
182 503
504/*
505 * XXX add usecounting for clkdm dependencies, otherwise the presence
506 * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm
507 * could cause trouble
508 */
183static struct clockdomain core_l4_2430_clkdm = { 509static struct clockdomain core_l4_2430_clkdm = {
184 .name = "core_l4_clkdm", 510 .name = "core_l4_clkdm",
185 .pwrdm = { .name = "core_pwrdm" }, 511 .pwrdm = { .name = "core_pwrdm" },
186 .flags = CLKDM_CAN_HWSUP, 512 .flags = CLKDM_CAN_HWSUP,
187 .clkstctrl_reg = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), 513 .clkstctrl_reg = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
514 .dep_bit = OMAP24XX_EN_CORE_SHIFT,
515 .wkdep_srcs = core_24xx_wkdeps,
188 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, 516 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
189 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 517 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
190}; 518};
@@ -212,6 +540,8 @@ static struct clockdomain mpu_34xx_clkdm = {
212 .pwrdm = { .name = "mpu_pwrdm" }, 540 .pwrdm = { .name = "mpu_pwrdm" },
213 .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP, 541 .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP,
214 .clkstctrl_reg = OMAP34XX_CM_REGADDR(MPU_MOD, OMAP2_CM_CLKSTCTRL), 542 .clkstctrl_reg = OMAP34XX_CM_REGADDR(MPU_MOD, OMAP2_CM_CLKSTCTRL),
543 .dep_bit = OMAP3430_EN_MPU_SHIFT,
544 .wkdep_srcs = mpu_34xx_wkdeps,
215 .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK, 545 .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK,
216 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 546 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
217}; 547};
@@ -222,6 +552,7 @@ static struct clockdomain neon_clkdm = {
222 .flags = CLKDM_CAN_HWSUP_SWSUP, 552 .flags = CLKDM_CAN_HWSUP_SWSUP,
223 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_NEON_MOD, 553 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_NEON_MOD,
224 OMAP2_CM_CLKSTCTRL), 554 OMAP2_CM_CLKSTCTRL),
555 .wkdep_srcs = neon_wkdeps,
225 .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK, 556 .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK,
226 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 557 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
227}; 558};
@@ -232,6 +563,8 @@ static struct clockdomain iva2_clkdm = {
232 .flags = CLKDM_CAN_HWSUP_SWSUP, 563 .flags = CLKDM_CAN_HWSUP_SWSUP,
233 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_IVA2_MOD, 564 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_IVA2_MOD,
234 OMAP2_CM_CLKSTCTRL), 565 OMAP2_CM_CLKSTCTRL),
566 .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT,
567 .wkdep_srcs = iva2_wkdeps,
235 .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK, 568 .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK,
236 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 569 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
237}; 570};
@@ -241,6 +574,8 @@ static struct clockdomain gfx_3430es1_clkdm = {
241 .pwrdm = { .name = "gfx_pwrdm" }, 574 .pwrdm = { .name = "gfx_pwrdm" },
242 .flags = CLKDM_CAN_HWSUP_SWSUP, 575 .flags = CLKDM_CAN_HWSUP_SWSUP,
243 .clkstctrl_reg = OMAP34XX_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL), 576 .clkstctrl_reg = OMAP34XX_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL),
577 .wkdep_srcs = gfx_sgx_wkdeps,
578 .sleepdep_srcs = cam_gfx_sleepdeps,
244 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK, 579 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK,
245 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1), 580 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1),
246}; 581};
@@ -251,6 +586,8 @@ static struct clockdomain sgx_clkdm = {
251 .flags = CLKDM_CAN_HWSUP_SWSUP, 586 .flags = CLKDM_CAN_HWSUP_SWSUP,
252 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430ES2_SGX_MOD, 587 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430ES2_SGX_MOD,
253 OMAP2_CM_CLKSTCTRL), 588 OMAP2_CM_CLKSTCTRL),
589 .wkdep_srcs = gfx_sgx_wkdeps,
590 .sleepdep_srcs = cam_gfx_sleepdeps,
254 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK, 591 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK,
255 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), 592 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
256}; 593};
@@ -271,30 +608,46 @@ static struct clockdomain d2d_clkdm = {
271 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 608 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
272}; 609};
273 610
611/*
612 * XXX add usecounting for clkdm dependencies, otherwise the presence
613 * of a single dep bit for core_l3_34xx_clkdm and core_l4_34xx_clkdm
614 * could cause trouble
615 */
274static struct clockdomain core_l3_34xx_clkdm = { 616static struct clockdomain core_l3_34xx_clkdm = {
275 .name = "core_l3_clkdm", 617 .name = "core_l3_clkdm",
276 .pwrdm = { .name = "core_pwrdm" }, 618 .pwrdm = { .name = "core_pwrdm" },
277 .flags = CLKDM_CAN_HWSUP, 619 .flags = CLKDM_CAN_HWSUP,
278 .clkstctrl_reg = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), 620 .clkstctrl_reg = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
621 .dep_bit = OMAP3430_EN_CORE_SHIFT,
279 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK, 622 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK,
280 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 623 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
281}; 624};
282 625
626/*
627 * XXX add usecounting for clkdm dependencies, otherwise the presence
628 * of a single dep bit for core_l3_34xx_clkdm and core_l4_34xx_clkdm
629 * could cause trouble
630 */
283static struct clockdomain core_l4_34xx_clkdm = { 631static struct clockdomain core_l4_34xx_clkdm = {
284 .name = "core_l4_clkdm", 632 .name = "core_l4_clkdm",
285 .pwrdm = { .name = "core_pwrdm" }, 633 .pwrdm = { .name = "core_pwrdm" },
286 .flags = CLKDM_CAN_HWSUP, 634 .flags = CLKDM_CAN_HWSUP,
287 .clkstctrl_reg = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), 635 .clkstctrl_reg = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
636 .dep_bit = OMAP3430_EN_CORE_SHIFT,
288 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK, 637 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK,
289 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 638 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
290}; 639};
291 640
641/* Another case of bit name collisions between several registers: EN_DSS */
292static struct clockdomain dss_34xx_clkdm = { 642static struct clockdomain dss_34xx_clkdm = {
293 .name = "dss_clkdm", 643 .name = "dss_clkdm",
294 .pwrdm = { .name = "dss_pwrdm" }, 644 .pwrdm = { .name = "dss_pwrdm" },
295 .flags = CLKDM_CAN_HWSUP_SWSUP, 645 .flags = CLKDM_CAN_HWSUP_SWSUP,
296 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_DSS_MOD, 646 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_DSS_MOD,
297 OMAP2_CM_CLKSTCTRL), 647 OMAP2_CM_CLKSTCTRL),
648 .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_DSS_SHIFT,
649 .wkdep_srcs = cam_dss_wkdeps,
650 .sleepdep_srcs = dss_per_usbhost_sleepdeps,
298 .clktrctrl_mask = OMAP3430_CLKTRCTRL_DSS_MASK, 651 .clktrctrl_mask = OMAP3430_CLKTRCTRL_DSS_MASK,
299 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 652 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
300}; 653};
@@ -305,6 +658,8 @@ static struct clockdomain cam_clkdm = {
305 .flags = CLKDM_CAN_HWSUP_SWSUP, 658 .flags = CLKDM_CAN_HWSUP_SWSUP,
306 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_CAM_MOD, 659 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_CAM_MOD,
307 OMAP2_CM_CLKSTCTRL), 660 OMAP2_CM_CLKSTCTRL),
661 .wkdep_srcs = cam_dss_wkdeps,
662 .sleepdep_srcs = cam_gfx_sleepdeps,
308 .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK, 663 .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK,
309 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 664 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
310}; 665};
@@ -315,6 +670,8 @@ static struct clockdomain usbhost_clkdm = {
315 .flags = CLKDM_CAN_HWSUP_SWSUP, 670 .flags = CLKDM_CAN_HWSUP_SWSUP,
316 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, 671 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430ES2_USBHOST_MOD,
317 OMAP2_CM_CLKSTCTRL), 672 OMAP2_CM_CLKSTCTRL),
673 .wkdep_srcs = per_usbhost_wkdeps,
674 .sleepdep_srcs = dss_per_usbhost_sleepdeps,
318 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK, 675 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK,
319 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), 676 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
320}; 677};
@@ -325,6 +682,9 @@ static struct clockdomain per_clkdm = {
325 .flags = CLKDM_CAN_HWSUP_SWSUP, 682 .flags = CLKDM_CAN_HWSUP_SWSUP,
326 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_PER_MOD, 683 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_PER_MOD,
327 OMAP2_CM_CLKSTCTRL), 684 OMAP2_CM_CLKSTCTRL),
685 .dep_bit = OMAP3430_EN_PER_SHIFT,
686 .wkdep_srcs = per_usbhost_wkdeps,
687 .sleepdep_srcs = dss_per_usbhost_sleepdeps,
328 .clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK, 688 .clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK,
329 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 689 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
330}; 690};
@@ -378,25 +738,21 @@ static struct clockdomain dpll5_clkdm = {
378#include "clockdomains44xx.h" 738#include "clockdomains44xx.h"
379 739
380/* 740/*
381 * Clockdomain-powerdomain hwsup dependencies (34XX only) 741 * Clockdomain hwsup dependencies (34XX only)
382 */ 742 */
383 743
384static struct clkdm_pwrdm_autodep clkdm_pwrdm_autodeps[] = { 744static struct clkdm_autodep clkdm_autodeps[] = {
385
386#ifdef CONFIG_ARCH_OMAP34XX
387 { 745 {
388 .pwrdm = { .name = "mpu_pwrdm" }, 746 .clkdm = { .name = "mpu_clkdm" },
389 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) 747 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
390 }, 748 },
391 { 749 {
392 .pwrdm = { .name = "iva2_pwrdm" }, 750 .clkdm = { .name = "iva2_clkdm" },
393 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) 751 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
394 }, 752 },
395 { 753 {
396 .pwrdm = { .name = NULL }, 754 .clkdm = { .name = NULL },
397 } 755 }
398#endif
399
400}; 756};
401 757
402/* 758/*