4 * Copyright (C) 2008-2009 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation
7 * Paul Walmsley, Jouni Högander
9 * This file contains clockdomains and clockdomain wakeup/sleep
10 * dependencies for the OMAP2/3 chips. Some notes:
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).
18 * 24xx does not support programmable sleep dependencies (SLEEPDEP)
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
24 * XXX should dep_bit be a mask, so we can test to see if it is 0 as a
26 * XXX encode hardware fixed wakeup dependencies -- esp. for 3430 CORE
31 * -> Port the Sleep/Wakeup dependencies for the domains
32 * from the Power domain framework
35 #include <linux/kernel.h>
38 #include "clockdomain.h"
39 #include "prm2xxx_3xxx.h"
40 #include "cm2xxx_3xxx.h"
41 #include "cm-regbits-24xx.h"
42 #include "cm-regbits-34xx.h"
43 #include "cm-regbits-44xx.h"
44 #include "prm-regbits-24xx.h"
45 #include "prm-regbits-34xx.h"
48 * Clockdomain dependencies for wkdeps/sleepdeps
50 * XXX Hardware dependencies (e.g., dependencies that cannot be
51 * changed in software) are not included here yet, but should be.
54 /* OMAP2/3-common wakeup dependencies */
57 * 2420/2430 PM_WKDEP_GFX: CORE, MPU, WKUP
58 * 3430ES1 PM_WKDEP_GFX: adds IVA2, removes CORE
59 * 3430ES2 PM_WKDEP_SGX: adds IVA2, removes CORE
60 * These can share data since they will never be present simultaneously
63 static struct clkdm_dep gfx_sgx_wkdeps
[] = {
65 .clkdm_name
= "core_l3_clkdm",
66 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
)
69 .clkdm_name
= "core_l4_clkdm",
70 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
)
73 .clkdm_name
= "iva2_clkdm",
74 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
77 .clkdm_name
= "mpu_clkdm",
78 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
|
82 .clkdm_name
= "wkup_clkdm",
83 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
|
90 /* 24XX-specific possible dependencies */
92 /* Wakeup dependency source arrays */
94 /* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */
95 static struct clkdm_dep dsp_24xx_wkdeps
[] = {
97 .clkdm_name
= "core_l3_clkdm",
98 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
)
101 .clkdm_name
= "core_l4_clkdm",
102 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
)
105 .clkdm_name
= "mpu_clkdm",
106 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
)
109 .clkdm_name
= "wkup_clkdm",
110 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
)
116 * 2420 PM_WKDEP_MPU: CORE, DSP, WKUP
119 static struct clkdm_dep mpu_24xx_wkdeps
[] = {
121 .clkdm_name
= "core_l3_clkdm",
122 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
)
125 .clkdm_name
= "core_l4_clkdm",
126 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
)
129 .clkdm_name
= "dsp_clkdm",
130 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
)
133 .clkdm_name
= "wkup_clkdm",
134 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
)
137 .clkdm_name
= "mdm_clkdm",
138 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP2430
)
144 * 2420 PM_WKDEP_CORE: DSP, GFX, MPU, WKUP
147 static struct clkdm_dep core_24xx_wkdeps
[] = {
149 .clkdm_name
= "dsp_clkdm",
150 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
)
153 .clkdm_name
= "gfx_clkdm",
154 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
)
157 .clkdm_name
= "mpu_clkdm",
158 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
)
161 .clkdm_name
= "wkup_clkdm",
162 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
)
165 .clkdm_name
= "mdm_clkdm",
166 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP2430
)
172 /* 2430-specific possible wakeup dependencies */
174 #ifdef CONFIG_ARCH_OMAP2430
176 /* 2430 PM_WKDEP_MDM: CORE, MPU, WKUP */
177 static struct clkdm_dep mdm_2430_wkdeps
[] = {
179 .clkdm_name
= "core_l3_clkdm",
180 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
)
183 .clkdm_name
= "core_l4_clkdm",
184 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
)
187 .clkdm_name
= "mpu_clkdm",
188 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
)
191 .clkdm_name
= "wkup_clkdm",
192 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
)
197 #endif /* CONFIG_ARCH_OMAP2430 */
200 /* OMAP3-specific possible dependencies */
202 #ifdef CONFIG_ARCH_OMAP3
204 /* 3430: PM_WKDEP_PER: CORE, IVA2, MPU, WKUP */
205 static struct clkdm_dep per_wkdeps
[] = {
207 .clkdm_name
= "core_l3_clkdm",
208 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
211 .clkdm_name
= "core_l4_clkdm",
212 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
215 .clkdm_name
= "iva2_clkdm",
216 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
219 .clkdm_name
= "mpu_clkdm",
220 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
223 .clkdm_name
= "wkup_clkdm",
224 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
229 /* 3430ES2: PM_WKDEP_USBHOST: CORE, IVA2, MPU, WKUP */
230 static struct clkdm_dep usbhost_wkdeps
[] = {
232 .clkdm_name
= "core_l3_clkdm",
233 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
236 .clkdm_name
= "core_l4_clkdm",
237 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
240 .clkdm_name
= "iva2_clkdm",
241 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
244 .clkdm_name
= "mpu_clkdm",
245 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
248 .clkdm_name
= "wkup_clkdm",
249 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
254 /* 3430 PM_WKDEP_MPU: CORE, IVA2, DSS, PER */
255 static struct clkdm_dep mpu_3xxx_wkdeps
[] = {
257 .clkdm_name
= "core_l3_clkdm",
258 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
261 .clkdm_name
= "core_l4_clkdm",
262 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
265 .clkdm_name
= "iva2_clkdm",
266 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
269 .clkdm_name
= "dss_clkdm",
270 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
273 .clkdm_name
= "per_clkdm",
274 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
279 /* 3430 PM_WKDEP_IVA2: CORE, MPU, WKUP, DSS, PER */
280 static struct clkdm_dep iva2_wkdeps
[] = {
282 .clkdm_name
= "core_l3_clkdm",
283 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
286 .clkdm_name
= "core_l4_clkdm",
287 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
290 .clkdm_name
= "mpu_clkdm",
291 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
294 .clkdm_name
= "wkup_clkdm",
295 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
298 .clkdm_name
= "dss_clkdm",
299 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
302 .clkdm_name
= "per_clkdm",
303 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
309 /* 3430 PM_WKDEP_CAM: IVA2, MPU, WKUP */
310 static struct clkdm_dep cam_wkdeps
[] = {
312 .clkdm_name
= "iva2_clkdm",
313 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
316 .clkdm_name
= "mpu_clkdm",
317 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
320 .clkdm_name
= "wkup_clkdm",
321 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
326 /* 3430 PM_WKDEP_DSS: IVA2, MPU, WKUP */
327 static struct clkdm_dep dss_wkdeps
[] = {
329 .clkdm_name
= "iva2_clkdm",
330 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
333 .clkdm_name
= "mpu_clkdm",
334 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
337 .clkdm_name
= "wkup_clkdm",
338 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
343 /* 3430: PM_WKDEP_NEON: MPU */
344 static struct clkdm_dep neon_wkdeps
[] = {
346 .clkdm_name
= "mpu_clkdm",
347 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
353 /* Sleep dependency source arrays for OMAP3-specific clkdms */
355 /* 3430: CM_SLEEPDEP_DSS: MPU, IVA */
356 static struct clkdm_dep dss_sleepdeps
[] = {
358 .clkdm_name
= "mpu_clkdm",
359 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
362 .clkdm_name
= "iva2_clkdm",
363 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
368 /* 3430: CM_SLEEPDEP_PER: MPU, IVA */
369 static struct clkdm_dep per_sleepdeps
[] = {
371 .clkdm_name
= "mpu_clkdm",
372 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
375 .clkdm_name
= "iva2_clkdm",
376 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
381 /* 3430ES2: CM_SLEEPDEP_USBHOST: MPU, IVA */
382 static struct clkdm_dep usbhost_sleepdeps
[] = {
384 .clkdm_name
= "mpu_clkdm",
385 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
388 .clkdm_name
= "iva2_clkdm",
389 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
394 /* 3430: CM_SLEEPDEP_CAM: MPU */
395 static struct clkdm_dep cam_sleepdeps
[] = {
397 .clkdm_name
= "mpu_clkdm",
398 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
404 * 3430ES1: CM_SLEEPDEP_GFX: MPU
405 * 3430ES2: CM_SLEEPDEP_SGX: MPU
406 * These can share data since they will never be present simultaneously
407 * on the same device.
409 static struct clkdm_dep gfx_sgx_sleepdeps
[] = {
411 .clkdm_name
= "mpu_clkdm",
412 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
417 #endif /* CONFIG_ARCH_OMAP3 */
421 * OMAP2/3-common clockdomains
423 * Even though the 2420 has a single PRCM module from the
424 * interconnect's perspective, internally it does appear to have
425 * separate PRM and CM clockdomains. The usual test case is
426 * sys_clkout/sys_clkout2.
429 /* This is an implicit clockdomain - it is never defined as such in TRM */
430 static struct clockdomain wkup_clkdm
= {
431 .name
= "wkup_clkdm",
432 .pwrdm
= { .name
= "wkup_pwrdm" },
433 .dep_bit
= OMAP_EN_WKUP_SHIFT
,
434 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
| CHIP_IS_OMAP3430
),
437 static struct clockdomain prm_clkdm
= {
439 .pwrdm
= { .name
= "wkup_pwrdm" },
440 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
| CHIP_IS_OMAP3430
),
443 static struct clockdomain cm_clkdm
= {
445 .pwrdm
= { .name
= "core_pwrdm" },
446 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP24XX
| CHIP_IS_OMAP3430
),
450 * 2420-only clockdomains
453 #if defined(CONFIG_ARCH_OMAP2420)
455 static struct clockdomain mpu_2420_clkdm
= {
457 .pwrdm
= { .name
= "mpu_pwrdm" },
458 .flags
= CLKDM_CAN_HWSUP
,
459 .wkdep_srcs
= mpu_24xx_wkdeps
,
460 .clktrctrl_mask
= OMAP24XX_AUTOSTATE_MPU_MASK
,
461 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP2420
),
464 static struct clockdomain iva1_2420_clkdm
= {
465 .name
= "iva1_clkdm",
466 .pwrdm
= { .name
= "dsp_pwrdm" },
467 .flags
= CLKDM_CAN_HWSUP_SWSUP
,
468 .dep_bit
= OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT
,
469 .wkdep_srcs
= dsp_24xx_wkdeps
,
470 .clktrctrl_mask
= OMAP2420_AUTOSTATE_IVA_MASK
,
471 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP2420
),
474 static struct clockdomain dsp_2420_clkdm
= {
476 .pwrdm
= { .name
= "dsp_pwrdm" },
477 .flags
= CLKDM_CAN_HWSUP_SWSUP
,
478 .clktrctrl_mask
= OMAP24XX_AUTOSTATE_DSP_MASK
,
479 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP2420
),
482 static struct clockdomain gfx_2420_clkdm
= {
484 .pwrdm
= { .name
= "gfx_pwrdm" },
485 .flags
= CLKDM_CAN_HWSUP_SWSUP
,
486 .wkdep_srcs
= gfx_sgx_wkdeps
,
487 .clktrctrl_mask
= OMAP24XX_AUTOSTATE_GFX_MASK
,
488 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP2420
),
491 static struct clockdomain core_l3_2420_clkdm
= {
492 .name
= "core_l3_clkdm",
493 .pwrdm
= { .name
= "core_pwrdm" },
494 .flags
= CLKDM_CAN_HWSUP
,
495 .wkdep_srcs
= core_24xx_wkdeps
,
496 .clktrctrl_mask
= OMAP24XX_AUTOSTATE_L3_MASK
,
497 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP2420
),
500 static struct clockdomain core_l4_2420_clkdm
= {
501 .name
= "core_l4_clkdm",
502 .pwrdm
= { .name
= "core_pwrdm" },
503 .flags
= CLKDM_CAN_HWSUP
,
504 .wkdep_srcs
= core_24xx_wkdeps
,
505 .clktrctrl_mask
= OMAP24XX_AUTOSTATE_L4_MASK
,
506 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP2420
),
509 static struct clockdomain dss_2420_clkdm
= {
511 .pwrdm
= { .name
= "core_pwrdm" },
512 .flags
= CLKDM_CAN_HWSUP
,
513 .clktrctrl_mask
= OMAP24XX_AUTOSTATE_DSS_MASK
,
514 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP2420
),
517 #endif /* CONFIG_ARCH_OMAP2420 */
521 * 2430-only clockdomains
524 #if defined(CONFIG_ARCH_OMAP2430)
526 static struct clockdomain mpu_2430_clkdm
= {
528 .pwrdm
= { .name
= "mpu_pwrdm" },
529 .flags
= CLKDM_CAN_HWSUP_SWSUP
,
530 .wkdep_srcs
= mpu_24xx_wkdeps
,
531 .clktrctrl_mask
= OMAP24XX_AUTOSTATE_MPU_MASK
,
532 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP2430
),
535 /* Another case of bit name collisions between several registers: EN_MDM */
536 static struct clockdomain mdm_clkdm
= {
538 .pwrdm
= { .name
= "mdm_pwrdm" },
539 .flags
= CLKDM_CAN_HWSUP_SWSUP
,
540 .dep_bit
= OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT
,
541 .wkdep_srcs
= mdm_2430_wkdeps
,
542 .clktrctrl_mask
= OMAP2430_AUTOSTATE_MDM_MASK
,
543 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP2430
),
546 static struct clockdomain dsp_2430_clkdm
= {
548 .pwrdm
= { .name
= "dsp_pwrdm" },
549 .flags
= CLKDM_CAN_HWSUP_SWSUP
,
550 .dep_bit
= OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT
,
551 .wkdep_srcs
= dsp_24xx_wkdeps
,
552 .clktrctrl_mask
= OMAP24XX_AUTOSTATE_DSP_MASK
,
553 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP2430
),
556 static struct clockdomain gfx_2430_clkdm
= {
558 .pwrdm
= { .name
= "gfx_pwrdm" },
559 .flags
= CLKDM_CAN_HWSUP_SWSUP
,
560 .wkdep_srcs
= gfx_sgx_wkdeps
,
561 .clktrctrl_mask
= OMAP24XX_AUTOSTATE_GFX_MASK
,
562 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP2430
),
566 * XXX add usecounting for clkdm dependencies, otherwise the presence
567 * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm
568 * could cause trouble
570 static struct clockdomain core_l3_2430_clkdm
= {
571 .name
= "core_l3_clkdm",
572 .pwrdm
= { .name
= "core_pwrdm" },
573 .flags
= CLKDM_CAN_HWSUP
,
574 .dep_bit
= OMAP24XX_EN_CORE_SHIFT
,
575 .wkdep_srcs
= core_24xx_wkdeps
,
576 .clktrctrl_mask
= OMAP24XX_AUTOSTATE_L3_MASK
,
577 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP2430
),
581 * XXX add usecounting for clkdm dependencies, otherwise the presence
582 * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm
583 * could cause trouble
585 static struct clockdomain core_l4_2430_clkdm
= {
586 .name
= "core_l4_clkdm",
587 .pwrdm
= { .name
= "core_pwrdm" },
588 .flags
= CLKDM_CAN_HWSUP
,
589 .dep_bit
= OMAP24XX_EN_CORE_SHIFT
,
590 .wkdep_srcs
= core_24xx_wkdeps
,
591 .clktrctrl_mask
= OMAP24XX_AUTOSTATE_L4_MASK
,
592 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP2430
),
595 static struct clockdomain dss_2430_clkdm
= {
597 .pwrdm
= { .name
= "core_pwrdm" },
598 .flags
= CLKDM_CAN_HWSUP
,
599 .clktrctrl_mask
= OMAP24XX_AUTOSTATE_DSS_MASK
,
600 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP2430
),
603 #endif /* CONFIG_ARCH_OMAP2430 */
610 #if defined(CONFIG_ARCH_OMAP3)
612 static struct clockdomain mpu_3xxx_clkdm
= {
614 .pwrdm
= { .name
= "mpu_pwrdm" },
615 .flags
= CLKDM_CAN_HWSUP
| CLKDM_CAN_FORCE_WAKEUP
,
616 .dep_bit
= OMAP3430_EN_MPU_SHIFT
,
617 .wkdep_srcs
= mpu_3xxx_wkdeps
,
618 .clktrctrl_mask
= OMAP3430_CLKTRCTRL_MPU_MASK
,
619 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
),
622 static struct clockdomain neon_clkdm
= {
623 .name
= "neon_clkdm",
624 .pwrdm
= { .name
= "neon_pwrdm" },
625 .flags
= CLKDM_CAN_HWSUP_SWSUP
,
626 .wkdep_srcs
= neon_wkdeps
,
627 .clktrctrl_mask
= OMAP3430_CLKTRCTRL_NEON_MASK
,
628 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
),
631 static struct clockdomain iva2_clkdm
= {
632 .name
= "iva2_clkdm",
633 .pwrdm
= { .name
= "iva2_pwrdm" },
634 .flags
= CLKDM_CAN_HWSUP_SWSUP
,
635 .dep_bit
= OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT
,
636 .wkdep_srcs
= iva2_wkdeps
,
637 .clktrctrl_mask
= OMAP3430_CLKTRCTRL_IVA2_MASK
,
638 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
),
641 static struct clockdomain gfx_3430es1_clkdm
= {
643 .pwrdm
= { .name
= "gfx_pwrdm" },
644 .flags
= CLKDM_CAN_HWSUP_SWSUP
,
645 .wkdep_srcs
= gfx_sgx_wkdeps
,
646 .sleepdep_srcs
= gfx_sgx_sleepdeps
,
647 .clktrctrl_mask
= OMAP3430ES1_CLKTRCTRL_GFX_MASK
,
648 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1
),
651 static struct clockdomain sgx_clkdm
= {
653 .pwrdm
= { .name
= "sgx_pwrdm" },
654 .flags
= CLKDM_CAN_HWSUP_SWSUP
,
655 .wkdep_srcs
= gfx_sgx_wkdeps
,
656 .sleepdep_srcs
= gfx_sgx_sleepdeps
,
657 .clktrctrl_mask
= OMAP3430ES2_CLKTRCTRL_SGX_MASK
,
658 .omap_chip
= OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2
),
662 * The die-to-die clockdomain was documented in the 34xx ES1 TRM, but
663 * then that information was removed from the 34xx ES2+ TRM. It is
664 * unclear whether the core is still there, but the clockdomain logic
665 * is there, and must be programmed to an appropriate state if the
666 * CORE clockdomain is to become inactive.
668 static struct clockdomain d2d_clkdm
= {
670 .pwrdm
= { .name
= "core_pwrdm" },
671 .flags
= CLKDM_CAN_HWSUP_SWSUP
,
672 .clktrctrl_mask
= OMAP3430ES1_CLKTRCTRL_D2D_MASK
,
673 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
),
677 * XXX add usecounting for clkdm dependencies, otherwise the presence
678 * of a single dep bit for core_l3_3xxx_clkdm and core_l4_3xxx_clkdm
679 * could cause trouble
681 static struct clockdomain core_l3_3xxx_clkdm
= {
682 .name
= "core_l3_clkdm",
683 .pwrdm
= { .name
= "core_pwrdm" },
684 .flags
= CLKDM_CAN_HWSUP
,
685 .dep_bit
= OMAP3430_EN_CORE_SHIFT
,
686 .clktrctrl_mask
= OMAP3430_CLKTRCTRL_L3_MASK
,
687 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
),
691 * XXX add usecounting for clkdm dependencies, otherwise the presence
692 * of a single dep bit for core_l3_3xxx_clkdm and core_l4_3xxx_clkdm
693 * could cause trouble
695 static struct clockdomain core_l4_3xxx_clkdm
= {
696 .name
= "core_l4_clkdm",
697 .pwrdm
= { .name
= "core_pwrdm" },
698 .flags
= CLKDM_CAN_HWSUP
,
699 .dep_bit
= OMAP3430_EN_CORE_SHIFT
,
700 .clktrctrl_mask
= OMAP3430_CLKTRCTRL_L4_MASK
,
701 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
),
704 /* Another case of bit name collisions between several registers: EN_DSS */
705 static struct clockdomain dss_3xxx_clkdm
= {
707 .pwrdm
= { .name
= "dss_pwrdm" },
708 .flags
= CLKDM_CAN_HWSUP_SWSUP
,
709 .dep_bit
= OMAP3430_PM_WKDEP_MPU_EN_DSS_SHIFT
,
710 .wkdep_srcs
= dss_wkdeps
,
711 .sleepdep_srcs
= dss_sleepdeps
,
712 .clktrctrl_mask
= OMAP3430_CLKTRCTRL_DSS_MASK
,
713 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
),
716 static struct clockdomain cam_clkdm
= {
718 .pwrdm
= { .name
= "cam_pwrdm" },
719 .flags
= CLKDM_CAN_HWSUP_SWSUP
,
720 .wkdep_srcs
= cam_wkdeps
,
721 .sleepdep_srcs
= cam_sleepdeps
,
722 .clktrctrl_mask
= OMAP3430_CLKTRCTRL_CAM_MASK
,
723 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
),
726 static struct clockdomain usbhost_clkdm
= {
727 .name
= "usbhost_clkdm",
728 .pwrdm
= { .name
= "usbhost_pwrdm" },
729 .flags
= CLKDM_CAN_HWSUP_SWSUP
,
730 .wkdep_srcs
= usbhost_wkdeps
,
731 .sleepdep_srcs
= usbhost_sleepdeps
,
732 .clktrctrl_mask
= OMAP3430ES2_CLKTRCTRL_USBHOST_MASK
,
733 .omap_chip
= OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2
),
736 static struct clockdomain per_clkdm
= {
738 .pwrdm
= { .name
= "per_pwrdm" },
739 .flags
= CLKDM_CAN_HWSUP_SWSUP
,
740 .dep_bit
= OMAP3430_EN_PER_SHIFT
,
741 .wkdep_srcs
= per_wkdeps
,
742 .sleepdep_srcs
= per_sleepdeps
,
743 .clktrctrl_mask
= OMAP3430_CLKTRCTRL_PER_MASK
,
744 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
),
748 * Disable hw supervised mode for emu_clkdm, because emu_pwrdm is
749 * switched of even if sdti is in use
751 static struct clockdomain emu_clkdm
= {
753 .pwrdm
= { .name
= "emu_pwrdm" },
754 .flags
= /* CLKDM_CAN_ENABLE_AUTO | */CLKDM_CAN_SWSUP
,
755 .clktrctrl_mask
= OMAP3430_CLKTRCTRL_EMU_MASK
,
756 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
),
759 static struct clockdomain dpll1_clkdm
= {
760 .name
= "dpll1_clkdm",
761 .pwrdm
= { .name
= "dpll1_pwrdm" },
762 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
),
765 static struct clockdomain dpll2_clkdm
= {
766 .name
= "dpll2_clkdm",
767 .pwrdm
= { .name
= "dpll2_pwrdm" },
768 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
),
771 static struct clockdomain dpll3_clkdm
= {
772 .name
= "dpll3_clkdm",
773 .pwrdm
= { .name
= "dpll3_pwrdm" },
774 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
),
777 static struct clockdomain dpll4_clkdm
= {
778 .name
= "dpll4_clkdm",
779 .pwrdm
= { .name
= "dpll4_pwrdm" },
780 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
),
783 static struct clockdomain dpll5_clkdm
= {
784 .name
= "dpll5_clkdm",
785 .pwrdm
= { .name
= "dpll5_pwrdm" },
786 .omap_chip
= OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2
),
789 #endif /* CONFIG_ARCH_OMAP3 */
792 * Clockdomain hwsup dependencies (OMAP3 only)
795 static struct clkdm_autodep clkdm_autodeps
[] = {
797 .clkdm
= { .name
= "mpu_clkdm" },
798 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
801 .clkdm
= { .name
= "iva2_clkdm" },
802 .omap_chip
= OMAP_CHIP_INIT(CHIP_IS_OMAP3430
)
805 .clkdm
= { .name
= NULL
},
809 static struct clockdomain
*clockdomains_omap2
[] __initdata
= {
814 #ifdef CONFIG_ARCH_OMAP2420
824 #ifdef CONFIG_ARCH_OMAP2430
834 #ifdef CONFIG_ARCH_OMAP3
857 void __init
omap2_clockdomains_init(void)
859 clkdm_init(clockdomains_omap2
, clkdm_autodeps
);