aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/clockdomain.c12
-rw-r--r--arch/arm/mach-omap2/clockdomains.h133
-rw-r--r--arch/arm/mach-omap2/cm.h5
-rw-r--r--arch/arm/mach-omap2/pm-debug.c4
-rw-r--r--arch/arm/mach-omap2/prcm.c43
-rw-r--r--arch/arm/plat-omap/include/plat/clockdomain.h3
6 files changed, 142 insertions, 58 deletions
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
index 50c8cd7c7126..52885ac5bb5d 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -163,7 +163,7 @@ static void _omap2_clkdm_set_hwsup(struct clockdomain *clkdm, int enable)
163 163
164 cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, 164 cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask,
165 v << __ffs(clkdm->clktrctrl_mask), 165 v << __ffs(clkdm->clktrctrl_mask),
166 clkdm->pwrdm.ptr->prcm_offs, CM_CLKSTCTRL); 166 clkdm->pwrdm.ptr->prcm_offs, OMAP2_CM_CLKSTCTRL);
167} 167}
168 168
169static struct clockdomain *_clkdm_lookup(const char *name) 169static struct clockdomain *_clkdm_lookup(const char *name)
@@ -371,7 +371,7 @@ struct powerdomain *clkdm_get_pwrdm(struct clockdomain *clkdm)
371 * @clk: struct clk * of a clockdomain 371 * @clk: struct clk * of a clockdomain
372 * 372 *
373 * Return the clockdomain's current state transition mode from the 373 * Return the clockdomain's current state transition mode from the
374 * corresponding domain CM_CLKSTCTRL register. Returns -EINVAL if clk 374 * corresponding domain OMAP2_CM_CLKSTCTRL register. Returns -EINVAL if clk
375 * is NULL or the current mode upon success. 375 * is NULL or the current mode upon success.
376 */ 376 */
377static int omap2_clkdm_clktrctrl_read(struct clockdomain *clkdm) 377static int omap2_clkdm_clktrctrl_read(struct clockdomain *clkdm)
@@ -381,7 +381,7 @@ static int omap2_clkdm_clktrctrl_read(struct clockdomain *clkdm)
381 if (!clkdm) 381 if (!clkdm)
382 return -EINVAL; 382 return -EINVAL;
383 383
384 v = cm_read_mod_reg(clkdm->pwrdm.ptr->prcm_offs, CM_CLKSTCTRL); 384 v = cm_read_mod_reg(clkdm->pwrdm.ptr->prcm_offs, OMAP2_CM_CLKSTCTRL);
385 v &= clkdm->clktrctrl_mask; 385 v &= clkdm->clktrctrl_mask;
386 v >>= __ffs(clkdm->clktrctrl_mask); 386 v >>= __ffs(clkdm->clktrctrl_mask);
387 387
@@ -421,7 +421,8 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm)
421 __ffs(clkdm->clktrctrl_mask)); 421 __ffs(clkdm->clktrctrl_mask));
422 422
423 cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, v, 423 cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, v,
424 clkdm->pwrdm.ptr->prcm_offs, CM_CLKSTCTRL); 424 clkdm->pwrdm.ptr->prcm_offs,
425 OMAP2_CM_CLKSTCTRL);
425 426
426 } else { 427 } else {
427 BUG(); 428 BUG();
@@ -463,7 +464,8 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)
463 __ffs(clkdm->clktrctrl_mask)); 464 __ffs(clkdm->clktrctrl_mask));
464 465
465 cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, v, 466 cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, v,
466 clkdm->pwrdm.ptr->prcm_offs, CM_CLKSTCTRL); 467 clkdm->pwrdm.ptr->prcm_offs,
468 OMAP2_CM_CLKSTCTRL);
467 469
468 } else { 470 } else {
469 BUG(); 471 BUG();
diff --git a/arch/arm/mach-omap2/clockdomains.h b/arch/arm/mach-omap2/clockdomains.h
index c4ee0761d908..0e6114058db5 100644
--- a/arch/arm/mach-omap2/clockdomains.h
+++ b/arch/arm/mach-omap2/clockdomains.h
@@ -11,6 +11,8 @@
11#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H 11#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H
12 12
13#include <plat/clockdomain.h> 13#include <plat/clockdomain.h>
14#include "cm.h"
15#include "prm44xx.h"
14 16
15/* 17/*
16 * OMAP2/3-common clockdomains 18 * OMAP2/3-common clockdomains
@@ -50,6 +52,7 @@ static struct clockdomain mpu_2420_clkdm = {
50 .name = "mpu_clkdm", 52 .name = "mpu_clkdm",
51 .pwrdm = { .name = "mpu_pwrdm" }, 53 .pwrdm = { .name = "mpu_pwrdm" },
52 .flags = CLKDM_CAN_HWSUP, 54 .flags = CLKDM_CAN_HWSUP,
55 .clkstctrl_reg = OMAP2420_CM_REGADDR(MPU_MOD, OMAP2_CM_CLKSTCTRL),
53 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, 56 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
54 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 57 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
55}; 58};
@@ -58,11 +61,59 @@ static struct clockdomain iva1_2420_clkdm = {
58 .name = "iva1_clkdm", 61 .name = "iva1_clkdm",
59 .pwrdm = { .name = "dsp_pwrdm" }, 62 .pwrdm = { .name = "dsp_pwrdm" },
60 .flags = CLKDM_CAN_HWSUP_SWSUP, 63 .flags = CLKDM_CAN_HWSUP_SWSUP,
64 .clkstctrl_reg = OMAP2420_CM_REGADDR(OMAP24XX_DSP_MOD,
65 OMAP2_CM_CLKSTCTRL),
61 .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK, 66 .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK,
62 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 67 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
63}; 68};
64 69
65#endif /* CONFIG_ARCH_OMAP2420 */ 70static struct clockdomain dsp_2420_clkdm = {
71 .name = "dsp_clkdm",
72 .pwrdm = { .name = "dsp_pwrdm" },
73 .flags = CLKDM_CAN_HWSUP_SWSUP,
74 .clkstctrl_reg = OMAP2420_CM_REGADDR(OMAP24XX_DSP_MOD,
75 OMAP2_CM_CLKSTCTRL),
76 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK,
77 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
78};
79
80static struct clockdomain gfx_2420_clkdm = {
81 .name = "gfx_clkdm",
82 .pwrdm = { .name = "gfx_pwrdm" },
83 .flags = CLKDM_CAN_HWSUP_SWSUP,
84 .clkstctrl_reg = OMAP2420_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL),
85 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
86 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
87};
88
89static struct clockdomain core_l3_2420_clkdm = {
90 .name = "core_l3_clkdm",
91 .pwrdm = { .name = "core_pwrdm" },
92 .flags = CLKDM_CAN_HWSUP,
93 .clkstctrl_reg = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
94 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
95 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
96};
97
98static struct clockdomain core_l4_2420_clkdm = {
99 .name = "core_l4_clkdm",
100 .pwrdm = { .name = "core_pwrdm" },
101 .flags = CLKDM_CAN_HWSUP,
102 .clkstctrl_reg = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
103 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
104 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
105};
106
107static struct clockdomain dss_2420_clkdm = {
108 .name = "dss_clkdm",
109 .pwrdm = { .name = "core_pwrdm" },
110 .flags = CLKDM_CAN_HWSUP,
111 .clkstctrl_reg = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
112 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK,
113 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
114};
115
116#endif /* CONFIG_ARCH_OMAP2420 */
66 117
67 118
68/* 119/*
@@ -75,6 +126,8 @@ static struct clockdomain mpu_2430_clkdm = {
75 .name = "mpu_clkdm", 126 .name = "mpu_clkdm",
76 .pwrdm = { .name = "mpu_pwrdm" }, 127 .pwrdm = { .name = "mpu_pwrdm" },
77 .flags = CLKDM_CAN_HWSUP_SWSUP, 128 .flags = CLKDM_CAN_HWSUP_SWSUP,
129 .clkstctrl_reg = OMAP2430_CM_REGADDR(MPU_MOD,
130 OMAP2_CM_CLKSTCTRL),
78 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, 131 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
79 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 132 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
80}; 133};
@@ -83,60 +136,59 @@ static struct clockdomain mdm_clkdm = {
83 .name = "mdm_clkdm", 136 .name = "mdm_clkdm",
84 .pwrdm = { .name = "mdm_pwrdm" }, 137 .pwrdm = { .name = "mdm_pwrdm" },
85 .flags = CLKDM_CAN_HWSUP_SWSUP, 138 .flags = CLKDM_CAN_HWSUP_SWSUP,
139 .clkstctrl_reg = OMAP2430_CM_REGADDR(OMAP2430_MDM_MOD,
140 OMAP2_CM_CLKSTCTRL),
86 .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK, 141 .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK,
87 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 142 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
88}; 143};
89 144
90#endif /* CONFIG_ARCH_OMAP2430 */ 145static struct clockdomain dsp_2430_clkdm = {
91
92
93/*
94 * 24XX-only clockdomains
95 */
96
97#if defined(CONFIG_ARCH_OMAP24XX)
98
99static struct clockdomain dsp_clkdm = {
100 .name = "dsp_clkdm", 146 .name = "dsp_clkdm",
101 .pwrdm = { .name = "dsp_pwrdm" }, 147 .pwrdm = { .name = "dsp_pwrdm" },
102 .flags = CLKDM_CAN_HWSUP_SWSUP, 148 .flags = CLKDM_CAN_HWSUP_SWSUP,
149 .clkstctrl_reg = OMAP2430_CM_REGADDR(OMAP24XX_DSP_MOD,
150 OMAP2_CM_CLKSTCTRL),
103 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, 151 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK,
104 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), 152 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
105}; 153};
106 154
107static struct clockdomain gfx_24xx_clkdm = { 155static struct clockdomain gfx_2430_clkdm = {
108 .name = "gfx_clkdm", 156 .name = "gfx_clkdm",
109 .pwrdm = { .name = "gfx_pwrdm" }, 157 .pwrdm = { .name = "gfx_pwrdm" },
110 .flags = CLKDM_CAN_HWSUP_SWSUP, 158 .flags = CLKDM_CAN_HWSUP_SWSUP,
159 .clkstctrl_reg = OMAP2430_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL),
111 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, 160 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
112 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), 161 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
113}; 162};
114 163
115static struct clockdomain core_l3_24xx_clkdm = { 164static struct clockdomain core_l3_2430_clkdm = {
116 .name = "core_l3_clkdm", 165 .name = "core_l3_clkdm",
117 .pwrdm = { .name = "core_pwrdm" }, 166 .pwrdm = { .name = "core_pwrdm" },
118 .flags = CLKDM_CAN_HWSUP, 167 .flags = CLKDM_CAN_HWSUP,
168 .clkstctrl_reg = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
119 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, 169 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
120 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), 170 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
121}; 171};
122 172
123static struct clockdomain core_l4_24xx_clkdm = { 173static struct clockdomain core_l4_2430_clkdm = {
124 .name = "core_l4_clkdm", 174 .name = "core_l4_clkdm",
125 .pwrdm = { .name = "core_pwrdm" }, 175 .pwrdm = { .name = "core_pwrdm" },
126 .flags = CLKDM_CAN_HWSUP, 176 .flags = CLKDM_CAN_HWSUP,
177 .clkstctrl_reg = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
127 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, 178 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
128 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), 179 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
129}; 180};
130 181
131static struct clockdomain dss_24xx_clkdm = { 182static struct clockdomain dss_2430_clkdm = {
132 .name = "dss_clkdm", 183 .name = "dss_clkdm",
133 .pwrdm = { .name = "core_pwrdm" }, 184 .pwrdm = { .name = "core_pwrdm" },
134 .flags = CLKDM_CAN_HWSUP, 185 .flags = CLKDM_CAN_HWSUP,
186 .clkstctrl_reg = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
135 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, 187 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK,
136 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), 188 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
137}; 189};
138 190
139#endif /* CONFIG_ARCH_OMAP24XX */ 191#endif /* CONFIG_ARCH_OMAP2430 */
140 192
141 193
142/* 194/*
@@ -149,6 +201,7 @@ static struct clockdomain mpu_34xx_clkdm = {
149 .name = "mpu_clkdm", 201 .name = "mpu_clkdm",
150 .pwrdm = { .name = "mpu_pwrdm" }, 202 .pwrdm = { .name = "mpu_pwrdm" },
151 .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP, 203 .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP,
204 .clkstctrl_reg = OMAP34XX_CM_REGADDR(MPU_MOD, OMAP2_CM_CLKSTCTRL),
152 .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK, 205 .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK,
153 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 206 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
154}; 207};
@@ -157,6 +210,8 @@ static struct clockdomain neon_clkdm = {
157 .name = "neon_clkdm", 210 .name = "neon_clkdm",
158 .pwrdm = { .name = "neon_pwrdm" }, 211 .pwrdm = { .name = "neon_pwrdm" },
159 .flags = CLKDM_CAN_HWSUP_SWSUP, 212 .flags = CLKDM_CAN_HWSUP_SWSUP,
213 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_NEON_MOD,
214 OMAP2_CM_CLKSTCTRL),
160 .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK, 215 .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK,
161 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 216 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
162}; 217};
@@ -165,6 +220,8 @@ static struct clockdomain iva2_clkdm = {
165 .name = "iva2_clkdm", 220 .name = "iva2_clkdm",
166 .pwrdm = { .name = "iva2_pwrdm" }, 221 .pwrdm = { .name = "iva2_pwrdm" },
167 .flags = CLKDM_CAN_HWSUP_SWSUP, 222 .flags = CLKDM_CAN_HWSUP_SWSUP,
223 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_IVA2_MOD,
224 OMAP2_CM_CLKSTCTRL),
168 .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK, 225 .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK,
169 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 226 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
170}; 227};
@@ -173,6 +230,7 @@ static struct clockdomain gfx_3430es1_clkdm = {
173 .name = "gfx_clkdm", 230 .name = "gfx_clkdm",
174 .pwrdm = { .name = "gfx_pwrdm" }, 231 .pwrdm = { .name = "gfx_pwrdm" },
175 .flags = CLKDM_CAN_HWSUP_SWSUP, 232 .flags = CLKDM_CAN_HWSUP_SWSUP,
233 .clkstctrl_reg = OMAP34XX_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL),
176 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK, 234 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK,
177 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1), 235 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1),
178}; 236};
@@ -181,6 +239,8 @@ static struct clockdomain sgx_clkdm = {
181 .name = "sgx_clkdm", 239 .name = "sgx_clkdm",
182 .pwrdm = { .name = "sgx_pwrdm" }, 240 .pwrdm = { .name = "sgx_pwrdm" },
183 .flags = CLKDM_CAN_HWSUP_SWSUP, 241 .flags = CLKDM_CAN_HWSUP_SWSUP,
242 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430ES2_SGX_MOD,
243 OMAP2_CM_CLKSTCTRL),
184 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK, 244 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK,
185 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), 245 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
186}; 246};
@@ -196,6 +256,7 @@ static struct clockdomain d2d_clkdm = {
196 .name = "d2d_clkdm", 256 .name = "d2d_clkdm",
197 .pwrdm = { .name = "core_pwrdm" }, 257 .pwrdm = { .name = "core_pwrdm" },
198 .flags = CLKDM_CAN_HWSUP_SWSUP, 258 .flags = CLKDM_CAN_HWSUP_SWSUP,
259 .clkstctrl_reg = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
199 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK, 260 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK,
200 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 261 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
201}; 262};
@@ -204,6 +265,7 @@ static struct clockdomain core_l3_34xx_clkdm = {
204 .name = "core_l3_clkdm", 265 .name = "core_l3_clkdm",
205 .pwrdm = { .name = "core_pwrdm" }, 266 .pwrdm = { .name = "core_pwrdm" },
206 .flags = CLKDM_CAN_HWSUP, 267 .flags = CLKDM_CAN_HWSUP,
268 .clkstctrl_reg = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
207 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK, 269 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK,
208 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 270 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
209}; 271};
@@ -212,6 +274,7 @@ static struct clockdomain core_l4_34xx_clkdm = {
212 .name = "core_l4_clkdm", 274 .name = "core_l4_clkdm",
213 .pwrdm = { .name = "core_pwrdm" }, 275 .pwrdm = { .name = "core_pwrdm" },
214 .flags = CLKDM_CAN_HWSUP, 276 .flags = CLKDM_CAN_HWSUP,
277 .clkstctrl_reg = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
215 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK, 278 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK,
216 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 279 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
217}; 280};
@@ -220,6 +283,8 @@ static struct clockdomain dss_34xx_clkdm = {
220 .name = "dss_clkdm", 283 .name = "dss_clkdm",
221 .pwrdm = { .name = "dss_pwrdm" }, 284 .pwrdm = { .name = "dss_pwrdm" },
222 .flags = CLKDM_CAN_HWSUP_SWSUP, 285 .flags = CLKDM_CAN_HWSUP_SWSUP,
286 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_DSS_MOD,
287 OMAP2_CM_CLKSTCTRL),
223 .clktrctrl_mask = OMAP3430_CLKTRCTRL_DSS_MASK, 288 .clktrctrl_mask = OMAP3430_CLKTRCTRL_DSS_MASK,
224 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 289 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
225}; 290};
@@ -228,6 +293,8 @@ static struct clockdomain cam_clkdm = {
228 .name = "cam_clkdm", 293 .name = "cam_clkdm",
229 .pwrdm = { .name = "cam_pwrdm" }, 294 .pwrdm = { .name = "cam_pwrdm" },
230 .flags = CLKDM_CAN_HWSUP_SWSUP, 295 .flags = CLKDM_CAN_HWSUP_SWSUP,
296 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_CAM_MOD,
297 OMAP2_CM_CLKSTCTRL),
231 .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK, 298 .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK,
232 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 299 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
233}; 300};
@@ -236,6 +303,8 @@ static struct clockdomain usbhost_clkdm = {
236 .name = "usbhost_clkdm", 303 .name = "usbhost_clkdm",
237 .pwrdm = { .name = "usbhost_pwrdm" }, 304 .pwrdm = { .name = "usbhost_pwrdm" },
238 .flags = CLKDM_CAN_HWSUP_SWSUP, 305 .flags = CLKDM_CAN_HWSUP_SWSUP,
306 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430ES2_USBHOST_MOD,
307 OMAP2_CM_CLKSTCTRL),
239 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK, 308 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK,
240 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), 309 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
241}; 310};
@@ -244,6 +313,8 @@ static struct clockdomain per_clkdm = {
244 .name = "per_clkdm", 313 .name = "per_clkdm",
245 .pwrdm = { .name = "per_pwrdm" }, 314 .pwrdm = { .name = "per_pwrdm" },
246 .flags = CLKDM_CAN_HWSUP_SWSUP, 315 .flags = CLKDM_CAN_HWSUP_SWSUP,
316 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_PER_MOD,
317 OMAP2_CM_CLKSTCTRL),
247 .clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK, 318 .clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK,
248 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 319 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
249}; 320};
@@ -256,6 +327,8 @@ static struct clockdomain emu_clkdm = {
256 .name = "emu_clkdm", 327 .name = "emu_clkdm",
257 .pwrdm = { .name = "emu_pwrdm" }, 328 .pwrdm = { .name = "emu_pwrdm" },
258 .flags = /* CLKDM_CAN_ENABLE_AUTO | */CLKDM_CAN_SWSUP, 329 .flags = /* CLKDM_CAN_ENABLE_AUTO | */CLKDM_CAN_SWSUP,
330 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_EMU_MOD,
331 OMAP2_CM_CLKSTCTRL),
259 .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK, 332 .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK,
260 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 333 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
261}; 334};
@@ -323,19 +396,21 @@ static struct clockdomain *clockdomains_omap[] = {
323#ifdef CONFIG_ARCH_OMAP2420 396#ifdef CONFIG_ARCH_OMAP2420
324 &mpu_2420_clkdm, 397 &mpu_2420_clkdm,
325 &iva1_2420_clkdm, 398 &iva1_2420_clkdm,
399 &dsp_2420_clkdm,
400 &gfx_2420_clkdm,
401 &core_l3_2420_clkdm,
402 &core_l4_2420_clkdm,
403 &dss_2420_clkdm,
326#endif 404#endif
327 405
328#ifdef CONFIG_ARCH_OMAP2430 406#ifdef CONFIG_ARCH_OMAP2430
329 &mpu_2430_clkdm, 407 &mpu_2430_clkdm,
330 &mdm_clkdm, 408 &mdm_clkdm,
331#endif 409 &dsp_2430_clkdm,
332 410 &gfx_2430_clkdm,
333#ifdef CONFIG_ARCH_OMAP24XX 411 &core_l3_2430_clkdm,
334 &dsp_clkdm, 412 &core_l4_2430_clkdm,
335 &gfx_24xx_clkdm, 413 &dss_2430_clkdm,
336 &core_l3_24xx_clkdm,
337 &core_l4_24xx_clkdm,
338 &dss_24xx_clkdm,
339#endif 414#endif
340 415
341#ifdef CONFIG_ARCH_OMAP34XX 416#ifdef CONFIG_ARCH_OMAP34XX
diff --git a/arch/arm/mach-omap2/cm.h b/arch/arm/mach-omap2/cm.h
index 90a4086fbdf4..4e4ac8ccd7f5 100644
--- a/arch/arm/mach-omap2/cm.h
+++ b/arch/arm/mach-omap2/cm.h
@@ -67,7 +67,8 @@
67#define CM_CLKSEL 0x0040 67#define CM_CLKSEL 0x0040
68#define CM_CLKSEL1 CM_CLKSEL 68#define CM_CLKSEL1 CM_CLKSEL
69#define CM_CLKSEL2 0x0044 69#define CM_CLKSEL2 0x0044
70#define CM_CLKSTCTRL 0x0048 70#define OMAP2_CM_CLKSTCTRL 0x0048
71#define OMAP4_CM_CLKSTCTRL 0x0000
71 72
72 73
73/* Architecture-specific registers */ 74/* Architecture-specific registers */
@@ -88,7 +89,7 @@
88#define OMAP3430_CM_CLKSEL1_PLL CM_CLKSEL 89#define OMAP3430_CM_CLKSEL1_PLL CM_CLKSEL
89#define OMAP3430_CM_CLKSEL2_PLL CM_CLKSEL2 90#define OMAP3430_CM_CLKSEL2_PLL CM_CLKSEL2
90#define OMAP3430_CM_SLEEPDEP CM_CLKSEL2 91#define OMAP3430_CM_SLEEPDEP CM_CLKSEL2
91#define OMAP3430_CM_CLKSEL3 CM_CLKSTCTRL 92#define OMAP3430_CM_CLKSEL3 OMAP2_CM_CLKSTCTRL
92#define OMAP3430_CM_CLKSTST 0x004c 93#define OMAP3430_CM_CLKSTST 0x004c
93#define OMAP3430ES2_CM_CLKSEL4 0x004c 94#define OMAP3430ES2_CM_CLKSEL4 0x004c
94#define OMAP3430ES2_CM_CLKSEL5 0x0050 95#define OMAP3430ES2_CM_CLKSEL5 0x0050
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index 03dc845c82cb..5b6ae1e88e01 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -67,7 +67,7 @@ void omap2_pm_dump(int mode, int resume, unsigned int us)
67#if 0 67#if 0
68 /* MPU */ 68 /* MPU */
69 DUMP_PRM_MOD_REG(OCP_MOD, OMAP2_PRM_IRQENABLE_MPU_OFFSET); 69 DUMP_PRM_MOD_REG(OCP_MOD, OMAP2_PRM_IRQENABLE_MPU_OFFSET);
70 DUMP_CM_MOD_REG(MPU_MOD, CM_CLKSTCTRL); 70 DUMP_CM_MOD_REG(MPU_MOD, OMAP2_CM_CLKSTCTRL);
71 DUMP_PRM_MOD_REG(MPU_MOD, OMAP2_PM_PWSTCTRL); 71 DUMP_PRM_MOD_REG(MPU_MOD, OMAP2_PM_PWSTCTRL);
72 DUMP_PRM_MOD_REG(MPU_MOD, OMAP2_PM_PWSTST); 72 DUMP_PRM_MOD_REG(MPU_MOD, OMAP2_PM_PWSTST);
73 DUMP_PRM_MOD_REG(MPU_MOD, PM_WKDEP); 73 DUMP_PRM_MOD_REG(MPU_MOD, PM_WKDEP);
@@ -103,7 +103,7 @@ void omap2_pm_dump(int mode, int resume, unsigned int us)
103 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_IDLEST); 103 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_IDLEST);
104 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_AUTOIDLE); 104 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_AUTOIDLE);
105 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_CLKSEL); 105 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_CLKSEL);
106 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_CLKSTCTRL); 106 DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_CM_CLKSTCTRL);
107 DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_RM_RSTCTRL); 107 DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_RM_RSTCTRL);
108 DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_RM_RSTST); 108 DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_RM_RSTST);
109 DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_PM_PWSTCTRL); 109 DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_PM_PWSTCTRL);
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
index b4ba14974b37..82ad8f8ad83a 100644
--- a/arch/arm/mach-omap2/prcm.c
+++ b/arch/arm/mach-omap2/prcm.c
@@ -291,7 +291,7 @@ void omap3_prcm_save_context(void)
291 prcm_context.emu_cm_clksel = 291 prcm_context.emu_cm_clksel =
292 cm_read_mod_reg(OMAP3430_EMU_MOD, CM_CLKSEL1); 292 cm_read_mod_reg(OMAP3430_EMU_MOD, CM_CLKSEL1);
293 prcm_context.emu_cm_clkstctrl = 293 prcm_context.emu_cm_clkstctrl =
294 cm_read_mod_reg(OMAP3430_EMU_MOD, CM_CLKSTCTRL); 294 cm_read_mod_reg(OMAP3430_EMU_MOD, OMAP2_CM_CLKSTCTRL);
295 prcm_context.pll_cm_autoidle2 = 295 prcm_context.pll_cm_autoidle2 =
296 cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE2); 296 cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE2);
297 prcm_context.pll_cm_clksel4 = 297 prcm_context.pll_cm_clksel4 =
@@ -344,23 +344,25 @@ void omap3_prcm_save_context(void)
344 prcm_context.mpu_cm_autoidle2 = 344 prcm_context.mpu_cm_autoidle2 =
345 cm_read_mod_reg(MPU_MOD, CM_AUTOIDLE2); 345 cm_read_mod_reg(MPU_MOD, CM_AUTOIDLE2);
346 prcm_context.iva2_cm_clkstctrl = 346 prcm_context.iva2_cm_clkstctrl =
347 cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSTCTRL); 347 cm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP2_CM_CLKSTCTRL);
348 prcm_context.mpu_cm_clkstctrl = 348 prcm_context.mpu_cm_clkstctrl =
349 cm_read_mod_reg(MPU_MOD, CM_CLKSTCTRL); 349 cm_read_mod_reg(MPU_MOD, OMAP2_CM_CLKSTCTRL);
350 prcm_context.core_cm_clkstctrl = 350 prcm_context.core_cm_clkstctrl =
351 cm_read_mod_reg(CORE_MOD, CM_CLKSTCTRL); 351 cm_read_mod_reg(CORE_MOD, OMAP2_CM_CLKSTCTRL);
352 prcm_context.sgx_cm_clkstctrl = 352 prcm_context.sgx_cm_clkstctrl =
353 cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_CLKSTCTRL); 353 cm_read_mod_reg(OMAP3430ES2_SGX_MOD,
354 OMAP2_CM_CLKSTCTRL);
354 prcm_context.dss_cm_clkstctrl = 355 prcm_context.dss_cm_clkstctrl =
355 cm_read_mod_reg(OMAP3430_DSS_MOD, CM_CLKSTCTRL); 356 cm_read_mod_reg(OMAP3430_DSS_MOD, OMAP2_CM_CLKSTCTRL);
356 prcm_context.cam_cm_clkstctrl = 357 prcm_context.cam_cm_clkstctrl =
357 cm_read_mod_reg(OMAP3430_CAM_MOD, CM_CLKSTCTRL); 358 cm_read_mod_reg(OMAP3430_CAM_MOD, OMAP2_CM_CLKSTCTRL);
358 prcm_context.per_cm_clkstctrl = 359 prcm_context.per_cm_clkstctrl =
359 cm_read_mod_reg(OMAP3430_PER_MOD, CM_CLKSTCTRL); 360 cm_read_mod_reg(OMAP3430_PER_MOD, OMAP2_CM_CLKSTCTRL);
360 prcm_context.neon_cm_clkstctrl = 361 prcm_context.neon_cm_clkstctrl =
361 cm_read_mod_reg(OMAP3430_NEON_MOD, CM_CLKSTCTRL); 362 cm_read_mod_reg(OMAP3430_NEON_MOD, OMAP2_CM_CLKSTCTRL);
362 prcm_context.usbhost_cm_clkstctrl = 363 prcm_context.usbhost_cm_clkstctrl =
363 cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_CLKSTCTRL); 364 cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD,
365 OMAP2_CM_CLKSTCTRL);
364 prcm_context.core_cm_autoidle1 = 366 prcm_context.core_cm_autoidle1 =
365 cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE1); 367 cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE1);
366 prcm_context.core_cm_autoidle2 = 368 prcm_context.core_cm_autoidle2 =
@@ -443,7 +445,7 @@ void omap3_prcm_restore_context(void)
443 cm_write_mod_reg(prcm_context.emu_cm_clksel, OMAP3430_EMU_MOD, 445 cm_write_mod_reg(prcm_context.emu_cm_clksel, OMAP3430_EMU_MOD,
444 CM_CLKSEL1); 446 CM_CLKSEL1);
445 cm_write_mod_reg(prcm_context.emu_cm_clkstctrl, OMAP3430_EMU_MOD, 447 cm_write_mod_reg(prcm_context.emu_cm_clkstctrl, OMAP3430_EMU_MOD,
446 CM_CLKSTCTRL); 448 OMAP2_CM_CLKSTCTRL);
447 cm_write_mod_reg(prcm_context.pll_cm_autoidle2, PLL_MOD, 449 cm_write_mod_reg(prcm_context.pll_cm_autoidle2, PLL_MOD,
448 CM_AUTOIDLE2); 450 CM_AUTOIDLE2);
449 cm_write_mod_reg(prcm_context.pll_cm_clksel4, PLL_MOD, 451 cm_write_mod_reg(prcm_context.pll_cm_clksel4, PLL_MOD,
@@ -489,22 +491,23 @@ void omap3_prcm_restore_context(void)
489 CM_AUTOIDLE2); 491 CM_AUTOIDLE2);
490 cm_write_mod_reg(prcm_context.mpu_cm_autoidle2, MPU_MOD, CM_AUTOIDLE2); 492 cm_write_mod_reg(prcm_context.mpu_cm_autoidle2, MPU_MOD, CM_AUTOIDLE2);
491 cm_write_mod_reg(prcm_context.iva2_cm_clkstctrl, OMAP3430_IVA2_MOD, 493 cm_write_mod_reg(prcm_context.iva2_cm_clkstctrl, OMAP3430_IVA2_MOD,
492 CM_CLKSTCTRL); 494 OMAP2_CM_CLKSTCTRL);
493 cm_write_mod_reg(prcm_context.mpu_cm_clkstctrl, MPU_MOD, CM_CLKSTCTRL); 495 cm_write_mod_reg(prcm_context.mpu_cm_clkstctrl, MPU_MOD,
496 OMAP2_CM_CLKSTCTRL);
494 cm_write_mod_reg(prcm_context.core_cm_clkstctrl, CORE_MOD, 497 cm_write_mod_reg(prcm_context.core_cm_clkstctrl, CORE_MOD,
495 CM_CLKSTCTRL); 498 OMAP2_CM_CLKSTCTRL);
496 cm_write_mod_reg(prcm_context.sgx_cm_clkstctrl, OMAP3430ES2_SGX_MOD, 499 cm_write_mod_reg(prcm_context.sgx_cm_clkstctrl, OMAP3430ES2_SGX_MOD,
497 CM_CLKSTCTRL); 500 OMAP2_CM_CLKSTCTRL);
498 cm_write_mod_reg(prcm_context.dss_cm_clkstctrl, OMAP3430_DSS_MOD, 501 cm_write_mod_reg(prcm_context.dss_cm_clkstctrl, OMAP3430_DSS_MOD,
499 CM_CLKSTCTRL); 502 OMAP2_CM_CLKSTCTRL);
500 cm_write_mod_reg(prcm_context.cam_cm_clkstctrl, OMAP3430_CAM_MOD, 503 cm_write_mod_reg(prcm_context.cam_cm_clkstctrl, OMAP3430_CAM_MOD,
501 CM_CLKSTCTRL); 504 OMAP2_CM_CLKSTCTRL);
502 cm_write_mod_reg(prcm_context.per_cm_clkstctrl, OMAP3430_PER_MOD, 505 cm_write_mod_reg(prcm_context.per_cm_clkstctrl, OMAP3430_PER_MOD,
503 CM_CLKSTCTRL); 506 OMAP2_CM_CLKSTCTRL);
504 cm_write_mod_reg(prcm_context.neon_cm_clkstctrl, OMAP3430_NEON_MOD, 507 cm_write_mod_reg(prcm_context.neon_cm_clkstctrl, OMAP3430_NEON_MOD,
505 CM_CLKSTCTRL); 508 OMAP2_CM_CLKSTCTRL);
506 cm_write_mod_reg(prcm_context.usbhost_cm_clkstctrl, 509 cm_write_mod_reg(prcm_context.usbhost_cm_clkstctrl,
507 OMAP3430ES2_USBHOST_MOD, CM_CLKSTCTRL); 510 OMAP3430ES2_USBHOST_MOD, OMAP2_CM_CLKSTCTRL);
508 cm_write_mod_reg(prcm_context.core_cm_autoidle1, CORE_MOD, 511 cm_write_mod_reg(prcm_context.core_cm_autoidle1, CORE_MOD,
509 CM_AUTOIDLE1); 512 CM_AUTOIDLE1);
510 cm_write_mod_reg(prcm_context.core_cm_autoidle2, CORE_MOD, 513 cm_write_mod_reg(prcm_context.core_cm_autoidle2, CORE_MOD,
diff --git a/arch/arm/plat-omap/include/plat/clockdomain.h b/arch/arm/plat-omap/include/plat/clockdomain.h
index eb734826e64e..4806e2c52c11 100644
--- a/arch/arm/plat-omap/include/plat/clockdomain.h
+++ b/arch/arm/plat-omap/include/plat/clockdomain.h
@@ -74,6 +74,9 @@ struct clockdomain {
74 struct powerdomain *ptr; 74 struct powerdomain *ptr;
75 } pwrdm; 75 } pwrdm;
76 76
77 /* CLKSTCTRL reg for the given clock domain*/
78 void __iomem *clkstctrl_reg;
79
77 /* CLKTRCTRL/AUTOSTATE field mask in CM_CLKSTCTRL reg */ 80 /* CLKTRCTRL/AUTOSTATE field mask in CM_CLKSTCTRL reg */
78 const u16 clktrctrl_mask; 81 const u16 clktrctrl_mask;
79 82