diff options
-rw-r--r-- | arch/arm/mach-omap2/clockdomain.c | 75 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clockdomains44xx_data.c | 121 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cm-regbits-34xx.h | 11 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cminst44xx.c | 105 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cminst44xx.h | 6 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/clockdomain.h | 20 |
6 files changed, 266 insertions, 72 deletions
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c index 8e3276bfed25..555a518836b9 100644 --- a/arch/arm/mach-omap2/clockdomain.c +++ b/arch/arm/mach-omap2/clockdomain.c | |||
@@ -29,6 +29,9 @@ | |||
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" | ||
33 | #include "cminst44xx.h" | ||
34 | #include "prcm44xx.h" | ||
32 | 35 | ||
33 | #include <plat/clock.h> | 36 | #include <plat/clock.h> |
34 | #include <plat/powerdomain.h> | 37 | #include <plat/powerdomain.h> |
@@ -247,13 +250,21 @@ static void _enable_hwsup(struct clockdomain *clkdm) | |||
247 | 250 | ||
248 | if (cpu_is_omap24xx()) | 251 | if (cpu_is_omap24xx()) |
249 | bits = OMAP24XX_CLKSTCTRL_ENABLE_AUTO; | 252 | bits = OMAP24XX_CLKSTCTRL_ENABLE_AUTO; |
250 | else if (cpu_is_omap34xx() || cpu_is_omap44xx()) | 253 | else if (cpu_is_omap34xx()) |
251 | bits = OMAP34XX_CLKSTCTRL_ENABLE_AUTO; | 254 | bits = OMAP34XX_CLKSTCTRL_ENABLE_AUTO; |
255 | else if (cpu_is_omap44xx()) | ||
256 | return omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition, | ||
257 | clkdm->cm_inst, | ||
258 | clkdm->clkdm_offs); | ||
252 | else | 259 | else |
253 | BUG(); | 260 | BUG(); |
254 | 261 | ||
255 | bits = bits << __ffs(clkdm->clktrctrl_mask); | 262 | bits = bits << __ffs(clkdm->clktrctrl_mask); |
256 | 263 | ||
264 | /* | ||
265 | * XXX clkstctrl_reg is known on OMAP2 - this clkdm | ||
266 | * field is not needed | ||
267 | */ | ||
257 | v = __raw_readl(clkdm->clkstctrl_reg); | 268 | v = __raw_readl(clkdm->clkstctrl_reg); |
258 | v &= ~(clkdm->clktrctrl_mask); | 269 | v &= ~(clkdm->clktrctrl_mask); |
259 | v |= bits; | 270 | v |= bits; |
@@ -275,21 +286,27 @@ static void _disable_hwsup(struct clockdomain *clkdm) | |||
275 | { | 286 | { |
276 | u32 bits, v; | 287 | u32 bits, v; |
277 | 288 | ||
278 | if (cpu_is_omap24xx()) { | 289 | if (cpu_is_omap24xx()) |
279 | bits = OMAP24XX_CLKSTCTRL_DISABLE_AUTO; | 290 | bits = OMAP24XX_CLKSTCTRL_DISABLE_AUTO; |
280 | } else if (cpu_is_omap34xx() || cpu_is_omap44xx()) { | 291 | else if (cpu_is_omap34xx()) |
281 | bits = OMAP34XX_CLKSTCTRL_DISABLE_AUTO; | 292 | bits = OMAP34XX_CLKSTCTRL_DISABLE_AUTO; |
282 | } else { | 293 | else if (cpu_is_omap44xx()) |
294 | return omap4_cminst_clkdm_disable_hwsup(clkdm->prcm_partition, | ||
295 | clkdm->cm_inst, | ||
296 | clkdm->clkdm_offs); | ||
297 | else | ||
283 | BUG(); | 298 | BUG(); |
284 | } | ||
285 | 299 | ||
286 | bits = bits << __ffs(clkdm->clktrctrl_mask); | 300 | bits = bits << __ffs(clkdm->clktrctrl_mask); |
287 | 301 | ||
302 | /* | ||
303 | * XXX clkstctrl_reg is known on OMAP2 - this clkdm | ||
304 | * field is not needed | ||
305 | */ | ||
288 | v = __raw_readl(clkdm->clkstctrl_reg); | 306 | v = __raw_readl(clkdm->clkstctrl_reg); |
289 | v &= ~(clkdm->clktrctrl_mask); | 307 | v &= ~(clkdm->clktrctrl_mask); |
290 | v |= bits; | 308 | v |= bits; |
291 | __raw_writel(v, clkdm->clkstctrl_reg); | 309 | __raw_writel(v, clkdm->clkstctrl_reg); |
292 | |||
293 | } | 310 | } |
294 | 311 | ||
295 | /* Public functions */ | 312 | /* Public functions */ |
@@ -727,14 +744,20 @@ int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm) | |||
727 | */ | 744 | */ |
728 | static int omap2_clkdm_clktrctrl_read(struct clockdomain *clkdm) | 745 | static int omap2_clkdm_clktrctrl_read(struct clockdomain *clkdm) |
729 | { | 746 | { |
730 | u32 v; | 747 | u32 v = 0; |
731 | 748 | ||
732 | if (!clkdm) | 749 | if (!clkdm) |
733 | return -EINVAL; | 750 | return -EINVAL; |
734 | 751 | ||
735 | v = __raw_readl(clkdm->clkstctrl_reg); | 752 | if (cpu_is_omap24xx() || cpu_is_omap34xx()) { |
736 | v &= clkdm->clktrctrl_mask; | 753 | v = __raw_readl(clkdm->clkstctrl_reg); |
737 | v >>= __ffs(clkdm->clktrctrl_mask); | 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 | } | ||
738 | 761 | ||
739 | return v; | 762 | return v; |
740 | } | 763 | } |
@@ -750,6 +773,8 @@ static int omap2_clkdm_clktrctrl_read(struct clockdomain *clkdm) | |||
750 | */ | 773 | */ |
751 | int omap2_clkdm_sleep(struct clockdomain *clkdm) | 774 | int omap2_clkdm_sleep(struct clockdomain *clkdm) |
752 | { | 775 | { |
776 | u32 bits, v; | ||
777 | |||
753 | if (!clkdm) | 778 | if (!clkdm) |
754 | return -EINVAL; | 779 | return -EINVAL; |
755 | 780 | ||
@@ -766,16 +791,22 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm) | |||
766 | omap2_cm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK, | 791 | omap2_cm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK, |
767 | clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); | 792 | clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); |
768 | 793 | ||
769 | } else if (cpu_is_omap34xx() || cpu_is_omap44xx()) { | 794 | } else if (cpu_is_omap34xx()) { |
770 | 795 | ||
771 | u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_SLEEP << | 796 | bits = (OMAP34XX_CLKSTCTRL_FORCE_SLEEP << |
772 | __ffs(clkdm->clktrctrl_mask)); | 797 | __ffs(clkdm->clktrctrl_mask)); |
773 | 798 | ||
774 | u32 v = __raw_readl(clkdm->clkstctrl_reg); | 799 | v = __raw_readl(clkdm->clkstctrl_reg); |
775 | v &= ~(clkdm->clktrctrl_mask); | 800 | v &= ~(clkdm->clktrctrl_mask); |
776 | v |= bits; | 801 | v |= bits; |
777 | __raw_writel(v, clkdm->clkstctrl_reg); | 802 | __raw_writel(v, clkdm->clkstctrl_reg); |
778 | 803 | ||
804 | } else if (cpu_is_omap44xx()) { | ||
805 | |||
806 | omap4_cminst_clkdm_force_sleep(clkdm->prcm_partition, | ||
807 | clkdm->cm_inst, | ||
808 | clkdm->clkdm_offs); | ||
809 | |||
779 | } else { | 810 | } else { |
780 | BUG(); | 811 | BUG(); |
781 | }; | 812 | }; |
@@ -794,6 +825,8 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm) | |||
794 | */ | 825 | */ |
795 | int omap2_clkdm_wakeup(struct clockdomain *clkdm) | 826 | int omap2_clkdm_wakeup(struct clockdomain *clkdm) |
796 | { | 827 | { |
828 | u32 bits, v; | ||
829 | |||
797 | if (!clkdm) | 830 | if (!clkdm) |
798 | return -EINVAL; | 831 | return -EINVAL; |
799 | 832 | ||
@@ -810,16 +843,22 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm) | |||
810 | omap2_cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE_MASK, | 843 | omap2_cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE_MASK, |
811 | clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); | 844 | clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); |
812 | 845 | ||
813 | } else if (cpu_is_omap34xx() || cpu_is_omap44xx()) { | 846 | } else if (cpu_is_omap34xx()) { |
814 | 847 | ||
815 | u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_WAKEUP << | 848 | bits = (OMAP34XX_CLKSTCTRL_FORCE_WAKEUP << |
816 | __ffs(clkdm->clktrctrl_mask)); | 849 | __ffs(clkdm->clktrctrl_mask)); |
817 | 850 | ||
818 | u32 v = __raw_readl(clkdm->clkstctrl_reg); | 851 | v = __raw_readl(clkdm->clkstctrl_reg); |
819 | v &= ~(clkdm->clktrctrl_mask); | 852 | v &= ~(clkdm->clktrctrl_mask); |
820 | v |= bits; | 853 | v |= bits; |
821 | __raw_writel(v, clkdm->clkstctrl_reg); | 854 | __raw_writel(v, clkdm->clkstctrl_reg); |
822 | 855 | ||
856 | } else if (cpu_is_omap44xx()) { | ||
857 | |||
858 | omap4_cminst_clkdm_force_wakeup(clkdm->prcm_partition, | ||
859 | clkdm->cm_inst, | ||
860 | clkdm->clkdm_offs); | ||
861 | |||
823 | } else { | 862 | } else { |
824 | BUG(); | 863 | BUG(); |
825 | }; | 864 | }; |
diff --git a/arch/arm/mach-omap2/clockdomains44xx_data.c b/arch/arm/mach-omap2/clockdomains44xx_data.c index 7fc81f651b5e..2d3d1ef23814 100644 --- a/arch/arm/mach-omap2/clockdomains44xx_data.c +++ b/arch/arm/mach-omap2/clockdomains44xx_data.c | |||
@@ -34,14 +34,16 @@ | |||
34 | #include "cm2_44xx.h" | 34 | #include "cm2_44xx.h" |
35 | #include "cm-regbits-44xx.h" | 35 | #include "cm-regbits-44xx.h" |
36 | #include "prm44xx.h" | 36 | #include "prm44xx.h" |
37 | #include "prcm44xx.h" | ||
37 | #include "prcm_mpu44xx.h" | 38 | #include "prcm_mpu44xx.h" |
38 | 39 | ||
39 | 40 | ||
40 | static struct clockdomain l4_cefuse_44xx_clkdm = { | 41 | static struct clockdomain l4_cefuse_44xx_clkdm = { |
41 | .name = "l4_cefuse_clkdm", | 42 | .name = "l4_cefuse_clkdm", |
42 | .pwrdm = { .name = "cefuse_pwrdm" }, | 43 | .pwrdm = { .name = "cefuse_pwrdm" }, |
43 | .clkstctrl_reg = OMAP4430_CM_CEFUSE_CLKSTCTRL, | 44 | .prcm_partition = OMAP4430_CM2_PARTITION, |
44 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 45 | .cm_inst = OMAP4430_CM2_CEFUSE_INST, |
46 | .clkdm_offs = OMAP4430_CM2_CEFUSE_CEFUSE_CDOFFS, | ||
45 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 47 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
46 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 48 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
47 | }; | 49 | }; |
@@ -49,8 +51,9 @@ static struct clockdomain l4_cefuse_44xx_clkdm = { | |||
49 | static struct clockdomain l4_cfg_44xx_clkdm = { | 51 | static struct clockdomain l4_cfg_44xx_clkdm = { |
50 | .name = "l4_cfg_clkdm", | 52 | .name = "l4_cfg_clkdm", |
51 | .pwrdm = { .name = "core_pwrdm" }, | 53 | .pwrdm = { .name = "core_pwrdm" }, |
52 | .clkstctrl_reg = OMAP4430_CM_L4CFG_CLKSTCTRL, | 54 | .prcm_partition = OMAP4430_CM2_PARTITION, |
53 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 55 | .cm_inst = OMAP4430_CM2_CORE_INST, |
56 | .clkdm_offs = OMAP4430_CM2_CORE_L4CFG_CDOFFS, | ||
54 | .flags = CLKDM_CAN_HWSUP, | 57 | .flags = CLKDM_CAN_HWSUP, |
55 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 58 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
56 | }; | 59 | }; |
@@ -58,8 +61,9 @@ static struct clockdomain l4_cfg_44xx_clkdm = { | |||
58 | static struct clockdomain tesla_44xx_clkdm = { | 61 | static struct clockdomain tesla_44xx_clkdm = { |
59 | .name = "tesla_clkdm", | 62 | .name = "tesla_clkdm", |
60 | .pwrdm = { .name = "tesla_pwrdm" }, | 63 | .pwrdm = { .name = "tesla_pwrdm" }, |
61 | .clkstctrl_reg = OMAP4430_CM_TESLA_CLKSTCTRL, | 64 | .prcm_partition = OMAP4430_CM1_PARTITION, |
62 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 65 | .cm_inst = OMAP4430_CM1_TESLA_INST, |
66 | .clkdm_offs = OMAP4430_CM1_TESLA_TESLA_CDOFFS, | ||
63 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 67 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
64 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 68 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
65 | }; | 69 | }; |
@@ -67,8 +71,9 @@ static struct clockdomain tesla_44xx_clkdm = { | |||
67 | static struct clockdomain l3_gfx_44xx_clkdm = { | 71 | static struct clockdomain l3_gfx_44xx_clkdm = { |
68 | .name = "l3_gfx_clkdm", | 72 | .name = "l3_gfx_clkdm", |
69 | .pwrdm = { .name = "gfx_pwrdm" }, | 73 | .pwrdm = { .name = "gfx_pwrdm" }, |
70 | .clkstctrl_reg = OMAP4430_CM_GFX_CLKSTCTRL, | 74 | .prcm_partition = OMAP4430_CM2_PARTITION, |
71 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 75 | .cm_inst = OMAP4430_CM2_GFX_INST, |
76 | .clkdm_offs = OMAP4430_CM2_GFX_GFX_CDOFFS, | ||
72 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 77 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
73 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 78 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
74 | }; | 79 | }; |
@@ -76,8 +81,9 @@ static struct clockdomain l3_gfx_44xx_clkdm = { | |||
76 | static struct clockdomain ivahd_44xx_clkdm = { | 81 | static struct clockdomain ivahd_44xx_clkdm = { |
77 | .name = "ivahd_clkdm", | 82 | .name = "ivahd_clkdm", |
78 | .pwrdm = { .name = "ivahd_pwrdm" }, | 83 | .pwrdm = { .name = "ivahd_pwrdm" }, |
79 | .clkstctrl_reg = OMAP4430_CM_IVAHD_CLKSTCTRL, | 84 | .prcm_partition = OMAP4430_CM2_PARTITION, |
80 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 85 | .cm_inst = OMAP4430_CM2_IVAHD_INST, |
86 | .clkdm_offs = OMAP4430_CM2_IVAHD_IVAHD_CDOFFS, | ||
81 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 87 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
82 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 88 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
83 | }; | 89 | }; |
@@ -85,8 +91,9 @@ static struct clockdomain ivahd_44xx_clkdm = { | |||
85 | static struct clockdomain l4_secure_44xx_clkdm = { | 91 | static struct clockdomain l4_secure_44xx_clkdm = { |
86 | .name = "l4_secure_clkdm", | 92 | .name = "l4_secure_clkdm", |
87 | .pwrdm = { .name = "l4per_pwrdm" }, | 93 | .pwrdm = { .name = "l4per_pwrdm" }, |
88 | .clkstctrl_reg = OMAP4430_CM_L4SEC_CLKSTCTRL, | 94 | .prcm_partition = OMAP4430_CM2_PARTITION, |
89 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 95 | .cm_inst = OMAP4430_CM2_L4PER_INST, |
96 | .clkdm_offs = OMAP4430_CM2_L4PER_L4SEC_CDOFFS, | ||
90 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 97 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
91 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 98 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
92 | }; | 99 | }; |
@@ -94,8 +101,9 @@ static struct clockdomain l4_secure_44xx_clkdm = { | |||
94 | static struct clockdomain l4_per_44xx_clkdm = { | 101 | static struct clockdomain l4_per_44xx_clkdm = { |
95 | .name = "l4_per_clkdm", | 102 | .name = "l4_per_clkdm", |
96 | .pwrdm = { .name = "l4per_pwrdm" }, | 103 | .pwrdm = { .name = "l4per_pwrdm" }, |
97 | .clkstctrl_reg = OMAP4430_CM_L4PER_CLKSTCTRL, | 104 | .prcm_partition = OMAP4430_CM2_PARTITION, |
98 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 105 | .cm_inst = OMAP4430_CM2_L4PER_INST, |
106 | .clkdm_offs = OMAP4430_CM2_L4PER_L4PER_CDOFFS, | ||
99 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 107 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
100 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 108 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
101 | }; | 109 | }; |
@@ -103,8 +111,9 @@ static struct clockdomain l4_per_44xx_clkdm = { | |||
103 | static struct clockdomain abe_44xx_clkdm = { | 111 | static struct clockdomain abe_44xx_clkdm = { |
104 | .name = "abe_clkdm", | 112 | .name = "abe_clkdm", |
105 | .pwrdm = { .name = "abe_pwrdm" }, | 113 | .pwrdm = { .name = "abe_pwrdm" }, |
106 | .clkstctrl_reg = OMAP4430_CM1_ABE_CLKSTCTRL, | 114 | .prcm_partition = OMAP4430_CM1_PARTITION, |
107 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 115 | .cm_inst = OMAP4430_CM1_ABE_INST, |
116 | .clkdm_offs = OMAP4430_CM1_ABE_ABE_CDOFFS, | ||
108 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 117 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
109 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 118 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
110 | }; | 119 | }; |
@@ -112,16 +121,18 @@ static struct clockdomain abe_44xx_clkdm = { | |||
112 | static struct clockdomain l3_instr_44xx_clkdm = { | 121 | static struct clockdomain l3_instr_44xx_clkdm = { |
113 | .name = "l3_instr_clkdm", | 122 | .name = "l3_instr_clkdm", |
114 | .pwrdm = { .name = "core_pwrdm" }, | 123 | .pwrdm = { .name = "core_pwrdm" }, |
115 | .clkstctrl_reg = OMAP4430_CM_L3INSTR_CLKSTCTRL, | 124 | .prcm_partition = OMAP4430_CM2_PARTITION, |
116 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 125 | .cm_inst = OMAP4430_CM2_CORE_INST, |
126 | .clkdm_offs = OMAP4430_CM2_CORE_L3INSTR_CDOFFS, | ||
117 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 127 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
118 | }; | 128 | }; |
119 | 129 | ||
120 | static struct clockdomain l3_init_44xx_clkdm = { | 130 | static struct clockdomain l3_init_44xx_clkdm = { |
121 | .name = "l3_init_clkdm", | 131 | .name = "l3_init_clkdm", |
122 | .pwrdm = { .name = "l3init_pwrdm" }, | 132 | .pwrdm = { .name = "l3init_pwrdm" }, |
123 | .clkstctrl_reg = OMAP4430_CM_L3INIT_CLKSTCTRL, | 133 | .prcm_partition = OMAP4430_CM2_PARTITION, |
124 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 134 | .cm_inst = OMAP4430_CM2_L3INIT_INST, |
135 | .clkdm_offs = OMAP4430_CM2_L3INIT_L3INIT_CDOFFS, | ||
125 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 136 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
126 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 137 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
127 | }; | 138 | }; |
@@ -129,8 +140,9 @@ static struct clockdomain l3_init_44xx_clkdm = { | |||
129 | static struct clockdomain mpuss_44xx_clkdm = { | 140 | static struct clockdomain mpuss_44xx_clkdm = { |
130 | .name = "mpuss_clkdm", | 141 | .name = "mpuss_clkdm", |
131 | .pwrdm = { .name = "mpu_pwrdm" }, | 142 | .pwrdm = { .name = "mpu_pwrdm" }, |
132 | .clkstctrl_reg = OMAP4430_CM_MPU_CLKSTCTRL, | 143 | .prcm_partition = OMAP4430_CM1_PARTITION, |
133 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 144 | .cm_inst = OMAP4430_CM1_MPU_INST, |
145 | .clkdm_offs = OMAP4430_CM1_MPU_MPU_CDOFFS, | ||
134 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 146 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
135 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 147 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
136 | }; | 148 | }; |
@@ -138,8 +150,9 @@ static struct clockdomain mpuss_44xx_clkdm = { | |||
138 | static struct clockdomain mpu0_44xx_clkdm = { | 150 | static struct clockdomain mpu0_44xx_clkdm = { |
139 | .name = "mpu0_clkdm", | 151 | .name = "mpu0_clkdm", |
140 | .pwrdm = { .name = "cpu0_pwrdm" }, | 152 | .pwrdm = { .name = "cpu0_pwrdm" }, |
141 | .clkstctrl_reg = OMAP4430_CM_CPU0_CLKSTCTRL, | 153 | .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, |
142 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 154 | .cm_inst = OMAP4430_PRCM_MPU_CPU0_INST, |
155 | .clkdm_offs = OMAP4430_PRCM_MPU_CPU0_MPU_CDOFFS, | ||
143 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 156 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
144 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 157 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
145 | }; | 158 | }; |
@@ -147,8 +160,9 @@ static struct clockdomain mpu0_44xx_clkdm = { | |||
147 | static struct clockdomain mpu1_44xx_clkdm = { | 160 | static struct clockdomain mpu1_44xx_clkdm = { |
148 | .name = "mpu1_clkdm", | 161 | .name = "mpu1_clkdm", |
149 | .pwrdm = { .name = "cpu1_pwrdm" }, | 162 | .pwrdm = { .name = "cpu1_pwrdm" }, |
150 | .clkstctrl_reg = OMAP4430_CM_CPU1_CLKSTCTRL, | 163 | .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, |
151 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 164 | .cm_inst = OMAP4430_PRCM_MPU_CPU1_INST, |
165 | .clkdm_offs = OMAP4430_PRCM_MPU_CPU1_MPU_CDOFFS, | ||
152 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 166 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
153 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 167 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
154 | }; | 168 | }; |
@@ -156,8 +170,9 @@ static struct clockdomain mpu1_44xx_clkdm = { | |||
156 | static struct clockdomain l3_emif_44xx_clkdm = { | 170 | static struct clockdomain l3_emif_44xx_clkdm = { |
157 | .name = "l3_emif_clkdm", | 171 | .name = "l3_emif_clkdm", |
158 | .pwrdm = { .name = "core_pwrdm" }, | 172 | .pwrdm = { .name = "core_pwrdm" }, |
159 | .clkstctrl_reg = OMAP4430_CM_MEMIF_CLKSTCTRL, | 173 | .prcm_partition = OMAP4430_CM2_PARTITION, |
160 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 174 | .cm_inst = OMAP4430_CM2_CORE_INST, |
175 | .clkdm_offs = OMAP4430_CM2_CORE_MEMIF_CDOFFS, | ||
161 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 176 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
162 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 177 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
163 | }; | 178 | }; |
@@ -165,8 +180,9 @@ static struct clockdomain l3_emif_44xx_clkdm = { | |||
165 | static struct clockdomain l4_ao_44xx_clkdm = { | 180 | static struct clockdomain l4_ao_44xx_clkdm = { |
166 | .name = "l4_ao_clkdm", | 181 | .name = "l4_ao_clkdm", |
167 | .pwrdm = { .name = "always_on_core_pwrdm" }, | 182 | .pwrdm = { .name = "always_on_core_pwrdm" }, |
168 | .clkstctrl_reg = OMAP4430_CM_ALWON_CLKSTCTRL, | 183 | .prcm_partition = OMAP4430_CM2_PARTITION, |
169 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 184 | .cm_inst = OMAP4430_CM2_ALWAYS_ON_INST, |
185 | .clkdm_offs = OMAP4430_CM2_ALWAYS_ON_ALWON_CDOFFS, | ||
170 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 186 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
171 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 187 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
172 | }; | 188 | }; |
@@ -174,8 +190,9 @@ static struct clockdomain l4_ao_44xx_clkdm = { | |||
174 | static struct clockdomain ducati_44xx_clkdm = { | 190 | static struct clockdomain ducati_44xx_clkdm = { |
175 | .name = "ducati_clkdm", | 191 | .name = "ducati_clkdm", |
176 | .pwrdm = { .name = "core_pwrdm" }, | 192 | .pwrdm = { .name = "core_pwrdm" }, |
177 | .clkstctrl_reg = OMAP4430_CM_DUCATI_CLKSTCTRL, | 193 | .prcm_partition = OMAP4430_CM2_PARTITION, |
178 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 194 | .cm_inst = OMAP4430_CM2_CORE_INST, |
195 | .clkdm_offs = OMAP4430_CM2_CORE_DUCATI_CDOFFS, | ||
179 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 196 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
180 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 197 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
181 | }; | 198 | }; |
@@ -183,8 +200,9 @@ static struct clockdomain ducati_44xx_clkdm = { | |||
183 | static struct clockdomain l3_2_44xx_clkdm = { | 200 | static struct clockdomain l3_2_44xx_clkdm = { |
184 | .name = "l3_2_clkdm", | 201 | .name = "l3_2_clkdm", |
185 | .pwrdm = { .name = "core_pwrdm" }, | 202 | .pwrdm = { .name = "core_pwrdm" }, |
186 | .clkstctrl_reg = OMAP4430_CM_L3_2_CLKSTCTRL, | 203 | .prcm_partition = OMAP4430_CM2_PARTITION, |
187 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 204 | .cm_inst = OMAP4430_CM2_CORE_INST, |
205 | .clkdm_offs = OMAP4430_CM2_CORE_L3_2_CDOFFS, | ||
188 | .flags = CLKDM_CAN_HWSUP, | 206 | .flags = CLKDM_CAN_HWSUP, |
189 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 207 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
190 | }; | 208 | }; |
@@ -192,8 +210,9 @@ static struct clockdomain l3_2_44xx_clkdm = { | |||
192 | static struct clockdomain l3_1_44xx_clkdm = { | 210 | static struct clockdomain l3_1_44xx_clkdm = { |
193 | .name = "l3_1_clkdm", | 211 | .name = "l3_1_clkdm", |
194 | .pwrdm = { .name = "core_pwrdm" }, | 212 | .pwrdm = { .name = "core_pwrdm" }, |
195 | .clkstctrl_reg = OMAP4430_CM_L3_1_CLKSTCTRL, | 213 | .prcm_partition = OMAP4430_CM2_PARTITION, |
196 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 214 | .cm_inst = OMAP4430_CM2_CORE_INST, |
215 | .clkdm_offs = OMAP4430_CM2_CORE_L3_1_CDOFFS, | ||
197 | .flags = CLKDM_CAN_HWSUP, | 216 | .flags = CLKDM_CAN_HWSUP, |
198 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 217 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
199 | }; | 218 | }; |
@@ -201,8 +220,9 @@ static struct clockdomain l3_1_44xx_clkdm = { | |||
201 | static struct clockdomain l3_d2d_44xx_clkdm = { | 220 | static struct clockdomain l3_d2d_44xx_clkdm = { |
202 | .name = "l3_d2d_clkdm", | 221 | .name = "l3_d2d_clkdm", |
203 | .pwrdm = { .name = "core_pwrdm" }, | 222 | .pwrdm = { .name = "core_pwrdm" }, |
204 | .clkstctrl_reg = OMAP4430_CM_D2D_CLKSTCTRL, | 223 | .prcm_partition = OMAP4430_CM2_PARTITION, |
205 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 224 | .cm_inst = OMAP4430_CM2_CORE_INST, |
225 | .clkdm_offs = OMAP4430_CM2_CORE_D2D_CDOFFS, | ||
206 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 226 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
207 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 227 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
208 | }; | 228 | }; |
@@ -210,8 +230,9 @@ static struct clockdomain l3_d2d_44xx_clkdm = { | |||
210 | static struct clockdomain iss_44xx_clkdm = { | 230 | static struct clockdomain iss_44xx_clkdm = { |
211 | .name = "iss_clkdm", | 231 | .name = "iss_clkdm", |
212 | .pwrdm = { .name = "cam_pwrdm" }, | 232 | .pwrdm = { .name = "cam_pwrdm" }, |
213 | .clkstctrl_reg = OMAP4430_CM_CAM_CLKSTCTRL, | 233 | .prcm_partition = OMAP4430_CM2_PARTITION, |
214 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 234 | .cm_inst = OMAP4430_CM2_CAM_INST, |
235 | .clkdm_offs = OMAP4430_CM2_CAM_CAM_CDOFFS, | ||
215 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 236 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
216 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 237 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
217 | }; | 238 | }; |
@@ -219,8 +240,9 @@ static struct clockdomain iss_44xx_clkdm = { | |||
219 | static struct clockdomain l3_dss_44xx_clkdm = { | 240 | static struct clockdomain l3_dss_44xx_clkdm = { |
220 | .name = "l3_dss_clkdm", | 241 | .name = "l3_dss_clkdm", |
221 | .pwrdm = { .name = "dss_pwrdm" }, | 242 | .pwrdm = { .name = "dss_pwrdm" }, |
222 | .clkstctrl_reg = OMAP4430_CM_DSS_CLKSTCTRL, | 243 | .prcm_partition = OMAP4430_CM2_PARTITION, |
223 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 244 | .cm_inst = OMAP4430_CM2_DSS_INST, |
245 | .clkdm_offs = OMAP4430_CM2_DSS_DSS_CDOFFS, | ||
224 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 246 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
225 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 247 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
226 | }; | 248 | }; |
@@ -228,8 +250,9 @@ static struct clockdomain l3_dss_44xx_clkdm = { | |||
228 | static struct clockdomain l4_wkup_44xx_clkdm = { | 250 | static struct clockdomain l4_wkup_44xx_clkdm = { |
229 | .name = "l4_wkup_clkdm", | 251 | .name = "l4_wkup_clkdm", |
230 | .pwrdm = { .name = "wkup_pwrdm" }, | 252 | .pwrdm = { .name = "wkup_pwrdm" }, |
231 | .clkstctrl_reg = OMAP4430_CM_WKUP_CLKSTCTRL, | 253 | .prcm_partition = OMAP4430_PRM_PARTITION, |
232 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 254 | .cm_inst = OMAP4430_PRM_WKUP_CM_INST, |
255 | .clkdm_offs = OMAP4430_PRM_WKUP_CM_WKUP_CDOFFS, | ||
233 | .flags = CLKDM_CAN_HWSUP, | 256 | .flags = CLKDM_CAN_HWSUP, |
234 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 257 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
235 | }; | 258 | }; |
@@ -237,8 +260,9 @@ static struct clockdomain l4_wkup_44xx_clkdm = { | |||
237 | static struct clockdomain emu_sys_44xx_clkdm = { | 260 | static struct clockdomain emu_sys_44xx_clkdm = { |
238 | .name = "emu_sys_clkdm", | 261 | .name = "emu_sys_clkdm", |
239 | .pwrdm = { .name = "emu_pwrdm" }, | 262 | .pwrdm = { .name = "emu_pwrdm" }, |
240 | .clkstctrl_reg = OMAP4430_CM_EMU_CLKSTCTRL, | 263 | .prcm_partition = OMAP4430_PRM_PARTITION, |
241 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 264 | .cm_inst = OMAP4430_PRM_EMU_CM_INST, |
265 | .clkdm_offs = OMAP4430_PRM_EMU_CM_EMU_CDOFFS, | ||
242 | .flags = CLKDM_CAN_HWSUP, | 266 | .flags = CLKDM_CAN_HWSUP, |
243 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 267 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
244 | }; | 268 | }; |
@@ -246,8 +270,9 @@ static struct clockdomain emu_sys_44xx_clkdm = { | |||
246 | static struct clockdomain l3_dma_44xx_clkdm = { | 270 | static struct clockdomain l3_dma_44xx_clkdm = { |
247 | .name = "l3_dma_clkdm", | 271 | .name = "l3_dma_clkdm", |
248 | .pwrdm = { .name = "core_pwrdm" }, | 272 | .pwrdm = { .name = "core_pwrdm" }, |
249 | .clkstctrl_reg = OMAP4430_CM_SDMA_CLKSTCTRL, | 273 | .prcm_partition = OMAP4430_CM2_PARTITION, |
250 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | 274 | .cm_inst = OMAP4430_CM2_CORE_INST, |
275 | .clkdm_offs = OMAP4430_CM2_CORE_SDMA_CDOFFS, | ||
251 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | 276 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, |
252 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | 277 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), |
253 | }; | 278 | }; |
diff --git a/arch/arm/mach-omap2/cm-regbits-34xx.h b/arch/arm/mach-omap2/cm-regbits-34xx.h index cd9ff8b6a109..b91275908f33 100644 --- a/arch/arm/mach-omap2/cm-regbits-34xx.h +++ b/arch/arm/mach-omap2/cm-regbits-34xx.h | |||
@@ -798,4 +798,15 @@ | |||
798 | #define OMAP3430ES2_CLKACTIVITY_USBHOST_SHIFT 0 | 798 | #define OMAP3430ES2_CLKACTIVITY_USBHOST_SHIFT 0 |
799 | #define OMAP3430ES2_CLKACTIVITY_USBHOST_MASK (1 << 0) | 799 | #define OMAP3430ES2_CLKACTIVITY_USBHOST_MASK (1 << 0) |
800 | 800 | ||
801 | /* | ||
802 | * | ||
803 | */ | ||
804 | |||
805 | /* OMAP3XXX CM_CLKSTCTRL_*.CLKTRCTRL_* register bit values */ | ||
806 | #define OMAP34XX_CLKSTCTRL_DISABLE_AUTO 0x0 | ||
807 | #define OMAP34XX_CLKSTCTRL_FORCE_SLEEP 0x1 | ||
808 | #define OMAP34XX_CLKSTCTRL_FORCE_WAKEUP 0x2 | ||
809 | #define OMAP34XX_CLKSTCTRL_ENABLE_AUTO 0x3 | ||
810 | |||
811 | |||
801 | #endif | 812 | #endif |
diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c index c13613b513b5..c04bbbea17a5 100644 --- a/arch/arm/mach-omap2/cminst44xx.c +++ b/arch/arm/mach-omap2/cminst44xx.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include "cm2_44xx.h" | 26 | #include "cm2_44xx.h" |
27 | #include "cm44xx.h" | 27 | #include "cm44xx.h" |
28 | #include "cminst44xx.h" | 28 | #include "cminst44xx.h" |
29 | #include "cm-regbits-34xx.h" | ||
29 | #include "cm-regbits-44xx.h" | 30 | #include "cm-regbits-44xx.h" |
30 | #include "prcm44xx.h" | 31 | #include "prcm44xx.h" |
31 | #include "prm44xx.h" | 32 | #include "prm44xx.h" |
@@ -72,6 +73,110 @@ u32 omap4_cminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part, s16 inst, | |||
72 | return v; | 73 | return v; |
73 | } | 74 | } |
74 | 75 | ||
76 | /* | ||
77 | * | ||
78 | */ | ||
79 | |||
80 | /** | ||
81 | * _clktrctrl_write - write @c to a CM_CLKSTCTRL.CLKTRCTRL register bitfield | ||
82 | * @c: CLKTRCTRL register bitfield (LSB = bit 0, i.e., unshifted) | ||
83 | * @part: PRCM partition ID that the CM_CLKSTCTRL register exists in | ||
84 | * @inst: CM instance register offset (*_INST macro) | ||
85 | * @cdoffs: Clockdomain register offset (*_CDOFFS macro) | ||
86 | * | ||
87 | * @c must be the unshifted value for CLKTRCTRL - i.e., this function | ||
88 | * will handle the shift itself. | ||
89 | */ | ||
90 | static void _clktrctrl_write(u8 c, u8 part, s16 inst, u16 cdoffs) | ||
91 | { | ||
92 | u32 v; | ||
93 | |||
94 | v = omap4_cminst_read_inst_reg(part, inst, cdoffs + OMAP4_CM_CLKSTCTRL); | ||
95 | v &= ~OMAP4430_CLKTRCTRL_MASK; | ||
96 | v |= c << OMAP4430_CLKTRCTRL_SHIFT; | ||
97 | omap4_cminst_write_inst_reg(v, part, inst, cdoffs + OMAP4_CM_CLKSTCTRL); | ||
98 | } | ||
99 | |||
100 | /** | ||
101 | * omap4_cminst_is_clkdm_in_hwsup - is a clockdomain in hwsup idle mode? | ||
102 | * @part: PRCM partition ID that the CM_CLKSTCTRL register exists in | ||
103 | * @inst: CM instance register offset (*_INST macro) | ||
104 | * @cdoffs: Clockdomain register offset (*_CDOFFS macro) | ||
105 | * | ||
106 | * Returns true if the clockdomain referred to by (@part, @inst, @cdoffs) | ||
107 | * is in hardware-supervised idle mode, or 0 otherwise. | ||
108 | */ | ||
109 | bool omap4_cminst_is_clkdm_in_hwsup(u8 part, s16 inst, u16 cdoffs) | ||
110 | { | ||
111 | u32 v; | ||
112 | |||
113 | v = omap4_cminst_read_inst_reg(part, inst, cdoffs + OMAP4_CM_CLKSTCTRL); | ||
114 | v &= OMAP4430_CLKTRCTRL_MASK; | ||
115 | v >>= OMAP4430_CLKTRCTRL_SHIFT; | ||
116 | |||
117 | return (v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) ? true : false; | ||
118 | } | ||
119 | |||
120 | /** | ||
121 | * omap4_cminst_clkdm_enable_hwsup - put a clockdomain in hwsup-idle mode | ||
122 | * @part: PRCM partition ID that the clockdomain registers exist in | ||
123 | * @inst: CM instance register offset (*_INST macro) | ||
124 | * @cdoffs: Clockdomain register offset (*_CDOFFS macro) | ||
125 | * | ||
126 | * Put a clockdomain referred to by (@part, @inst, @cdoffs) into | ||
127 | * hardware-supervised idle mode. No return value. | ||
128 | */ | ||
129 | void omap4_cminst_clkdm_enable_hwsup(u8 part, s16 inst, u16 cdoffs) | ||
130 | { | ||
131 | _clktrctrl_write(OMAP34XX_CLKSTCTRL_ENABLE_AUTO, part, inst, cdoffs); | ||
132 | } | ||
133 | |||
134 | /** | ||
135 | * omap4_cminst_clkdm_disable_hwsup - put a clockdomain in swsup-idle mode | ||
136 | * @part: PRCM partition ID that the clockdomain registers exist in | ||
137 | * @inst: CM instance register offset (*_INST macro) | ||
138 | * @cdoffs: Clockdomain register offset (*_CDOFFS macro) | ||
139 | * | ||
140 | * Put a clockdomain referred to by (@part, @inst, @cdoffs) into | ||
141 | * software-supervised idle mode, i.e., controlled manually by the | ||
142 | * Linux OMAP clockdomain code. No return value. | ||
143 | */ | ||
144 | void omap4_cminst_clkdm_disable_hwsup(u8 part, s16 inst, u16 cdoffs) | ||
145 | { | ||
146 | _clktrctrl_write(OMAP34XX_CLKSTCTRL_DISABLE_AUTO, part, inst, cdoffs); | ||
147 | } | ||
148 | |||
149 | /** | ||
150 | * omap4_cminst_clkdm_force_sleep - try to put a clockdomain into idle | ||
151 | * @part: PRCM partition ID that the clockdomain registers exist in | ||
152 | * @inst: CM instance register offset (*_INST macro) | ||
153 | * @cdoffs: Clockdomain register offset (*_CDOFFS macro) | ||
154 | * | ||
155 | * Put a clockdomain referred to by (@part, @inst, @cdoffs) into idle | ||
156 | * No return value. | ||
157 | */ | ||
158 | void omap4_cminst_clkdm_force_sleep(u8 part, s16 inst, u16 cdoffs) | ||
159 | { | ||
160 | _clktrctrl_write(OMAP34XX_CLKSTCTRL_FORCE_SLEEP, part, inst, cdoffs); | ||
161 | } | ||
162 | |||
163 | /** | ||
164 | * omap4_cminst_clkdm_force_sleep - try to take a clockdomain out of idle | ||
165 | * @part: PRCM partition ID that the clockdomain registers exist in | ||
166 | * @inst: CM instance register offset (*_INST macro) | ||
167 | * @cdoffs: Clockdomain register offset (*_CDOFFS macro) | ||
168 | * | ||
169 | * Take a clockdomain referred to by (@part, @inst, @cdoffs) out of idle, | ||
170 | * waking it up. No return value. | ||
171 | */ | ||
172 | void omap4_cminst_clkdm_force_wakeup(u8 part, s16 inst, u16 cdoffs) | ||
173 | { | ||
174 | _clktrctrl_write(OMAP34XX_CLKSTCTRL_FORCE_WAKEUP, part, inst, cdoffs); | ||
175 | } | ||
176 | |||
177 | /* | ||
178 | * | ||
179 | */ | ||
75 | 180 | ||
76 | /** | 181 | /** |
77 | * omap4_cm_wait_module_ready - wait for a module to be in 'func' state | 182 | * omap4_cm_wait_module_ready - wait for a module to be in 'func' state |
diff --git a/arch/arm/mach-omap2/cminst44xx.h b/arch/arm/mach-omap2/cminst44xx.h index 6baa4c7b14f1..a6abd0a8cb82 100644 --- a/arch/arm/mach-omap2/cminst44xx.h +++ b/arch/arm/mach-omap2/cminst44xx.h | |||
@@ -11,6 +11,12 @@ | |||
11 | #ifndef __ARCH_ASM_MACH_OMAP2_CMINST44XX_H | 11 | #ifndef __ARCH_ASM_MACH_OMAP2_CMINST44XX_H |
12 | #define __ARCH_ASM_MACH_OMAP2_CMINST44XX_H | 12 | #define __ARCH_ASM_MACH_OMAP2_CMINST44XX_H |
13 | 13 | ||
14 | extern bool omap4_cminst_is_clkdm_in_hwsup(u8 part, s16 inst, u16 cdoffs); | ||
15 | extern void omap4_cminst_clkdm_enable_hwsup(u8 part, s16 inst, u16 cdoffs); | ||
16 | extern void omap4_cminst_clkdm_disable_hwsup(u8 part, s16 inst, u16 cdoffs); | ||
17 | extern void omap4_cminst_clkdm_force_sleep(u8 part, s16 inst, u16 cdoffs); | ||
18 | extern void omap4_cminst_clkdm_force_wakeup(u8 part, s16 inst, u16 cdoffs); | ||
19 | |||
14 | /* | 20 | /* |
15 | * In an ideal world, we would not export these low-level functions, | 21 | * In an ideal world, we would not export these low-level functions, |
16 | * but this will probably take some time to fix properly | 22 | * but this will probably take some time to fix properly |
diff --git a/arch/arm/plat-omap/include/plat/clockdomain.h b/arch/arm/plat-omap/include/plat/clockdomain.h index a5f8579f7aa9..ec433c3aef68 100644 --- a/arch/arm/plat-omap/include/plat/clockdomain.h +++ b/arch/arm/plat-omap/include/plat/clockdomain.h | |||
@@ -38,12 +38,6 @@ | |||
38 | #define OMAP24XX_CLKSTCTRL_DISABLE_AUTO 0x0 | 38 | #define OMAP24XX_CLKSTCTRL_DISABLE_AUTO 0x0 |
39 | #define OMAP24XX_CLKSTCTRL_ENABLE_AUTO 0x1 | 39 | #define OMAP24XX_CLKSTCTRL_ENABLE_AUTO 0x1 |
40 | 40 | ||
41 | /* OMAP3XXX CM_CLKSTCTRL_*.CLKTRCTRL_* register bit values */ | ||
42 | #define OMAP34XX_CLKSTCTRL_DISABLE_AUTO 0x0 | ||
43 | #define OMAP34XX_CLKSTCTRL_FORCE_SLEEP 0x1 | ||
44 | #define OMAP34XX_CLKSTCTRL_FORCE_WAKEUP 0x2 | ||
45 | #define OMAP34XX_CLKSTCTRL_ENABLE_AUTO 0x3 | ||
46 | |||
47 | /** | 41 | /** |
48 | * struct clkdm_autodep - clkdm deps to add when entering/exiting hwsup mode | 42 | * struct clkdm_autodep - clkdm deps to add when entering/exiting hwsup mode |
49 | * @clkdm: clockdomain to add wkdep+sleepdep on - set name member only | 43 | * @clkdm: clockdomain to add wkdep+sleepdep on - set name member only |
@@ -94,11 +88,20 @@ struct clkdm_dep { | |||
94 | * @clktrctrl_mask: CLKTRCTRL/AUTOSTATE field mask in CM_CLKSTCTRL reg | 88 | * @clktrctrl_mask: CLKTRCTRL/AUTOSTATE field mask in CM_CLKSTCTRL reg |
95 | * @flags: Clockdomain capability flags | 89 | * @flags: Clockdomain capability flags |
96 | * @dep_bit: Bit shift of this clockdomain's PM_WKDEP/CM_SLEEPDEP bit | 90 | * @dep_bit: Bit shift of this clockdomain's PM_WKDEP/CM_SLEEPDEP bit |
91 | * @prcm_partition: (OMAP4 only) PRCM partition ID for this clkdm's registers | ||
92 | * @cm_inst: (OMAP4 only) CM instance register offset | ||
93 | * @clkdm_offs: (OMAP4 only) CM clockdomain register offset | ||
97 | * @wkdep_srcs: Clockdomains that can be told to wake this powerdomain up | 94 | * @wkdep_srcs: Clockdomains that can be told to wake this powerdomain up |
98 | * @sleepdep_srcs: Clockdomains that can be told to keep this clkdm from inact | 95 | * @sleepdep_srcs: Clockdomains that can be told to keep this clkdm from inact |
99 | * @omap_chip: OMAP chip types that this clockdomain is valid on | 96 | * @omap_chip: OMAP chip types that this clockdomain is valid on |
100 | * @usecount: Usecount tracking | 97 | * @usecount: Usecount tracking |
101 | * @node: list_head to link all clockdomains together | 98 | * @node: list_head to link all clockdomains together |
99 | * | ||
100 | * @prcm_partition should be a macro from mach-omap2/prcm44xx.h (OMAP4 only) | ||
101 | * @cm_inst should be a macro ending in _INST from the OMAP4 CM instance | ||
102 | * definitions (OMAP4 only) | ||
103 | * @clkdm_offs should be a macro ending in _CDOFFS from the OMAP4 CM instance | ||
104 | * definitions (OMAP4 only) | ||
102 | */ | 105 | */ |
103 | struct clockdomain { | 106 | struct clockdomain { |
104 | const char *name; | 107 | const char *name; |
@@ -106,10 +109,15 @@ struct clockdomain { | |||
106 | const char *name; | 109 | const char *name; |
107 | struct powerdomain *ptr; | 110 | struct powerdomain *ptr; |
108 | } pwrdm; | 111 | } pwrdm; |
112 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) | ||
109 | void __iomem *clkstctrl_reg; | 113 | void __iomem *clkstctrl_reg; |
110 | const u16 clktrctrl_mask; | 114 | const u16 clktrctrl_mask; |
115 | #endif | ||
111 | const u8 flags; | 116 | const u8 flags; |
112 | const u8 dep_bit; | 117 | const u8 dep_bit; |
118 | const u8 prcm_partition; | ||
119 | const s16 cm_inst; | ||
120 | const u16 clkdm_offs; | ||
113 | struct clkdm_dep *wkdep_srcs; | 121 | struct clkdm_dep *wkdep_srcs; |
114 | struct clkdm_dep *sleepdep_srcs; | 122 | struct clkdm_dep *sleepdep_srcs; |
115 | const struct omap_chip_id omap_chip; | 123 | const struct omap_chip_id omap_chip; |