Skip to content

Commit cd9a0b6

Browse files
committed
Merge branch 'next/pm' of git://git.linaro.org/people/arnd/arm-soc
* 'next/pm' of git://git.linaro.org/people/arnd/arm-soc: (66 commits) ARM: CSR: PM: use outer_resume to resume L2 cache ARM: CSR: call l2x0_of_init to init L2 cache of SiRFprimaII ARM: OMAP: voltage: voltage layer present, even when CONFIG_PM=n ARM: CSR: PM: add sleep entry for SiRFprimaII ARM: CSR: PM: save/restore irq status in suspend cycle ARM: CSR: PM: save/restore timer status in suspend cycle OMAP4: PM: TWL6030: add cmd register OMAP4: PM: TWL6030: fix ON/RET/OFF voltages OMAP4: PM: TWL6030: address 0V conversions OMAP4: PM: TWL6030: fix uv to voltage for >0x39 OMAP4: PM: TWL6030: fix voltage conversion formula omap: voltage: add a stub header file for external/regulator use OMAP2+: VC: more registers are per-channel starting with OMAP5 OMAP3+: voltage: update nominal voltage in voltdm_scale() not VC post-scale OMAP3+: voltage: rename omap_voltage_get_nom_volt -> voltdm_get_voltage OMAP3+: voltdm: final removal of omap_vdd_info OMAP3+: voltage: move/rename curr_volt from vdd_info into struct voltagedomain OMAP3+: voltage: rename scale and reset functions using voltdm_ prefix OMAP3+: VP: combine setting init voltage into common function OMAP3+: VP: remove unused omap_vp_get_curr_volt() ... Fix up trivial conflict in arch/arm/mach-prima2/l2x0.c (code removal vs edit)
2 parents ac5761a + 090ad10 commit cd9a0b6

44 files changed

Lines changed: 2097 additions & 1325 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/arm/boot/dts/prima2-cb.dts‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,12 @@
3939
ranges = <0x40000000 0x40000000 0x80000000>;
4040

4141
l2-cache-controller@80040000 {
42-
compatible = "arm,pl310-cache";
42+
compatible = "arm,pl310-cache", "sirf,prima2-pl310-cache";
4343
reg = <0x80040000 0x1000>;
4444
interrupts = <59>;
45+
arm,tag-latency = <1 1 1>;
46+
arm,data-latency = <1 1 1>;
47+
arm,filter-ranges = <0 0x40000000>;
4548
};
4649

4750
intc: interrupt-controller@80020000 {
@@ -67,6 +70,11 @@
6770
compatible = "sirf,prima2-rstc";
6871
reg = <0x88010000 0x1000>;
6972
};
73+
74+
rsc-controller@88020000 {
75+
compatible = "sirf,prima2-rsc";
76+
reg = <0x88020000 0x1000>;
77+
};
7078
};
7179

7280
mem-iobg {
@@ -274,7 +282,7 @@
274282
gpio: gpio-controller@b0120000 {
275283
#gpio-cells = <2>;
276284
#interrupt-cells = <2>;
277-
compatible = "sirf,prima2-gpio";
285+
compatible = "sirf,prima2-gpio-pinmux";
278286
reg = <0xb0120000 0x10000>;
279287
gpio-controller;
280288
interrupt-controller;
@@ -358,7 +366,7 @@
358366
};
359367

360368
rtc-iobg {
361-
compatible = "sirf,prima2-rtciobg", "simple-bus";
369+
compatible = "sirf,prima2-rtciobg", "sirf-prima2-rtciobg-bus";
362370
#address-cells = <1>;
363371
#size-cells = <1>;
364372
reg = <0x80030000 0x10000>;

‎arch/arm/mach-omap2/Makefile‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,13 @@ obj-$(CONFIG_ARCH_OMAP4) += prcm.o cm2xxx_3xxx.o cminst44xx.o \
8989
vp44xx_data.o
9090

9191
# OMAP voltage domains
92-
ifeq ($(CONFIG_PM),y)
93-
voltagedomain-common := voltage.o
94-
obj-$(CONFIG_ARCH_OMAP2) += $(voltagedomain-common)
92+
voltagedomain-common := voltage.o vc.o vp.o
93+
obj-$(CONFIG_ARCH_OMAP2) += $(voltagedomain-common) \
94+
voltagedomains2xxx_data.o
9595
obj-$(CONFIG_ARCH_OMAP3) += $(voltagedomain-common) \
9696
voltagedomains3xxx_data.o
9797
obj-$(CONFIG_ARCH_OMAP4) += $(voltagedomain-common) \
9898
voltagedomains44xx_data.o
99-
endif
10099

101100
# OMAP powerdomain framework
102101
powerdomain-common += powerdomain.o powerdomain-common.o

‎arch/arm/mach-omap2/io.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "io.h"
3838

3939
#include <plat/omap-pm.h>
40+
#include "voltage.h"
4041
#include "powerdomain.h"
4142

4243
#include "clockdomain.h"
@@ -341,18 +342,22 @@ void __init omap2_init_common_infrastructure(void)
341342
u8 postsetup_state;
342343

343344
if (cpu_is_omap242x()) {
345+
omap2xxx_voltagedomains_init();
344346
omap242x_powerdomains_init();
345347
omap242x_clockdomains_init();
346348
omap2420_hwmod_init();
347349
} else if (cpu_is_omap243x()) {
350+
omap2xxx_voltagedomains_init();
348351
omap243x_powerdomains_init();
349352
omap243x_clockdomains_init();
350353
omap2430_hwmod_init();
351354
} else if (cpu_is_omap34xx()) {
355+
omap3xxx_voltagedomains_init();
352356
omap3xxx_powerdomains_init();
353357
omap3xxx_clockdomains_init();
354358
omap3xxx_hwmod_init();
355359
} else if (cpu_is_omap44xx()) {
360+
omap44xx_voltagedomains_init();
356361
omap44xx_powerdomains_init();
357362
omap44xx_clockdomains_init();
358363
omap44xx_hwmod_init();

‎arch/arm/mach-omap2/omap_hwmod_3xxx_data.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2569,7 +2569,7 @@ static struct omap_hwmod omap34xx_sr1_hwmod = {
25692569
.name = "sr1_hwmod",
25702570
.class = &omap34xx_smartreflex_hwmod_class,
25712571
.main_clk = "sr1_fck",
2572-
.vdd_name = "mpu",
2572+
.vdd_name = "mpu_iva",
25732573
.prcm = {
25742574
.omap2 = {
25752575
.prcm_reg_id = 1,
@@ -2588,7 +2588,7 @@ static struct omap_hwmod omap36xx_sr1_hwmod = {
25882588
.name = "sr1_hwmod",
25892589
.class = &omap36xx_smartreflex_hwmod_class,
25902590
.main_clk = "sr1_fck",
2591-
.vdd_name = "mpu",
2591+
.vdd_name = "mpu_iva",
25922592
.prcm = {
25932593
.omap2 = {
25942594
.prcm_reg_id = 1,

‎arch/arm/mach-omap2/omap_twl.c‎

Lines changed: 63 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@
4242

4343
#define OMAP4_SRI2C_SLAVE_ADDR 0x12
4444
#define OMAP4_VDD_MPU_SR_VOLT_REG 0x55
45+
#define OMAP4_VDD_MPU_SR_CMD_REG 0x56
4546
#define OMAP4_VDD_IVA_SR_VOLT_REG 0x5B
47+
#define OMAP4_VDD_IVA_SR_CMD_REG 0x5C
4648
#define OMAP4_VDD_CORE_SR_VOLT_REG 0x61
49+
#define OMAP4_VDD_CORE_SR_CMD_REG 0x62
4750

4851
#define OMAP4_VP_CONFIG_ERROROFFSET 0x00
4952
#define OMAP4_VP_VSTEPMIN_VSTEPMIN 0x01
@@ -95,6 +98,8 @@ static unsigned long twl6030_vsel_to_uv(const u8 vsel)
9598
is_offset_valid = true;
9699
}
97100

101+
if (!vsel)
102+
return 0;
98103
/*
99104
* There is no specific formula for voltage to vsel
100105
* conversion above 1.3V. There are special hardcoded
@@ -106,9 +111,9 @@ static unsigned long twl6030_vsel_to_uv(const u8 vsel)
106111
return 1350000;
107112

108113
if (smps_offset & 0x8)
109-
return ((((vsel - 1) * 125) + 7000)) * 100;
114+
return ((((vsel - 1) * 1266) + 70900)) * 10;
110115
else
111-
return ((((vsel - 1) * 125) + 6000)) * 100;
116+
return ((((vsel - 1) * 1266) + 60770)) * 10;
112117
}
113118

114119
static u8 twl6030_uv_to_vsel(unsigned long uv)
@@ -127,23 +132,30 @@ static u8 twl6030_uv_to_vsel(unsigned long uv)
127132
is_offset_valid = true;
128133
}
129134

135+
if (!uv)
136+
return 0x00;
130137
/*
131138
* There is no specific formula for voltage to vsel
132139
* conversion above 1.3V. There are special hardcoded
133140
* values for voltages above 1.3V. Currently we are
134141
* hardcoding only for 1.35 V which is used for 1GH OPP for
135142
* OMAP4430.
136143
*/
137-
if (uv == 1350000)
144+
if (uv > twl6030_vsel_to_uv(0x39)) {
145+
if (uv == 1350000)
146+
return 0x3A;
147+
pr_err("%s:OUT OF RANGE! non mapped vsel for %ld Vs max %ld\n",
148+
__func__, uv, twl6030_vsel_to_uv(0x39));
138149
return 0x3A;
150+
}
139151

140152
if (smps_offset & 0x8)
141-
return DIV_ROUND_UP(uv - 700000, 12500) + 1;
153+
return DIV_ROUND_UP(uv - 709000, 12660) + 1;
142154
else
143-
return DIV_ROUND_UP(uv - 600000, 12500) + 1;
155+
return DIV_ROUND_UP(uv - 607700, 12660) + 1;
144156
}
145157

146-
static struct omap_volt_pmic_info omap3_mpu_volt_info = {
158+
static struct omap_voltdm_pmic omap3_mpu_pmic = {
147159
.slew_rate = 4000,
148160
.step_size = 12500,
149161
.on_volt = 1200000,
@@ -158,12 +170,13 @@ static struct omap_volt_pmic_info omap3_mpu_volt_info = {
158170
.vp_vddmax = OMAP3430_VP1_VLIMITTO_VDDMAX,
159171
.vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US,
160172
.i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR,
161-
.pmic_reg = OMAP3_VDD_MPU_SR_CONTROL_REG,
173+
.volt_reg_addr = OMAP3_VDD_MPU_SR_CONTROL_REG,
174+
.i2c_high_speed = true,
162175
.vsel_to_uv = twl4030_vsel_to_uv,
163176
.uv_to_vsel = twl4030_uv_to_vsel,
164177
};
165178

166-
static struct omap_volt_pmic_info omap3_core_volt_info = {
179+
static struct omap_voltdm_pmic omap3_core_pmic = {
167180
.slew_rate = 4000,
168181
.step_size = 12500,
169182
.on_volt = 1200000,
@@ -178,18 +191,19 @@ static struct omap_volt_pmic_info omap3_core_volt_info = {
178191
.vp_vddmax = OMAP3430_VP2_VLIMITTO_VDDMAX,
179192
.vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US,
180193
.i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR,
181-
.pmic_reg = OMAP3_VDD_CORE_SR_CONTROL_REG,
194+
.volt_reg_addr = OMAP3_VDD_CORE_SR_CONTROL_REG,
195+
.i2c_high_speed = true,
182196
.vsel_to_uv = twl4030_vsel_to_uv,
183197
.uv_to_vsel = twl4030_uv_to_vsel,
184198
};
185199

186-
static struct omap_volt_pmic_info omap4_mpu_volt_info = {
200+
static struct omap_voltdm_pmic omap4_mpu_pmic = {
187201
.slew_rate = 4000,
188-
.step_size = 12500,
189-
.on_volt = 1350000,
190-
.onlp_volt = 1350000,
191-
.ret_volt = 837500,
192-
.off_volt = 600000,
202+
.step_size = 12660,
203+
.on_volt = 1375000,
204+
.onlp_volt = 1375000,
205+
.ret_volt = 830000,
206+
.off_volt = 0,
193207
.volt_setup_time = 0,
194208
.vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET,
195209
.vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN,
@@ -198,18 +212,20 @@ static struct omap_volt_pmic_info omap4_mpu_volt_info = {
198212
.vp_vddmax = OMAP4_VP_MPU_VLIMITTO_VDDMAX,
199213
.vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
200214
.i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR,
201-
.pmic_reg = OMAP4_VDD_MPU_SR_VOLT_REG,
215+
.volt_reg_addr = OMAP4_VDD_MPU_SR_VOLT_REG,
216+
.cmd_reg_addr = OMAP4_VDD_MPU_SR_CMD_REG,
217+
.i2c_high_speed = true,
202218
.vsel_to_uv = twl6030_vsel_to_uv,
203219
.uv_to_vsel = twl6030_uv_to_vsel,
204220
};
205221

206-
static struct omap_volt_pmic_info omap4_iva_volt_info = {
222+
static struct omap_voltdm_pmic omap4_iva_pmic = {
207223
.slew_rate = 4000,
208-
.step_size = 12500,
209-
.on_volt = 1100000,
210-
.onlp_volt = 1100000,
211-
.ret_volt = 837500,
212-
.off_volt = 600000,
224+
.step_size = 12660,
225+
.on_volt = 1188000,
226+
.onlp_volt = 1188000,
227+
.ret_volt = 830000,
228+
.off_volt = 0,
213229
.volt_setup_time = 0,
214230
.vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET,
215231
.vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN,
@@ -218,18 +234,20 @@ static struct omap_volt_pmic_info omap4_iva_volt_info = {
218234
.vp_vddmax = OMAP4_VP_IVA_VLIMITTO_VDDMAX,
219235
.vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
220236
.i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR,
221-
.pmic_reg = OMAP4_VDD_IVA_SR_VOLT_REG,
237+
.volt_reg_addr = OMAP4_VDD_IVA_SR_VOLT_REG,
238+
.cmd_reg_addr = OMAP4_VDD_IVA_SR_CMD_REG,
239+
.i2c_high_speed = true,
222240
.vsel_to_uv = twl6030_vsel_to_uv,
223241
.uv_to_vsel = twl6030_uv_to_vsel,
224242
};
225243

226-
static struct omap_volt_pmic_info omap4_core_volt_info = {
244+
static struct omap_voltdm_pmic omap4_core_pmic = {
227245
.slew_rate = 4000,
228-
.step_size = 12500,
229-
.on_volt = 1100000,
230-
.onlp_volt = 1100000,
231-
.ret_volt = 837500,
232-
.off_volt = 600000,
246+
.step_size = 12660,
247+
.on_volt = 1200000,
248+
.onlp_volt = 1200000,
249+
.ret_volt = 830000,
250+
.off_volt = 0,
233251
.volt_setup_time = 0,
234252
.vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET,
235253
.vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN,
@@ -238,7 +256,8 @@ static struct omap_volt_pmic_info omap4_core_volt_info = {
238256
.vp_vddmax = OMAP4_VP_CORE_VLIMITTO_VDDMAX,
239257
.vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
240258
.i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR,
241-
.pmic_reg = OMAP4_VDD_CORE_SR_VOLT_REG,
259+
.volt_reg_addr = OMAP4_VDD_CORE_SR_VOLT_REG,
260+
.cmd_reg_addr = OMAP4_VDD_CORE_SR_CMD_REG,
242261
.vsel_to_uv = twl6030_vsel_to_uv,
243262
.uv_to_vsel = twl6030_uv_to_vsel,
244263
};
@@ -250,14 +269,14 @@ int __init omap4_twl_init(void)
250269
if (!cpu_is_omap44xx())
251270
return -ENODEV;
252271

253-
voltdm = omap_voltage_domain_lookup("mpu");
254-
omap_voltage_register_pmic(voltdm, &omap4_mpu_volt_info);
272+
voltdm = voltdm_lookup("mpu");
273+
omap_voltage_register_pmic(voltdm, &omap4_mpu_pmic);
255274

256-
voltdm = omap_voltage_domain_lookup("iva");
257-
omap_voltage_register_pmic(voltdm, &omap4_iva_volt_info);
275+
voltdm = voltdm_lookup("iva");
276+
omap_voltage_register_pmic(voltdm, &omap4_iva_pmic);
258277

259-
voltdm = omap_voltage_domain_lookup("core");
260-
omap_voltage_register_pmic(voltdm, &omap4_core_volt_info);
278+
voltdm = voltdm_lookup("core");
279+
omap_voltage_register_pmic(voltdm, &omap4_core_pmic);
261280

262281
return 0;
263282
}
@@ -270,10 +289,10 @@ int __init omap3_twl_init(void)
270289
return -ENODEV;
271290

272291
if (cpu_is_omap3630()) {
273-
omap3_mpu_volt_info.vp_vddmin = OMAP3630_VP1_VLIMITTO_VDDMIN;
274-
omap3_mpu_volt_info.vp_vddmax = OMAP3630_VP1_VLIMITTO_VDDMAX;
275-
omap3_core_volt_info.vp_vddmin = OMAP3630_VP2_VLIMITTO_VDDMIN;
276-
omap3_core_volt_info.vp_vddmax = OMAP3630_VP2_VLIMITTO_VDDMAX;
292+
omap3_mpu_pmic.vp_vddmin = OMAP3630_VP1_VLIMITTO_VDDMIN;
293+
omap3_mpu_pmic.vp_vddmax = OMAP3630_VP1_VLIMITTO_VDDMAX;
294+
omap3_core_pmic.vp_vddmin = OMAP3630_VP2_VLIMITTO_VDDMIN;
295+
omap3_core_pmic.vp_vddmax = OMAP3630_VP2_VLIMITTO_VDDMAX;
277296
}
278297

279298
/*
@@ -288,11 +307,11 @@ int __init omap3_twl_init(void)
288307
if (!twl_sr_enable_autoinit)
289308
omap3_twl_set_sr_bit(true);
290309

291-
voltdm = omap_voltage_domain_lookup("mpu");
292-
omap_voltage_register_pmic(voltdm, &omap3_mpu_volt_info);
310+
voltdm = voltdm_lookup("mpu_iva");
311+
omap_voltage_register_pmic(voltdm, &omap3_mpu_pmic);
293312

294-
voltdm = omap_voltage_domain_lookup("core");
295-
omap_voltage_register_pmic(voltdm, &omap3_core_volt_info);
313+
voltdm = voltdm_lookup("core");
314+
omap_voltage_register_pmic(voltdm, &omap3_core_pmic);
296315

297316
return 0;
298317
}

‎arch/arm/mach-omap2/pm.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
181181
goto exit;
182182
}
183183

184-
voltdm = omap_voltage_domain_lookup(vdd_name);
184+
voltdm = voltdm_lookup(vdd_name);
185185
if (IS_ERR(voltdm)) {
186186
pr_err("%s: unable to get vdd pointer for vdd_%s\n",
187187
__func__, vdd_name);
@@ -211,7 +211,7 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
211211
goto exit;
212212
}
213213

214-
omap_voltage_scale_vdd(voltdm, bootup_volt);
214+
voltdm_scale(voltdm, bootup_volt);
215215
return 0;
216216

217217
exit:
@@ -224,7 +224,7 @@ static void __init omap3_init_voltages(void)
224224
if (!cpu_is_omap34xx())
225225
return;
226226

227-
omap2_set_init_voltage("mpu", "dpll1_ck", mpu_dev);
227+
omap2_set_init_voltage("mpu_iva", "dpll1_ck", mpu_dev);
228228
omap2_set_init_voltage("core", "l3_ick", l3_dev);
229229
}
230230

0 commit comments

Comments
 (0)