OMAP4: Smartreflex and Voltage layer support
Subsystems (6)
v2 cover OMAP4: Smartreflex and Voltage layer support
This patch series adds support for OMAP4 support in the smartreflex and voltage layer. The series involves extensions to voltage layer and smartreflex layer for supporting OMAP4. In addition it involves changes to pm debugfs layer to support OMAP4 so that smartreflex and voltage debug entries can be viewed, changes in opp layer so that opp layer gets enabled for OMAP4, some changes in OMAP4 clock database and finally addition of OMAP4 opp tables.
All these patches might not be dependent on voltage and smartreflex layer but is required for the correct functionality of these layers for OMAP4.
This series in based off origin/pm-core and origin/pm-opp branches off Kevin Hilman' PM tree. But for this series to compile and work properly one will have to apply the following additional patches also.
http://dev.omapzoom.org/?p=santosh/kernel-omap4-base.git;a=summary branch - omap4_scm_2.6.37 http://marc.info/?l=linux-omap&m=128516673609816&w=2
All these patches are also available at
http://dev.omapzoom.org/?p=thara/omap-dvfs.git;a=summary
head: thara-pm-sr
This patch series has been tested on OMAP4430 SDP with omap3_defconfig and omap_4430dsp_defconfig with the following menuconfig options enabled
System type -> TI OMAP Implementations -> Smartreflex Support
System type -> TI OMAP Implementations ->
Class 3 mode of Smartreflex ImplementationBenoit Cousson (1):
OMAP4: hwmod: Add inital data for smartreflex modules.
Thara Gopinath (10):
OMAP4: PM debugfs support
OMAP4: OPP framework support
OMAP4: Add the new voltage to vsel calculation formula
OMAP4: Extend clock data.
OMAP4: Adding voltage driver support
OMAP4: PM: Program correct init voltages for scalable VDDs
OMAP4: Adding dev atrributes to OMAP4 smartreflex hwmod data
OMAP4: Smartreflex framework extensions
OMAP4: Enabling smartrefles class 3 driver.
OMAP4: Add opp tables.
arch/arm/mach-omap2/Makefile | 3 +- arch/arm/mach-omap2/board-4430sdp.c | 2 + arch/arm/mach-omap2/clock44xx_data.c | 40 ++++- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 219 ++++++++++++++++++++++++++++ arch/arm/mach-omap2/opp44xx_data.c | 99 +++++++++++++ arch/arm/mach-omap2/pm-debug.c | 28 ++-- arch/arm/mach-omap2/pm.c | 5 + arch/arm/mach-omap2/pm.h | 1 + arch/arm/mach-omap2/smartreflex.c | 8 +- arch/arm/mach-omap2/sr_device.c | 15 ++- arch/arm/mach-omap2/voltage.c | 211 ++++++++++++++++++++++++++- arch/arm/plat-omap/Kconfig | 2 +- arch/arm/plat-omap/Makefile | 1 + arch/arm/plat-omap/include/plat/control.h | 12 ++ arch/arm/plat-omap/include/plat/voltage.h | 20 +++- arch/arm/plat-omap/opp_twl_tps.c | 71 +++++++++ 16 files changed, 707 insertions(+), 30 deletions(-) create mode 100644 arch/arm/mach-omap2/opp44xx_data.c
PATCH v2 1/11 OMAP4: PM debugfs support
This patch extends pm debugfs to support OMAP4 debug entries also. Currently PM register dump support is not added for OMAP4.
--- arch/arm/mach-omap2/pm-debug.c | 28 +++++++++++++++------------- 1 files changed, 15 insertions(+), 13 deletions(-)
arch/arm/mach-omap2/pm-debug.c +15 -13
@@ -617,7 +617,7 @@ static int __init pm_dbg_init(void)if (cpu_is_omap34xx ()) pm_dbg_reg_modules = omap3_pm_reg_modules; -else { +else if (!cpu_is_omap44xx ()) {printk (KERN_ERR "%s: only OMAP3 supported\n" , __func__);return -ENODEV ; }
@@ -633,20 +633,22 @@ static int __init pm_dbg_init(void)pwrdm_for_each (pwrdms_setup, (void *)d); - pm_dbg_dir =debugfs_create_dir ("registers" , d); -if (IS_ERR (pm_dbg_dir)) -return PTR_ERR (pm_dbg_dir); +if (cpu_is_omap34xx ()) { + pm_dbg_dir =debugfs_create_dir ("registers" , d); +if (IS_ERR (pm_dbg_dir)) +return PTR_ERR (pm_dbg_dir); - (void )debugfs_create_file ("current" ,S_IRUGO , - pm_dbg_dir, (void *)0 , &debug_reg_fops); + (void )debugfs_create_file ("current" ,S_IRUGO , + pm_dbg_dir, (void *)0 , &debug_reg_fops); -for (i =0 ; i <PM_DBG_MAX_REG_SETS ; i++) -if (pm_dbg_reg_set[i] !=NULL ) { -sprintf (name,"%d" , i+1 ); - (void )debugfs_create_file (name,S_IRUGO , - pm_dbg_dir, (void *)(i+1 ), &debug_reg_fops); - - } +for (i =0 ; i <PM_DBG_MAX_REG_SETS ; i++) +if (pm_dbg_reg_set[i] !=NULL ) { +sprintf (name,"%d" , i+1 ); + (void )debugfs_create_file (name,S_IRUGO , + pm_dbg_dir, (void *)(i+1 ), + &debug_reg_fops); + } + } (void )debugfs_create_file ("enable_off_mode" ,S_IRUGO |S_IWUGO , d, &enable_off_mode, &pm_dbg_option_fops);
Signature · 1 line
1.7.0.4
PATCH v2 2/11 OMAP4: OPP framework support
In reply to Thara GopinathThis patch allows the compilation of the generic
opp layer for OMAP4 also.
--- arch/arm/plat-omap/Makefile | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/plat-omap/Makefile +1 -0
@@ -15,6 +15,7 @@ obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o # OPP support in (OMAP3+ only at the moment) ifdef CONFIG_PM obj-$(CONFIG_ARCH_OMAP3) += opp.o +obj-$(CONFIG_ARCH_OMAP4) += opp.o obj-$(CONFIG_TWL4030_CORE) += opp_twl_tps.o endif
Signature · 1 line
1.7.0.4
PATCH v2 3/11 OMAP4: Add the new voltage to vsel calculation formula
In reply to Thara GopinathTWL6030 the power IC used along with OMAP4 in OMAP4 SDPs, blaze boards and panda boards has a different formula from that of TWL4030 for voltage to vsel and
vsel to voltage calculation. This patch implements the new formula depending on the PMIC type.
--- arch/arm/plat-omap/opp_twl_tps.c | 71 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 71 insertions(+), 0 deletions(-)
arch/arm/plat-omap/opp_twl_tps.c +71 -0
@@ -15,9 +15,16 @@#include <linux/module.h> +#include <linux/i2c/twl.h> +#include <plat/opp_twl_tps.h> #include <plat/voltage.h> +static bool is_offset_valid; +static u8 smps_offset; + +#define REG_SMPS_OFFSET 0xE0 +/** * omap_twl_vsel_to_vdc - convert TWL/TPS VSEL value to microvolts DC * @vsel: TWL/TPS VSEL value to convert
@@ -27,6 +34,38 @@*/ unsigned long omap_twl_vsel_to_uv (const u8 vsel) { +if (twl_class_is_6030 ()) { +/* +* In TWL6030 depending on the value of SMPS_OFFSET +* efuse register the voltage range supported in +* standard mode can be either between 0.6V - 1.3V or +* 0.7V - 1.4V. In TWL6030 ES1.0 SMPS_OFFSET efuse +* is programmed to all 0's where as starting from +* TWL6030 ES1.1 the efuse is programmed to 1 +*/ +if (!is_offset_valid) { +twl_i2c_read_u8 (TWL6030_MODULE_ID0 , &smps_offset,0xE0 ); + is_offset_valid = true; + } + +if (smps_offset &0x8 ) { +return ((((vsel -1 ) *125 ) +7000 )) *100 ; + }else { +/* +* In case of the supported voltage range being +* between 0.6V - 1.3V, there is not specific +* formula for voltage to vsel conversion above +* 1.3V. There are special hardcoded values for +* voltages above 1.3V. Currently we are hardcodig +* only for 1.35 V which is used for 1GH OPP for +* OMAP4430. +*/ +if (vsel ==0x3A ) +return 1350000 ; +return ((((vsel -1 ) *125 ) +6000 )) *100 ; + } + } +return (((vsel *125 ) +6000 )) *100 ; }
@@ -40,6 +79,38 @@ unsigned long omap_twl_vsel_to_uv(const u8 vsel)u8 omap_twl_uv_to_vsel (unsigned long uv) {/* Round up to higher voltage */ +if (twl_class_is_6030 ()) { +/* +* In TWL6030 depending on the value of SMPS_OFFSET +* efuse register the voltage range supported in +* standard mode can be either between 0.6V - 1.3V or +* 0.7V - 1.4V. In TWL6030 ES1.0 SMPS_OFFSET efuse +* is programmed to all 0's where as starting from +* TWL6030 ES1.1 the efuse is programmed to 1 +*/ +if (!is_offset_valid) { +twl_i2c_read_u8 (TWL6030_MODULE_ID0 , &smps_offset,0xE0 ); + is_offset_valid = true; + } + +if (smps_offset &0x8 ) { +return DIV_ROUND_UP (uv -700000 ,12500 ) +1 ; + }else { +/* +* In case of the supported voltage range being +* between 0.6V - 1.3V, there is not specific +* formula for voltage to vsel conversion above +* 1.3V. There are special hardcoded values for +* voltages above 1.3V. Currently we are hardcodig +* only for 1.35 V which is used for 1GH OPP for +* OMAP4430. +*/ +if (uv ==1350000 ) +return 0x3A ; +return DIV_ROUND_UP (uv -600000 ,12500 ) +1 ; + } + } +return DIV_ROUND_UP (uv -600000 ,12500 ); }
Signature · 1 line
1.7.0.4
RE: [PATCH v2 03/11] OMAP4: Add the new voltage to vsel calculation formula
Hi Thara,
Quoted 49 lines
-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Thara Gopinath
Sent: Saturday, September 25, 2010 6:21 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Thara Gopinath
Subject: [PATCH v2 03/11] OMAP4: Add the new voltage to vsel calculation formulaTWL6030 the power IC used along with OMAP4 in OMAP4 SDPs, blaze boards and panda boards has a different formula from that of TWL4030 for voltage to vsel and
vsel to voltage calculation. This patch implements the new formula depending on the PMIC type.Signed-off-by Thara Gopinath <[email protected]>--- arch/arm/plat-omap/opp_twl_tps.c | 71 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 71 insertions(+), 0 deletions(-)arch/arm/plat- renamed from arch/arm/plat-omap/opp_twl_tps.c +0
-0
omap/opp_twl_tps.c
index 4448fc5..358b67b 100644arch/arm/plat-omap/opp_twl_tps.c +8
-0@@ -15,9 +15,16 @@#include <linux/module.h> +#include <linux/i2c/twl.h> +#include <plat/opp_twl_tps.h> #include <plat/voltage.h> +static bool is_offset_valid; +static u8 smps_offset; + +#define REG_SMPS_OFFSET 0xE0 +/** * omap_twl_vsel_to_vdc - convert TWL/TPS VSEL value to microvolts DC * @vsel: TWL/TPS VSEL value to convert @@ -27,6 +34,38 @@*/ unsigned long omap_twl_vsel_to_uv (const u8 vsel) { +if (twl_class_is_6030 ()) {
arch/arm/plat-omap/opp_twl_tps.c line 47
Quoted 10 lines
arch/arm/plat-omap/opp_twl_tps.c +10
-0+/* +* In TWL6030 depending on the value of SMPS_OFFSET +* efuse register the voltage range supported in +* standard mode can be either between 0.6V - 1.3V or +* 0.7V - 1.4V. In TWL6030 ES1.0 SMPS_OFFSET efuse +* is programmed to all 0's where as starting from +* TWL6030 ES1.1 the efuse is programmed to 1 +*/ +if (!is_offset_valid) { + twl_i2c_read_u8(TWL6030_MODULE_ID0, &smps_offset,
0xE0);
arch/arm/plat-omap/opp_twl_tps.c line 49
Quoted 2 lines
arch/arm/plat-omap/opp_twl_tps.c +2
-0+ is_offset_valid = true; + }
Is it necessary to do the i2c read each time to check the smps_offset? OR it can be done one time initially.
Quoted 27 lines
arch/arm/plat-omap/opp_twl_tps.c +20
-0+ +if (smps_offset &0x8 ) { +return ((((vsel -1 ) *125 ) +7000 )) *100 ; + }else { +/* +* In case of the supported voltage range being +* between 0.6V - 1.3V, there is not specific +* formula for voltage to vsel conversion above +* 1.3V. There are special hardcoded values for +* voltages above 1.3V. Currently we are hardcodig +* only for 1.35 V which is used for 1GH OPP for +* OMAP4430. +*/ +if (vsel ==0x3A ) +return 1350000 ; +return ((((vsel -1 ) *125 ) +6000 )) *100 ; + } + } +return (((vsel *125 ) +6000 )) *100 ; }@@ -40,6 +79,38 @@ unsigned long omap_twl_vsel_to_uv(const u8 vsel)u8 omap_twl_uv_to_vsel (unsigned long uv) {/* Round up to higher voltage */ +if (twl_class_is_6030 ()) {
arch/arm/plat-omap/opp_twl_tps.c unsigned long omap_twl_vsel_to_uv(const u8 vsel) · line 92
Quoted 10 lines
arch/arm/plat-omap/opp_twl_tps.c +10
-0+/* +* In TWL6030 depending on the value of SMPS_OFFSET +* efuse register the voltage range supported in +* standard mode can be either between 0.6V - 1.3V or +* 0.7V - 1.4V. In TWL6030 ES1.0 SMPS_OFFSET efuse +* is programmed to all 0's where as starting from +* TWL6030 ES1.1 the efuse is programmed to 1 +*/ +if (!is_offset_valid) { + twl_i2c_read_u8(TWL6030_MODULE_ID0, &smps_offset,
0xE0);
arch/arm/plat-omap/opp_twl_tps.c unsigned long omap_twl_vsel_to_uv(const u8 vsel) · line 94
Quoted 2 lines
arch/arm/plat-omap/opp_twl_tps.c +2
-0+ is_offset_valid = true; + }
Prev. comment +
And this will be called each time when we do voltage scaling.
- Lesly
Quoted 29 lines
arch/arm/plat-omap/opp_twl_tps.c +19
-1+ +if (smps_offset &0x8 ) { +return DIV_ROUND_UP (uv -700000 ,12500 ) +1 ; + }else { +/* +* In case of the supported voltage range being +* between 0.6V - 1.3V, there is not specific +* formula for voltage to vsel conversion above +* 1.3V. There are special hardcoded values for +* voltages above 1.3V. Currently we are hardcodig +* only for 1.35 V which is used for 1GH OPP for +* OMAP4430. +*/ +if (uv ==1350000 ) +return 0x3A ; +return DIV_ROUND_UP (uv -600000 ,12500 ) +1 ; + } + } +return DIV_ROUND_UP (uv -600000 ,12500 ); } --1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH v2 03/11] OMAP4: Add the new voltage to vsel calculation formula
Quoted 72 lines
Quoted 72 lines
-----Original Message-----
From: Manuel, Lesly Arackal
Sent: Monday, September 27, 2010 9:44 AM
To: Gopinath, Thara; [email protected]
Cc: [email protected]; [email protected]; Cousson, Benoit; Sripathy, Vishwanath; Sawant, Anand
Subject: RE: [PATCH v2 03/11] OMAP4: Add the new voltage to vsel calculation formulaHi Thara,
Quoted 49 lines
-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Thara Gopinath
Sent: Saturday, September 25, 2010 6:21 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Thara Gopinath
Subject: [PATCH v2 03/11] OMAP4: Add the new voltage to vsel calculation formulaTWL6030 the power IC used along with OMAP4 in OMAP4 SDPs, blaze boards and panda boards has a different formula from that of TWL4030 for voltage to vsel and
vsel to voltage calculation. This patch implements the new formula depending on the PMIC type.Signed-off-by Thara Gopinath <[email protected]>--- arch/arm/plat-omap/opp_twl_tps.c | 71 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 71 insertions(+), 0 deletions(-)arch/arm/plat- renamed from arch/arm/plat-omap/opp_twl_tps.c +0
-0
omap/opp_twl_tps.c
index 4448fc5..358b67b 100644arch/arm/plat-omap/opp_twl_tps.c +8
-0@@ -15,9 +15,16 @@#include <linux/module.h> +#include <linux/i2c/twl.h> +#include <plat/opp_twl_tps.h> #include <plat/voltage.h> +static bool is_offset_valid; +static u8 smps_offset; + +#define REG_SMPS_OFFSET 0xE0 +/** * omap_twl_vsel_to_vdc - convert TWL/TPS VSEL value to microvolts DC * @vsel: TWL/TPS VSEL value to convert @@ -27,6 +34,38 @@*/ unsigned long omap_twl_vsel_to_uv (const u8 vsel) { +if (twl_class_is_6030 ()) {arch/arm/plat-omap/opp_twl_tps.c line 47
Quoted 10 lines
arch/arm/plat-omap/opp_twl_tps.c +10
-0+/* +* In TWL6030 depending on the value of SMPS_OFFSET +* efuse register the voltage range supported in +* standard mode can be either between 0.6V - 1.3V or +* 0.7V - 1.4V. In TWL6030 ES1.0 SMPS_OFFSET efuse +* is programmed to all 0's where as starting from +* TWL6030 ES1.1 the efuse is programmed to 1 +*/ +if (!is_offset_valid) { + twl_i2c_read_u8(TWL6030_MODULE_ID0, &smps_offset,
0xE0);
Quoted 5 lines
Quoted 5 lines
arch/arm/plat-omap/opp_twl_tps.c line 49
Quoted 2 lines
arch/arm/plat-omap/opp_twl_tps.c +2
-0+ is_offset_valid = true; + }Is it necessary to do the i2c read each time to check the
smps_offset? OR it can be done one time initially.
Hello Lesly,
It is not done every time. It is only done the first time omap_twl_vsel_to_uv or omap_twl_uv_to_vsel is called. If is_offset_valid, we do not read the register via i2c interface.
Regards
Thara
PATCH v2 4/11 OMAP4: Extend clock data.
In reply to Thara GopinathThis patch extends the OMAP4 clock data to include various x2 clockc nodes as the clock framework skips a *2 whie calculating the dpll locked frequency.
--- arch/arm/mach-omap2/clock44xx_data.c | 40 +++++++++++++++++++++++++++------ 1 files changed, 32 insertions(+), 8 deletions(-)
arch/arm/mach-omap2/clock44xx_data.c +32 -8
@@ -481,14 +481,21 @@ static struct clk dpll_core_m5_ck = { .set_rate = &omap2_clksel_set_rate, }; +static struct clk dpll_core_m5x2_ck = { + .name ="dpll_core_m5x2_ck" , + .parent = &dpll_core_m5_ck, + .ops = &clkops_null, + .recalc = &omap3_clkoutx2_recalc, +}; +static const struct clksel div_core_div[] = { - { .parent = &dpll_core_m5_ck, .rates = div2_1to2_rates }, + { .parent = &dpll_core_m5x2_ck, .rates = div2_1to2_rates }, { .parent =NULL }, };static struct clk div_core_ck = { .name ="div_core_ck" , - .parent = &dpll_core_m5_ck, + .parent = &dpll_core_m5x2_ck, .clksel = div_core_div, .clksel_reg =OMAP4430_CM_CLKSEL_CORE , .clksel_mask =OMAP4430_CLKSEL_CORE_MASK ,
@@ -507,13 +514,13 @@ static const struct clksel_rate div4_1to8_rates[] = { };static const struct clksel div_iva_hs_clk_div[] = { - { .parent = &dpll_core_m5_ck, .rates = div4_1to8_rates }, + { .parent = &dpll_core_m5x2_ck, .rates = div4_1to8_rates }, { .parent =NULL }, };static struct clk div_iva_hs_clk = { .name ="div_iva_hs_clk" , - .parent = &dpll_core_m5_ck, + .parent = &dpll_core_m5x2_ck, .clksel = div_iva_hs_clk_div, .clksel_reg =OMAP4430_CM_BYPCLK_DPLL_IVA , .clksel_mask =OMAP4430_CLKSEL_0_1_MASK ,
@@ -525,7 +532,7 @@ static struct clk div_iva_hs_clk = {static struct clk div_mpu_hs_clk = { .name ="div_mpu_hs_clk" , - .parent = &dpll_core_m5_ck, + .parent = &dpll_core_m5x2_ck, .clksel = div_iva_hs_clk_div, .clksel_reg =OMAP4430_CM_BYPCLK_DPLL_MPU , .clksel_mask =OMAP4430_CLKSEL_0_1_MASK ,
@@ -651,6 +658,13 @@ static struct clk dpll_iva_m4_ck = { .set_rate = &omap2_clksel_set_rate, }; +static struct clk dpll_iva_m4x2_ck = { + .name ="dpll_iva_m4x2_ck" , + .parent = &dpll_iva_m4_ck, + .ops = &clkops_null, + .recalc = &omap3_clkoutx2_recalc, +}; +static struct clk dpll_iva_m5_ck = { .name ="dpll_iva_m5_ck" , .parent = &dpll_iva_ck,
@@ -663,6 +677,13 @@ static struct clk dpll_iva_m5_ck = { .set_rate = &omap2_clksel_set_rate, }; +static struct clk dpll_iva_m5x2_ck = { + .name ="dpll_iva_m5x2_ck" , + .parent = &dpll_iva_m5_ck, + .ops = &clkops_null, + .recalc = &omap3_clkoutx2_recalc, +}; +/* DPLL_MPU */ static struct dpll_data dpll_mpu_dd = { .mult_div1_reg =OMAP4430_CM_CLKSEL_DPLL_MPU ,
@@ -1350,7 +1371,7 @@ static struct clk dsp_fck = { .enable_reg = OMAP4430_CM_TESLA_TESLA_CLKCTRL, .enable_bit = OMAP4430_MODULEMODE_HWCTRL, .clkdm_name = "tesla_clkdm", - .parent = &dpll_iva_m4_ck, + .parent = &dpll_iva_m4x2_ck, .recalc = &followparent_recalc, };
@@ -1725,7 +1746,7 @@ static struct clk iva_fck = { .enable_reg = OMAP4430_CM_IVAHD_IVAHD_CLKCTRL, .enable_bit = OMAP4430_MODULEMODE_HWCTRL, .clkdm_name = "ivahd_clkdm", - .parent = &dpll_iva_m5_ck, + .parent = &dpll_iva_m5x2_ck, .recalc = &followparent_recalc, };
@@ -2089,7 +2110,7 @@ static struct clk sl2if_ick = { .enable_reg = OMAP4430_CM_IVAHD_SL2_CLKCTRL, .enable_bit = OMAP4430_MODULEMODE_HWCTRL, .clkdm_name = "ivahd_clkdm", - .parent = &dpll_iva_m5_ck, + .parent = &dpll_iva_m5x2_ck, .recalc = &followparent_recalc, };
@@ -2782,6 +2803,7 @@ static struct omap_clk omap44xx_clks[] = {CLK (NULL ,"dpll_core_m2_ck" , &dpll_core_m2_ck,CK_443X ),CLK (NULL ,"ddrphy_ck" , &ddrphy_ck,CK_443X ),CLK (NULL ,"dpll_core_m5_ck" , &dpll_core_m5_ck,CK_443X ), +CLK (NULL ,"dpll_core_m5x2_ck" , &dpll_core_m5x2_ck,CK_443X ),CLK (NULL ,"div_core_ck" , &div_core_ck,CK_443X ),CLK (NULL ,"div_iva_hs_clk" , &div_iva_hs_clk,CK_443X ), CLK(NULL, "div_mpu_hs_clk", &div_mpu_hs_clk, CK_443X),
@@ -2793,7 +2815,9 @@ static struct omap_clk omap44xx_clks[] = {CLK (NULL ,"iva_hsd_byp_clk_mux_ck" , &iva_hsd_byp_clk_mux_ck,CK_443X ),CLK (NULL ,"dpll_iva_ck" , &dpll_iva_ck,CK_443X ),CLK (NULL ,"dpll_iva_m4_ck" , &dpll_iva_m4_ck,CK_443X ), +CLK (NULL ,"dpll_iva_m4x2_ck" , &dpll_iva_m4x2_ck,CK_443X ),CLK (NULL ,"dpll_iva_m5_ck" , &dpll_iva_m5_ck,CK_443X ), +CLK (NULL ,"dpll_iva_m5x2_ck" , &dpll_iva_m5x2_ck,CK_443X ),CLK (NULL ,"dpll_mpu_ck" , &dpll_mpu_ck,CK_443X ),CLK (NULL ,"dpll_mpu_m2_ck" , &dpll_mpu_m2_ck,CK_443X ), CLK(NULL, "per_hs_clk_div_ck", &per_hs_clk_div_ck, CK_443X),
Signature · 1 line
1.7.0.4
Re: [PATCH v2 04/11] OMAP4: Extend clock data.
Quoted 5 lines · Thara Gopinath
This patch extends the OMAP4 clock data to include various x2 clockc nodes as the clock framework skips a *2 whie calculating the dpll locked frequency.
Signed-off-by Thara Gopinath <[email protected]>
Please post this as a separate patch, and Paul can queue for 2.6.37.
Thanks,
Kevin
Quoted 130 lines
--- arch/arm/mach-omap2/clock44xx_data.c | 40 +++++++++++++++++++++++++++------ 1 files changed, 32 insertions(+), 8 deletions(-)arch/arm/mach-omap2/clock44xx_data.c +32
-8@@ -481,14 +481,21 @@ static struct clk dpll_core_m5_ck = { .set_rate = &omap2_clksel_set_rate, }; +static struct clk dpll_core_m5x2_ck = { + .name ="dpll_core_m5x2_ck" , + .parent = &dpll_core_m5_ck, + .ops = &clkops_null, + .recalc = &omap3_clkoutx2_recalc, +}; +static const struct clksel div_core_div[] = { - { .parent = &dpll_core_m5_ck, .rates = div2_1to2_rates }, + { .parent = &dpll_core_m5x2_ck, .rates = div2_1to2_rates }, { .parent =NULL }, };static struct clk div_core_ck = { .name ="div_core_ck" , - .parent = &dpll_core_m5_ck, + .parent = &dpll_core_m5x2_ck, .clksel = div_core_div, .clksel_reg =OMAP4430_CM_CLKSEL_CORE , .clksel_mask =OMAP4430_CLKSEL_CORE_MASK ,@@ -507,13 +514,13 @@ static const struct clksel_rate div4_1to8_rates[] = { };static const struct clksel div_iva_hs_clk_div[] = { - { .parent = &dpll_core_m5_ck, .rates = div4_1to8_rates }, + { .parent = &dpll_core_m5x2_ck, .rates = div4_1to8_rates }, { .parent =NULL }, };static struct clk div_iva_hs_clk = { .name ="div_iva_hs_clk" , - .parent = &dpll_core_m5_ck, + .parent = &dpll_core_m5x2_ck, .clksel = div_iva_hs_clk_div, .clksel_reg =OMAP4430_CM_BYPCLK_DPLL_IVA , .clksel_mask =OMAP4430_CLKSEL_0_1_MASK ,@@ -525,7 +532,7 @@ static struct clk div_iva_hs_clk = {static struct clk div_mpu_hs_clk = { .name ="div_mpu_hs_clk" , - .parent = &dpll_core_m5_ck, + .parent = &dpll_core_m5x2_ck, .clksel = div_iva_hs_clk_div, .clksel_reg =OMAP4430_CM_BYPCLK_DPLL_MPU , .clksel_mask =OMAP4430_CLKSEL_0_1_MASK ,@@ -651,6 +658,13 @@ static struct clk dpll_iva_m4_ck = { .set_rate = &omap2_clksel_set_rate, }; +static struct clk dpll_iva_m4x2_ck = { + .name ="dpll_iva_m4x2_ck" , + .parent = &dpll_iva_m4_ck, + .ops = &clkops_null, + .recalc = &omap3_clkoutx2_recalc, +}; +static struct clk dpll_iva_m5_ck = { .name ="dpll_iva_m5_ck" , .parent = &dpll_iva_ck,@@ -663,6 +677,13 @@ static struct clk dpll_iva_m5_ck = { .set_rate = &omap2_clksel_set_rate, }; +static struct clk dpll_iva_m5x2_ck = { + .name ="dpll_iva_m5x2_ck" , + .parent = &dpll_iva_m5_ck, + .ops = &clkops_null, + .recalc = &omap3_clkoutx2_recalc, +}; +/* DPLL_MPU */ static struct dpll_data dpll_mpu_dd = { .mult_div1_reg =OMAP4430_CM_CLKSEL_DPLL_MPU ,@@ -1350,7 +1371,7 @@ static struct clk dsp_fck = { .enable_reg = OMAP4430_CM_TESLA_TESLA_CLKCTRL, .enable_bit = OMAP4430_MODULEMODE_HWCTRL, .clkdm_name = "tesla_clkdm", - .parent = &dpll_iva_m4_ck, + .parent = &dpll_iva_m4x2_ck, .recalc = &followparent_recalc, };@@ -1725,7 +1746,7 @@ static struct clk iva_fck = { .enable_reg = OMAP4430_CM_IVAHD_IVAHD_CLKCTRL, .enable_bit = OMAP4430_MODULEMODE_HWCTRL, .clkdm_name = "ivahd_clkdm", - .parent = &dpll_iva_m5_ck, + .parent = &dpll_iva_m5x2_ck, .recalc = &followparent_recalc, };@@ -2089,7 +2110,7 @@ static struct clk sl2if_ick = { .enable_reg = OMAP4430_CM_IVAHD_SL2_CLKCTRL, .enable_bit = OMAP4430_MODULEMODE_HWCTRL, .clkdm_name = "ivahd_clkdm", - .parent = &dpll_iva_m5_ck, + .parent = &dpll_iva_m5x2_ck, .recalc = &followparent_recalc, };@@ -2782,6 +2803,7 @@ static struct omap_clk omap44xx_clks[] = {CLK (NULL ,"dpll_core_m2_ck" , &dpll_core_m2_ck,CK_443X ),CLK (NULL ,"ddrphy_ck" , &ddrphy_ck,CK_443X ),CLK (NULL ,"dpll_core_m5_ck" , &dpll_core_m5_ck,CK_443X ), +CLK (NULL ,"dpll_core_m5x2_ck" , &dpll_core_m5x2_ck,CK_443X ),CLK (NULL ,"div_core_ck" , &div_core_ck,CK_443X ),CLK (NULL ,"div_iva_hs_clk" , &div_iva_hs_clk,CK_443X ), CLK(NULL, "div_mpu_hs_clk", &div_mpu_hs_clk, CK_443X),@@ -2793,7 +2815,9 @@ static struct omap_clk omap44xx_clks[] = {CLK (NULL ,"iva_hsd_byp_clk_mux_ck" , &iva_hsd_byp_clk_mux_ck,CK_443X ),CLK (NULL ,"dpll_iva_ck" , &dpll_iva_ck,CK_443X ),CLK (NULL ,"dpll_iva_m4_ck" , &dpll_iva_m4_ck,CK_443X ), +CLK (NULL ,"dpll_iva_m4x2_ck" , &dpll_iva_m4x2_ck,CK_443X ),CLK (NULL ,"dpll_iva_m5_ck" , &dpll_iva_m5_ck,CK_443X ), +CLK (NULL ,"dpll_iva_m5x2_ck" , &dpll_iva_m5x2_ck,CK_443X ),CLK (NULL ,"dpll_mpu_ck" , &dpll_mpu_ck,CK_443X ),CLK (NULL ,"dpll_mpu_m2_ck" , &dpll_mpu_m2_ck,CK_443X ), CLK(NULL, "per_hs_clk_div_ck", &per_hs_clk_div_ck, CK_443X),
RE: [PATCH v2 04/11] OMAP4: Extend clock data.
Quoted 16 lines
Quoted 16 lines
-----Original Message-----
From: Kevin Hilman [mailto:[email protected]]
Sent: Wednesday, September 29, 2010 4:39 AM
To: Gopinath, Thara
Cc: [email protected]; [email protected]; Cousson, Benoit; Sripathy, Vishwanath; Sawant, Anand
Subject: Re: [PATCH v2 04/11] OMAP4: Extend clock data.Quoted 4 lines · Thara Gopinath
This patch extends the OMAP4 clock data to include various x2 clockc nodes as the clock framework skips a *2 whie calculating the dpll locked frequency.
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Thara Gopinath <[email protected]>Acked-by Kevin Hilman <[email protected]>Please post this as a separate patch, and Paul can queue for 2.6.37.
Ok I will post this as a separate patch.
Regards
Thara
Quoted 142 lines
Quoted 142 lines
Thanks,
Kevin
Quoted 2 lines
--- arch/arm/mach-omap2/clock44xx_data.c | 40 +++++++++++++++++++++++++++------
arch/arm/mach-
Quoted 3 lines
1 files changed, 32 insertions(+), 8 deletions(-)arch/arm/mach- renamed from arch/arm/mach-omap2/clock44xx_data.c +0
-0
omap2/clock44xx_data.cQuoted 108 lines
index edf2c28..3652fda 100644
arch/arm/mach-omap2/clock44xx_data.c +29
-8@@ -481,14 +481,21 @@ static struct clk dpll_core_m5_ck = { .set_rate = &omap2_clksel_set_rate, }; +static struct clk dpll_core_m5x2_ck = { + .name ="dpll_core_m5x2_ck" , + .parent = &dpll_core_m5_ck, + .ops = &clkops_null, + .recalc = &omap3_clkoutx2_recalc, +}; +static const struct clksel div_core_div[] = { - { .parent = &dpll_core_m5_ck, .rates = div2_1to2_rates }, + { .parent = &dpll_core_m5x2_ck, .rates = div2_1to2_rates }, { .parent =NULL }, };static struct clk div_core_ck = { .name ="div_core_ck" , - .parent = &dpll_core_m5_ck, + .parent = &dpll_core_m5x2_ck, .clksel = div_core_div, .clksel_reg =OMAP4430_CM_CLKSEL_CORE , .clksel_mask =OMAP4430_CLKSEL_CORE_MASK ,@@ -507,13 +514,13 @@ static const struct clksel_rate div4_1to8_rates[] = { };static const struct clksel div_iva_hs_clk_div[] = { - { .parent = &dpll_core_m5_ck, .rates = div4_1to8_rates }, + { .parent = &dpll_core_m5x2_ck, .rates = div4_1to8_rates }, { .parent =NULL }, };static struct clk div_iva_hs_clk = { .name ="div_iva_hs_clk" , - .parent = &dpll_core_m5_ck, + .parent = &dpll_core_m5x2_ck, .clksel = div_iva_hs_clk_div, .clksel_reg =OMAP4430_CM_BYPCLK_DPLL_IVA , .clksel_mask =OMAP4430_CLKSEL_0_1_MASK ,@@ -525,7 +532,7 @@ static struct clk div_iva_hs_clk = {static struct clk div_mpu_hs_clk = { .name ="div_mpu_hs_clk" , - .parent = &dpll_core_m5_ck, + .parent = &dpll_core_m5x2_ck, .clksel = div_iva_hs_clk_div, .clksel_reg =OMAP4430_CM_BYPCLK_DPLL_MPU , .clksel_mask =OMAP4430_CLKSEL_0_1_MASK ,@@ -651,6 +658,13 @@ static struct clk dpll_iva_m4_ck = { .set_rate = &omap2_clksel_set_rate, }; +static struct clk dpll_iva_m4x2_ck = { + .name ="dpll_iva_m4x2_ck" , + .parent = &dpll_iva_m4_ck, + .ops = &clkops_null, + .recalc = &omap3_clkoutx2_recalc, +}; +static struct clk dpll_iva_m5_ck = { .name ="dpll_iva_m5_ck" , .parent = &dpll_iva_ck,@@ -663,6 +677,13 @@ static struct clk dpll_iva_m5_ck = { .set_rate = &omap2_clksel_set_rate, }; +static struct clk dpll_iva_m5x2_ck = { + .name ="dpll_iva_m5x2_ck" , + .parent = &dpll_iva_m5_ck, + .ops = &clkops_null, + .recalc = &omap3_clkoutx2_recalc, +}; +/* DPLL_MPU */ static struct dpll_data dpll_mpu_dd = { .mult_div1_reg =OMAP4430_CM_CLKSEL_DPLL_MPU ,@@ -1350,7 +1371,7 @@ static struct clk dsp_fck = { .enable_reg = OMAP4430_CM_TESLA_TESLA_CLKCTRL, .enable_bit = OMAP4430_MODULEMODE_HWCTRL, .clkdm_name = "tesla_clkdm", - .parent = &dpll_iva_m4_ck, + .parent = &dpll_iva_m4x2_ck, .recalc = &followparent_recalc, };@@ -1725,7 +1746,7 @@ static struct clk iva_fck = { .enable_reg = OMAP4430_CM_IVAHD_IVAHD_CLKCTRL, .enable_bit = OMAP4430_MODULEMODE_HWCTRL, .clkdm_name = "ivahd_clkdm", - .parent = &dpll_iva_m5_ck, + .parent = &dpll_iva_m5x2_ck, .recalc = &followparent_recalc, };@@ -2089,7 +2110,7 @@ static struct clk sl2if_ick = { .enable_reg = OMAP4430_CM_IVAHD_SL2_CLKCTRL, .enable_bit = OMAP4430_MODULEMODE_HWCTRL, .clkdm_name = "ivahd_clkdm", - .parent = &dpll_iva_m5_ck, + .parent = &dpll_iva_m5x2_ck, .recalc = &followparent_recalc, };arch/arm/mach-omap2/clock44xx_data.c static struct omap_clk omap44xx_clks[] = { · line 2806
Quoted 4 lines
arch/arm/mach-omap2/clock44xx_data.c +1
-0@@ -2782,6 +2803,7 @@ static struct omap_clk omap44xx_clks[] = {CLK (NULL ,"dpll_core_m2_ck" , &dpll_core_m2_ck,CK_443X ),CLK (NULL ,"ddrphy_ck" , &ddrphy_ck,CK_443X ),CLK (NULL ,"dpll_core_m5_ck" , &dpll_core_m5_ck,CK_443X ), + CLK(NULL, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck,CK_443X),arch/arm/mach-omap2/clock44xx_data.c static struct omap_clk omap44xx_clks[] = { · line 2815
Quoted 5 lines
arch/arm/mach-omap2/clock44xx_data.c +0
-0CLK (NULL ,"div_core_ck" , &div_core_ck,CK_443X ),CLK (NULL ,"div_iva_hs_clk" , &div_iva_hs_clk,CK_443X ), CLK(NULL, "div_mpu_hs_clk", &div_mpu_hs_clk, CK_443X),@@ -2793,7 +2815,9 @@ static struct omap_clk omap44xx_clks[] = { CLK(NULL, "iva_hsd_byp_clk_mux_ck", &iva_hsd_byp_clk_mux_ck,CK_443X),arch/arm/mach-omap2/clock44xx_data.c static struct omap_clk omap44xx_clks[] = {
Quoted 3 lines
arch/arm/mach-omap2/clock44xx_data.c +1
-0CLK (NULL ,"dpll_iva_ck" , &dpll_iva_ck,CK_443X ),CLK (NULL ,"dpll_iva_m4_ck" , &dpll_iva_m4_ck,CK_443X ), + CLK(NULL, "dpll_iva_m4x2_ck", &dpll_iva_m4x2_ck,CK_443X),arch/arm/mach-omap2/clock44xx_data.c static struct omap_clk omap44xx_clks[] = { · line 2820
Quoted 2 lines
arch/arm/mach-omap2/clock44xx_data.c +1
-0CLK (NULL ,"dpll_iva_m5_ck" , &dpll_iva_m5_ck,CK_443X ), + CLK(NULL, "dpll_iva_m5x2_ck", &dpll_iva_m5x2_ck,CK_443X),arch/arm/mach-omap2/clock44xx_data.c static struct omap_clk omap44xx_clks[] = {
Quoted 3 lines
arch/arm/mach-omap2/clock44xx_data.c +0
-0CLK (NULL ,"dpll_mpu_ck" , &dpll_mpu_ck,CK_443X ),CLK (NULL ,"dpll_mpu_m2_ck" , &dpll_mpu_m2_ck,CK_443X ), CLK(NULL, "per_hs_clk_div_ck", &per_hs_clk_div_ck,CK_443X),
PATCH v2 5/11 OMAP4: Adding voltage driver support
In reply to Thara GopinathOMAP4 has three scalable voltage domains vdd_mpu, vdd_iva and vdd_core. This patch adds the voltage tables and other configurable voltage processor and voltage controller settings to control these three scalable domains in OMAP4.
--- arch/arm/mach-omap2/Makefile | 2 +- arch/arm/mach-omap2/voltage.c | 211 ++++++++++++++++++++++++++++- arch/arm/plat-omap/include/plat/voltage.h | 20 +++- 3 files changed, 229 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/Makefile +1 -1
@@ -52,7 +52,7 @@ obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o pm_bus.o obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o voltage.o \ cpuidle34xx.o pm_bus.o -obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o pm_bus.o +obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o voltage.o pm_bus.o obj-$(CONFIG_PM_DEBUG) += pm-debug.o obj-$(CONFIG_OMAP_SMARTREFLEX) += sr_device.o smartreflex.o obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3) += smartreflex-class3.o
arch/arm/mach-omap2/voltage.c +209 -2
264 lines not on this page · raw message
arch/arm/plat-omap/include/plat/voltage.h +19 -1
@@ -27,6 +27,12 @@ extern struct dentry *pm_dbg_main_dir;#define OMAP3_VDD1_SR_CONTROL_REG 0x00#define OMAP3_VDD2_SR_CONTROL_REG 0x01 +/* Voltage SR parameters for OMAP4 */ +#define OMAP4_SRI2C_SLAVE_ADDR 0x12 +#define OMAP4_VDD_MPU_SR_VOLT_REG 0x55 +#define OMAP4_VDD_IVA_SR_VOLT_REG 0x5B +#define OMAP4_VDD_CORE_SR_VOLT_REG 0x61 +/* * Omap3 VP register specific values. Maybe these need to come from * board file or PMIC data structure
@@ -56,7 +62,19 @@ extern struct dentry *pm_dbg_main_dir;#define OMAP3630_VP2_VLIMITTO_VDDMIN 0x18#define OMAP3630_VP2_VLIMITTO_VDDMAX 0x30 -/* TODO OMAP4 VP register values if the same file is used for OMAP4*/ +/* OMAP4 VP register values */ +#define OMAP4_VP_CONFIG_ERROROFFSET 0x00 +#define OMAP4_VP_VSTEPMIN_SMPSWAITTIMEMIN 0x3C +#define OMAP4_VP_VSTEPMIN_VSTEPMIN 0x1 +#define OMAP4_VP_VSTEPMAX_SMPSWAITTIMEMAX 0x3C +#define OMAP4_VP_VSTEPMAX_VSTEPMAX 0x04 +#define OMAP4_VP_VLIMITTO_TIMEOUT_US 0x200 +#define OMAP4_VP_MPU_VLIMITTO_VDDMIN 0x18 +#define OMAP4_VP_MPU_VLIMITTO_VDDMAX 0x3C +#define OMAP4_VP_IVA_VLIMITTO_VDDMIN 0x18 +#define OMAP4_VP_IVA_VLIMITTO_VDDMAX 0x3C +#define OMAP4_VP_CORE_VLIMITTO_VDDMIN 0x18 +#define OMAP4_VP_CORE_VLIMITTO_VDDMAX 0x30/** * voltagedomain - omap voltage domain global structure
Signature · 1 line
1.7.0.4
PATCH v2 6/11 OMAP4: PM: Program correct init voltages for scalable VDDs
In reply to Thara GopinathBy default the system boots up at nominal voltage for every voltage domain in the system. This patch puts vdd_mpu, vdd_iva and vdd_core to the correct boot up voltage as per the opp tables specified. This patch implements this by matching the rate of the main clock of the voltage domain with the opp table and picking up the correct voltage.
--- arch/arm/mach-omap2/pm.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/pm.c +4 -0
@@ -207,6 +207,10 @@ static int __init omap2_common_pm_init(void)omap3_pm_init_opp_table ();omap2_set_init_voltage ("mpu" ,"dpll1_ck" , mpu_dev);omap2_set_init_voltage ("core" ,"l3_ick" , l3_dev); + }else if (cpu_is_omap44xx ()) { +omap2_set_init_voltage ("mpu" ,"dpll_mpu_ck" , mpu_dev); +omap2_set_init_voltage ("core" ,"l3_div_ck" , l3_dev); +omap2_set_init_voltage ("iva" ,"dpll_iva_m5x2_ck" , iva_dev); }omap_pm_if_init ();
Signature · 1 line
1.7.0.4
PATCH v2 7/11 OMAP4: hwmod: Add inital data for smartreflex modules.
In reply to Thara GopinathFrom: Benoit Cousson <[email protected]>
This patch adds the hwmod details for OMAP4 smartreflex modules.
--- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 163 ++++++++++++++++++++++++++++ 1 files changed, 163 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +163 -0
@@ -452,6 +452,165 @@ static struct omap_hwmod omap44xx_mpu_hwmod = { .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), }; +/* +* 'smartreflex' class +* smartreflex module (monitor silicon performance and outputs a measure of +* performance error) +*/ + +/* The IP is not compliant to type1 / type2 scheme */ +static struct omap_hwmod_sysc_fields omap_hwmod_sysc_type_smartreflex = { + .sidle_shift =24 , + .enwkup_shift =26 , +}; + +static struct omap_hwmod_class_sysconfig omap44xx_smartreflex_sysc = { + .sysc_offs =0x0038 , + .sysc_flags = (SYSC_HAS_ENAWAKEUP |SYSC_HAS_SIDLEMODE ), + .idlemodes = (SIDLE_FORCE |SIDLE_NO |SIDLE_SMART ), + .sysc_fields = &omap_hwmod_sysc_type_smartreflex, +}; + +static struct omap_hwmod_class omap44xx_smartreflex_hwmod_class = { + .name ="smartreflex" , + .sysc = &omap44xx_smartreflex_sysc, +}; + +/* smartreflex_core */ +static struct omap_hwmod omap44xx_smartreflex_core_hwmod; +static struct omap_hwmod_irq_info omap44xx_smartreflex_core_irqs[] = { + { .irq =19 +OMAP44XX_IRQ_GIC_START }, +}; + +static struct omap_hwmod_addr_space omap44xx_smartreflex_core_addrs[] = { + { + .pa_start =0x4a0dd000 , + .pa_end =0x4a0dd03f , + .flags =ADDR_TYPE_RT + }, +}; + +/* l4_cfg -> smartreflex_core */ +static struct omap_hwmod_ocp_if omap44xx_l4_cfg__smartreflex_core = { + .master = &omap44xx_l4_cfg_hwmod, + .slave = &omap44xx_smartreflex_core_hwmod, + .clk ="l4_div_ck" , + .addr = omap44xx_smartreflex_core_addrs, + .addr_cnt =ARRAY_SIZE (omap44xx_smartreflex_core_addrs), + .user =OCP_USER_MPU |OCP_USER_SDMA , +}; + +/* smartreflex_core slave ports */ +static struct omap_hwmod_ocp_if *omap44xx_smartreflex_core_slaves[] = { + &omap44xx_l4_cfg__smartreflex_core, +}; + +static struct omap_hwmod omap44xx_smartreflex_core_hwmod = { + .name ="smartreflex_core" , + .class = &omap44xx_smartreflex_hwmod_class, + .mpu_irqs = omap44xx_smartreflex_core_irqs, + .mpu_irqs_cnt =ARRAY_SIZE (omap44xx_smartreflex_core_irqs), + .main_clk ="smartreflex_core_fck" , + .prcm = { + .omap4 = { + .clkctrl_reg =OMAP4430_CM_ALWON_SR_CORE_CLKCTRL , + }, + }, + .slaves = omap44xx_smartreflex_core_slaves, + .slaves_cnt =ARRAY_SIZE (omap44xx_smartreflex_core_slaves), + .omap_chip =OMAP_CHIP_INIT (CHIP_IS_OMAP4430 ), +}; + +/* smartreflex_iva */ +static struct omap_hwmod omap44xx_smartreflex_iva_hwmod; +static struct omap_hwmod_irq_info omap44xx_smartreflex_iva_irqs[] = { + { .irq =102 +OMAP44XX_IRQ_GIC_START }, +}; + +static struct omap_hwmod_addr_space omap44xx_smartreflex_iva_addrs[] = { + { + .pa_start =0x4a0db000 , + .pa_end =0x4a0db03f , + .flags =ADDR_TYPE_RT + }, +}; + +/* l4_cfg -> smartreflex_iva */ +static struct omap_hwmod_ocp_if omap44xx_l4_cfg__smartreflex_iva = { + .master = &omap44xx_l4_cfg_hwmod, + .slave = &omap44xx_smartreflex_iva_hwmod, + .clk ="l4_div_ck" , + .addr = omap44xx_smartreflex_iva_addrs, + .addr_cnt =ARRAY_SIZE (omap44xx_smartreflex_iva_addrs), + .user =OCP_USER_MPU |OCP_USER_SDMA , +}; + +/* smartreflex_iva slave ports */ +static struct omap_hwmod_ocp_if *omap44xx_smartreflex_iva_slaves[] = { + &omap44xx_l4_cfg__smartreflex_iva, +}; + +static struct omap_hwmod omap44xx_smartreflex_iva_hwmod = { + .name ="smartreflex_iva" , + .class = &omap44xx_smartreflex_hwmod_class, + .mpu_irqs = omap44xx_smartreflex_iva_irqs, + .mpu_irqs_cnt =ARRAY_SIZE (omap44xx_smartreflex_iva_irqs), + .main_clk ="smartreflex_iva_fck" , + .prcm = { + .omap4 = { + .clkctrl_reg =OMAP4430_CM_ALWON_SR_IVA_CLKCTRL , + }, + }, + .slaves = omap44xx_smartreflex_iva_slaves, + .slaves_cnt =ARRAY_SIZE (omap44xx_smartreflex_iva_slaves), + .omap_chip =OMAP_CHIP_INIT (CHIP_IS_OMAP4430 ), +}; + +/* smartreflex_mpu */ +static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod; +static struct omap_hwmod_irq_info omap44xx_smartreflex_mpu_irqs[] = { + { .irq =18 +OMAP44XX_IRQ_GIC_START }, +}; + +static struct omap_hwmod_addr_space omap44xx_smartreflex_mpu_addrs[] = { + { + .pa_start =0x4a0d9000 , + .pa_end =0x4a0d903f , + .flags =ADDR_TYPE_RT + }, +}; + +/* l4_cfg -> smartreflex_mpu */ +static struct omap_hwmod_ocp_if omap44xx_l4_cfg__smartreflex_mpu = { + .master = &omap44xx_l4_cfg_hwmod, + .slave = &omap44xx_smartreflex_mpu_hwmod, + .clk ="l4_div_ck" , + .addr = omap44xx_smartreflex_mpu_addrs, + .addr_cnt =ARRAY_SIZE (omap44xx_smartreflex_mpu_addrs), + .user =OCP_USER_MPU |OCP_USER_SDMA , +}; + +/* smartreflex_mpu slave ports */ +static struct omap_hwmod_ocp_if *omap44xx_smartreflex_mpu_slaves[] = { + &omap44xx_l4_cfg__smartreflex_mpu, +}; + +static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = { + .name ="smartreflex_mpu" , + .class = &omap44xx_smartreflex_hwmod_class, + .mpu_irqs = omap44xx_smartreflex_mpu_irqs, + .mpu_irqs_cnt =ARRAY_SIZE (omap44xx_smartreflex_mpu_irqs), + .main_clk ="smartreflex_mpu_fck" , + .prcm = { + .omap4 = { + .clkctrl_reg =OMAP4430_CM_ALWON_SR_MPU_CLKCTRL , + }, + }, + .slaves = omap44xx_smartreflex_mpu_slaves, + .slaves_cnt =ARRAY_SIZE (omap44xx_smartreflex_mpu_slaves), + .omap_chip =OMAP_CHIP_INIT (CHIP_IS_OMAP4430 ), +}; +static __initdata struct omap_hwmod *omap44xx_hwmods[] = {/* dmm class */ &omap44xx_dmm_hwmod,
@@ -472,6 +631,10 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {/* mpu class */ &omap44xx_mpu_hwmod, + + &omap44xx_smartreflex_core_hwmod, + &omap44xx_smartreflex_iva_hwmod, + &omap44xx_smartreflex_mpu_hwmod, NULL, };
Signature · 1 line
1.7.0.4
PATCH v2 8/11 OMAP4: Adding dev atrributes to OMAP4 smartreflex hwmod data
In reply to Thara GopinathThis patch adds dev attributes for smartreflex modules in the OMAP4 hwmod database. This patch also updates the smartreflex rev in the smartreflex class data structure in the OMAP4 hwmod database.
--- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 56 ++++++++++++++++++++++++++++ arch/arm/plat-omap/include/plat/control.h | 12 ++++++ 2 files changed, 68 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +56 -0
@@ -22,6 +22,8 @@#include <plat/omap_hwmod.h> #include <plat/cpu.h> +#include <plat/smartreflex.h> +#include <plat/control.h> #include "omap_hwmod_common_data.h"
@@ -474,6 +476,7 @@ static struct omap_hwmod_class_sysconfig omap44xx_smartreflex_sysc = {static struct omap_hwmod_class omap44xx_smartreflex_hwmod_class = { .name ="smartreflex" , .sysc = &omap44xx_smartreflex_sysc, + .rev =2 , };/* smartreflex_core */
@@ -505,6 +508,22 @@ static struct omap_hwmod_ocp_if *omap44xx_smartreflex_core_slaves[] = { &omap44xx_l4_cfg__smartreflex_core, }; +static u32 omap44xx_sr_core_efuse_offs[] = { +OMAP44XX_CONTROL_FUSE_CORE_OPP50 ,OMAP44XX_CONTROL_FUSE_CORE_OPP100 , +}; + +static u32 omap44xx_sr_core_test_nvalues[] = { +0x0 ,0x0 +}; + +static struct omap_sr_dev_data omap44xx_sr_core_dev_attr = { + .efuse_nvalues_offs = omap44xx_sr_core_efuse_offs, + .test_sennenable =0x1 , + .test_senpenable =0x1 , + .test_nvalues = omap44xx_sr_core_test_nvalues, + .vdd_name ="core" +}; +static struct omap_hwmod omap44xx_smartreflex_core_hwmod = { .name ="smartreflex_core" , .class = &omap44xx_smartreflex_hwmod_class,
@@ -518,6 +537,7 @@ static struct omap_hwmod omap44xx_smartreflex_core_hwmod = { }, .slaves = omap44xx_smartreflex_core_slaves, .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_core_slaves), + .dev_attr = &omap44xx_sr_core_dev_attr, .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), };
@@ -550,6 +570,23 @@ static struct omap_hwmod_ocp_if *omap44xx_smartreflex_iva_slaves[] = { &omap44xx_l4_cfg__smartreflex_iva, }; +static u32 omap44xx_sr_iva_efuse_offs[] = { +OMAP44XX_CONTROL_FUSE_IVA_OPP50 ,OMAP44XX_CONTROL_FUSE_IVA_OPP100 , +OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO , +}; + +static u32 omap44xx_sr_iva_test_nvalues[] = { +0x0 ,0x0 ,0x0 ,0x0 +}; + +static struct omap_sr_dev_data omap44xx_sr_iva_dev_attr = { + .efuse_nvalues_offs = omap44xx_sr_iva_efuse_offs, + .test_sennenable =0x1 , + .test_senpenable =0x1 , + .test_nvalues = omap44xx_sr_iva_test_nvalues, + .vdd_name ="iva" +}; +static struct omap_hwmod omap44xx_smartreflex_iva_hwmod = { .name ="smartreflex_iva" , .class = &omap44xx_smartreflex_hwmod_class,
@@ -563,6 +600,7 @@ static struct omap_hwmod omap44xx_smartreflex_iva_hwmod = { }, .slaves = omap44xx_smartreflex_iva_slaves, .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_iva_slaves), + .dev_attr = &omap44xx_sr_iva_dev_attr, .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), };
@@ -595,6 +633,23 @@ static struct omap_hwmod_ocp_if *omap44xx_smartreflex_mpu_slaves[] = { &omap44xx_l4_cfg__smartreflex_mpu, }; +static u32 omap44xx_sr_mpu_efuse_offs[] = { +OMAP44XX_CONTROL_FUSE_MPU_OPP50 ,OMAP44XX_CONTROL_FUSE_MPU_OPP100 , +OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO ,OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO , +}; + +static u32 omap44xx_sr_mpu_test_nvalues[] = { +0x0 ,0x0 ,0x0 ,0x0 +}; + +static struct omap_sr_dev_data omap44xx_sr_mpu_dev_attr = { + .efuse_nvalues_offs = omap44xx_sr_mpu_efuse_offs, + .test_sennenable =0x1 , + .test_senpenable =0x1 , + .test_nvalues = omap44xx_sr_mpu_test_nvalues, + .vdd_name ="mpu" +}; +static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = { .name ="smartreflex_mpu" , .class = &omap44xx_smartreflex_hwmod_class,
@@ -608,6 +663,7 @@ static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = { }, .slaves = omap44xx_smartreflex_mpu_slaves, .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_mpu_slaves), + .dev_attr = &omap44xx_sr_mpu_dev_attr, .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), };
arch/arm/plat-omap/include/plat/control.h +12 -0
@@ -181,6 +181,18 @@#define OMAP3630_CONTROL_FUSE_OPP50_VDD2 (OMAP2_CONTROL_GENERAL + 0x0128)#define OMAP3630_CONTROL_FUSE_OPP100_VDD2 (OMAP2_CONTROL_GENERAL + 0x012C) +/* 44xx control efuse offsets */ +#define OMAP44XX_CONTROL_FUSE_IVA_OPP50 0x22C +#define OMAP44XX_CONTROL_FUSE_IVA_OPP100 0x22F +#define OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO 0x232 +#define OMAP44XX_CONTROL_FUSE_IVA_OPPNITRO 0x235 +#define OMAP44XX_CONTROL_FUSE_MPU_OPP50 0x240 +#define OMAP44XX_CONTROL_FUSE_MPU_OPP100 0x243 +#define OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO 0x246 +#define OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO 0x249 +#define OMAP44XX_CONTROL_FUSE_CORE_OPP50 0x254 +#define OMAP44XX_CONTROL_FUSE_CORE_OPP100 0x257 +/* AM35XX only CONTROL_GENERAL register offsets */ #define AM35XX_CONTROL_MSUSPENDMUX_6 (OMAP2_CONTROL_GENERAL + 0x0038)#define AM35XX_CONTROL_DEVCONF2 (OMAP2_CONTROL_GENERAL + 0x0310)
Signature · 1 line
1.7.0.4
Re: [PATCH v2 08/11] OMAP4: Adding dev atrributes to OMAP4 smartreflex hwmod data
Quoted 13 lines · Thara Gopinath
arch/arm/plat-omap/include/plat/control.h +2
-0@@ -181,6 +181,18 @@#define OMAP3630_CONTROL_FUSE_OPP50_VDD2 (OMAP2_CONTROL_GENERAL + 0x0128)#define OMAP3630_CONTROL_FUSE_OPP100_VDD2 (OMAP2_CONTROL_GENERAL +0x012C ) +/* 44xx control efuse offsets */ +#define OMAP44XX_CONTROL_FUSE_IVA_OPP50 0x22C
arch/arm/plat-omap/include/plat/control.h line 197
Quoted 10 lines
arch/arm/plat-omap/include/plat/control.h +10
-0+#define OMAP44XX_CONTROL_FUSE_IVA_OPP100 0x22F +#define OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO 0x232 +#define OMAP44XX_CONTROL_FUSE_IVA_OPPNITRO 0x235 +#define OMAP44XX_CONTROL_FUSE_MPU_OPP50 0x240 +#define OMAP44XX_CONTROL_FUSE_MPU_OPP100 0x243 +#define OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO 0x246 +#define OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO 0x249 +#define OMAP44XX_CONTROL_FUSE_CORE_OPP50 0x254 +#define OMAP44XX_CONTROL_FUSE_CORE_OPP100 0x257 +
These names are not consistent with the TRM (ES2.x NDA TRM vL). e.g. rather than MPU_OPP50, OPP1, the TRM has MPU_0, MPU_1. However, the TRM is confusing here too since the register names are MPU_0, MPU_1, etc. but the field names in the register descriptions use OPP50, OPP100, etc. What a mess. We need a consistent naming for these.
Benoit?
Also, based on the TRM, the offsets here don't look quite right. e.g. there is no MPU OPP at 0x240, so the OMAP4 the code reading these is using reserved/undocumented bits for the first OPP.
Also, the single byte offsets here could use a better explanation, not necessarily here but in the omap4 code that reads the nvalues. I expected that these would be single byte aligned to compact the address space and remove some unused space, but no, they seem to be arbitrarily shifted around.
Kevin
Re: [PATCH v2 08/11] OMAP4: Adding dev atrributes to OMAP4 smartreflex hwmod data
Hi Kevin,
Sorry for that late reply, I missed that email a little bit.
Quoted 31 lines · Kevin Hilman
Quoted 13 lines · Thara Gopinath
arch/arm/plat-omap/include/plat/control.h +2
-0@@ -181,6 +181,18 @@#define OMAP3630_CONTROL_FUSE_OPP50_VDD2 (OMAP2_CONTROL_GENERAL + 0x0128)#define OMAP3630_CONTROL_FUSE_OPP100_VDD2 (OMAP2_CONTROL_GENERAL +0x012C ) +/* 44xx control efuse offsets */ +#define OMAP44XX_CONTROL_FUSE_IVA_OPP50 0x22Carch/arm/plat-omap/include/plat/control.h line 197
Quoted 10 lines
arch/arm/plat-omap/include/plat/control.h +10
-0+#define OMAP44XX_CONTROL_FUSE_IVA_OPP100 0x22F +#define OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO 0x232 +#define OMAP44XX_CONTROL_FUSE_IVA_OPPNITRO 0x235 +#define OMAP44XX_CONTROL_FUSE_MPU_OPP50 0x240 +#define OMAP44XX_CONTROL_FUSE_MPU_OPP100 0x243 +#define OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO 0x246 +#define OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO 0x249 +#define OMAP44XX_CONTROL_FUSE_CORE_OPP50 0x254 +#define OMAP44XX_CONTROL_FUSE_CORE_OPP100 0x257 +These names are not consistent with the TRM (ES2.x NDA TRM vL). e.g. rather than
MPU_OPP50, OPP1, the TRM hasMPU_0,MPU_1. However, the TRM is confusing here too since the register names areMPU_0,MPU_1, etc. but the field names in the register descriptions use OPP50, OPP100, etc. What a mess. We need a consistent naming for these.
Quoted 1 line
Benoit?
It is indeed a mess... these names are the latest ones used in the HW spec. But we are still wondering how to name that in the future. OPP_LOW, OPP_MID, OPP_HIGH, OPP_TURBO and OPP_NITRO are now considered but I'm not sure it is really better.
Honestly I do prefer the OPP50, OPP100, OPP130, OPP166 that are providing the percentage wrt nominal frequency and that can scale easily. If we do introduce a OPP between OPP_MID and OPP_HIGH, I'm not sure anybody will be able to find a proper name whereas OPP_80 is straightforward.
In anycase, that will never match the HW spec or the TRM :-(
Benoit
Quoted 13 lines
Also, based on the TRM, the offsets here don't look quite right. e.g. there is no MPU OPP at
0x240, so the OMAP4 the code reading these is using reserved/undocumented bits for the first OPP.Also, the single byte offsets here could use a better explanation, not necessarily here but in the omap4 code that reads the nvalues. I expected that these would be single byte aligned to compact the address space and remove some unused space, but no, they seem to be arbitrarily shifted around.
Kevin
Re: [PATCH v2 08/11] OMAP4: Adding dev atrributes to OMAP4 smartreflex hwmod data
In reply to Thara GopinathQuoted 33 lines · Thara
This patch adds dev attributes for smartreflex modules in the OMAP4 hwmod database. This patch also updates the smartreflex rev in the smartreflex class data structure in the OMAP4 hwmod database.
Signed-off-by Thara Gopinath<[email protected]>--- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 56 ++++++++++++++++++++++++++++ arch/arm/plat-omap/include/plat/control.h | 12 ++++++ 2 files changed, 68 insertions(+), 0 deletions(-)arch/arm/mach-omap2/omap_hwmod_44xx_data.c +3
-0@@ -22,6 +22,8 @@#include <plat/omap_hwmod.h> #include <plat/cpu.h> +#include <plat/smartreflex.h> +#include <plat/control.h> #include "omap_hwmod_common_data.h" @@ -474,6 +476,7 @@ static struct omap_hwmod_class_sysconfig omap44xx_smartreflex_sysc = {static struct omap_hwmod_class omap44xx_smartreflex_hwmod_class = { .name ="smartreflex" , .sysc =&omap44xx_smartreflex_sysc, + .rev =2 , };/* smartreflex_core */
arch/arm/mach-omap2/omap_hwmod_44xx_data.c static struct omap_hwmod_ocp_if *omap44xx_smartreflex_core_slaves[] = { · line 517
Quoted 10 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +7
-0@@ -505,6 +508,22 @@ static struct omap_hwmod_ocp_if *omap44xx_smartreflex_core_slaves[] = { &omap44xx_l4_cfg__smartreflex_core, }; +static u32 omap44xx_sr_core_efuse_offs[] = { +OMAP44XX_CONTROL_FUSE_CORE_OPP50 ,OMAP44XX_CONTROL_FUSE_CORE_OPP100 , +}; + +static u32 omap44xx_sr_core_test_nvalues[] = { +0x0 ,0x0 +};
At first, I thought it was a good idea to put such data here, but now after the discussion about timer hwmod data, I realize I was wrong.
These informations belong to omap_volt_data. For each OPP you should provide the efuse offset an the SW nvalues.
BTW, you should not call them test Nvalues, these are perfectly valid and can be potentially used in production. There are just not as optimized as a efuse Nvalue.
Benoit
Quoted 107 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +46
-0+ +static struct omap_sr_dev_data omap44xx_sr_core_dev_attr = { + .efuse_nvalues_offs = omap44xx_sr_core_efuse_offs, + .test_sennenable =0x1 , + .test_senpenable =0x1 , + .test_nvalues = omap44xx_sr_core_test_nvalues, + .vdd_name ="core" +}; +static struct omap_hwmod omap44xx_smartreflex_core_hwmod = { .name ="smartreflex_core" , .class =&omap44xx_smartreflex_hwmod_class,@@ -518,6 +537,7 @@ static struct omap_hwmod omap44xx_smartreflex_core_hwmod = { }, .slaves = omap44xx_smartreflex_core_slaves, .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_core_slaves), + .dev_attr =&omap44xx_sr_core_dev_attr, .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), };@@ -550,6 +570,23 @@ static struct omap_hwmod_ocp_if *omap44xx_smartreflex_iva_slaves[] = { &omap44xx_l4_cfg__smartreflex_iva, }; +static u32 omap44xx_sr_iva_efuse_offs[] = { +OMAP44XX_CONTROL_FUSE_IVA_OPP50 ,OMAP44XX_CONTROL_FUSE_IVA_OPP100 , +OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO , +}; + +static u32 omap44xx_sr_iva_test_nvalues[] = { +0x0 ,0x0 ,0x0 ,0x0 +}; + +static struct omap_sr_dev_data omap44xx_sr_iva_dev_attr = { + .efuse_nvalues_offs = omap44xx_sr_iva_efuse_offs, + .test_sennenable =0x1 , + .test_senpenable =0x1 , + .test_nvalues = omap44xx_sr_iva_test_nvalues, + .vdd_name ="iva" +}; +static struct omap_hwmod omap44xx_smartreflex_iva_hwmod = { .name ="smartreflex_iva" , .class =&omap44xx_smartreflex_hwmod_class,@@ -563,6 +600,7 @@ static struct omap_hwmod omap44xx_smartreflex_iva_hwmod = { }, .slaves = omap44xx_smartreflex_iva_slaves, .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_iva_slaves), + .dev_attr =&omap44xx_sr_iva_dev_attr, .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), };@@ -595,6 +633,23 @@ static struct omap_hwmod_ocp_if *omap44xx_smartreflex_mpu_slaves[] = { &omap44xx_l4_cfg__smartreflex_mpu, }; +static u32 omap44xx_sr_mpu_efuse_offs[] = { +OMAP44XX_CONTROL_FUSE_MPU_OPP50 ,OMAP44XX_CONTROL_FUSE_MPU_OPP100 , +OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO ,OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO , +}; + +static u32 omap44xx_sr_mpu_test_nvalues[] = { +0x0 ,0x0 ,0x0 ,0x0 +}; + +static struct omap_sr_dev_data omap44xx_sr_mpu_dev_attr = { + .efuse_nvalues_offs = omap44xx_sr_mpu_efuse_offs, + .test_sennenable =0x1 , + .test_senpenable =0x1 , + .test_nvalues = omap44xx_sr_mpu_test_nvalues, + .vdd_name ="mpu" +}; +static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = { .name ="smartreflex_mpu" , .class =&omap44xx_smartreflex_hwmod_class,@@ -608,6 +663,7 @@ static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = { }, .slaves = omap44xx_smartreflex_mpu_slaves, .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_mpu_slaves), + .dev_attr =&omap44xx_sr_mpu_dev_attr, .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), };arch/arm/plat-omap/include/plat/control.h +12
-0@@ -181,6 +181,18 @@#define OMAP3630_CONTROL_FUSE_OPP50_VDD2 (OMAP2_CONTROL_GENERAL + 0x0128)#define OMAP3630_CONTROL_FUSE_OPP100_VDD2 (OMAP2_CONTROL_GENERAL + 0x012C) +/* 44xx control efuse offsets */ +#define OMAP44XX_CONTROL_FUSE_IVA_OPP50 0x22C +#define OMAP44XX_CONTROL_FUSE_IVA_OPP100 0x22F +#define OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO 0x232 +#define OMAP44XX_CONTROL_FUSE_IVA_OPPNITRO 0x235 +#define OMAP44XX_CONTROL_FUSE_MPU_OPP50 0x240 +#define OMAP44XX_CONTROL_FUSE_MPU_OPP100 0x243 +#define OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO 0x246 +#define OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO 0x249 +#define OMAP44XX_CONTROL_FUSE_CORE_OPP50 0x254 +#define OMAP44XX_CONTROL_FUSE_CORE_OPP100 0x257 +/* AM35XX only CONTROL_GENERAL register offsets */ #define AM35XX_CONTROL_MSUSPENDMUX_6 (OMAP2_CONTROL_GENERAL + 0x0038)#define AM35XX_CONTROL_DEVCONF2 (OMAP2_CONTROL_GENERAL + 0x0310)
Re: [PATCH v2 08/11] OMAP4: Adding dev atrributes to OMAP4 smartreflex hwmod data
Quoted 48 lines · Benoit
Quoted 33 lines · Thara
This patch adds dev attributes for smartreflex modules in the OMAP4 hwmod database. This patch also updates the smartreflex rev in the smartreflex class data structure in the OMAP4 hwmod database.
Signed-off-by Thara Gopinath<[email protected]>--- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 56 ++++++++++++++++++++++++++++ arch/arm/plat-omap/include/plat/control.h | 12 ++++++ 2 files changed, 68 insertions(+), 0 deletions(-)arch/arm/mach-omap2/omap_hwmod_44xx_data.c +3
-0@@ -22,6 +22,8 @@#include <plat/omap_hwmod.h> #include <plat/cpu.h> +#include <plat/smartreflex.h> +#include <plat/control.h> #include "omap_hwmod_common_data.h" @@ -474,6 +476,7 @@ static struct omap_hwmod_class_sysconfig omap44xx_smartreflex_sysc = {static struct omap_hwmod_class omap44xx_smartreflex_hwmod_class = { .name ="smartreflex" , .sysc =&omap44xx_smartreflex_sysc, + .rev =2 , };/* smartreflex_core */ arch/arm/mach-omap2/omap_hwmod_44xx_data.c static struct omap_hwmod_ocp_if *omap44xx_smartreflex_core_slaves[] = { · line 517
Quoted 10 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +7
-0@@ -505,6 +508,22 @@ static struct omap_hwmod_ocp_if *omap44xx_smartreflex_core_slaves[] = { &omap44xx_l4_cfg__smartreflex_core, }; +static u32 omap44xx_sr_core_efuse_offs[] = { +OMAP44XX_CONTROL_FUSE_CORE_OPP50 ,OMAP44XX_CONTROL_FUSE_CORE_OPP100 , +}; + +static u32 omap44xx_sr_core_test_nvalues[] = { +0x0 ,0x0 +};At first, I thought it was a good idea to put such data here, but now after the discussion about timer hwmod data, I realize I was wrong.
Quoted 5 lines
These informations belong to
omap_volt_data. For each OPP you should provide the efuse offset an the SW nvalues.
BTW, you should not call them test Nvalues, these are perfectly valid and can be potentially used in production. There are just not as optimized as a efuse Nvalue.
Just to clarify...
Benoit, what's your opinion of my comment that these values don't belong in the volt_data.
As they are only used in the SR layer, they should remain there, IMO. The only thing needed in volt_data is an efuse id/offset.
Kevin
Re: [PATCH v2 08/11] OMAP4: Adding dev atrributes to OMAP4 smartreflex hwmod data
Hi Kevin,
Quoted 56 lines · Kevin Hilman
Quoted 48 lines · Benoit
Quoted 33 lines · Thara
This patch adds dev attributes for smartreflex modules in the OMAP4 hwmod database. This patch also updates the smartreflex rev in the smartreflex class data structure in the OMAP4 hwmod database.
Signed-off-by Thara Gopinath<[email protected]>--- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 56 ++++++++++++++++++++++++++++ arch/arm/plat-omap/include/plat/control.h | 12 ++++++ 2 files changed, 68 insertions(+), 0 deletions(-)arch/arm/mach-omap2/omap_hwmod_44xx_data.c +3
-0@@ -22,6 +22,8 @@#include <plat/omap_hwmod.h> #include <plat/cpu.h> +#include <plat/smartreflex.h> +#include <plat/control.h> #include "omap_hwmod_common_data.h" @@ -474,6 +476,7 @@ static struct omap_hwmod_class_sysconfig omap44xx_smartreflex_sysc = {static struct omap_hwmod_class omap44xx_smartreflex_hwmod_class = { .name ="smartreflex" , .sysc =&omap44xx_smartreflex_sysc, + .rev =2 , };/* smartreflex_core */ arch/arm/mach-omap2/omap_hwmod_44xx_data.c static struct omap_hwmod_ocp_if *omap44xx_smartreflex_core_slaves[] = { · line 517
Quoted 10 lines
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +7
-0@@ -505,6 +508,22 @@ static struct omap_hwmod_ocp_if *omap44xx_smartreflex_core_slaves[] = { &omap44xx_l4_cfg__smartreflex_core, }; +static u32 omap44xx_sr_core_efuse_offs[] = { +OMAP44XX_CONTROL_FUSE_CORE_OPP50 ,OMAP44XX_CONTROL_FUSE_CORE_OPP100 , +}; + +static u32 omap44xx_sr_core_test_nvalues[] = { +0x0 ,0x0 +};At first, I thought it was a good idea to put such data here, but now after the discussion about timer hwmod data, I realize I was wrong.
Quoted 5 lines
These informations belong to
omap_volt_data. For each OPP you should provide the efuse offset an the SW nvalues.
BTW, you should not call them test Nvalues, these are perfectly valid and can be potentially used in production. There are just not as optimized as a efuse Nvalue.
Quoted 4 lines
Just to clarify...
Benoit, what's your opinion of my comment that these values don't belong in the
volt_data.
Or maybe it is just volt_data that should be renamed, because all the data in it are SR / VP related:
{.volt_nominal = 975000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C},
So the efuse info belongs to it as well.
At the end the volt_data at voltage management level is just a list of supported voltages. Does it make sense to add an id instead of keeping the voltage as an index?
volt_data should be:
{.volt_nominal = 975000},
and then volt_sr_vp_data will be:
{.volt_nominal = 975000, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C, efuse_stuff...},
or with an id:
{.id = 0, .sr_errminlimit = 0xF4, .vp_errgain = 0x0C, efuse_stuff...},
I do agree that we have to split that in two structures, but I'm not sure the id is really needed here?
Regards,
Benoit
PATCH v2 9/11 OMAP4: Smartreflex framework extensions
In reply to Thara GopinathThis patch extends the smartreflex framework to support OMAP4. The changes are minor like compiling smartreflex Kconfig option for OMAP4 also, and a couple of OMAP4 checks in the smartreflex framework.
The change in sr_device.c where new logic has to be introduced for reading the efuse registers is due to the fact that 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.
--- arch/arm/mach-omap2/smartreflex.c | 8 ++++++-- arch/arm/mach-omap2/sr_device.c | 15 +++++++++++++-- arch/arm/plat-omap/Kconfig | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/smartreflex.c +6 -2
@@ -152,7 +152,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__);
@@ -192,7 +196,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 ;
arch/arm/mach-omap2/sr_device.c +13 -2
@@ -20,6 +20,7 @@#include <linux/err.h> #include <linux/slab.h> +#include <linux/io.h> #include <plat/control.h> #include <plat/omap_device.h>
@@ -98,9 +99,19 @@ static void __init sr_set_nvalues(struct omap_sr_dev_data *dev_data, dev_data->senpenable_shift); } -for (i =0 ; i < dev_data->volts_supported; i++) - dev_data->volt_data[i].sr_nvalue =omap_ctrl_readl ( +for (i =0 ; i < dev_data->volts_supported; i++) { +if (cpu_is_omap44xx ()) { +u16 offset = dev_data->efuse_nvalues_offs[i]; + + dev_data->volt_data[i].sr_nvalue = +omap_ctrl_readb (offset) | +omap_ctrl_readb (offset +1 ) <<8 | +omap_ctrl_readb (offset +2 ) <<16 ; + }else { + dev_data->volt_data[i].sr_nvalue =omap_ctrl_readl ( dev_data->efuse_nvalues_offs[i]); + } + } }#endif
arch/arm/plat-omap/Kconfig +1 -1
@@ -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.
Signature · 1 line
1.7.0.4
PATCH v2 10/11 OMAP4: Enabling smartrefles class 3 driver.
In reply to Thara GopinathThis patch enables smartreflex class3 mode of operation for OMAP4430 SDP board.
--- arch/arm/mach-omap2/board-4430sdp.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-4430sdp.c +2 -0
@@ -36,6 +36,7 @@#include <plat/usb.h> #include <plat/mmc.h> #include "hsmmc.h" +#include "smartreflex-class3.h" #define ETH_KS8851_IRQ 34#define ETH_KS8851_POWER_ON 48
@@ -182,6 +183,7 @@ static void __init omap_4430sdp_init_irq(void)#endif gic_init_irq ();omap_gpio_init (); +sr_class3_init (); }static struct omap_musb_board_data musb_board_data = {
Signature · 1 line
1.7.0.4
PATCH v2 11/11 OMAP4: Add opp tables.
In reply to Thara GopinathThis patch adds OPP tables for OMAP4. A new file opp44xx_data.c has been introduced to keep the OMAP4 opp tables and the registeration of these tables with the generic opp framework.
--- arch/arm/mach-omap2/Makefile | 3 +- arch/arm/mach-omap2/opp44xx_data.c | 99 ++++++++++++++++++++++++++++++++++++ arch/arm/mach-omap2/pm.c | 1 + arch/arm/mach-omap2/pm.h | 1 + 4 files changed, 103 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-omap2/opp44xx_data.c
arch/arm/mach-omap2/Makefile +2 -1
@@ -52,7 +52,8 @@ obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o pm_bus.o obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o voltage.o \ cpuidle34xx.o pm_bus.o -obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o voltage.o pm_bus.o +obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o voltage.o pm_bus.o \ + opp44xx_data.o obj-$(CONFIG_PM_DEBUG) += pm-debug.o obj-$(CONFIG_OMAP_SMARTREFLEX) += sr_device.o smartreflex.o obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3) += smartreflex-class3.o
arch/arm/mach-omap2/opp44xx_data.c new file +99 -0
99 lines not on this page · raw message
arch/arm/mach-omap2/pm.c +1 -0
@@ -208,6 +208,7 @@ static int __init omap2_common_pm_init(void)omap2_set_init_voltage ("mpu" ,"dpll1_ck" , mpu_dev);omap2_set_init_voltage ("core" ,"l3_ick" , l3_dev); }else if (cpu_is_omap44xx ()) { +omap4_pm_init_opp_table ();omap2_set_init_voltage ("mpu" ,"dpll_mpu_ck" , mpu_dev);omap2_set_init_voltage ("core" ,"l3_div_ck" , l3_dev);omap2_set_init_voltage ("iva" ,"dpll_iva_m5x2_ck" , iva_dev);
arch/arm/mach-omap2/pm.h +1 -0
@@ -23,6 +23,7 @@ extern int omap3_can_sleep(void);extern int omap_set_pwrdm_state (struct powerdomain *pwrdm,u32 state);extern int omap3_idle_init (void );extern int omap3_pm_init_opp_table (void ); +extern int omap4_pm_init_opp_table (void );struct cpuidle_params {u8 valid;
Signature · 1 line
1.7.0.4