OMAP3: PM: Adding T2 enabling of smartreflex
Subsystems (3)
PATCH 1/1 OMAP3: PM: Adding T2 enabling of smartreflex
The smartreflex bit on twl4030 needs to be enabled by default irrespective of whether smartreflex module is enabled on the OMAP side or not. This is because without this bit enabled the voltage scaling through vp forceupdate does not function properly on OMAP3.
---
This patch is against LO master and has been
tested on OMAP3430 SDP and OMAP2430 SDP.
arch/arm/mach-omap2/omap_twl.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/omap_twl.c +16 -0
@@ -58,7 +58,9 @@static bool is_offset_valid;static u8 smps_offset; +#define TWL4030_DCDC_GLOBAL_CFG 0x06#define REG_SMPS_OFFSET 0xE0 +#define SMARTREFLEX_ENABLE BIT(3)unsigned long twl4030_vsel_to_uv (const u8 vsel) {
@@ -256,6 +258,7 @@ int __init omap4_twl_init(void)int __init omap3_twl_init (void ) {struct voltagedomain *voltdm; +u8 temp;if (!cpu_is_omap34xx ())return -ENODEV ;
@@ -267,6 +270,19 @@ int __init omap3_twl_init(void) omap3_core_volt_info.vp_vddmax =OMAP3630_VP2_VLIMITTO_VDDMAX ; } +/* +* The smartreflex bit on twl4030 needs to be enabled by +* default irrespective of whether smartreflex module is +* enabled on the OMAP side or not. This is because without +* this bit enabled the voltage scaling through +* vp forceupdate does not function properly on OMAP3. +*/ +twl_i2c_read_u8 (TWL4030_MODULE_PM_RECEIVER , &temp, +TWL4030_DCDC_GLOBAL_CFG ); + temp |=SMARTREFLEX_ENABLE ; +twl_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER , temp, +TWL4030_DCDC_GLOBAL_CFG ); + voltdm =omap_voltage_domain_lookup ("mpu" );omap_voltage_register_pmic (voltdm, &omap3_mpu_volt_info);
Signature · 1 line
1.7.0.4
Thara Gopinath had written, on 12/31/2010 02:07 AM, the following:
Quoted 4 lines
The smartreflex bit on twl4030 needs to be enabled by default irrespective of whether smartreflex module is enabled on the OMAP side or not. This is because without this bit enabled the voltage scaling through vp forceupdate does not function properly on OMAP3.
s/does not function properly/ does not function ;)
SR I2C is used for forceupdate/vc bypass modes - so neither will function without switching t2 mode.
T2 voltages could be set in quiet a few methods:
a) Synchronized Scaling Hardware Strategy (ENABLE_VMODE = 1) (for OMAP2 and I had worked on one OMAP3430 product which used this as well) using VDD1_VFLOOR and VDD1_VROOF
b) Direct Strategy Software Scaling Mode (ENABLE_VMODE = 0) (Smart reflex disabled) - VDD1_VSEL
c) using smart reflex - as done below - allows OMAP with smart reflex hardware wired to the twl to use that functionality.
Blindly setting it to smartreflex mode is not correct IMHO. It might work on SDP and few TI and non-TI platforms, but not all.
Quoted 51 lines
Signed-off-by Thara Gopinath <[email protected]>---
This patch is against LO master and has been
tested on OMAP3430 SDP and OMAP2430 SDP.arch/arm/mach-omap2/omap_twl.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)arch/arm/mach-omap2/omap_twl.c +16
-0@@ -58,7 +58,9 @@static bool is_offset_valid;static u8 smps_offset; +#define TWL4030_DCDC_GLOBAL_CFG 0x06#define REG_SMPS_OFFSET 0xE0 +#define SMARTREFLEX_ENABLE BIT(3)unsigned long twl4030_vsel_to_uv (const u8 vsel) {@@ -256,6 +258,7 @@ int __init omap4_twl_init(void)int __init omap3_twl_init (void ) {struct voltagedomain *voltdm; +u8 temp;if (!cpu_is_omap34xx ())return -ENODEV ;@@ -267,6 +270,19 @@ int __init omap3_twl_init(void) omap3_core_volt_info.vp_vddmax =OMAP3630_VP2_VLIMITTO_VDDMAX ; } +/* +* The smartreflex bit on twl4030 needs to be enabled by +* default irrespective of whether smartreflex module is +* enabled on the OMAP side or not. This is because without +* this bit enabled the voltage scaling through +* vp forceupdate does not function properly on OMAP3. +*/ +twl_i2c_read_u8 (TWL4030_MODULE_PM_RECEIVER , &temp, +TWL4030_DCDC_GLOBAL_CFG ); + temp |=SMARTREFLEX_ENABLE ; +twl_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER , temp, +TWL4030_DCDC_GLOBAL_CFG ); + voltdm =omap_voltage_domain_lookup ("mpu" );omap_voltage_register_pmic (voltdm, &omap3_mpu_volt_info);
Signature · 2 lines
Regards, Nishanth Menon
Quoted 29 lines
Quoted 29 lines
-----Original Message-----
From: Menon, Nishanth
Sent: Monday, January 03, 2011 9:22 PM
To: Gopinath, Thara
Cc: [email protected]; [email protected]; [email protected]; Cousson, Benoit; Sripathy, Vishwanath; Sawant, Anand
Subject: Re: [PATCH] OMAP3: PM: Adding T2 enabling of smartreflexThara Gopinath had written, on 12/31/2010 02:07 AM, the following:
Quoted 1 line
The smartreflex bit on twl4030 needs to be enabled by default
irrespective
Quoted 3 lines
of whether smartreflex module is enabled on the OMAP side or not. This is because without this bit enabled the voltage scaling through vp forceupdate does not function properly on OMAP3.
s/does not function properly/ does not function ;)
SR I2C is used for forceupdate/vc bypass modes - so neither will function without switching t2 mode.T2 voltages could be set in quiet a few methods:
a) Synchronized Scaling Hardware Strategy (ENABLE_VMODE= 1) (for OMAP2 and I had worked on one OMAP3430 product which used this as well) usingVDD1_VFLOORandVDD1_VROOF
b) Direct Strategy Software Scaling Mode (ENABLE_VMODE= 0) (Smart reflex disabled) -VDD1_VSEL
c) using smart reflex - as done below - allows OMAP with smart reflex hardware wired to the twl to use that functionality.
Quoted 2 lines
Quoted 2 lines
Blindly setting it to smartreflex mode is not correct IMHO. It might work on SDP and few TI and non-TI platforms, but not all.
Yes you are right. The SR I2C needs to be enabled for vp force update
and vc bypass method of voltage scaling as well as for smartreflex
feature. Are you telling that there are platforms out there using OMAP3
and T2 and still using VMODE or VSEL. As far as I am aware our h/w folks themselves do not recommend these methods.
Regards
Thara
Quoted 58 lines
Quoted 58 lines
arch/arm/mach-
Quoted 11 lines
Signed-off-by Thara Gopinath <[email protected]>---
This patch is against LO master and has been
tested on OMAP3430 SDP and OMAP2430 SDP.arch/arm/mach-omap2/omap_twl.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)arch/arm/mach- renamed from arch/arm/mach-omap2/omap_twl.c +0
-0
omap2/omap_twl.cQuoted 31 lines
index 15f8c6c..a59f36b 100644
arch/arm/mach-omap2/omap_twl.c +9
-0@@ -58,7 +58,9 @@static bool is_offset_valid;static u8 smps_offset; +#define TWL4030_DCDC_GLOBAL_CFG 0x06#define REG_SMPS_OFFSET 0xE0 +#define SMARTREFLEX_ENABLE BIT(3)unsigned long twl4030_vsel_to_uv (const u8 vsel) {@@ -256,6 +258,7 @@ int __init omap4_twl_init(void)int __init omap3_twl_init (void ) {struct voltagedomain *voltdm; +u8 temp;if (!cpu_is_omap34xx ())return -ENODEV ;@@ -267,6 +270,19 @@ int __init omap3_twl_init(void) omap3_core_volt_info.vp_vddmax =OMAP3630_VP2_VLIMITTO_VDDMAX ; } +/* +* The smartreflex bit on twl4030 needs to be enabled by +* default irrespective of whether smartreflex module is +* enabled on the OMAP side or not. This is because without +* this bit enabled the voltage scaling through +* vp forceupdate does not function properly on OMAP3. arch/arm/mach-omap2/omap_twl.c int __init omap3_twl_init(void) · line 288
Quoted 10 lines
arch/arm/mach-omap2/omap_twl.c +7
-0+*/ +twl_i2c_read_u8 (TWL4030_MODULE_PM_RECEIVER , &temp, +TWL4030_DCDC_GLOBAL_CFG ); + temp |=SMARTREFLEX_ENABLE ; +twl_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER , temp, +TWL4030_DCDC_GLOBAL_CFG ); + voltdm =omap_voltage_domain_lookup ("mpu" );omap_voltage_register_pmic (voltdm, &omap3_mpu_volt_info);--
Regards,
Nishanth Menon
Gopinath, Thara wrote, on 01/05/2011 04:46 AM:
[..]
Quoted 4 lines
Yes you are right. The SR I2C needs to be enabled for vp force update
and vc bypass method of voltage scaling as well as for smartreflex
feature. Are you telling that there are platforms out there using OMAP3
and T2 and still using VMODE or VSEL. As far as I am aware our h/w folks themselves do not recommend these methods.
;) not every one likes to follow recommendations rt? but yeah, there are folks who use vmode for 3430, vsel is possible even for 3630 - using class2 implementation if desired or forced to if the SR lines are not hooked up on the board.
Signature · 2 lines
Regards, Nishanth Menon
Quoted 4 lines · Thara Gopinath
The smartreflex bit on twl4030 needs to be enabled by default irrespective of whether smartreflex module is enabled on the OMAP side or not. This is because without this bit enabled the voltage scaling through vp forceupdate does not function properly on OMAP3.
Based on Nishanth's comments, the abofe statements need a little more justification.
What is probably needed is some default setting (possibly this one) but with the possibility of board code to disable this if needed.
Kevin
Quoted 50 lines
Signed-off-by Thara Gopinath <[email protected]>---
This patch is against LO master and has been
tested on OMAP3430 SDP and OMAP2430 SDP.arch/arm/mach-omap2/omap_twl.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)arch/arm/mach-omap2/omap_twl.c +16
-0@@ -58,7 +58,9 @@static bool is_offset_valid;static u8 smps_offset; +#define TWL4030_DCDC_GLOBAL_CFG 0x06#define REG_SMPS_OFFSET 0xE0 +#define SMARTREFLEX_ENABLE BIT(3)unsigned long twl4030_vsel_to_uv (const u8 vsel) {@@ -256,6 +258,7 @@ int __init omap4_twl_init(void)int __init omap3_twl_init (void ) {struct voltagedomain *voltdm; +u8 temp;if (!cpu_is_omap34xx ())return -ENODEV ;@@ -267,6 +270,19 @@ int __init omap3_twl_init(void) omap3_core_volt_info.vp_vddmax =OMAP3630_VP2_VLIMITTO_VDDMAX ; } +/* +* The smartreflex bit on twl4030 needs to be enabled by +* default irrespective of whether smartreflex module is +* enabled on the OMAP side or not. This is because without +* this bit enabled the voltage scaling through +* vp forceupdate does not function properly on OMAP3. +*/ +twl_i2c_read_u8 (TWL4030_MODULE_PM_RECEIVER , &temp, +TWL4030_DCDC_GLOBAL_CFG ); + temp |=SMARTREFLEX_ENABLE ; +twl_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER , temp, +TWL4030_DCDC_GLOBAL_CFG ); + voltdm =omap_voltage_domain_lookup ("mpu" );omap_voltage_register_pmic (voltdm, &omap3_mpu_volt_info);
Quoted 18 lines
Quoted 18 lines
-----Original Message-----
From: Hilman, Kevin
Sent: Wednesday, January 05, 2011 4:18 AM
To: Gopinath, Thara
Cc: [email protected]; [email protected]; Cousson, Benoit; Sripathy, Vishwanath; Sawant, Anand; Menon, Nishanth
Subject: Re: [PATCH] OMAP3: PM: Adding T2 enabling of smartreflexQuoted 1 line · Thara Gopinath
The smartreflex bit on twl4030 needs to be enabled by default
irrespective
Quoted 3 lines
of whether smartreflex module is enabled on the OMAP side or not. This is because without this bit enabled the voltage scaling through vp forceupdate does not function properly on OMAP3.
Quoted 5 lines
Quoted 5 lines
Based on Nishanth's comments, the abofe statements need a little more justification.
What is probably needed is some default setting (possibly this one) but with the possibility of board code to disable this if needed.
Yes. If we need to support the other means of voltage scaling, we definitely need to override this bit from board files. I am not so convinced that we need to support them though. IMHO, this patch can still go in with change in the comment and if needed, there can be another patch with an API in omap_twl.c allowing overriding/ enabling-disabling of sr - i2c bit on the T2 side.
Regards
Thara
Quoted 54 lines
Quoted 54 lines
Kevin
arch/arm/mach-
Quoted 10 lines
Signed-off-by Thara Gopinath <[email protected]>---
This patch is against LO master and has been
tested on OMAP3430 SDP and OMAP2430 SDP.arch/arm/mach-omap2/omap_twl.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)arch/arm/mach- renamed from arch/arm/mach-omap2/omap_twl.c +0
-0
omap2/omap_twl.cQuoted 40 lines
index 15f8c6c..a59f36b 100644
arch/arm/mach-omap2/omap_twl.c +16
-0@@ -58,7 +58,9 @@static bool is_offset_valid;static u8 smps_offset; +#define TWL4030_DCDC_GLOBAL_CFG 0x06#define REG_SMPS_OFFSET 0xE0 +#define SMARTREFLEX_ENABLE BIT(3)unsigned long twl4030_vsel_to_uv (const u8 vsel) {@@ -256,6 +258,7 @@ int __init omap4_twl_init(void)int __init omap3_twl_init (void ) {struct voltagedomain *voltdm; +u8 temp;if (!cpu_is_omap34xx ())return -ENODEV ;@@ -267,6 +270,19 @@ int __init omap3_twl_init(void) omap3_core_volt_info.vp_vddmax =OMAP3630_VP2_VLIMITTO_VDDMAX ; } +/* +* The smartreflex bit on twl4030 needs to be enabled by +* default irrespective of whether smartreflex module is +* enabled on the OMAP side or not. This is because without +* this bit enabled the voltage scaling through +* vp forceupdate does not function properly on OMAP3. +*/ +twl_i2c_read_u8 (TWL4030_MODULE_PM_RECEIVER , &temp, +TWL4030_DCDC_GLOBAL_CFG ); + temp |=SMARTREFLEX_ENABLE ; +twl_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER , temp, +TWL4030_DCDC_GLOBAL_CFG ); + voltdm =omap_voltage_domain_lookup ("mpu" );omap_voltage_register_pmic (voltdm, &omap3_mpu_volt_info);
Quoted 22 lines · Thara
Quoted 16 lines
Quoted 16 lines
-----Original Message-----
From: Hilman, Kevin
Sent: Wednesday, January 05, 2011 4:18 AM
To: Gopinath, Thara
Cc: [email protected]; [email protected]; Cousson, Benoit; Sripathy, Vishwanath; Sawant, Anand; Menon, Nishanth
Subject: Re: [PATCH] OMAP3: PM: Adding T2 enabling of smartreflexQuoted 1 line · Thara Gopinath
The smartreflex bit on twl4030 needs to be enabled by default
irrespective
Quoted 3 lines
of whether smartreflex module is enabled on the OMAP side or not. This is because without this bit enabled the voltage scaling through vp forceupdate does not function properly on OMAP3.
Quoted 5 lines
Quoted 5 lines
Based on Nishanth's comments, the abofe statements need a little more justification.
What is probably needed is some default setting (possibly this one) but with the possibility of board code to disable this if needed.
Quoted 6 lines
Yes. If we need to support the other means of voltage scaling, we definitely need to override this bit from board files. I am not so convinced that we need to support them though. IMHO, this patch can still go in with change in the comment and if needed, there can be another patch with an API in
omap_twl.callowing overriding/ enabling-disabling of sr - i2c bit on the T2 side.
I'm OK with this.
Kevin