From fbd3e04781b130165302a27d87e1776c7a73df22 Mon Sep 17 00:00:00 2001 From: Thara Gopinath Date: Wed, 18 Aug 2010 12:23:12 +0530 Subject: [PATCH] --- yaml --- r: 226671 b: refs/heads/master c: b35cecf978e33bf8f4be0f36ffe00fe10f381c4a h: refs/heads/master i: 226669: eeac3188f3e3bc371907261a610fdb570ffaf8cd 226667: 05989c26bae8a0504abc831d99ae63316b7130ed 226663: 0d463cc2074e32e09ff4157715b2de47a360e94f 226655: d15b385084ef6e7a422208aa846f9c0814093840 v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-omap2/smartreflex.c | 8 ++++++-- trunk/arch/arm/mach-omap2/sr_device.c | 17 ++++++++++++++++- trunk/arch/arm/plat-omap/Kconfig | 2 +- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index a29c624b686e..88c930671039 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fb200cfb2330b959eabc94e2f2c15717ce8466af +refs/heads/master: b35cecf978e33bf8f4be0f36ffe00fe10f381c4a diff --git a/trunk/arch/arm/mach-omap2/smartreflex.c b/trunk/arch/arm/mach-omap2/smartreflex.c index 52a05b336c08..77ecebf3fae2 100644 --- a/trunk/arch/arm/mach-omap2/smartreflex.c +++ b/trunk/arch/arm/mach-omap2/smartreflex.c @@ -153,7 +153,11 @@ static void sr_set_clk_length(struct omap_sr *sr) struct clk *sys_ck; u32 sys_clk_speed; - sys_ck = clk_get(NULL, "sys_ck"); + if (cpu_is_omap34xx()) + sys_ck = clk_get(NULL, "sys_ck"); + else + sys_ck = clk_get(NULL, "sys_clkin_ck"); + if (IS_ERR(sys_ck)) { dev_err(&sr->pdev->dev, "%s: unable to get sys clk\n", __func__); @@ -193,7 +197,7 @@ static void sr_set_regfields(struct omap_sr *sr) * file or pmic specific data structure. In that case these structure * fields will have to be populated using the pdata or pmic structure. */ - if (cpu_is_omap34xx()) { + if (cpu_is_omap34xx() || cpu_is_omap44xx()) { sr->err_weight = OMAP3430_SR_ERRWEIGHT; sr->err_maxlimit = OMAP3430_SR_ERRMAXLIMIT; sr->accum_data = OMAP3430_SR_ACCUMDATA; diff --git a/trunk/arch/arm/mach-omap2/sr_device.c b/trunk/arch/arm/mach-omap2/sr_device.c index 9a3538fb633a..786d685c09a9 100644 --- a/trunk/arch/arm/mach-omap2/sr_device.c +++ b/trunk/arch/arm/mach-omap2/sr_device.c @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -51,7 +52,21 @@ static void __init sr_set_nvalues(struct omap_volt_data *volt_data, GFP_KERNEL); for (i = 0; i < count; i++) { - u32 v = omap_ctrl_readl(volt_data[i].sr_efuse_offs); + u32 v; + /* + * In OMAP4 the efuse registers are 24 bit aligned. + * A __raw_readl will fail for non-32 bit aligned address + * and hence the 8-bit read and shift. + */ + if (cpu_is_omap44xx()) { + u16 offset = volt_data[i].sr_efuse_offs; + + v = omap_ctrl_readb(offset) | + omap_ctrl_readb(offset + 1) << 8 | + omap_ctrl_readb(offset + 2) << 16; + } else { + v = omap_ctrl_readl(volt_data[i].sr_efuse_offs); + } nvalue_table[i].efuse_offs = volt_data[i].sr_efuse_offs; nvalue_table[i].nvalue = v; diff --git a/trunk/arch/arm/plat-omap/Kconfig b/trunk/arch/arm/plat-omap/Kconfig index f4e05134aafa..11bf9f991509 100644 --- a/trunk/arch/arm/plat-omap/Kconfig +++ b/trunk/arch/arm/plat-omap/Kconfig @@ -37,7 +37,7 @@ config OMAP_DEBUG_LEDS config OMAP_SMARTREFLEX bool "SmartReflex support" - depends on ARCH_OMAP3 && PM + depends on (ARCH_OMAP3 || ARCH_OMAP4) && PM help Say Y if you want to enable SmartReflex.