aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Hilman <khilman@ti.com>2011-03-29 18:14:38 -0400
committerKevin Hilman <khilman@ti.com>2011-09-15 15:08:56 -0400
commit08d1c9a3e2dc7a285db7c689c42963d0f5271c1f (patch)
tree233910c2fc9df488c03d1e1b1f1a09eb72b73648
parent5892bb1fc6430d086f5c2a4216f9ed00070e31ad (diff)
OMAP3+: VC: move on/onlp/ret/off command configuration into common init
Configuring the on/onlp/ret/off command values is common to OMAP3 & 4. Move from OMAP3-only init into common VC init. Signed-off-by: Kevin Hilman <khilman@ti.com>
-rw-r--r--arch/arm/mach-omap2/vc.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c
index f78e62abe720..72c9cb64a42b 100644
--- a/arch/arm/mach-omap2/vc.c
+++ b/arch/arm/mach-omap2/vc.c
@@ -157,26 +157,11 @@ static void __init omap3_vfsm_init(struct voltagedomain *voltdm)
157 157
158static void __init omap3_vc_init_channel(struct voltagedomain *voltdm) 158static void __init omap3_vc_init_channel(struct voltagedomain *voltdm)
159{ 159{
160 struct omap_vc_channel *vc = voltdm->vc;
161 struct omap_vdd_info *vdd = voltdm->vdd;
162 static bool is_initialized; 160 static bool is_initialized;
163 u8 on_vsel, onlp_vsel, ret_vsel, off_vsel;
164 u32 vc_val;
165 161
166 if (is_initialized) 162 if (is_initialized)
167 return; 163 return;
168 164
169 /* Set up the on, inactive, retention and off voltage */
170 on_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->on_volt);
171 onlp_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->onlp_volt);
172 ret_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->ret_volt);
173 off_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->off_volt);
174 vc_val = ((on_vsel << vc->common->cmd_on_shift) |
175 (onlp_vsel << vc->common->cmd_onlp_shift) |
176 (ret_vsel << vc->common->cmd_ret_shift) |
177 (off_vsel << vc->common->cmd_off_shift));
178 voltdm->write(vc_val, vc->cmdval_reg);
179
180 /* 165 /*
181 * Generic VC parameters init 166 * Generic VC parameters init
182 * XXX This data should be abstracted out 167 * XXX This data should be abstracted out
@@ -201,8 +186,6 @@ static void __init omap4_vc_init_channel(struct voltagedomain *voltdm)
201 if (is_initialized) 186 if (is_initialized)
202 return; 187 return;
203 188
204 /* TODO: Configure setup times and CMD_VAL values*/
205
206 /* 189 /*
207 * Generic VC parameters init 190 * Generic VC parameters init
208 * XXX This data should be abstracted out 191 * XXX This data should be abstracted out
@@ -223,6 +206,8 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm)
223{ 206{
224 struct omap_vc_channel *vc = voltdm->vc; 207 struct omap_vc_channel *vc = voltdm->vc;
225 struct omap_vdd_info *vdd = voltdm->vdd; 208 struct omap_vdd_info *vdd = voltdm->vdd;
209 u8 on_vsel, onlp_vsel, ret_vsel, off_vsel;
210 u32 val;
226 211
227 if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) { 212 if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) {
228 pr_err("%s: PMIC info requried to configure vc for" 213 pr_err("%s: PMIC info requried to configure vc for"
@@ -259,6 +244,17 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm)
259 vc->cmd_reg_addr << __ffs(vc->smps_cmdra_mask), 244 vc->cmd_reg_addr << __ffs(vc->smps_cmdra_mask),
260 vc->common->smps_cmdra_reg); 245 vc->common->smps_cmdra_reg);
261 246
247 /* Set up the on, inactive, retention and off voltage */
248 on_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->on_volt);
249 onlp_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->onlp_volt);
250 ret_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->ret_volt);
251 off_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->off_volt);
252 val = ((on_vsel << vc->common->cmd_on_shift) |
253 (onlp_vsel << vc->common->cmd_onlp_shift) |
254 (ret_vsel << vc->common->cmd_ret_shift) |
255 (off_vsel << vc->common->cmd_off_shift));
256 voltdm->write(val, vc->cmdval_reg);
257
262 /* Configure the setup times */ 258 /* Configure the setup times */
263 voltdm->rmw(voltdm->vfsm->voltsetup_mask, 259 voltdm->rmw(voltdm->vfsm->voltsetup_mask,
264 vc->setup_time << __ffs(voltdm->vfsm->voltsetup_mask), 260 vc->setup_time << __ffs(voltdm->vfsm->voltsetup_mask),