mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
msm: acpuclock-krait: Fix PTE efuse address for acpuclock-8974
Correct the efuse address base and offset for 8974. Since the offset is now different on 8974 than on other Krait-based targets, it's no longer possible to hard-code it in acpuclock-krait.c. Instead, move it into the QFPROM address passed from SoC specific files. Since the PTE EFUSE is not yet used on 8974 to select different frequency/voltage tables, this change should have no current functional effect. Change-Id: I26de7c9ce84e2873b883123f9fe420b3cb14e364 Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
This commit is contained in:
parent
5e45426f3d
commit
bef7e9773a
9 changed files with 19 additions and 22 deletions
|
@ -219,7 +219,7 @@ static struct acpuclk_krait_params acpuclk_8064_params __initdata = {
|
|||
.l2_freq_tbl = l2_freq_tbl,
|
||||
.l2_freq_tbl_size = sizeof(l2_freq_tbl),
|
||||
.bus_scale = &bus_scale_data,
|
||||
.qfprom_phys_base = 0x00700000,
|
||||
.pte_efuse_phys = 0x007000C0,
|
||||
.stby_khz = 384000,
|
||||
};
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ static struct acpuclk_krait_params acpuclk_8627_params __initdata = {
|
|||
.l2_freq_tbl = l2_freq_tbl,
|
||||
.l2_freq_tbl_size = sizeof(l2_freq_tbl),
|
||||
.bus_scale = &bus_scale_data,
|
||||
.qfprom_phys_base = 0x00700000,
|
||||
.pte_efuse_phys = 0x007000C0,
|
||||
.stby_khz = 384000,
|
||||
};
|
||||
|
||||
|
|
|
@ -221,7 +221,7 @@ static struct acpuclk_krait_params acpuclk_8930_params __initdata = {
|
|||
.l2_freq_tbl = l2_freq_tbl,
|
||||
.l2_freq_tbl_size = sizeof(l2_freq_tbl),
|
||||
.bus_scale = &bus_scale_data,
|
||||
.qfprom_phys_base = 0x00700000,
|
||||
.pte_efuse_phys = 0x007000C0,
|
||||
.stby_khz = 384000,
|
||||
};
|
||||
|
||||
|
|
|
@ -200,7 +200,7 @@ static struct acpuclk_krait_params acpuclk_8930aa_params __initdata = {
|
|||
.l2_freq_tbl = l2_freq_tbl,
|
||||
.l2_freq_tbl_size = sizeof(l2_freq_tbl),
|
||||
.bus_scale = &bus_scale_data,
|
||||
.qfprom_phys_base = 0x00700000,
|
||||
.pte_efuse_phys = 0x007000C0,
|
||||
.stby_khz = 384000,
|
||||
};
|
||||
|
||||
|
|
|
@ -204,7 +204,7 @@ static struct acpuclk_krait_params acpuclk_8960_params __initdata = {
|
|||
.l2_freq_tbl = l2_freq_tbl,
|
||||
.l2_freq_tbl_size = sizeof(l2_freq_tbl),
|
||||
.bus_scale = &bus_scale_data,
|
||||
.qfprom_phys_base = 0x00700000,
|
||||
.pte_efuse_phys = 0x007000C0,
|
||||
.stby_khz = 384000,
|
||||
};
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ static struct acpuclk_krait_params acpuclk_8960ab_params __initdata = {
|
|||
.l2_freq_tbl = l2_freq_tbl,
|
||||
.l2_freq_tbl_size = sizeof(l2_freq_tbl),
|
||||
.bus_scale = &bus_scale_data,
|
||||
.qfprom_phys_base = 0x00700000,
|
||||
.pte_efuse_phys = 0x007000C0,
|
||||
.stby_khz = 384000,
|
||||
};
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ static struct acpuclk_krait_params acpuclk_8974_params __initdata = {
|
|||
.l2_freq_tbl = l2_freq_tbl,
|
||||
.l2_freq_tbl_size = sizeof(l2_freq_tbl),
|
||||
.bus_scale = &bus_scale_data,
|
||||
.qfprom_phys_base = 0xFC4A8000,
|
||||
.pte_efuse_phys = 0xFC4B80B0,
|
||||
.stby_khz = 300000,
|
||||
};
|
||||
|
||||
|
|
|
@ -44,9 +44,6 @@
|
|||
#define SEC_SRC_SEL_L2PLL 1
|
||||
#define SEC_SRC_SEL_AUX 2
|
||||
|
||||
/* PTE EFUSE register offset. */
|
||||
#define PTE_EFUSE 0xC0
|
||||
|
||||
static DEFINE_MUTEX(driver_lock);
|
||||
static DEFINE_SPINLOCK(l2_lock);
|
||||
|
||||
|
@ -931,20 +928,20 @@ static void krait_apply_vmin(struct acpu_level *tbl)
|
|||
tbl->vdd_core = 1150000;
|
||||
}
|
||||
|
||||
static int __init select_freq_plan(u32 qfprom_phys)
|
||||
static int __init select_freq_plan(u32 pte_efuse_phys)
|
||||
{
|
||||
void __iomem *qfprom_base;
|
||||
u32 pte_efuse, pvs, tbl_idx;
|
||||
void __iomem *pte_efuse;
|
||||
u32 pte_efuse_val, pvs, tbl_idx;
|
||||
char *pvs_names[] = { "Slow", "Nominal", "Fast", "Faster", "Unknown" };
|
||||
|
||||
qfprom_base = ioremap(qfprom_phys, SZ_256);
|
||||
pte_efuse = ioremap(pte_efuse_phys, 4);
|
||||
/* Select frequency tables. */
|
||||
if (qfprom_base) {
|
||||
pte_efuse = readl_relaxed(qfprom_base + PTE_EFUSE);
|
||||
pvs = (pte_efuse >> 10) & 0x7;
|
||||
iounmap(qfprom_base);
|
||||
if (pte_efuse) {
|
||||
pte_efuse_val = readl_relaxed(pte_efuse);
|
||||
pvs = (pte_efuse_val >> 10) & 0x7;
|
||||
iounmap(pte_efuse);
|
||||
if (pvs == 0x7)
|
||||
pvs = (pte_efuse >> 13) & 0x7;
|
||||
pvs = (pte_efuse_val >> 13) & 0x7;
|
||||
|
||||
switch (pvs) {
|
||||
case 0x0:
|
||||
|
@ -1005,7 +1002,7 @@ static void __init drv_data_init(struct device *dev,
|
|||
GFP_KERNEL);
|
||||
BUG_ON(!drv.bus_scale->usecase);
|
||||
|
||||
tbl_idx = select_freq_plan(params->qfprom_phys_base);
|
||||
tbl_idx = select_freq_plan(params->pte_efuse_phys);
|
||||
drv.acpu_freq_tbl = kmemdup(params->pvs_tables[tbl_idx].table,
|
||||
params->pvs_tables[tbl_idx].size,
|
||||
GFP_KERNEL);
|
||||
|
|
|
@ -236,7 +236,7 @@ struct pvs_table {
|
|||
* @pvs_tables: CPU frequency tables.
|
||||
* @l2_freq_tbl: L2 frequency table.
|
||||
* @l2_freq_tbl_size: Size of @l2_freq_tbl.
|
||||
* @qfprom_phys_base: Physical base address of QFPROM.
|
||||
* @pte_efuse_phys: Physical address of PTE EFUSE.
|
||||
* @bus_scale: MSM bus driver parameters.
|
||||
* @stby_khz: KHz value corresponding to an always-on clock source.
|
||||
*/
|
||||
|
@ -247,7 +247,7 @@ struct acpuclk_krait_params {
|
|||
struct pvs_table *pvs_tables;
|
||||
struct l2_level *l2_freq_tbl;
|
||||
size_t l2_freq_tbl_size;
|
||||
phys_addr_t qfprom_phys_base;
|
||||
phys_addr_t pte_efuse_phys;
|
||||
struct msm_bus_scale_pdata *bus_scale;
|
||||
unsigned long stby_khz;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue