You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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)
This commit is contained in:
@@ -39,9 +39,12 @@
|
||||
ranges = <0x40000000 0x40000000 0x80000000>;
|
||||
|
||||
l2-cache-controller@80040000 {
|
||||
compatible = "arm,pl310-cache";
|
||||
compatible = "arm,pl310-cache", "sirf,prima2-pl310-cache";
|
||||
reg = <0x80040000 0x1000>;
|
||||
interrupts = <59>;
|
||||
arm,tag-latency = <1 1 1>;
|
||||
arm,data-latency = <1 1 1>;
|
||||
arm,filter-ranges = <0 0x40000000>;
|
||||
};
|
||||
|
||||
intc: interrupt-controller@80020000 {
|
||||
@@ -67,6 +70,11 @@
|
||||
compatible = "sirf,prima2-rstc";
|
||||
reg = <0x88010000 0x1000>;
|
||||
};
|
||||
|
||||
rsc-controller@88020000 {
|
||||
compatible = "sirf,prima2-rsc";
|
||||
reg = <0x88020000 0x1000>;
|
||||
};
|
||||
};
|
||||
|
||||
mem-iobg {
|
||||
@@ -274,7 +282,7 @@
|
||||
gpio: gpio-controller@b0120000 {
|
||||
#gpio-cells = <2>;
|
||||
#interrupt-cells = <2>;
|
||||
compatible = "sirf,prima2-gpio";
|
||||
compatible = "sirf,prima2-gpio-pinmux";
|
||||
reg = <0xb0120000 0x10000>;
|
||||
gpio-controller;
|
||||
interrupt-controller;
|
||||
@@ -358,7 +366,7 @@
|
||||
};
|
||||
|
||||
rtc-iobg {
|
||||
compatible = "sirf,prima2-rtciobg", "simple-bus";
|
||||
compatible = "sirf,prima2-rtciobg", "sirf-prima2-rtciobg-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
reg = <0x80030000 0x10000>;
|
||||
|
||||
@@ -89,14 +89,13 @@ obj-$(CONFIG_ARCH_OMAP4) += prcm.o cm2xxx_3xxx.o cminst44xx.o \
|
||||
vp44xx_data.o
|
||||
|
||||
# OMAP voltage domains
|
||||
ifeq ($(CONFIG_PM),y)
|
||||
voltagedomain-common := voltage.o
|
||||
obj-$(CONFIG_ARCH_OMAP2) += $(voltagedomain-common)
|
||||
voltagedomain-common := voltage.o vc.o vp.o
|
||||
obj-$(CONFIG_ARCH_OMAP2) += $(voltagedomain-common) \
|
||||
voltagedomains2xxx_data.o
|
||||
obj-$(CONFIG_ARCH_OMAP3) += $(voltagedomain-common) \
|
||||
voltagedomains3xxx_data.o
|
||||
obj-$(CONFIG_ARCH_OMAP4) += $(voltagedomain-common) \
|
||||
voltagedomains44xx_data.o
|
||||
endif
|
||||
|
||||
# OMAP powerdomain framework
|
||||
powerdomain-common += powerdomain.o powerdomain-common.o
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "io.h"
|
||||
|
||||
#include <plat/omap-pm.h>
|
||||
#include "voltage.h"
|
||||
#include "powerdomain.h"
|
||||
|
||||
#include "clockdomain.h"
|
||||
@@ -341,18 +342,22 @@ void __init omap2_init_common_infrastructure(void)
|
||||
u8 postsetup_state;
|
||||
|
||||
if (cpu_is_omap242x()) {
|
||||
omap2xxx_voltagedomains_init();
|
||||
omap242x_powerdomains_init();
|
||||
omap242x_clockdomains_init();
|
||||
omap2420_hwmod_init();
|
||||
} else if (cpu_is_omap243x()) {
|
||||
omap2xxx_voltagedomains_init();
|
||||
omap243x_powerdomains_init();
|
||||
omap243x_clockdomains_init();
|
||||
omap2430_hwmod_init();
|
||||
} else if (cpu_is_omap34xx()) {
|
||||
omap3xxx_voltagedomains_init();
|
||||
omap3xxx_powerdomains_init();
|
||||
omap3xxx_clockdomains_init();
|
||||
omap3xxx_hwmod_init();
|
||||
} else if (cpu_is_omap44xx()) {
|
||||
omap44xx_voltagedomains_init();
|
||||
omap44xx_powerdomains_init();
|
||||
omap44xx_clockdomains_init();
|
||||
omap44xx_hwmod_init();
|
||||
|
||||
@@ -2569,7 +2569,7 @@ static struct omap_hwmod omap34xx_sr1_hwmod = {
|
||||
.name = "sr1_hwmod",
|
||||
.class = &omap34xx_smartreflex_hwmod_class,
|
||||
.main_clk = "sr1_fck",
|
||||
.vdd_name = "mpu",
|
||||
.vdd_name = "mpu_iva",
|
||||
.prcm = {
|
||||
.omap2 = {
|
||||
.prcm_reg_id = 1,
|
||||
@@ -2588,7 +2588,7 @@ static struct omap_hwmod omap36xx_sr1_hwmod = {
|
||||
.name = "sr1_hwmod",
|
||||
.class = &omap36xx_smartreflex_hwmod_class,
|
||||
.main_clk = "sr1_fck",
|
||||
.vdd_name = "mpu",
|
||||
.vdd_name = "mpu_iva",
|
||||
.prcm = {
|
||||
.omap2 = {
|
||||
.prcm_reg_id = 1,
|
||||
|
||||
@@ -42,8 +42,11 @@
|
||||
|
||||
#define OMAP4_SRI2C_SLAVE_ADDR 0x12
|
||||
#define OMAP4_VDD_MPU_SR_VOLT_REG 0x55
|
||||
#define OMAP4_VDD_MPU_SR_CMD_REG 0x56
|
||||
#define OMAP4_VDD_IVA_SR_VOLT_REG 0x5B
|
||||
#define OMAP4_VDD_IVA_SR_CMD_REG 0x5C
|
||||
#define OMAP4_VDD_CORE_SR_VOLT_REG 0x61
|
||||
#define OMAP4_VDD_CORE_SR_CMD_REG 0x62
|
||||
|
||||
#define OMAP4_VP_CONFIG_ERROROFFSET 0x00
|
||||
#define OMAP4_VP_VSTEPMIN_VSTEPMIN 0x01
|
||||
@@ -95,6 +98,8 @@ static unsigned long twl6030_vsel_to_uv(const u8 vsel)
|
||||
is_offset_valid = true;
|
||||
}
|
||||
|
||||
if (!vsel)
|
||||
return 0;
|
||||
/*
|
||||
* There is no specific formula for voltage to vsel
|
||||
* conversion above 1.3V. There are special hardcoded
|
||||
@@ -106,9 +111,9 @@ static unsigned long twl6030_vsel_to_uv(const u8 vsel)
|
||||
return 1350000;
|
||||
|
||||
if (smps_offset & 0x8)
|
||||
return ((((vsel - 1) * 125) + 7000)) * 100;
|
||||
return ((((vsel - 1) * 1266) + 70900)) * 10;
|
||||
else
|
||||
return ((((vsel - 1) * 125) + 6000)) * 100;
|
||||
return ((((vsel - 1) * 1266) + 60770)) * 10;
|
||||
}
|
||||
|
||||
static u8 twl6030_uv_to_vsel(unsigned long uv)
|
||||
@@ -127,6 +132,8 @@ static u8 twl6030_uv_to_vsel(unsigned long uv)
|
||||
is_offset_valid = true;
|
||||
}
|
||||
|
||||
if (!uv)
|
||||
return 0x00;
|
||||
/*
|
||||
* There is no specific formula for voltage to vsel
|
||||
* conversion above 1.3V. There are special hardcoded
|
||||
@@ -134,16 +141,21 @@ static u8 twl6030_uv_to_vsel(unsigned long uv)
|
||||
* hardcoding only for 1.35 V which is used for 1GH OPP for
|
||||
* OMAP4430.
|
||||
*/
|
||||
if (uv == 1350000)
|
||||
if (uv > twl6030_vsel_to_uv(0x39)) {
|
||||
if (uv == 1350000)
|
||||
return 0x3A;
|
||||
pr_err("%s:OUT OF RANGE! non mapped vsel for %ld Vs max %ld\n",
|
||||
__func__, uv, twl6030_vsel_to_uv(0x39));
|
||||
return 0x3A;
|
||||
}
|
||||
|
||||
if (smps_offset & 0x8)
|
||||
return DIV_ROUND_UP(uv - 700000, 12500) + 1;
|
||||
return DIV_ROUND_UP(uv - 709000, 12660) + 1;
|
||||
else
|
||||
return DIV_ROUND_UP(uv - 600000, 12500) + 1;
|
||||
return DIV_ROUND_UP(uv - 607700, 12660) + 1;
|
||||
}
|
||||
|
||||
static struct omap_volt_pmic_info omap3_mpu_volt_info = {
|
||||
static struct omap_voltdm_pmic omap3_mpu_pmic = {
|
||||
.slew_rate = 4000,
|
||||
.step_size = 12500,
|
||||
.on_volt = 1200000,
|
||||
@@ -158,12 +170,13 @@ static struct omap_volt_pmic_info omap3_mpu_volt_info = {
|
||||
.vp_vddmax = OMAP3430_VP1_VLIMITTO_VDDMAX,
|
||||
.vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US,
|
||||
.i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR,
|
||||
.pmic_reg = OMAP3_VDD_MPU_SR_CONTROL_REG,
|
||||
.volt_reg_addr = OMAP3_VDD_MPU_SR_CONTROL_REG,
|
||||
.i2c_high_speed = true,
|
||||
.vsel_to_uv = twl4030_vsel_to_uv,
|
||||
.uv_to_vsel = twl4030_uv_to_vsel,
|
||||
};
|
||||
|
||||
static struct omap_volt_pmic_info omap3_core_volt_info = {
|
||||
static struct omap_voltdm_pmic omap3_core_pmic = {
|
||||
.slew_rate = 4000,
|
||||
.step_size = 12500,
|
||||
.on_volt = 1200000,
|
||||
@@ -178,18 +191,19 @@ static struct omap_volt_pmic_info omap3_core_volt_info = {
|
||||
.vp_vddmax = OMAP3430_VP2_VLIMITTO_VDDMAX,
|
||||
.vp_timeout_us = OMAP3_VP_VLIMITTO_TIMEOUT_US,
|
||||
.i2c_slave_addr = OMAP3_SRI2C_SLAVE_ADDR,
|
||||
.pmic_reg = OMAP3_VDD_CORE_SR_CONTROL_REG,
|
||||
.volt_reg_addr = OMAP3_VDD_CORE_SR_CONTROL_REG,
|
||||
.i2c_high_speed = true,
|
||||
.vsel_to_uv = twl4030_vsel_to_uv,
|
||||
.uv_to_vsel = twl4030_uv_to_vsel,
|
||||
};
|
||||
|
||||
static struct omap_volt_pmic_info omap4_mpu_volt_info = {
|
||||
static struct omap_voltdm_pmic omap4_mpu_pmic = {
|
||||
.slew_rate = 4000,
|
||||
.step_size = 12500,
|
||||
.on_volt = 1350000,
|
||||
.onlp_volt = 1350000,
|
||||
.ret_volt = 837500,
|
||||
.off_volt = 600000,
|
||||
.step_size = 12660,
|
||||
.on_volt = 1375000,
|
||||
.onlp_volt = 1375000,
|
||||
.ret_volt = 830000,
|
||||
.off_volt = 0,
|
||||
.volt_setup_time = 0,
|
||||
.vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET,
|
||||
.vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN,
|
||||
@@ -198,18 +212,20 @@ static struct omap_volt_pmic_info omap4_mpu_volt_info = {
|
||||
.vp_vddmax = OMAP4_VP_MPU_VLIMITTO_VDDMAX,
|
||||
.vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
|
||||
.i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR,
|
||||
.pmic_reg = OMAP4_VDD_MPU_SR_VOLT_REG,
|
||||
.volt_reg_addr = OMAP4_VDD_MPU_SR_VOLT_REG,
|
||||
.cmd_reg_addr = OMAP4_VDD_MPU_SR_CMD_REG,
|
||||
.i2c_high_speed = true,
|
||||
.vsel_to_uv = twl6030_vsel_to_uv,
|
||||
.uv_to_vsel = twl6030_uv_to_vsel,
|
||||
};
|
||||
|
||||
static struct omap_volt_pmic_info omap4_iva_volt_info = {
|
||||
static struct omap_voltdm_pmic omap4_iva_pmic = {
|
||||
.slew_rate = 4000,
|
||||
.step_size = 12500,
|
||||
.on_volt = 1100000,
|
||||
.onlp_volt = 1100000,
|
||||
.ret_volt = 837500,
|
||||
.off_volt = 600000,
|
||||
.step_size = 12660,
|
||||
.on_volt = 1188000,
|
||||
.onlp_volt = 1188000,
|
||||
.ret_volt = 830000,
|
||||
.off_volt = 0,
|
||||
.volt_setup_time = 0,
|
||||
.vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET,
|
||||
.vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN,
|
||||
@@ -218,18 +234,20 @@ static struct omap_volt_pmic_info omap4_iva_volt_info = {
|
||||
.vp_vddmax = OMAP4_VP_IVA_VLIMITTO_VDDMAX,
|
||||
.vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
|
||||
.i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR,
|
||||
.pmic_reg = OMAP4_VDD_IVA_SR_VOLT_REG,
|
||||
.volt_reg_addr = OMAP4_VDD_IVA_SR_VOLT_REG,
|
||||
.cmd_reg_addr = OMAP4_VDD_IVA_SR_CMD_REG,
|
||||
.i2c_high_speed = true,
|
||||
.vsel_to_uv = twl6030_vsel_to_uv,
|
||||
.uv_to_vsel = twl6030_uv_to_vsel,
|
||||
};
|
||||
|
||||
static struct omap_volt_pmic_info omap4_core_volt_info = {
|
||||
static struct omap_voltdm_pmic omap4_core_pmic = {
|
||||
.slew_rate = 4000,
|
||||
.step_size = 12500,
|
||||
.on_volt = 1100000,
|
||||
.onlp_volt = 1100000,
|
||||
.ret_volt = 837500,
|
||||
.off_volt = 600000,
|
||||
.step_size = 12660,
|
||||
.on_volt = 1200000,
|
||||
.onlp_volt = 1200000,
|
||||
.ret_volt = 830000,
|
||||
.off_volt = 0,
|
||||
.volt_setup_time = 0,
|
||||
.vp_erroroffset = OMAP4_VP_CONFIG_ERROROFFSET,
|
||||
.vp_vstepmin = OMAP4_VP_VSTEPMIN_VSTEPMIN,
|
||||
@@ -238,7 +256,8 @@ static struct omap_volt_pmic_info omap4_core_volt_info = {
|
||||
.vp_vddmax = OMAP4_VP_CORE_VLIMITTO_VDDMAX,
|
||||
.vp_timeout_us = OMAP4_VP_VLIMITTO_TIMEOUT_US,
|
||||
.i2c_slave_addr = OMAP4_SRI2C_SLAVE_ADDR,
|
||||
.pmic_reg = OMAP4_VDD_CORE_SR_VOLT_REG,
|
||||
.volt_reg_addr = OMAP4_VDD_CORE_SR_VOLT_REG,
|
||||
.cmd_reg_addr = OMAP4_VDD_CORE_SR_CMD_REG,
|
||||
.vsel_to_uv = twl6030_vsel_to_uv,
|
||||
.uv_to_vsel = twl6030_uv_to_vsel,
|
||||
};
|
||||
@@ -250,14 +269,14 @@ int __init omap4_twl_init(void)
|
||||
if (!cpu_is_omap44xx())
|
||||
return -ENODEV;
|
||||
|
||||
voltdm = omap_voltage_domain_lookup("mpu");
|
||||
omap_voltage_register_pmic(voltdm, &omap4_mpu_volt_info);
|
||||
voltdm = voltdm_lookup("mpu");
|
||||
omap_voltage_register_pmic(voltdm, &omap4_mpu_pmic);
|
||||
|
||||
voltdm = omap_voltage_domain_lookup("iva");
|
||||
omap_voltage_register_pmic(voltdm, &omap4_iva_volt_info);
|
||||
voltdm = voltdm_lookup("iva");
|
||||
omap_voltage_register_pmic(voltdm, &omap4_iva_pmic);
|
||||
|
||||
voltdm = omap_voltage_domain_lookup("core");
|
||||
omap_voltage_register_pmic(voltdm, &omap4_core_volt_info);
|
||||
voltdm = voltdm_lookup("core");
|
||||
omap_voltage_register_pmic(voltdm, &omap4_core_pmic);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -270,10 +289,10 @@ int __init omap3_twl_init(void)
|
||||
return -ENODEV;
|
||||
|
||||
if (cpu_is_omap3630()) {
|
||||
omap3_mpu_volt_info.vp_vddmin = OMAP3630_VP1_VLIMITTO_VDDMIN;
|
||||
omap3_mpu_volt_info.vp_vddmax = OMAP3630_VP1_VLIMITTO_VDDMAX;
|
||||
omap3_core_volt_info.vp_vddmin = OMAP3630_VP2_VLIMITTO_VDDMIN;
|
||||
omap3_core_volt_info.vp_vddmax = OMAP3630_VP2_VLIMITTO_VDDMAX;
|
||||
omap3_mpu_pmic.vp_vddmin = OMAP3630_VP1_VLIMITTO_VDDMIN;
|
||||
omap3_mpu_pmic.vp_vddmax = OMAP3630_VP1_VLIMITTO_VDDMAX;
|
||||
omap3_core_pmic.vp_vddmin = OMAP3630_VP2_VLIMITTO_VDDMIN;
|
||||
omap3_core_pmic.vp_vddmax = OMAP3630_VP2_VLIMITTO_VDDMAX;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -288,11 +307,11 @@ int __init omap3_twl_init(void)
|
||||
if (!twl_sr_enable_autoinit)
|
||||
omap3_twl_set_sr_bit(true);
|
||||
|
||||
voltdm = omap_voltage_domain_lookup("mpu");
|
||||
omap_voltage_register_pmic(voltdm, &omap3_mpu_volt_info);
|
||||
voltdm = voltdm_lookup("mpu_iva");
|
||||
omap_voltage_register_pmic(voltdm, &omap3_mpu_pmic);
|
||||
|
||||
voltdm = omap_voltage_domain_lookup("core");
|
||||
omap_voltage_register_pmic(voltdm, &omap3_core_volt_info);
|
||||
voltdm = voltdm_lookup("core");
|
||||
omap_voltage_register_pmic(voltdm, &omap3_core_pmic);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
|
||||
goto exit;
|
||||
}
|
||||
|
||||
voltdm = omap_voltage_domain_lookup(vdd_name);
|
||||
voltdm = voltdm_lookup(vdd_name);
|
||||
if (IS_ERR(voltdm)) {
|
||||
pr_err("%s: unable to get vdd pointer for vdd_%s\n",
|
||||
__func__, vdd_name);
|
||||
@@ -211,7 +211,7 @@ static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
|
||||
goto exit;
|
||||
}
|
||||
|
||||
omap_voltage_scale_vdd(voltdm, bootup_volt);
|
||||
voltdm_scale(voltdm, bootup_volt);
|
||||
return 0;
|
||||
|
||||
exit:
|
||||
@@ -224,7 +224,7 @@ static void __init omap3_init_voltages(void)
|
||||
if (!cpu_is_omap34xx())
|
||||
return;
|
||||
|
||||
omap2_set_init_voltage("mpu", "dpll1_ck", mpu_dev);
|
||||
omap2_set_init_voltage("mpu_iva", "dpll1_ck", mpu_dev);
|
||||
omap2_set_init_voltage("core", "l3_ick", l3_dev);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ static struct powerdomain *_pwrdm_lookup(const char *name)
|
||||
static int _pwrdm_register(struct powerdomain *pwrdm)
|
||||
{
|
||||
int i;
|
||||
struct voltagedomain *voltdm;
|
||||
|
||||
if (!pwrdm || !pwrdm->name)
|
||||
return -EINVAL;
|
||||
@@ -91,6 +92,16 @@ static int _pwrdm_register(struct powerdomain *pwrdm)
|
||||
if (_pwrdm_lookup(pwrdm->name))
|
||||
return -EEXIST;
|
||||
|
||||
voltdm = voltdm_lookup(pwrdm->voltdm.name);
|
||||
if (!voltdm) {
|
||||
pr_err("powerdomain: %s: voltagedomain %s does not exist\n",
|
||||
pwrdm->name, pwrdm->voltdm.name);
|
||||
return -EINVAL;
|
||||
}
|
||||
pwrdm->voltdm.ptr = voltdm;
|
||||
INIT_LIST_HEAD(&pwrdm->voltdm_node);
|
||||
voltdm_add_pwrdm(voltdm, pwrdm);
|
||||
|
||||
list_add(&pwrdm->node, &pwrdm_list);
|
||||
|
||||
/* Initialize the powerdomain's state counter */
|
||||
@@ -426,6 +437,18 @@ int pwrdm_for_each_clkdm(struct powerdomain *pwrdm,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* pwrdm_get_voltdm - return a ptr to the voltdm that this pwrdm resides in
|
||||
* @pwrdm: struct powerdomain *
|
||||
*
|
||||
* Return a pointer to the struct voltageomain that the specified powerdomain
|
||||
* @pwrdm exists in.
|
||||
*/
|
||||
struct voltagedomain *pwrdm_get_voltdm(struct powerdomain *pwrdm)
|
||||
{
|
||||
return pwrdm->voltdm.ptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* pwrdm_get_mem_bank_count - get number of memory banks in this powerdomain
|
||||
* @pwrdm: struct powerdomain *
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
#include <plat/cpu.h>
|
||||
|
||||
#include "voltage.h"
|
||||
|
||||
/* Powerdomain basic power states */
|
||||
#define PWRDM_POWER_OFF 0x0
|
||||
#define PWRDM_POWER_RET 0x1
|
||||
@@ -78,6 +80,7 @@ struct powerdomain;
|
||||
/**
|
||||
* struct powerdomain - OMAP powerdomain
|
||||
* @name: Powerdomain name
|
||||
* @voltdm: voltagedomain containing this powerdomain
|
||||
* @prcm_offs: the address offset from CM_BASE/PRM_BASE
|
||||
* @prcm_partition: (OMAP4 only) the PRCM partition ID containing @prcm_offs
|
||||
* @pwrsts: Possible powerdomain power states
|
||||
@@ -88,6 +91,7 @@ struct powerdomain;
|
||||
* @pwrsts_mem_on: Possible memory bank pwrstates when pwrdm in ON
|
||||
* @pwrdm_clkdms: Clockdomains in this powerdomain
|
||||
* @node: list_head linking all powerdomains
|
||||
* @voltdm_node: list_head linking all powerdomains in a voltagedomain
|
||||
* @state:
|
||||
* @state_counter:
|
||||
* @timer:
|
||||
@@ -97,6 +101,10 @@ struct powerdomain;
|
||||
*/
|
||||
struct powerdomain {
|
||||
const char *name;
|
||||
union {
|
||||
const char *name;
|
||||
struct voltagedomain *ptr;
|
||||
} voltdm;
|
||||
const s16 prcm_offs;
|
||||
const u8 pwrsts;
|
||||
const u8 pwrsts_logic_ret;
|
||||
@@ -107,6 +115,7 @@ struct powerdomain {
|
||||
const u8 prcm_partition;
|
||||
struct clockdomain *pwrdm_clkdms[PWRDM_MAX_CLKDMS];
|
||||
struct list_head node;
|
||||
struct list_head voltdm_node;
|
||||
int state;
|
||||
unsigned state_counter[PWRDM_MAX_PWRSTS];
|
||||
unsigned ret_logic_off_counter;
|
||||
@@ -176,6 +185,7 @@ int pwrdm_del_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm);
|
||||
int pwrdm_for_each_clkdm(struct powerdomain *pwrdm,
|
||||
int (*fn)(struct powerdomain *pwrdm,
|
||||
struct clockdomain *clkdm));
|
||||
struct voltagedomain *pwrdm_get_voltdm(struct powerdomain *pwrdm);
|
||||
|
||||
int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* OMAP2 and OMAP3 powerdomain control
|
||||
*
|
||||
* Copyright (C) 2009-2010 Texas Instruments, Inc.
|
||||
* Copyright (C) 2009-2011 Texas Instruments, Inc.
|
||||
* Copyright (C) 2007-2009 Nokia Corporation
|
||||
*
|
||||
* Derived from mach-omap2/powerdomain.c written by Paul Walmsley
|
||||
|
||||
@@ -54,10 +54,12 @@ struct powerdomain gfx_omap2_pwrdm = {
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRSTS_ON, /* MEMONSTATE */
|
||||
},
|
||||
.voltdm = { .name = "core" },
|
||||
};
|
||||
|
||||
struct powerdomain wkup_omap2_pwrdm = {
|
||||
.name = "wkup_pwrdm",
|
||||
.prcm_offs = WKUP_MOD,
|
||||
.pwrsts = PWRSTS_ON,
|
||||
.voltdm = { .name = "wakeup" },
|
||||
};
|
||||
|
||||
@@ -37,6 +37,7 @@ static struct powerdomain dsp_pwrdm = {
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRSTS_ON,
|
||||
},
|
||||
.voltdm = { .name = "core" },
|
||||
};
|
||||
|
||||
static struct powerdomain mpu_24xx_pwrdm = {
|
||||
@@ -51,6 +52,7 @@ static struct powerdomain mpu_24xx_pwrdm = {
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRSTS_ON,
|
||||
},
|
||||
.voltdm = { .name = "core" },
|
||||
};
|
||||
|
||||
static struct powerdomain core_24xx_pwrdm = {
|
||||
@@ -68,6 +70,7 @@ static struct powerdomain core_24xx_pwrdm = {
|
||||
[1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */
|
||||
[2] = PWRSTS_OFF_RET_ON, /* MEM3ONSTATE */
|
||||
},
|
||||
.voltdm = { .name = "core" },
|
||||
};
|
||||
|
||||
|
||||
@@ -89,6 +92,7 @@ static struct powerdomain mdm_pwrdm = {
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRSTS_ON, /* MEMONSTATE */
|
||||
},
|
||||
.voltdm = { .name = "core" },
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -51,6 +51,7 @@ static struct powerdomain iva2_pwrdm = {
|
||||
[2] = PWRSTS_OFF_ON,
|
||||
[3] = PWRSTS_ON,
|
||||
},
|
||||
.voltdm = { .name = "mpu_iva" },
|
||||
};
|
||||
|
||||
static struct powerdomain mpu_3xxx_pwrdm = {
|
||||
@@ -66,6 +67,7 @@ static struct powerdomain mpu_3xxx_pwrdm = {
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRSTS_OFF_ON,
|
||||
},
|
||||
.voltdm = { .name = "mpu_iva" },
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -92,6 +94,7 @@ static struct powerdomain core_3xxx_pre_es3_1_pwrdm = {
|
||||
[0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */
|
||||
[1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */
|
||||
},
|
||||
.voltdm = { .name = "core" },
|
||||
};
|
||||
|
||||
static struct powerdomain core_3xxx_es3_1_pwrdm = {
|
||||
@@ -113,6 +116,7 @@ static struct powerdomain core_3xxx_es3_1_pwrdm = {
|
||||
[0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */
|
||||
[1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */
|
||||
},
|
||||
.voltdm = { .name = "core" },
|
||||
};
|
||||
|
||||
static struct powerdomain dss_pwrdm = {
|
||||
@@ -127,6 +131,7 @@ static struct powerdomain dss_pwrdm = {
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRSTS_ON, /* MEMONSTATE */
|
||||
},
|
||||
.voltdm = { .name = "core" },
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -147,6 +152,7 @@ static struct powerdomain sgx_pwrdm = {
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRSTS_ON, /* MEMONSTATE */
|
||||
},
|
||||
.voltdm = { .name = "core" },
|
||||
};
|
||||
|
||||
static struct powerdomain cam_pwrdm = {
|
||||
@@ -161,6 +167,7 @@ static struct powerdomain cam_pwrdm = {
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRSTS_ON, /* MEMONSTATE */
|
||||
},
|
||||
.voltdm = { .name = "core" },
|
||||
};
|
||||
|
||||
static struct powerdomain per_pwrdm = {
|
||||
@@ -175,11 +182,13 @@ static struct powerdomain per_pwrdm = {
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRSTS_ON, /* MEMONSTATE */
|
||||
},
|
||||
.voltdm = { .name = "core" },
|
||||
};
|
||||
|
||||
static struct powerdomain emu_pwrdm = {
|
||||
.name = "emu_pwrdm",
|
||||
.prcm_offs = OMAP3430_EMU_MOD,
|
||||
.voltdm = { .name = "core" },
|
||||
};
|
||||
|
||||
static struct powerdomain neon_pwrdm = {
|
||||
@@ -187,6 +196,7 @@ static struct powerdomain neon_pwrdm = {
|
||||
.prcm_offs = OMAP3430_NEON_MOD,
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
.pwrsts_logic_ret = PWRSTS_RET,
|
||||
.voltdm = { .name = "mpu_iva" },
|
||||
};
|
||||
|
||||
static struct powerdomain usbhost_pwrdm = {
|
||||
@@ -208,31 +218,37 @@ static struct powerdomain usbhost_pwrdm = {
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRSTS_ON, /* MEMONSTATE */
|
||||
},
|
||||
.voltdm = { .name = "core" },
|
||||
};
|
||||
|
||||
static struct powerdomain dpll1_pwrdm = {
|
||||
.name = "dpll1_pwrdm",
|
||||
.prcm_offs = MPU_MOD,
|
||||
.voltdm = { .name = "mpu_iva" },
|
||||
};
|
||||
|
||||
static struct powerdomain dpll2_pwrdm = {
|
||||
.name = "dpll2_pwrdm",
|
||||
.prcm_offs = OMAP3430_IVA2_MOD,
|
||||
.voltdm = { .name = "mpu_iva" },
|
||||
};
|
||||
|
||||
static struct powerdomain dpll3_pwrdm = {
|
||||
.name = "dpll3_pwrdm",
|
||||
.prcm_offs = PLL_MOD,
|
||||
.voltdm = { .name = "core" },
|
||||
};
|
||||
|
||||
static struct powerdomain dpll4_pwrdm = {
|
||||
.name = "dpll4_pwrdm",
|
||||
.prcm_offs = PLL_MOD,
|
||||
.voltdm = { .name = "core" },
|
||||
};
|
||||
|
||||
static struct powerdomain dpll5_pwrdm = {
|
||||
.name = "dpll5_pwrdm",
|
||||
.prcm_offs = PLL_MOD,
|
||||
.voltdm = { .name = "core" },
|
||||
};
|
||||
|
||||
/* As powerdomains are added or removed above, this list must also be changed */
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
/* core_44xx_pwrdm: CORE power domain */
|
||||
static struct powerdomain core_44xx_pwrdm = {
|
||||
.name = "core_pwrdm",
|
||||
.voltdm = { .name = "core" },
|
||||
.prcm_offs = OMAP4430_PRM_CORE_INST,
|
||||
.prcm_partition = OMAP4430_PRM_PARTITION,
|
||||
.pwrsts = PWRSTS_RET_ON,
|
||||
@@ -58,6 +59,7 @@ static struct powerdomain core_44xx_pwrdm = {
|
||||
/* gfx_44xx_pwrdm: 3D accelerator power domain */
|
||||
static struct powerdomain gfx_44xx_pwrdm = {
|
||||
.name = "gfx_pwrdm",
|
||||
.voltdm = { .name = "core" },
|
||||
.prcm_offs = OMAP4430_PRM_GFX_INST,
|
||||
.prcm_partition = OMAP4430_PRM_PARTITION,
|
||||
.pwrsts = PWRSTS_OFF_ON,
|
||||
@@ -74,6 +76,7 @@ static struct powerdomain gfx_44xx_pwrdm = {
|
||||
/* abe_44xx_pwrdm: Audio back end power domain */
|
||||
static struct powerdomain abe_44xx_pwrdm = {
|
||||
.name = "abe_pwrdm",
|
||||
.voltdm = { .name = "iva" },
|
||||
.prcm_offs = OMAP4430_PRM_ABE_INST,
|
||||
.prcm_partition = OMAP4430_PRM_PARTITION,
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
@@ -93,6 +96,7 @@ static struct powerdomain abe_44xx_pwrdm = {
|
||||
/* dss_44xx_pwrdm: Display subsystem power domain */
|
||||
static struct powerdomain dss_44xx_pwrdm = {
|
||||
.name = "dss_pwrdm",
|
||||
.voltdm = { .name = "core" },
|
||||
.prcm_offs = OMAP4430_PRM_DSS_INST,
|
||||
.prcm_partition = OMAP4430_PRM_PARTITION,
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
@@ -110,6 +114,7 @@ static struct powerdomain dss_44xx_pwrdm = {
|
||||
/* tesla_44xx_pwrdm: Tesla processor power domain */
|
||||
static struct powerdomain tesla_44xx_pwrdm = {
|
||||
.name = "tesla_pwrdm",
|
||||
.voltdm = { .name = "iva" },
|
||||
.prcm_offs = OMAP4430_PRM_TESLA_INST,
|
||||
.prcm_partition = OMAP4430_PRM_PARTITION,
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
@@ -131,6 +136,7 @@ static struct powerdomain tesla_44xx_pwrdm = {
|
||||
/* wkup_44xx_pwrdm: Wake-up power domain */
|
||||
static struct powerdomain wkup_44xx_pwrdm = {
|
||||
.name = "wkup_pwrdm",
|
||||
.voltdm = { .name = "wakeup" },
|
||||
.prcm_offs = OMAP4430_PRM_WKUP_INST,
|
||||
.prcm_partition = OMAP4430_PRM_PARTITION,
|
||||
.pwrsts = PWRSTS_ON,
|
||||
@@ -146,6 +152,7 @@ static struct powerdomain wkup_44xx_pwrdm = {
|
||||
/* cpu0_44xx_pwrdm: MPU0 processor and Neon coprocessor power domain */
|
||||
static struct powerdomain cpu0_44xx_pwrdm = {
|
||||
.name = "cpu0_pwrdm",
|
||||
.voltdm = { .name = "mpu" },
|
||||
.prcm_offs = OMAP4430_PRCM_MPU_CPU0_INST,
|
||||
.prcm_partition = OMAP4430_PRCM_MPU_PARTITION,
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
@@ -162,6 +169,7 @@ static struct powerdomain cpu0_44xx_pwrdm = {
|
||||
/* cpu1_44xx_pwrdm: MPU1 processor and Neon coprocessor power domain */
|
||||
static struct powerdomain cpu1_44xx_pwrdm = {
|
||||
.name = "cpu1_pwrdm",
|
||||
.voltdm = { .name = "mpu" },
|
||||
.prcm_offs = OMAP4430_PRCM_MPU_CPU1_INST,
|
||||
.prcm_partition = OMAP4430_PRCM_MPU_PARTITION,
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
@@ -178,6 +186,7 @@ static struct powerdomain cpu1_44xx_pwrdm = {
|
||||
/* emu_44xx_pwrdm: Emulation power domain */
|
||||
static struct powerdomain emu_44xx_pwrdm = {
|
||||
.name = "emu_pwrdm",
|
||||
.voltdm = { .name = "wakeup" },
|
||||
.prcm_offs = OMAP4430_PRM_EMU_INST,
|
||||
.prcm_partition = OMAP4430_PRM_PARTITION,
|
||||
.pwrsts = PWRSTS_OFF_ON,
|
||||
@@ -193,6 +202,7 @@ static struct powerdomain emu_44xx_pwrdm = {
|
||||
/* mpu_44xx_pwrdm: Modena processor and the Neon coprocessor power domain */
|
||||
static struct powerdomain mpu_44xx_pwrdm = {
|
||||
.name = "mpu_pwrdm",
|
||||
.voltdm = { .name = "mpu" },
|
||||
.prcm_offs = OMAP4430_PRM_MPU_INST,
|
||||
.prcm_partition = OMAP4430_PRM_PARTITION,
|
||||
.pwrsts = PWRSTS_RET_ON,
|
||||
@@ -213,6 +223,7 @@ static struct powerdomain mpu_44xx_pwrdm = {
|
||||
/* ivahd_44xx_pwrdm: IVA-HD power domain */
|
||||
static struct powerdomain ivahd_44xx_pwrdm = {
|
||||
.name = "ivahd_pwrdm",
|
||||
.voltdm = { .name = "iva" },
|
||||
.prcm_offs = OMAP4430_PRM_IVAHD_INST,
|
||||
.prcm_partition = OMAP4430_PRM_PARTITION,
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
@@ -236,6 +247,7 @@ static struct powerdomain ivahd_44xx_pwrdm = {
|
||||
/* cam_44xx_pwrdm: Camera subsystem power domain */
|
||||
static struct powerdomain cam_44xx_pwrdm = {
|
||||
.name = "cam_pwrdm",
|
||||
.voltdm = { .name = "core" },
|
||||
.prcm_offs = OMAP4430_PRM_CAM_INST,
|
||||
.prcm_partition = OMAP4430_PRM_PARTITION,
|
||||
.pwrsts = PWRSTS_OFF_ON,
|
||||
@@ -252,6 +264,7 @@ static struct powerdomain cam_44xx_pwrdm = {
|
||||
/* l3init_44xx_pwrdm: L3 initators pheripherals power domain */
|
||||
static struct powerdomain l3init_44xx_pwrdm = {
|
||||
.name = "l3init_pwrdm",
|
||||
.voltdm = { .name = "core" },
|
||||
.prcm_offs = OMAP4430_PRM_L3INIT_INST,
|
||||
.prcm_partition = OMAP4430_PRM_PARTITION,
|
||||
.pwrsts = PWRSTS_RET_ON,
|
||||
@@ -269,6 +282,7 @@ static struct powerdomain l3init_44xx_pwrdm = {
|
||||
/* l4per_44xx_pwrdm: Target peripherals power domain */
|
||||
static struct powerdomain l4per_44xx_pwrdm = {
|
||||
.name = "l4per_pwrdm",
|
||||
.voltdm = { .name = "core" },
|
||||
.prcm_offs = OMAP4430_PRM_L4PER_INST,
|
||||
.prcm_partition = OMAP4430_PRM_PARTITION,
|
||||
.pwrsts = PWRSTS_RET_ON,
|
||||
@@ -291,6 +305,7 @@ static struct powerdomain l4per_44xx_pwrdm = {
|
||||
*/
|
||||
static struct powerdomain always_on_core_44xx_pwrdm = {
|
||||
.name = "always_on_core_pwrdm",
|
||||
.voltdm = { .name = "core" },
|
||||
.prcm_offs = OMAP4430_PRM_ALWAYS_ON_INST,
|
||||
.prcm_partition = OMAP4430_PRM_PARTITION,
|
||||
.pwrsts = PWRSTS_ON,
|
||||
@@ -299,6 +314,7 @@ static struct powerdomain always_on_core_44xx_pwrdm = {
|
||||
/* cefuse_44xx_pwrdm: Customer efuse controller power domain */
|
||||
static struct powerdomain cefuse_44xx_pwrdm = {
|
||||
.name = "cefuse_pwrdm",
|
||||
.voltdm = { .name = "core" },
|
||||
.prcm_offs = OMAP4430_PRM_CEFUSE_INST,
|
||||
.prcm_partition = OMAP4430_PRM_PARTITION,
|
||||
.pwrsts = PWRSTS_OFF_ON,
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include <plat/cpu.h>
|
||||
#include <plat/prcm.h>
|
||||
|
||||
#include "vp.h"
|
||||
|
||||
#include "prm2xxx_3xxx.h"
|
||||
#include "cm2xxx_3xxx.h"
|
||||
#include "prm-regbits-24xx.h"
|
||||
@@ -156,3 +158,57 @@ int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift)
|
||||
|
||||
return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0;
|
||||
}
|
||||
|
||||
/* PRM VP */
|
||||
|
||||
/*
|
||||
* struct omap3_vp - OMAP3 VP register access description.
|
||||
* @tranxdone_status: VP_TRANXDONE_ST bitmask in PRM_IRQSTATUS_MPU reg
|
||||
*/
|
||||
struct omap3_vp {
|
||||
u32 tranxdone_status;
|
||||
};
|
||||
|
||||
static struct omap3_vp omap3_vp[] = {
|
||||
[OMAP3_VP_VDD_MPU_ID] = {
|
||||
.tranxdone_status = OMAP3430_VP1_TRANXDONE_ST_MASK,
|
||||
},
|
||||
[OMAP3_VP_VDD_CORE_ID] = {
|
||||
.tranxdone_status = OMAP3430_VP2_TRANXDONE_ST_MASK,
|
||||
},
|
||||
};
|
||||
|
||||
#define MAX_VP_ID ARRAY_SIZE(omap3_vp);
|
||||
|
||||
u32 omap3_prm_vp_check_txdone(u8 vp_id)
|
||||
{
|
||||
struct omap3_vp *vp = &omap3_vp[vp_id];
|
||||
u32 irqstatus;
|
||||
|
||||
irqstatus = omap2_prm_read_mod_reg(OCP_MOD,
|
||||
OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
|
||||
return irqstatus & vp->tranxdone_status;
|
||||
}
|
||||
|
||||
void omap3_prm_vp_clear_txdone(u8 vp_id)
|
||||
{
|
||||
struct omap3_vp *vp = &omap3_vp[vp_id];
|
||||
|
||||
omap2_prm_write_mod_reg(vp->tranxdone_status,
|
||||
OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
|
||||
}
|
||||
|
||||
u32 omap3_prm_vcvp_read(u8 offset)
|
||||
{
|
||||
return omap2_prm_read_mod_reg(OMAP3430_GR_MOD, offset);
|
||||
}
|
||||
|
||||
void omap3_prm_vcvp_write(u32 val, u8 offset)
|
||||
{
|
||||
omap2_prm_write_mod_reg(val, OMAP3430_GR_MOD, offset);
|
||||
}
|
||||
|
||||
u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset)
|
||||
{
|
||||
return omap2_prm_rmw_mod_reg_bits(mask, bits, OMAP3430_GR_MOD, offset);
|
||||
}
|
||||
|
||||
@@ -303,7 +303,19 @@ extern int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift);
|
||||
extern int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift);
|
||||
extern int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift);
|
||||
|
||||
/* OMAP3-specific VP functions */
|
||||
u32 omap3_prm_vp_check_txdone(u8 vp_id);
|
||||
void omap3_prm_vp_clear_txdone(u8 vp_id);
|
||||
|
||||
/*
|
||||
* OMAP3 access functions for voltage controller (VC) and
|
||||
* voltage proccessor (VP) in the PRM.
|
||||
*/
|
||||
extern u32 omap3_prm_vcvp_read(u8 offset);
|
||||
extern void omap3_prm_vcvp_write(u32 val, u8 offset);
|
||||
extern u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset);
|
||||
#endif /* CONFIG_ARCH_OMAP4 */
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -21,8 +21,11 @@
|
||||
#include <plat/cpu.h>
|
||||
#include <plat/prcm.h>
|
||||
|
||||
#include "vp.h"
|
||||
#include "prm44xx.h"
|
||||
#include "prm-regbits-44xx.h"
|
||||
#include "prcm44xx.h"
|
||||
#include "prminst44xx.h"
|
||||
|
||||
/* PRM low-level functions */
|
||||
|
||||
@@ -50,3 +53,71 @@ u32 omap4_prm_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 reg)
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
/* PRM VP */
|
||||
|
||||
/*
|
||||
* struct omap4_vp - OMAP4 VP register access description.
|
||||
* @irqstatus_mpu: offset to IRQSTATUS_MPU register for VP
|
||||
* @tranxdone_status: VP_TRANXDONE_ST bitmask in PRM_IRQSTATUS_MPU reg
|
||||
*/
|
||||
struct omap4_vp {
|
||||
u32 irqstatus_mpu;
|
||||
u32 tranxdone_status;
|
||||
};
|
||||
|
||||
static struct omap4_vp omap4_vp[] = {
|
||||
[OMAP4_VP_VDD_MPU_ID] = {
|
||||
.irqstatus_mpu = OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET,
|
||||
.tranxdone_status = OMAP4430_VP_MPU_TRANXDONE_ST_MASK,
|
||||
},
|
||||
[OMAP4_VP_VDD_IVA_ID] = {
|
||||
.irqstatus_mpu = OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
|
||||
.tranxdone_status = OMAP4430_VP_IVA_TRANXDONE_ST_MASK,
|
||||
},
|
||||
[OMAP4_VP_VDD_CORE_ID] = {
|
||||
.irqstatus_mpu = OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
|
||||
.tranxdone_status = OMAP4430_VP_CORE_TRANXDONE_ST_MASK,
|
||||
},
|
||||
};
|
||||
|
||||
u32 omap4_prm_vp_check_txdone(u8 vp_id)
|
||||
{
|
||||
struct omap4_vp *vp = &omap4_vp[vp_id];
|
||||
u32 irqstatus;
|
||||
|
||||
irqstatus = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
|
||||
OMAP4430_PRM_OCP_SOCKET_INST,
|
||||
vp->irqstatus_mpu);
|
||||
return irqstatus & vp->tranxdone_status;
|
||||
}
|
||||
|
||||
void omap4_prm_vp_clear_txdone(u8 vp_id)
|
||||
{
|
||||
struct omap4_vp *vp = &omap4_vp[vp_id];
|
||||
|
||||
omap4_prminst_write_inst_reg(vp->tranxdone_status,
|
||||
OMAP4430_PRM_PARTITION,
|
||||
OMAP4430_PRM_OCP_SOCKET_INST,
|
||||
vp->irqstatus_mpu);
|
||||
};
|
||||
|
||||
u32 omap4_prm_vcvp_read(u8 offset)
|
||||
{
|
||||
return omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
|
||||
OMAP4430_PRM_DEVICE_INST, offset);
|
||||
}
|
||||
|
||||
void omap4_prm_vcvp_write(u32 val, u8 offset)
|
||||
{
|
||||
omap4_prminst_write_inst_reg(val, OMAP4430_PRM_PARTITION,
|
||||
OMAP4430_PRM_DEVICE_INST, offset);
|
||||
}
|
||||
|
||||
u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset)
|
||||
{
|
||||
return omap4_prminst_rmw_inst_reg_bits(mask, bits,
|
||||
OMAP4430_PRM_PARTITION,
|
||||
OMAP4430_PRM_DEVICE_INST,
|
||||
offset);
|
||||
}
|
||||
|
||||
@@ -751,6 +751,18 @@ extern u32 omap4_prm_read_inst_reg(s16 inst, u16 idx);
|
||||
extern void omap4_prm_write_inst_reg(u32 val, s16 inst, u16 idx);
|
||||
extern u32 omap4_prm_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx);
|
||||
|
||||
/* OMAP4-specific VP functions */
|
||||
u32 omap4_prm_vp_check_txdone(u8 vp_id);
|
||||
void omap4_prm_vp_clear_txdone(u8 vp_id);
|
||||
|
||||
/*
|
||||
* OMAP4 access functions for voltage controller (VC) and
|
||||
* voltage proccessor (VP) in the PRM.
|
||||
*/
|
||||
extern u32 omap4_prm_vcvp_read(u8 offset);
|
||||
extern void omap4_prm_vcvp_write(u32 val, u8 offset);
|
||||
extern u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset);
|
||||
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
static int sr_class3_enable(struct voltagedomain *voltdm)
|
||||
{
|
||||
unsigned long volt = omap_voltage_get_nom_volt(voltdm);
|
||||
unsigned long volt = voltdm_get_voltage(voltdm);
|
||||
|
||||
if (!volt) {
|
||||
pr_warning("%s: Curr voltage unknown. Cannot enable sr_%s\n",
|
||||
@@ -32,7 +32,7 @@ static int sr_class3_disable(struct voltagedomain *voltdm, int is_volt_reset)
|
||||
omap_vp_disable(voltdm);
|
||||
sr_disable(voltdm);
|
||||
if (is_volt_reset)
|
||||
omap_voltage_reset(voltdm);
|
||||
voltdm_reset(voltdm);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -62,6 +62,7 @@ static LIST_HEAD(sr_list);
|
||||
|
||||
static struct omap_sr_class_data *sr_class;
|
||||
static struct omap_sr_pmic_data *sr_pmic_data;
|
||||
static struct dentry *sr_dbg_dir;
|
||||
|
||||
static inline void sr_write_reg(struct omap_sr *sr, unsigned offset, u32 value)
|
||||
{
|
||||
@@ -826,9 +827,10 @@ static int __init omap_sr_probe(struct platform_device *pdev)
|
||||
struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL);
|
||||
struct omap_sr_data *pdata = pdev->dev.platform_data;
|
||||
struct resource *mem, *irq;
|
||||
struct dentry *vdd_dbg_dir, *nvalue_dir;
|
||||
struct dentry *nvalue_dir;
|
||||
struct omap_volt_data *volt_data;
|
||||
int i, ret = 0;
|
||||
char *name;
|
||||
|
||||
if (!sr_info) {
|
||||
dev_err(&pdev->dev, "%s: unable to allocate sr_info\n",
|
||||
@@ -899,18 +901,25 @@ static int __init omap_sr_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
dev_info(&pdev->dev, "%s: SmartReflex driver initialized\n", __func__);
|
||||
|
||||
/*
|
||||
* If the voltage domain debugfs directory is not created, do
|
||||
* not try to create rest of the debugfs entries.
|
||||
*/
|
||||
vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm);
|
||||
if (!vdd_dbg_dir) {
|
||||
ret = -EINVAL;
|
||||
goto err_iounmap;
|
||||
if (!sr_dbg_dir) {
|
||||
sr_dbg_dir = debugfs_create_dir("smartreflex", NULL);
|
||||
if (!sr_dbg_dir) {
|
||||
ret = PTR_ERR(sr_dbg_dir);
|
||||
pr_err("%s:sr debugfs dir creation failed(%d)\n",
|
||||
__func__, ret);
|
||||
goto err_iounmap;
|
||||
}
|
||||
}
|
||||
|
||||
sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
|
||||
name = kasprintf(GFP_KERNEL, "sr_%s", sr_info->voltdm->name);
|
||||
if (!name) {
|
||||
dev_err(&pdev->dev, "%s: Unable to alloc debugfs name\n",
|
||||
__func__);
|
||||
ret = -ENOMEM;
|
||||
goto err_iounmap;
|
||||
}
|
||||
sr_info->dbg_dir = debugfs_create_dir(name, sr_dbg_dir);
|
||||
kfree(name);
|
||||
if (IS_ERR(sr_info->dbg_dir)) {
|
||||
dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
|
||||
__func__);
|
||||
|
||||
@@ -102,7 +102,7 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user)
|
||||
sr_data->senn_mod = 0x1;
|
||||
sr_data->senp_mod = 0x1;
|
||||
|
||||
sr_data->voltdm = omap_voltage_domain_lookup(oh->vdd_name);
|
||||
sr_data->voltdm = voltdm_lookup(oh->vdd_name);
|
||||
if (IS_ERR(sr_data->voltdm)) {
|
||||
pr_err("%s: Unable to get voltage domain pointer for VDD %s\n",
|
||||
__func__, oh->vdd_name);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user