OMAP3: PM: Smartreflex clean up patches against PM tree
Subsystems (5)
cover OMAP3: PM: Smartreflex clean up patches against PM tree
This patch series does clean up of Kevin Hilman's PM tree so that the earlier Smartreflex series against lo-master can be applied seamlessly. This patch sereis also does some smartreflex related code changes in the cpuidle and dvfs code which exists only in the pm tree and not on lo-master.
This patch series has been tested in conjunction with the the Smartreflex series posted against the lo-master on OMAP3430 SDP, OMAP3630SDP and ZOOM3 using omap3_pm_defconfig.
Thara Gopinath (4):
OMAP3: PM: Cleaning up of smartreflex code.
OMAP3: PM: Disabling Smartreflex across both frequency and voltage
scaling during DVFS.
OMAP3: PM: Removing voltage related code from the generic pm code.
OMAP3: PM: Enabling Smartreflex Class 3 driver by default in pm
defconfig
arch/arm/configs/omap3_pm_defconfig | 1 + arch/arm/mach-omap2/Makefile | 1 - arch/arm/mach-omap2/board-3430sdp.c | 5 +- arch/arm/mach-omap2/pm.h | 25 - arch/arm/mach-omap2/pm34xx.c | 94 +--- arch/arm/mach-omap2/prm-regbits-34xx.h | 8 +- arch/arm/mach-omap2/resource34xx.c | 29 +- arch/arm/mach-omap2/resource34xx.h | 1 - arch/arm/mach-omap2/smartreflex.c | 1043 ----------------------------- arch/arm/mach-omap2/smartreflex.h | 256 ------- arch/arm/plat-omap/Kconfig | 31 - arch/arm/plat-omap/include/plat/control.h | 9 - 12 files changed, 25 insertions(+), 1478 deletions(-) delete mode 100644 arch/arm/mach-omap2/smartreflex.c delete mode 100644 arch/arm/mach-omap2/smartreflex.h
PATCH 1/4 OMAP3: PM: Cleaning up of smartreflex code.
This patch removes smartreflex driver and other associated code so that the patch series posted against LO for adding smartreflex support can be applied seamlessly on linux-omap-pm . Unfortunately even with this patch the code changes in arch/arm/mach-omap2/pm-debug.c in the LO smartreflex series have to be manually applied to this tree.
--- arch/arm/mach-omap2/Makefile | 1 - arch/arm/mach-omap2/prm-regbits-34xx.h | 8 +- arch/arm/mach-omap2/smartreflex.c | 1043 ----------------------------- arch/arm/mach-omap2/smartreflex.h | 256 ------- arch/arm/plat-omap/Kconfig | 31 - arch/arm/plat-omap/include/plat/control.h | 9 - 6 files changed, 4 insertions(+), 1344 deletions(-) delete mode 100644 arch/arm/mach-omap2/smartreflex.c delete mode 100644 arch/arm/mach-omap2/smartreflex.h
arch/arm/mach-omap2/Makefile +0 -1
@@ -48,7 +48,6 @@ obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o cpuidle34xx.o obj-$(CONFIG_PM_DEBUG) += pm-debug.o -obj-$(CONFIG_OMAP_SMARTREFLEX) += smartreflex.o AFLAGS_sleep24xx.o :=-Wa,-march=armv6 AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a
arch/arm/mach-omap2/prm-regbits-34xx.h +4 -4
@@ -437,10 +437,10 @@/* PM_PWSTST_EMU specific bits */ /* PRM_VC_SMPS_SA */ -#define OMAP3430_SMPS_SA1_SHIFT 16 -#define OMAP3430_SMPS_SA1_MASK (0x7f << 16) -#define OMAP3430_SMPS_SA0_SHIFT 0 -#define OMAP3430_SMPS_SA0_MASK (0x7f << 0) +#define OMAP3430_PRM_VC_SMPS_SA_SA1_SHIFT 16 +#define OMAP3430_PRM_VC_SMPS_SA_SA1_MASK (0x7f << 16) +#define OMAP3430_PRM_VC_SMPS_SA_SA0_SHIFT 0 +#define OMAP3430_PRM_VC_SMPS_SA_SA0_MASK (0x7f << 0)/* PRM_VC_SMPS_VOL_RA */ #define OMAP3430_VOLRA1_SHIFT 16
arch/arm/mach-omap2/smartreflex.c deleted +0 -1043
1,043 lines not on this page · raw message
arch/arm/mach-omap2/smartreflex.h deleted +0 -256
256 lines not on this page · raw message
arch/arm/plat-omap/Kconfig +0 -31
@@ -53,37 +53,6 @@ config OMAP_DEBUG_LEDS depends on OMAP_DEBUG_DEVICES default y if LEDS || LEDS_OMAP_DEBUG -config OMAP_SMARTREFLEX - bool "SmartReflex support" - depends on ARCH_OMAP3 && TWL4030_CORE && PM - help - Say Y if you want to enable SmartReflex. - - SmartReflex can perform continuous dynamic voltage - scaling around the nominal operating point voltage - according to silicon characteristics and operating - conditions. Enabling SmartReflex reduces power - consumption. - - Please note, that by default SmartReflex is only - initialized. To enable the automatic voltage - compensation for VDD1 and VDD2, user must write 1 to - /sys/power/sr_vddX_autocomp, where X is 1 or 2. - -config OMAP_SMARTREFLEX_TESTING - bool "Smartreflex testing support" - depends on OMAP_SMARTREFLEX - default n - help - Say Y if you want to enable SmartReflex testing with SW hardcoded - NVALUES intead of E-fuse NVALUES set in factory silicon testing. - - In some devices the E-fuse values have not been set, even though - SmartReflex modules are included. Using these hardcoded values set - in software, one can test the SmartReflex features without E-fuse. - - WARNING: Enabling this option may cause your device to hang! - config OMAP_RESET_CLOCKS bool "Reset unused clocks during boot" depends on ARCH_OMAP
arch/arm/plat-omap/include/plat/control.h +0 -9
@@ -144,15 +144,6 @@#define OMAP343X_CONTROL_TEST_KEY_11 (OMAP2_CONTROL_GENERAL + 0x00f4)#define OMAP343X_CONTROL_TEST_KEY_12 (OMAP2_CONTROL_GENERAL + 0x00f8)#define OMAP343X_CONTROL_TEST_KEY_13 (OMAP2_CONTROL_GENERAL + 0x00fc) -#define OMAP343X_CONTROL_FUSE_OPP1_VDD1 (OMAP2_CONTROL_GENERAL + 0x0110) -#define OMAP343X_CONTROL_FUSE_OPP2_VDD1 (OMAP2_CONTROL_GENERAL + 0x0114) -#define OMAP343X_CONTROL_FUSE_OPP3_VDD1 (OMAP2_CONTROL_GENERAL + 0x0118) -#define OMAP343X_CONTROL_FUSE_OPP4_VDD1 (OMAP2_CONTROL_GENERAL + 0x011c) -#define OMAP343X_CONTROL_FUSE_OPP5_VDD1 (OMAP2_CONTROL_GENERAL + 0x0120) -#define OMAP343X_CONTROL_FUSE_OPP1_VDD2 (OMAP2_CONTROL_GENERAL + 0x0124) -#define OMAP343X_CONTROL_FUSE_OPP2_VDD2 (OMAP2_CONTROL_GENERAL + 0x0128) -#define OMAP343X_CONTROL_FUSE_OPP3_VDD2 (OMAP2_CONTROL_GENERAL + 0x012c) -#define OMAP343X_CONTROL_FUSE_SR (OMAP2_CONTROL_GENERAL + 0x0130)#define OMAP343X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190)#define OMAP343X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194)#define OMAP343X_CONTROL_DEBOBS (i) (OMAP2_CONTROL_GENERAL + 0x01B0 \
Signature · 1 line
1.7.0.rc1.33.g07cf0f
PATCH 2/4 OMAP3: PM: Disabling Smartreflex across both frequency and voltage scaling during DVFS.
This patch disables smartreflex across both frequency and voltage scaling instead of just across voltage scaling as before. This is the hardware recommended practice.
This bug was first reported and solved on Nokia N900 code base by Nishanth Menon and Paul Walmsley.
This patch also does some changes in SRF to adapt to the new smartreflex and voltage driver.
--- arch/arm/mach-omap2/resource34xx.c | 29 +++++++++++------------------ arch/arm/mach-omap2/resource34xx.h | 1 - 2 files changed, 11 insertions(+), 19 deletions(-)
arch/arm/mach-omap2/resource34xx.c +11 -18
@@ -26,8 +26,9 @@#include <plat/clockdomain.h> #include <plat/omap34xx.h> #include <plat/opp_twl_tps.h> +#include <plat/smartreflex.h> -#include "smartreflex.h" +#include "voltage.h" #include "resource34xx.h" #include "pm.h" #include "cm.h"
@@ -353,12 +354,6 @@ static int program_opp(int res, enum opp_t opp_type, int target_level, {int i, ret =0 , raise;unsigned long freq; -#ifdef CONFIG_OMAP_SMARTREFLEX -unsigned long t_opp, c_opp; - - t_opp =ID_VDD (res) |ID_OPP_NO (target_level); - c_opp =ID_VDD (res) |ID_OPP_NO (current_level); -#endif /* See if have a freq associated, if not, invalid opp */ ret =opp_to_freq (&freq, opp_type, target_level);
@@ -370,15 +365,15 @@ static int program_opp(int res, enum opp_t opp_type, int target_level,else raise =0 ; +omap_smartreflex_disable (res -1 ); +for (i =0 ; i <2 ; i++) { -if (i == raise) +if (i == raise) { ret =program_opp_freq (res, target_level, current_level); -#ifdef CONFIG_OMAP_SMARTREFLEX - else { -u8 vc, vt; + }else {struct omap_opp *oppx; -unsigned long uvdc; +unsigned long uvdc_current, uvdc_target;/* * transitioning from good to good OPP
@@ -386,21 +381,19 @@ static int program_opp(int res, enum opp_t opp_type, int target_level,*/ oppx =opp_find_freq_exact (opp_type, freq, true);BUG_ON (IS_ERR (oppx)); - uvdc =opp_get_voltage (oppx); - vt =omap_twl_uv_to_vsel (uvdc); + uvdc_target =opp_get_voltage (oppx);BUG_ON (opp_to_freq (&freq, opp_type, current_level)); oppx =opp_find_freq_exact (opp_type, freq, true);BUG_ON (IS_ERR (oppx)); - uvdc =opp_get_voltage (oppx); - vc =omap_twl_uv_to_vsel (uvdc); + uvdc_current =opp_get_voltage (oppx);/* ok to scale.. */ - sr_voltagescale_vcbypass(t_opp, c_opp, vt, vc); +omap_voltage_scale (res -1 , uvdc_target); } -#endif } +omap_smartreflex_enable (res -1 );return ret; }
arch/arm/mach-omap2/resource34xx.h +0 -1
@@ -30,7 +30,6 @@#include <plat/opp.h> #include <plat/omap34xx.h> -extern int sr_voltagescale_vcbypass (u32 t_opp,u32 c_opp,u8 t_vsel,u8 c_vsel);extern void lock_scratchpad_sem (void );extern void unlock_scratchpad_sem (void );
Signature · 1 line
1.7.0.rc1.33.g07cf0f
PATCH 3/4 OMAP3: PM: Removing voltage related code from the generic pm code.
Now there is a voltage driver to handle all voltage specific code. This patch removes all voltage specific code from generic pm code so that the new voltage driver can function properly. Also this patch renames the smartreflex API's used in the generic pm code as per the new smartreflex driver.
--- arch/arm/mach-omap2/board-3430sdp.c | 5 +- arch/arm/mach-omap2/pm.h | 25 --------- arch/arm/mach-omap2/pm34xx.c | 94 ++-------------------------------- 3 files changed, 9 insertions(+), 115 deletions(-)
arch/arm/mach-omap2/board-3430sdp.c +3 -2
@@ -47,6 +47,7 @@#include "sdram-qimonda-hyb18m512160af-6.h" #include "hsmmc.h" #include "pm.h" +#include "voltage.h" #include "omap3-opp.h" #define SDP3430_TS_GPIO_IRQ_SDPV1 3
@@ -76,7 +77,7 @@ static struct cpuidle_params omap3_cpuidle_params_table[] = { };/* FIXME: These are not the optimal setup values to be used on 3430sdp*/ -static struct prm_setup_vc omap3_setuptime_table = { +static struct omap_volt_vc_data omap3_setuptime_table = { .clksetup =0xff , .voltsetup_time1 =0xfff , .voltsetup_time2 =0xfff ,
@@ -345,7 +346,7 @@ static void __init omap_3430sdp_init_irq(void) omap_board_config_size =ARRAY_SIZE (sdp3430_config);omap3_pm_init_opp_table ();omap3_pm_init_cpuidle (omap3_cpuidle_params_table); -omap3_pm_init_vc (&omap3_setuptime_table); +omap_voltage_init_vc (&omap3_setuptime_table);omap2_init_common_hw (hyb18m512160af6_sdrc_params,NULL );omap_init_irq ();omap_gpio_init ();
arch/arm/mach-omap2/pm.h +0 -25
@@ -40,31 +40,6 @@ inline void omap3_pm_init_cpuidle(struct cpuidle_params *cpuidle_board_params) }#endif -struct prm_setup_vc { -u16 clksetup; -u16 voltsetup_time1; -u16 voltsetup_time2; -u16 voltoffset; -u16 voltsetup2; -/* PRM_VC_CMD_VAL_0 specific bits */ -u16 vdd0_on; -u16 vdd0_onlp; -u16 vdd0_ret; -u16 vdd0_off; -/* PRM_VC_CMD_VAL_1 specific bits */ -u16 vdd1_on; -u16 vdd1_onlp; -u16 vdd1_ret; -u16 vdd1_off; -}; -#ifdef CONFIG_PM -extern void omap3_pm_init_vc (struct prm_setup_vc *setup_vc); -#else -static inline void omap3_pm_init_vc (struct prm_setup_vc *setup_vc) -{ -} -#endif -extern int omap3_pm_get_suspend_state (struct powerdomain *pwrdm);extern int omap3_pm_set_suspend_state (struct powerdomain *pwrdm,int state);
arch/arm/mach-omap2/pm34xx.c +6 -88
146 lines not on this page · raw message
Signature · 1 line
1.7.0.rc1.33.g07cf0f
PATCH 4/4 OMAP3: PM: Enabling Smartreflex Class 3 driver by default in pm defconfig
This patch enables smartreflex class 3 driver in omap3_pm_defconfig.
--- arch/arm/configs/omap3_pm_defconfig | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/configs/omap3_pm_defconfig +1 -0
@@ -246,6 +246,7 @@ CONFIG_ARCH_OMAP4=y # OMAP Feature Selections # CONFIG_OMAP_SMARTREFLEX=y +CONFIG_OMAP_SMARTREFLEX_CLASS3=y # CONFIG_OMAP_SMARTREFLEX_TESTING is not set CONFIG_OMAP_RESET_CLOCKS=y CONFIG_OMAP_MUX=y
Signature · 1 line
1.7.0.rc1.33.g07cf0f
Quoted 9 lines · Thara Gopinath
This patch series does clean up of Kevin Hilman's PM tree so that the earlier Smartreflex series against lo-master can be applied seamlessly. This patch sereis also does some smartreflex related code changes in the cpuidle and dvfs code which exists only in the pm tree and not on lo-master.
This patch series has been tested in conjunction with the the Smartreflex series posted against the lo-master on OMAP3430 SDP, OMAP3630SDP and ZOOM3 using
omap3_pm_defconfig.
This series should no longer be necessary as your latest SR series is part of the PM branch (as pm-sr branch.)
Quoted 4 lines
Thara Gopinath (4):
OMAP3: PM: Cleaning up of smartreflex code.
OMAP3: PM: Disabling Smartreflex across both frequency and voltage
scaling during DVFS.
This one I've added to the pm-srf branch.
Quoted 3 lines
OMAP3: PM: Removing voltage related code from the generic pm code.
OMAP3: PM: Enabling Smartreflex Class 3 driver by default in pm
defconfig
And I've updatd omap3_pm_defconfig with this one.
Thanks,
Kevin