diff options
-rw-r--r-- | arch/arm/mach-omap2/clockdomain.c | 135 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c | 40 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cm-regbits-24xx.h | 5 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cm2xxx_3xxx.c | 68 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cm2xxx_3xxx.h | 9 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/clockdomain.h | 5 |
6 files changed, 127 insertions, 135 deletions
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c index 555a518836b9..e5605c21ad38 100644 --- a/arch/arm/mach-omap2/clockdomain.c +++ b/arch/arm/mach-omap2/clockdomain.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include "prm2xxx_3xxx.h" | 29 | #include "prm2xxx_3xxx.h" |
30 | #include "prm-regbits-24xx.h" | 30 | #include "prm-regbits-24xx.h" |
31 | #include "cm2xxx_3xxx.h" | 31 | #include "cm2xxx_3xxx.h" |
32 | #include "cm-regbits-34xx.h" | 32 | #include "cm-regbits-24xx.h" |
33 | #include "cminst44xx.h" | 33 | #include "cminst44xx.h" |
34 | #include "prcm44xx.h" | 34 | #include "prcm44xx.h" |
35 | 35 | ||
@@ -246,30 +246,18 @@ static void _clkdm_del_autodeps(struct clockdomain *clkdm) | |||
246 | */ | 246 | */ |
247 | static void _enable_hwsup(struct clockdomain *clkdm) | 247 | static void _enable_hwsup(struct clockdomain *clkdm) |
248 | { | 248 | { |
249 | u32 bits, v; | ||
250 | |||
251 | if (cpu_is_omap24xx()) | 249 | if (cpu_is_omap24xx()) |
252 | bits = OMAP24XX_CLKSTCTRL_ENABLE_AUTO; | 250 | omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs, |
251 | clkdm->clktrctrl_mask); | ||
253 | else if (cpu_is_omap34xx()) | 252 | else if (cpu_is_omap34xx()) |
254 | bits = OMAP34XX_CLKSTCTRL_ENABLE_AUTO; | 253 | omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs, |
254 | clkdm->clktrctrl_mask); | ||
255 | else if (cpu_is_omap44xx()) | 255 | else if (cpu_is_omap44xx()) |
256 | return omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition, | 256 | return omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition, |
257 | clkdm->cm_inst, | 257 | clkdm->cm_inst, |
258 | clkdm->clkdm_offs); | 258 | clkdm->clkdm_offs); |
259 | else | 259 | else |
260 | BUG(); | 260 | BUG(); |
261 | |||
262 | bits = bits << __ffs(clkdm->clktrctrl_mask); | ||
263 | |||
264 | /* | ||
265 | * XXX clkstctrl_reg is known on OMAP2 - this clkdm | ||
266 | * field is not needed | ||
267 | */ | ||
268 | v = __raw_readl(clkdm->clkstctrl_reg); | ||
269 | v &= ~(clkdm->clktrctrl_mask); | ||
270 | v |= bits; | ||
271 | __raw_writel(v, clkdm->clkstctrl_reg); | ||
272 | |||
273 | } | 261 | } |
274 | 262 | ||
275 | /** | 263 | /** |
@@ -284,29 +272,18 @@ static void _enable_hwsup(struct clockdomain *clkdm) | |||
284 | */ | 272 | */ |
285 | static void _disable_hwsup(struct clockdomain *clkdm) | 273 | static void _disable_hwsup(struct clockdomain *clkdm) |
286 | { | 274 | { |
287 | u32 bits, v; | ||
288 | |||
289 | if (cpu_is_omap24xx()) | 275 | if (cpu_is_omap24xx()) |
290 | bits = OMAP24XX_CLKSTCTRL_DISABLE_AUTO; | 276 | omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs, |
277 | clkdm->clktrctrl_mask); | ||
291 | else if (cpu_is_omap34xx()) | 278 | else if (cpu_is_omap34xx()) |
292 | bits = OMAP34XX_CLKSTCTRL_DISABLE_AUTO; | 279 | omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs, |
280 | clkdm->clktrctrl_mask); | ||
293 | else if (cpu_is_omap44xx()) | 281 | else if (cpu_is_omap44xx()) |
294 | return omap4_cminst_clkdm_disable_hwsup(clkdm->prcm_partition, | 282 | return omap4_cminst_clkdm_disable_hwsup(clkdm->prcm_partition, |
295 | clkdm->cm_inst, | 283 | clkdm->cm_inst, |
296 | clkdm->clkdm_offs); | 284 | clkdm->clkdm_offs); |
297 | else | 285 | else |
298 | BUG(); | 286 | BUG(); |
299 | |||
300 | bits = bits << __ffs(clkdm->clktrctrl_mask); | ||
301 | |||
302 | /* | ||
303 | * XXX clkstctrl_reg is known on OMAP2 - this clkdm | ||
304 | * field is not needed | ||
305 | */ | ||
306 | v = __raw_readl(clkdm->clkstctrl_reg); | ||
307 | v &= ~(clkdm->clktrctrl_mask); | ||
308 | v |= bits; | ||
309 | __raw_writel(v, clkdm->clkstctrl_reg); | ||
310 | } | 287 | } |
311 | 288 | ||
312 | /* Public functions */ | 289 | /* Public functions */ |
@@ -735,34 +712,6 @@ int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm) | |||
735 | } | 712 | } |
736 | 713 | ||
737 | /** | 714 | /** |
738 | * omap2_clkdm_clktrctrl_read - read the clkdm's current state transition mode | ||
739 | * @clkdm: struct clkdm * of a clockdomain | ||
740 | * | ||
741 | * Return the clockdomain @clkdm current state transition mode from the | ||
742 | * corresponding domain CM_CLKSTCTRL register. Returns -EINVAL if @clkdm | ||
743 | * is NULL or the current mode upon success. | ||
744 | */ | ||
745 | static int omap2_clkdm_clktrctrl_read(struct clockdomain *clkdm) | ||
746 | { | ||
747 | u32 v = 0; | ||
748 | |||
749 | if (!clkdm) | ||
750 | return -EINVAL; | ||
751 | |||
752 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) { | ||
753 | v = __raw_readl(clkdm->clkstctrl_reg); | ||
754 | v &= clkdm->clktrctrl_mask; | ||
755 | v >>= __ffs(clkdm->clktrctrl_mask); | ||
756 | } else if (cpu_is_omap44xx()) { | ||
757 | pr_warn("OMAP4 clockdomain: missing wakeup/sleep deps\n"); | ||
758 | } else { | ||
759 | BUG(); | ||
760 | } | ||
761 | |||
762 | return v; | ||
763 | } | ||
764 | |||
765 | /** | ||
766 | * omap2_clkdm_sleep - force clockdomain sleep transition | 715 | * omap2_clkdm_sleep - force clockdomain sleep transition |
767 | * @clkdm: struct clockdomain * | 716 | * @clkdm: struct clockdomain * |
768 | * | 717 | * |
@@ -773,8 +722,6 @@ static int omap2_clkdm_clktrctrl_read(struct clockdomain *clkdm) | |||
773 | */ | 722 | */ |
774 | int omap2_clkdm_sleep(struct clockdomain *clkdm) | 723 | int omap2_clkdm_sleep(struct clockdomain *clkdm) |
775 | { | 724 | { |
776 | u32 bits, v; | ||
777 | |||
778 | if (!clkdm) | 725 | if (!clkdm) |
779 | return -EINVAL; | 726 | return -EINVAL; |
780 | 727 | ||
@@ -793,13 +740,8 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm) | |||
793 | 740 | ||
794 | } else if (cpu_is_omap34xx()) { | 741 | } else if (cpu_is_omap34xx()) { |
795 | 742 | ||
796 | bits = (OMAP34XX_CLKSTCTRL_FORCE_SLEEP << | 743 | omap3xxx_cm_clkdm_force_sleep(clkdm->pwrdm.ptr->prcm_offs, |
797 | __ffs(clkdm->clktrctrl_mask)); | 744 | clkdm->clktrctrl_mask); |
798 | |||
799 | v = __raw_readl(clkdm->clkstctrl_reg); | ||
800 | v &= ~(clkdm->clktrctrl_mask); | ||
801 | v |= bits; | ||
802 | __raw_writel(v, clkdm->clkstctrl_reg); | ||
803 | 745 | ||
804 | } else if (cpu_is_omap44xx()) { | 746 | } else if (cpu_is_omap44xx()) { |
805 | 747 | ||
@@ -825,8 +767,6 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm) | |||
825 | */ | 767 | */ |
826 | int omap2_clkdm_wakeup(struct clockdomain *clkdm) | 768 | int omap2_clkdm_wakeup(struct clockdomain *clkdm) |
827 | { | 769 | { |
828 | u32 bits, v; | ||
829 | |||
830 | if (!clkdm) | 770 | if (!clkdm) |
831 | return -EINVAL; | 771 | return -EINVAL; |
832 | 772 | ||
@@ -845,13 +785,8 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm) | |||
845 | 785 | ||
846 | } else if (cpu_is_omap34xx()) { | 786 | } else if (cpu_is_omap34xx()) { |
847 | 787 | ||
848 | bits = (OMAP34XX_CLKSTCTRL_FORCE_WAKEUP << | 788 | omap3xxx_cm_clkdm_force_wakeup(clkdm->pwrdm.ptr->prcm_offs, |
849 | __ffs(clkdm->clktrctrl_mask)); | 789 | clkdm->clktrctrl_mask); |
850 | |||
851 | v = __raw_readl(clkdm->clkstctrl_reg); | ||
852 | v &= ~(clkdm->clktrctrl_mask); | ||
853 | v |= bits; | ||
854 | __raw_writel(v, clkdm->clkstctrl_reg); | ||
855 | 790 | ||
856 | } else if (cpu_is_omap44xx()) { | 791 | } else if (cpu_is_omap44xx()) { |
857 | 792 | ||
@@ -964,7 +899,7 @@ void omap2_clkdm_deny_idle(struct clockdomain *clkdm) | |||
964 | */ | 899 | */ |
965 | int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) | 900 | int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) |
966 | { | 901 | { |
967 | int v; | 902 | bool hwsup = false; |
968 | 903 | ||
969 | /* | 904 | /* |
970 | * XXX Rewrite this code to maintain a list of enabled | 905 | * XXX Rewrite this code to maintain a list of enabled |
@@ -982,13 +917,23 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) | |||
982 | pr_debug("clockdomain: clkdm %s: clk %s now enabled\n", clkdm->name, | 917 | pr_debug("clockdomain: clkdm %s: clk %s now enabled\n", clkdm->name, |
983 | clk->name); | 918 | clk->name); |
984 | 919 | ||
985 | if (!clkdm->clkstctrl_reg) | 920 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) { |
986 | return 0; | ||
987 | 921 | ||
988 | v = omap2_clkdm_clktrctrl_read(clkdm); | 922 | if (!clkdm->clktrctrl_mask) |
923 | return 0; | ||
924 | |||
925 | hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
926 | clkdm->clktrctrl_mask); | ||
927 | |||
928 | } else if (cpu_is_omap44xx()) { | ||
929 | |||
930 | hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition, | ||
931 | clkdm->cm_inst, | ||
932 | clkdm->clkdm_offs); | ||
989 | 933 | ||
990 | if ((cpu_is_omap34xx() && v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) || | 934 | } |
991 | (cpu_is_omap24xx() && v == OMAP24XX_CLKSTCTRL_ENABLE_AUTO)) { | 935 | |
936 | if (hwsup) { | ||
992 | /* Disable HW transitions when we are changing deps */ | 937 | /* Disable HW transitions when we are changing deps */ |
993 | _disable_hwsup(clkdm); | 938 | _disable_hwsup(clkdm); |
994 | _clkdm_add_autodeps(clkdm); | 939 | _clkdm_add_autodeps(clkdm); |
@@ -1019,7 +964,7 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) | |||
1019 | */ | 964 | */ |
1020 | int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) | 965 | int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) |
1021 | { | 966 | { |
1022 | int v; | 967 | bool hwsup = false; |
1023 | 968 | ||
1024 | /* | 969 | /* |
1025 | * XXX Rewrite this code to maintain a list of enabled | 970 | * XXX Rewrite this code to maintain a list of enabled |
@@ -1044,13 +989,23 @@ int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) | |||
1044 | pr_debug("clockdomain: clkdm %s: clk %s now disabled\n", clkdm->name, | 989 | pr_debug("clockdomain: clkdm %s: clk %s now disabled\n", clkdm->name, |
1045 | clk->name); | 990 | clk->name); |
1046 | 991 | ||
1047 | if (!clkdm->clkstctrl_reg) | 992 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) { |
1048 | return 0; | 993 | |
994 | if (!clkdm->clktrctrl_mask) | ||
995 | return 0; | ||
996 | |||
997 | hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs, | ||
998 | clkdm->clktrctrl_mask); | ||
1049 | 999 | ||
1050 | v = omap2_clkdm_clktrctrl_read(clkdm); | 1000 | } else if (cpu_is_omap44xx()) { |
1001 | |||
1002 | hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition, | ||
1003 | clkdm->cm_inst, | ||
1004 | clkdm->clkdm_offs); | ||
1005 | |||
1006 | } | ||
1051 | 1007 | ||
1052 | if ((cpu_is_omap34xx() && v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) || | 1008 | if (hwsup) { |
1053 | (cpu_is_omap24xx() && v == OMAP24XX_CLKSTCTRL_ENABLE_AUTO)) { | ||
1054 | /* Disable HW transitions when we are changing deps */ | 1009 | /* Disable HW transitions when we are changing deps */ |
1055 | _disable_hwsup(clkdm); | 1010 | _disable_hwsup(clkdm); |
1056 | _clkdm_del_autodeps(clkdm); | 1011 | _clkdm_del_autodeps(clkdm); |
diff --git a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c index de1d3b759aee..6e9ec49d637f 100644 --- a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c +++ b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c | |||
@@ -456,7 +456,6 @@ static struct clockdomain mpu_2420_clkdm = { | |||
456 | .name = "mpu_clkdm", | 456 | .name = "mpu_clkdm", |
457 | .pwrdm = { .name = "mpu_pwrdm" }, | 457 | .pwrdm = { .name = "mpu_pwrdm" }, |
458 | .flags = CLKDM_CAN_HWSUP, | 458 | .flags = CLKDM_CAN_HWSUP, |
459 | .clkstctrl_reg = OMAP2420_CM_REGADDR(MPU_MOD, OMAP2_CM_CLKSTCTRL), | ||
460 | .wkdep_srcs = mpu_24xx_wkdeps, | 459 | .wkdep_srcs = mpu_24xx_wkdeps, |
461 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, | 460 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, |
462 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | 461 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
@@ -466,8 +465,6 @@ static struct clockdomain iva1_2420_clkdm = { | |||
466 | .name = "iva1_clkdm", | 465 | .name = "iva1_clkdm", |
467 | .pwrdm = { .name = "dsp_pwrdm" }, | 466 | .pwrdm = { .name = "dsp_pwrdm" }, |
468 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 467 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
469 | .clkstctrl_reg = OMAP2420_CM_REGADDR(OMAP24XX_DSP_MOD, | ||
470 | OMAP2_CM_CLKSTCTRL), | ||
471 | .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT, | 468 | .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT, |
472 | .wkdep_srcs = dsp_24xx_wkdeps, | 469 | .wkdep_srcs = dsp_24xx_wkdeps, |
473 | .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK, | 470 | .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK, |
@@ -478,8 +475,6 @@ static struct clockdomain dsp_2420_clkdm = { | |||
478 | .name = "dsp_clkdm", | 475 | .name = "dsp_clkdm", |
479 | .pwrdm = { .name = "dsp_pwrdm" }, | 476 | .pwrdm = { .name = "dsp_pwrdm" }, |
480 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 477 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
481 | .clkstctrl_reg = OMAP2420_CM_REGADDR(OMAP24XX_DSP_MOD, | ||
482 | OMAP2_CM_CLKSTCTRL), | ||
483 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, | 478 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, |
484 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | 479 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
485 | }; | 480 | }; |
@@ -488,7 +483,6 @@ static struct clockdomain gfx_2420_clkdm = { | |||
488 | .name = "gfx_clkdm", | 483 | .name = "gfx_clkdm", |
489 | .pwrdm = { .name = "gfx_pwrdm" }, | 484 | .pwrdm = { .name = "gfx_pwrdm" }, |
490 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 485 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
491 | .clkstctrl_reg = OMAP2420_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL), | ||
492 | .wkdep_srcs = gfx_sgx_wkdeps, | 486 | .wkdep_srcs = gfx_sgx_wkdeps, |
493 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, | 487 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, |
494 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | 488 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
@@ -498,7 +492,6 @@ static struct clockdomain core_l3_2420_clkdm = { | |||
498 | .name = "core_l3_clkdm", | 492 | .name = "core_l3_clkdm", |
499 | .pwrdm = { .name = "core_pwrdm" }, | 493 | .pwrdm = { .name = "core_pwrdm" }, |
500 | .flags = CLKDM_CAN_HWSUP, | 494 | .flags = CLKDM_CAN_HWSUP, |
501 | .clkstctrl_reg = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), | ||
502 | .wkdep_srcs = core_24xx_wkdeps, | 495 | .wkdep_srcs = core_24xx_wkdeps, |
503 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, | 496 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, |
504 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | 497 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
@@ -508,7 +501,6 @@ static struct clockdomain core_l4_2420_clkdm = { | |||
508 | .name = "core_l4_clkdm", | 501 | .name = "core_l4_clkdm", |
509 | .pwrdm = { .name = "core_pwrdm" }, | 502 | .pwrdm = { .name = "core_pwrdm" }, |
510 | .flags = CLKDM_CAN_HWSUP, | 503 | .flags = CLKDM_CAN_HWSUP, |
511 | .clkstctrl_reg = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), | ||
512 | .wkdep_srcs = core_24xx_wkdeps, | 504 | .wkdep_srcs = core_24xx_wkdeps, |
513 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, | 505 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, |
514 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | 506 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
@@ -518,7 +510,6 @@ static struct clockdomain dss_2420_clkdm = { | |||
518 | .name = "dss_clkdm", | 510 | .name = "dss_clkdm", |
519 | .pwrdm = { .name = "core_pwrdm" }, | 511 | .pwrdm = { .name = "core_pwrdm" }, |
520 | .flags = CLKDM_CAN_HWSUP, | 512 | .flags = CLKDM_CAN_HWSUP, |
521 | .clkstctrl_reg = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), | ||
522 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, | 513 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, |
523 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | 514 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
524 | }; | 515 | }; |
@@ -536,8 +527,6 @@ static struct clockdomain mpu_2430_clkdm = { | |||
536 | .name = "mpu_clkdm", | 527 | .name = "mpu_clkdm", |
537 | .pwrdm = { .name = "mpu_pwrdm" }, | 528 | .pwrdm = { .name = "mpu_pwrdm" }, |
538 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 529 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
539 | .clkstctrl_reg = OMAP2430_CM_REGADDR(MPU_MOD, | ||
540 | OMAP2_CM_CLKSTCTRL), | ||
541 | .wkdep_srcs = mpu_24xx_wkdeps, | 530 | .wkdep_srcs = mpu_24xx_wkdeps, |
542 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, | 531 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, |
543 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | 532 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
@@ -548,8 +537,6 @@ static struct clockdomain mdm_clkdm = { | |||
548 | .name = "mdm_clkdm", | 537 | .name = "mdm_clkdm", |
549 | .pwrdm = { .name = "mdm_pwrdm" }, | 538 | .pwrdm = { .name = "mdm_pwrdm" }, |
550 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 539 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
551 | .clkstctrl_reg = OMAP2430_CM_REGADDR(OMAP2430_MDM_MOD, | ||
552 | OMAP2_CM_CLKSTCTRL), | ||
553 | .dep_bit = OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT, | 540 | .dep_bit = OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT, |
554 | .wkdep_srcs = mdm_2430_wkdeps, | 541 | .wkdep_srcs = mdm_2430_wkdeps, |
555 | .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK, | 542 | .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK, |
@@ -560,8 +547,6 @@ static struct clockdomain dsp_2430_clkdm = { | |||
560 | .name = "dsp_clkdm", | 547 | .name = "dsp_clkdm", |
561 | .pwrdm = { .name = "dsp_pwrdm" }, | 548 | .pwrdm = { .name = "dsp_pwrdm" }, |
562 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 549 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
563 | .clkstctrl_reg = OMAP2430_CM_REGADDR(OMAP24XX_DSP_MOD, | ||
564 | OMAP2_CM_CLKSTCTRL), | ||
565 | .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT, | 550 | .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT, |
566 | .wkdep_srcs = dsp_24xx_wkdeps, | 551 | .wkdep_srcs = dsp_24xx_wkdeps, |
567 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, | 552 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, |
@@ -572,7 +557,6 @@ static struct clockdomain gfx_2430_clkdm = { | |||
572 | .name = "gfx_clkdm", | 557 | .name = "gfx_clkdm", |
573 | .pwrdm = { .name = "gfx_pwrdm" }, | 558 | .pwrdm = { .name = "gfx_pwrdm" }, |
574 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 559 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
575 | .clkstctrl_reg = OMAP2430_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL), | ||
576 | .wkdep_srcs = gfx_sgx_wkdeps, | 560 | .wkdep_srcs = gfx_sgx_wkdeps, |
577 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, | 561 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, |
578 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | 562 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
@@ -587,7 +571,6 @@ static struct clockdomain core_l3_2430_clkdm = { | |||
587 | .name = "core_l3_clkdm", | 571 | .name = "core_l3_clkdm", |
588 | .pwrdm = { .name = "core_pwrdm" }, | 572 | .pwrdm = { .name = "core_pwrdm" }, |
589 | .flags = CLKDM_CAN_HWSUP, | 573 | .flags = CLKDM_CAN_HWSUP, |
590 | .clkstctrl_reg = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), | ||
591 | .dep_bit = OMAP24XX_EN_CORE_SHIFT, | 574 | .dep_bit = OMAP24XX_EN_CORE_SHIFT, |
592 | .wkdep_srcs = core_24xx_wkdeps, | 575 | .wkdep_srcs = core_24xx_wkdeps, |
593 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, | 576 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, |
@@ -603,7 +586,6 @@ static struct clockdomain core_l4_2430_clkdm = { | |||
603 | .name = "core_l4_clkdm", | 586 | .name = "core_l4_clkdm", |
604 | .pwrdm = { .name = "core_pwrdm" }, | 587 | .pwrdm = { .name = "core_pwrdm" }, |
605 | .flags = CLKDM_CAN_HWSUP, | 588 | .flags = CLKDM_CAN_HWSUP, |
606 | .clkstctrl_reg = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), | ||
607 | .dep_bit = OMAP24XX_EN_CORE_SHIFT, | 589 | .dep_bit = OMAP24XX_EN_CORE_SHIFT, |
608 | .wkdep_srcs = core_24xx_wkdeps, | 590 | .wkdep_srcs = core_24xx_wkdeps, |
609 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, | 591 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, |
@@ -614,7 +596,6 @@ static struct clockdomain dss_2430_clkdm = { | |||
614 | .name = "dss_clkdm", | 596 | .name = "dss_clkdm", |
615 | .pwrdm = { .name = "core_pwrdm" }, | 597 | .pwrdm = { .name = "core_pwrdm" }, |
616 | .flags = CLKDM_CAN_HWSUP, | 598 | .flags = CLKDM_CAN_HWSUP, |
617 | .clkstctrl_reg = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), | ||
618 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, | 599 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, |
619 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | 600 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
620 | }; | 601 | }; |
@@ -632,7 +613,6 @@ static struct clockdomain mpu_3xxx_clkdm = { | |||
632 | .name = "mpu_clkdm", | 613 | .name = "mpu_clkdm", |
633 | .pwrdm = { .name = "mpu_pwrdm" }, | 614 | .pwrdm = { .name = "mpu_pwrdm" }, |
634 | .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP, | 615 | .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP, |
635 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(MPU_MOD, OMAP2_CM_CLKSTCTRL), | ||
636 | .dep_bit = OMAP3430_EN_MPU_SHIFT, | 616 | .dep_bit = OMAP3430_EN_MPU_SHIFT, |
637 | .wkdep_srcs = mpu_3xxx_wkdeps, | 617 | .wkdep_srcs = mpu_3xxx_wkdeps, |
638 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK, | 618 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK, |
@@ -643,8 +623,6 @@ static struct clockdomain neon_clkdm = { | |||
643 | .name = "neon_clkdm", | 623 | .name = "neon_clkdm", |
644 | .pwrdm = { .name = "neon_pwrdm" }, | 624 | .pwrdm = { .name = "neon_pwrdm" }, |
645 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 625 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
646 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_NEON_MOD, | ||
647 | OMAP2_CM_CLKSTCTRL), | ||
648 | .wkdep_srcs = neon_wkdeps, | 626 | .wkdep_srcs = neon_wkdeps, |
649 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK, | 627 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK, |
650 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 628 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
@@ -654,8 +632,6 @@ static struct clockdomain iva2_clkdm = { | |||
654 | .name = "iva2_clkdm", | 632 | .name = "iva2_clkdm", |
655 | .pwrdm = { .name = "iva2_pwrdm" }, | 633 | .pwrdm = { .name = "iva2_pwrdm" }, |
656 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 634 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
657 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_IVA2_MOD, | ||
658 | OMAP2_CM_CLKSTCTRL), | ||
659 | .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT, | 635 | .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT, |
660 | .wkdep_srcs = iva2_wkdeps, | 636 | .wkdep_srcs = iva2_wkdeps, |
661 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK, | 637 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK, |
@@ -666,7 +642,6 @@ static struct clockdomain gfx_3430es1_clkdm = { | |||
666 | .name = "gfx_clkdm", | 642 | .name = "gfx_clkdm", |
667 | .pwrdm = { .name = "gfx_pwrdm" }, | 643 | .pwrdm = { .name = "gfx_pwrdm" }, |
668 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 644 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
669 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL), | ||
670 | .wkdep_srcs = gfx_sgx_wkdeps, | 645 | .wkdep_srcs = gfx_sgx_wkdeps, |
671 | .sleepdep_srcs = gfx_sgx_sleepdeps, | 646 | .sleepdep_srcs = gfx_sgx_sleepdeps, |
672 | .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK, | 647 | .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK, |
@@ -677,8 +652,6 @@ static struct clockdomain sgx_clkdm = { | |||
677 | .name = "sgx_clkdm", | 652 | .name = "sgx_clkdm", |
678 | .pwrdm = { .name = "sgx_pwrdm" }, | 653 | .pwrdm = { .name = "sgx_pwrdm" }, |
679 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 654 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
680 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430ES2_SGX_MOD, | ||
681 | OMAP2_CM_CLKSTCTRL), | ||
682 | .wkdep_srcs = gfx_sgx_wkdeps, | 655 | .wkdep_srcs = gfx_sgx_wkdeps, |
683 | .sleepdep_srcs = gfx_sgx_sleepdeps, | 656 | .sleepdep_srcs = gfx_sgx_sleepdeps, |
684 | .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK, | 657 | .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK, |
@@ -696,7 +669,6 @@ static struct clockdomain d2d_clkdm = { | |||
696 | .name = "d2d_clkdm", | 669 | .name = "d2d_clkdm", |
697 | .pwrdm = { .name = "core_pwrdm" }, | 670 | .pwrdm = { .name = "core_pwrdm" }, |
698 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 671 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
699 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), | ||
700 | .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK, | 672 | .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK, |
701 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 673 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
702 | }; | 674 | }; |
@@ -710,7 +682,6 @@ static struct clockdomain core_l3_3xxx_clkdm = { | |||
710 | .name = "core_l3_clkdm", | 682 | .name = "core_l3_clkdm", |
711 | .pwrdm = { .name = "core_pwrdm" }, | 683 | .pwrdm = { .name = "core_pwrdm" }, |
712 | .flags = CLKDM_CAN_HWSUP, | 684 | .flags = CLKDM_CAN_HWSUP, |
713 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), | ||
714 | .dep_bit = OMAP3430_EN_CORE_SHIFT, | 685 | .dep_bit = OMAP3430_EN_CORE_SHIFT, |
715 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK, | 686 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK, |
716 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 687 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
@@ -725,7 +696,6 @@ static struct clockdomain core_l4_3xxx_clkdm = { | |||
725 | .name = "core_l4_clkdm", | 696 | .name = "core_l4_clkdm", |
726 | .pwrdm = { .name = "core_pwrdm" }, | 697 | .pwrdm = { .name = "core_pwrdm" }, |
727 | .flags = CLKDM_CAN_HWSUP, | 698 | .flags = CLKDM_CAN_HWSUP, |
728 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), | ||
729 | .dep_bit = OMAP3430_EN_CORE_SHIFT, | 699 | .dep_bit = OMAP3430_EN_CORE_SHIFT, |
730 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK, | 700 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK, |
731 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 701 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
@@ -736,8 +706,6 @@ static struct clockdomain dss_3xxx_clkdm = { | |||
736 | .name = "dss_clkdm", | 706 | .name = "dss_clkdm", |
737 | .pwrdm = { .name = "dss_pwrdm" }, | 707 | .pwrdm = { .name = "dss_pwrdm" }, |
738 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 708 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
739 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_DSS_MOD, | ||
740 | OMAP2_CM_CLKSTCTRL), | ||
741 | .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_DSS_SHIFT, | 709 | .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_DSS_SHIFT, |
742 | .wkdep_srcs = dss_wkdeps, | 710 | .wkdep_srcs = dss_wkdeps, |
743 | .sleepdep_srcs = dss_sleepdeps, | 711 | .sleepdep_srcs = dss_sleepdeps, |
@@ -749,8 +717,6 @@ static struct clockdomain cam_clkdm = { | |||
749 | .name = "cam_clkdm", | 717 | .name = "cam_clkdm", |
750 | .pwrdm = { .name = "cam_pwrdm" }, | 718 | .pwrdm = { .name = "cam_pwrdm" }, |
751 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 719 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
752 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_CAM_MOD, | ||
753 | OMAP2_CM_CLKSTCTRL), | ||
754 | .wkdep_srcs = cam_wkdeps, | 720 | .wkdep_srcs = cam_wkdeps, |
755 | .sleepdep_srcs = cam_sleepdeps, | 721 | .sleepdep_srcs = cam_sleepdeps, |
756 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK, | 722 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK, |
@@ -761,8 +727,6 @@ static struct clockdomain usbhost_clkdm = { | |||
761 | .name = "usbhost_clkdm", | 727 | .name = "usbhost_clkdm", |
762 | .pwrdm = { .name = "usbhost_pwrdm" }, | 728 | .pwrdm = { .name = "usbhost_pwrdm" }, |
763 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 729 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
764 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, | ||
765 | OMAP2_CM_CLKSTCTRL), | ||
766 | .wkdep_srcs = usbhost_wkdeps, | 730 | .wkdep_srcs = usbhost_wkdeps, |
767 | .sleepdep_srcs = usbhost_sleepdeps, | 731 | .sleepdep_srcs = usbhost_sleepdeps, |
768 | .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK, | 732 | .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK, |
@@ -773,8 +737,6 @@ static struct clockdomain per_clkdm = { | |||
773 | .name = "per_clkdm", | 737 | .name = "per_clkdm", |
774 | .pwrdm = { .name = "per_pwrdm" }, | 738 | .pwrdm = { .name = "per_pwrdm" }, |
775 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 739 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
776 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_PER_MOD, | ||
777 | OMAP2_CM_CLKSTCTRL), | ||
778 | .dep_bit = OMAP3430_EN_PER_SHIFT, | 740 | .dep_bit = OMAP3430_EN_PER_SHIFT, |
779 | .wkdep_srcs = per_wkdeps, | 741 | .wkdep_srcs = per_wkdeps, |
780 | .sleepdep_srcs = per_sleepdeps, | 742 | .sleepdep_srcs = per_sleepdeps, |
@@ -790,8 +752,6 @@ static struct clockdomain emu_clkdm = { | |||
790 | .name = "emu_clkdm", | 752 | .name = "emu_clkdm", |
791 | .pwrdm = { .name = "emu_pwrdm" }, | 753 | .pwrdm = { .name = "emu_pwrdm" }, |
792 | .flags = /* CLKDM_CAN_ENABLE_AUTO | */CLKDM_CAN_SWSUP, | 754 | .flags = /* CLKDM_CAN_ENABLE_AUTO | */CLKDM_CAN_SWSUP, |
793 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_EMU_MOD, | ||
794 | OMAP2_CM_CLKSTCTRL), | ||
795 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK, | 755 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK, |
796 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 756 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
797 | }; | 757 | }; |
diff --git a/arch/arm/mach-omap2/cm-regbits-24xx.h b/arch/arm/mach-omap2/cm-regbits-24xx.h index 0856f2bcee5d..d70660e82fe6 100644 --- a/arch/arm/mach-omap2/cm-regbits-24xx.h +++ b/arch/arm/mach-omap2/cm-regbits-24xx.h | |||
@@ -434,4 +434,9 @@ | |||
434 | #define OMAP2430_AUTOSTATE_MDM_SHIFT 0 | 434 | #define OMAP2430_AUTOSTATE_MDM_SHIFT 0 |
435 | #define OMAP2430_AUTOSTATE_MDM_MASK (1 << 0) | 435 | #define OMAP2430_AUTOSTATE_MDM_MASK (1 << 0) |
436 | 436 | ||
437 | /* OMAP24XX CM_CLKSTCTRL_*.AUTOSTATE_* register bit values */ | ||
438 | #define OMAP24XX_CLKSTCTRL_DISABLE_AUTO 0x0 | ||
439 | #define OMAP24XX_CLKSTCTRL_ENABLE_AUTO 0x1 | ||
440 | |||
441 | |||
437 | #endif | 442 | #endif |
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.c b/arch/arm/mach-omap2/cm2xxx_3xxx.c index e3d598a4c624..96954aa48671 100644 --- a/arch/arm/mach-omap2/cm2xxx_3xxx.c +++ b/arch/arm/mach-omap2/cm2xxx_3xxx.c | |||
@@ -62,6 +62,74 @@ u32 omap2_cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx) | |||
62 | return omap2_cm_rmw_mod_reg_bits(bits, 0x0, module, idx); | 62 | return omap2_cm_rmw_mod_reg_bits(bits, 0x0, module, idx); |
63 | } | 63 | } |
64 | 64 | ||
65 | /* | ||
66 | * | ||
67 | */ | ||
68 | |||
69 | static void _write_clktrctrl(u8 c, s16 module, u32 mask) | ||
70 | { | ||
71 | u32 v; | ||
72 | |||
73 | v = omap2_cm_read_mod_reg(module, OMAP2_CM_CLKSTCTRL); | ||
74 | v &= ~mask; | ||
75 | v |= c << __ffs(mask); | ||
76 | omap2_cm_write_mod_reg(v, module, OMAP2_CM_CLKSTCTRL); | ||
77 | } | ||
78 | |||
79 | bool omap2_cm_is_clkdm_in_hwsup(s16 module, u32 mask) | ||
80 | { | ||
81 | u32 v; | ||
82 | bool ret = 0; | ||
83 | |||
84 | BUG_ON(!cpu_is_omap24xx() && !cpu_is_omap34xx()); | ||
85 | |||
86 | v = omap2_cm_read_mod_reg(module, OMAP2_CM_CLKSTCTRL); | ||
87 | v &= mask; | ||
88 | v >>= __ffs(mask); | ||
89 | |||
90 | if (cpu_is_omap24xx()) | ||
91 | ret = (v == OMAP24XX_CLKSTCTRL_ENABLE_AUTO) ? 1 : 0; | ||
92 | else | ||
93 | ret = (v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) ? 1 : 0; | ||
94 | |||
95 | return ret; | ||
96 | } | ||
97 | |||
98 | void omap2xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask) | ||
99 | { | ||
100 | _write_clktrctrl(OMAP24XX_CLKSTCTRL_ENABLE_AUTO, module, mask); | ||
101 | } | ||
102 | |||
103 | void omap2xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask) | ||
104 | { | ||
105 | _write_clktrctrl(OMAP24XX_CLKSTCTRL_DISABLE_AUTO, module, mask); | ||
106 | } | ||
107 | |||
108 | void omap3xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask) | ||
109 | { | ||
110 | _write_clktrctrl(OMAP34XX_CLKSTCTRL_ENABLE_AUTO, module, mask); | ||
111 | } | ||
112 | |||
113 | void omap3xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask) | ||
114 | { | ||
115 | _write_clktrctrl(OMAP34XX_CLKSTCTRL_DISABLE_AUTO, module, mask); | ||
116 | } | ||
117 | |||
118 | void omap3xxx_cm_clkdm_force_sleep(s16 module, u32 mask) | ||
119 | { | ||
120 | _write_clktrctrl(OMAP34XX_CLKSTCTRL_FORCE_SLEEP, module, mask); | ||
121 | } | ||
122 | |||
123 | void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask) | ||
124 | { | ||
125 | _write_clktrctrl(OMAP34XX_CLKSTCTRL_FORCE_WAKEUP, module, mask); | ||
126 | } | ||
127 | |||
128 | |||
129 | /* | ||
130 | * | ||
131 | */ | ||
132 | |||
65 | /** | 133 | /** |
66 | * omap2_cm_wait_idlest_ready - wait for a module to leave idle or standby | 134 | * omap2_cm_wait_idlest_ready - wait for a module to leave idle or standby |
67 | * @prcm_mod: PRCM module offset | 135 | * @prcm_mod: PRCM module offset |
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.h b/arch/arm/mach-omap2/cm2xxx_3xxx.h index ff24edf54d31..5e9ea5bd60b9 100644 --- a/arch/arm/mach-omap2/cm2xxx_3xxx.h +++ b/arch/arm/mach-omap2/cm2xxx_3xxx.h | |||
@@ -113,6 +113,15 @@ extern int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, | |||
113 | extern u32 omap2_cm_set_mod_reg_bits(u32 bits, s16 module, s16 idx); | 113 | extern u32 omap2_cm_set_mod_reg_bits(u32 bits, s16 module, s16 idx); |
114 | extern u32 omap2_cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx); | 114 | extern u32 omap2_cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx); |
115 | 115 | ||
116 | extern bool omap2_cm_is_clkdm_in_hwsup(s16 module, u32 mask); | ||
117 | extern void omap2xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask); | ||
118 | extern void omap2xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask); | ||
119 | |||
120 | extern void omap3xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask); | ||
121 | extern void omap3xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask); | ||
122 | extern void omap3xxx_cm_clkdm_force_sleep(s16 module, u32 mask); | ||
123 | extern void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask); | ||
124 | |||
116 | #endif | 125 | #endif |
117 | 126 | ||
118 | /* CM register bits shared between 24XX and 3430 */ | 127 | /* CM register bits shared between 24XX and 3430 */ |
diff --git a/arch/arm/plat-omap/include/plat/clockdomain.h b/arch/arm/plat-omap/include/plat/clockdomain.h index ec433c3aef68..e91ae92f217c 100644 --- a/arch/arm/plat-omap/include/plat/clockdomain.h +++ b/arch/arm/plat-omap/include/plat/clockdomain.h | |||
@@ -34,10 +34,6 @@ | |||
34 | #define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP) | 34 | #define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP) |
35 | #define CLKDM_CAN_HWSUP_SWSUP (CLKDM_CAN_SWSUP | CLKDM_CAN_HWSUP) | 35 | #define CLKDM_CAN_HWSUP_SWSUP (CLKDM_CAN_SWSUP | CLKDM_CAN_HWSUP) |
36 | 36 | ||
37 | /* OMAP24XX CM_CLKSTCTRL_*.AUTOSTATE_* register bit values */ | ||
38 | #define OMAP24XX_CLKSTCTRL_DISABLE_AUTO 0x0 | ||
39 | #define OMAP24XX_CLKSTCTRL_ENABLE_AUTO 0x1 | ||
40 | |||
41 | /** | 37 | /** |
42 | * struct clkdm_autodep - clkdm deps to add when entering/exiting hwsup mode | 38 | * struct clkdm_autodep - clkdm deps to add when entering/exiting hwsup mode |
43 | * @clkdm: clockdomain to add wkdep+sleepdep on - set name member only | 39 | * @clkdm: clockdomain to add wkdep+sleepdep on - set name member only |
@@ -110,7 +106,6 @@ struct clockdomain { | |||
110 | struct powerdomain *ptr; | 106 | struct powerdomain *ptr; |
111 | } pwrdm; | 107 | } pwrdm; |
112 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) | 108 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) |
113 | void __iomem *clkstctrl_reg; | ||
114 | const u16 clktrctrl_mask; | 109 | const u16 clktrctrl_mask; |
115 | #endif | 110 | #endif |
116 | const u8 flags; | 111 | const u8 flags; |