Skip to content

Commit

Permalink
Merge branch 'android-omap-3.0' into android-omap-tuna-3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
toddpoynor committed Dec 1, 2011
2 parents b1771ff + 3c2c794 commit a214b1f
Show file tree
Hide file tree
Showing 18 changed files with 1,278 additions and 90 deletions.
1 change: 1 addition & 0 deletions arch/arm/mach-omap2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ obj-$(CONFIG_ARCH_OMAP4) += prcm-debug.o
endif
obj-$(CONFIG_OMAP_SMARTREFLEX) += sr_device.o smartreflex.o
obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3) += smartreflex-class3.o
obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS1P5) += smartreflex-class1p5.o

AFLAGS_sleep24xx.o :=-Wa,-march=armv6
AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a$(plus_sec)
Expand Down
23 changes: 19 additions & 4 deletions arch/arm/mach-omap2/dvfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,8 @@ static int _dvfs_scale(struct device *req_dev, struct device *target_dev,
int ret = 0;
struct voltagedomain *voltdm;
struct omap_vdd_info *vdd;
struct omap_volt_data *new_vdata;
struct omap_volt_data *curr_vdata;

voltdm = tdvfs_info->voltdm;
if (IS_ERR_OR_NULL(voltdm)) {
Expand All @@ -741,9 +743,22 @@ static int _dvfs_scale(struct device *req_dev, struct device *target_dev,
node = plist_last(&tdvfs_info->vdd_user_list);
new_volt = node->prio;

new_vdata = omap_voltage_get_voltdata(voltdm, new_volt);
if (IS_ERR_OR_NULL(new_vdata)) {
pr_err("%s:%s: Bad New voltage data for %ld\n",
__func__, voltdm->name, new_volt);
return PTR_ERR(new_vdata);
}
new_volt = omap_get_operation_voltage(new_vdata);
curr_vdata = omap_voltage_get_curr_vdata(voltdm);
if (IS_ERR_OR_NULL(curr_vdata)) {
pr_err("%s:%s: Bad Current voltage data\n",
__func__, voltdm->name);
return PTR_ERR(curr_vdata);
}
curr_volt = omap_vp_get_curr_volt(voltdm);
if (!curr_volt)
curr_volt = omap_voltage_get_nom_volt(voltdm);
curr_volt = omap_get_operation_voltage(curr_vdata);

/* Disable smartreflex module across voltage and frequency scaling */
omap_sr_disable(voltdm);
Expand All @@ -760,7 +775,7 @@ static int _dvfs_scale(struct device *req_dev, struct device *target_dev,
goto fail;
}

ret = voltdm_scale(voltdm, new_volt);
ret = voltdm_scale(voltdm, new_vdata);
if (ret) {
dev_err(target_dev,
"%s: Unable to scale the %s to %ld volt\n",
Expand Down Expand Up @@ -817,7 +832,7 @@ static int _dvfs_scale(struct device *req_dev, struct device *target_dev,
goto fail;

if (DVFS_VOLT_SCALE_DOWN == volt_scale_dir) {
voltdm_scale(voltdm, new_volt);
voltdm_scale(voltdm, new_vdata);
_dep_scale_domains(target_dev, vdd);
}

Expand All @@ -829,7 +844,7 @@ static int _dvfs_scale(struct device *req_dev, struct device *target_dev,
__func__, voltdm->name);
out:
/* Re-enable Smartreflex module */
omap_sr_enable(voltdm);
omap_sr_enable(voltdm, new_vdata);

return ret;
}
Expand Down
17 changes: 17 additions & 0 deletions arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,15 @@ static struct omap_hwmod_ocp_if omap3_l4_core__i2c3 = {
.user = OCP_USER_MPU | OCP_USER_SDMA,
};


static struct omap_hwmod_irq_info omap3_smartreflex_mpu_irqs[] = {
{.name = "sr1_irq", .irq = 18},
};

static struct omap_hwmod_irq_info omap3_smartreflex_core_irqs[] = {
{.name = "sr2_irq", .irq = 19},
};

/* L4 CORE -> SR1 interface */
static struct omap_hwmod_addr_space omap3_sr1_addr_space[] = {
{
Expand Down Expand Up @@ -2975,6 +2984,8 @@ static struct omap_hwmod omap34xx_sr1_hwmod = {
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 |
CHIP_IS_OMAP3430ES3_0 |
CHIP_IS_OMAP3430ES3_1),
.mpu_irqs = omap3_smartreflex_mpu_irqs,
.mpu_irqs_cnt = ARRAY_SIZE(omap3_smartreflex_mpu_irqs),
.flags = HWMOD_SET_DEFAULT_CLOCKACT,
};

Expand All @@ -2995,6 +3006,8 @@ static struct omap_hwmod omap36xx_sr1_hwmod = {
.slaves_cnt = ARRAY_SIZE(omap3_sr1_slaves),
.dev_attr = &sr1_dev_attr,
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
.mpu_irqs = omap3_smartreflex_mpu_irqs,
.mpu_irqs_cnt = ARRAY_SIZE(omap3_smartreflex_mpu_irqs),
};

/* SR2 */
Expand Down Expand Up @@ -3025,6 +3038,8 @@ static struct omap_hwmod omap34xx_sr2_hwmod = {
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 |
CHIP_IS_OMAP3430ES3_0 |
CHIP_IS_OMAP3430ES3_1),
.mpu_irqs = omap3_smartreflex_core_irqs,
.mpu_irqs_cnt = ARRAY_SIZE(omap3_smartreflex_core_irqs),
.flags = HWMOD_SET_DEFAULT_CLOCKACT,
};

Expand All @@ -3045,6 +3060,8 @@ static struct omap_hwmod omap36xx_sr2_hwmod = {
.slaves_cnt = ARRAY_SIZE(omap3_sr2_slaves),
.dev_attr = &sr2_dev_attr,
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
.mpu_irqs = omap3_smartreflex_core_irqs,
.mpu_irqs_cnt = ARRAY_SIZE(omap3_smartreflex_core_irqs),
};

/*
Expand Down
6 changes: 4 additions & 2 deletions arch/arm/mach-omap2/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
*/

if (freq_cur < freq_valid) {
ret = voltdm_scale(voltdm, bootup_volt);
ret = voltdm_scale(voltdm,
omap_voltage_get_voltdata(voltdm, bootup_volt));
if (ret) {
pr_err("%s: Fail set voltage-%s(f=%ld v=%ld)on vdd%s\n",
__func__, vdd_name, freq_valid,
Expand All @@ -391,7 +392,8 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
}

if (freq_cur >= freq_valid) {
ret = voltdm_scale(voltdm, bootup_volt);
ret = voltdm_scale(voltdm,
omap_voltage_get_voltdata(voltdm, bootup_volt));
if (ret) {
pr_err("%s: Fail set voltage-%s(f=%ld v=%ld)on vdd%s\n",
__func__, clk_name, freq_valid,
Expand Down
18 changes: 12 additions & 6 deletions arch/arm/mach-omap2/pm44xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ void omap4_enter_sleep(unsigned int cpu, unsigned int power_state, bool suspend)
goto abort_gpio;

if (mpu_next_state < PWRDM_POWER_INACTIVE) {
omap_sr_disable_reset_volt(mpu_voltdm);
if (omap_sr_disable_reset_volt(mpu_voltdm))
goto abort_device_off;
omap_vc_set_auto_trans(mpu_voltdm,
OMAP_VC_CHANNEL_AUTO_TRANSITION_RETENTION);
}
Expand All @@ -179,8 +180,10 @@ void omap4_enter_sleep(unsigned int cpu, unsigned int power_state, bool suspend)
* enabling AUTO RET requires SR to disabled, its done here for
* now. Needs a relook to see if this can be optimized.
*/
omap_sr_disable_reset_volt(iva_voltdm);
omap_sr_disable_reset_volt(core_voltdm);
if (omap_sr_disable_reset_volt(iva_voltdm))
goto abort_device_off;
if (omap_sr_disable_reset_volt(core_voltdm))
goto abort_device_off;
omap_vc_set_auto_trans(core_voltdm,
OMAP_VC_CHANNEL_AUTO_TRANSITION_RETENTION);
if (!is_pm44xx_erratum(IVA_AUTO_RET_iXXX)) {
Expand Down Expand Up @@ -236,8 +239,10 @@ void omap4_enter_sleep(unsigned int cpu, unsigned int power_state, bool suspend)
}

omap_temp_sensor_resume_idle();
omap_sr_enable(iva_voltdm);
omap_sr_enable(core_voltdm);
omap_sr_enable(iva_voltdm,
omap_voltage_get_curr_vdata(iva_voltdm));
omap_sr_enable(core_voltdm,
omap_voltage_get_curr_vdata(core_voltdm));
}

if (omap4_device_prev_state_off()) {
Expand All @@ -257,7 +262,8 @@ void omap4_enter_sleep(unsigned int cpu, unsigned int power_state, bool suspend)
if (mpu_next_state < PWRDM_POWER_INACTIVE) {
omap_vc_set_auto_trans(mpu_voltdm,
OMAP_VC_CHANNEL_AUTO_TRANSITION_DISABLE);
omap_sr_enable(mpu_voltdm);
omap_sr_enable(mpu_voltdm,
omap_voltage_get_curr_vdata(mpu_voltdm));
}


Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-omap2/prm44xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <plat/cpu.h>
#include <plat/prcm.h>

#include "voltage.h"
#include "vp.h"
#include "prm44xx.h"
#include "prm-regbits-44xx.h"
Expand Down
Loading

0 comments on commit a214b1f

Please sign in to comment.