Skip to contentSkip to conversation

OMAP3: Adding Smartreflex and Voltage driver support

PATCH Superseded Thara Gopinath 2 participants 19 messages May 29, 2010 – Jun 25, 2010

Subsystems (6)

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

cover OMAP3: Adding Smartreflex and Voltage driver support

This patch series introduces smartreflex and voltage driver support for OMAP3430 and OMAP3630. SmartReflex modules do adaptive voltage control for real-time voltage adjustments.

Originally all the functionalities introduced in this patch were present in arch/arm/mach-omap2/smartreflex.c file in Kevin's pm tree. This patch series does a major rewrite of this file and introduces a separate voltage driver. Major contributors to the original driver are

Eduardo Valentin (1):
OMAP3: PM: SmartReflex: Fix scheduled while atomic problem

Kalle Jokiniemi (1):
OMAP3: PM: SmartReflex driver integration

Kevin Hilman (2):
temp: SR: IO_ADDRESS conversion
OMAP: SR: OPP interfaces removed from OMAP PM layer

Nishanth Menon (1):
omap3: pm: sr: replace get_opp with freq_to_opp

Paul Walmsley (2):
OMAP SR: use opp_find_opp_by_opp_id()
OMAP SR: use OPP API for OPP ID, remove direct access

Phil Carmody (2):
OMAP3: PM: Don't do unnecessary searches in omap_sr_vdd*_autocomp_store
OMAP3: PM: Early exit on invalid parameters

Rajendra Nayak (9):
OMAP3: SR: Fix init voltage on OPP change
OMAP3: SR: Update VDD1/2 voltages at boot
OMAP3: SR: Use sysclk for SR CLKLENGTH calc
OMAP3: SR: Reset voltage level on SR disable
OMAP3: SR: Replace printk's with pr_* calls
OMAP3: SR: Remove redundant defines
OMAP3: SR: Fix SR driver to check for omap-pm return values
OMAP3: PM: Put optimal SMPS stabilization delay
OMAP3: SR: Wait for VP idle before a VP disable

Roger Quadros (4):
OMAP3: PM: Fix Smartreflex when used with PM_NOOP layer
OMAP3: PM: Make Smartreflex driver independent of SRF
OMAP3: PM: Do not Enable SmartReflex if OPP tables not defined
OMAP3: PM: Smartreflex: Fix VDD2 OPP determining logic

Romit Dasgupta (1):
omap: pm: SR: use enum for OPP types

Teerth Reddy (1):
OMAP3: SR: Replace SR_PASS/FAIL,SR_TRUE/FALSE

Tero Kristo (1):
Smartreflex: Avoid unnecessary spam

This patch series is based against origin/opp branch off Kevin's pm tree which in turn is based off lo-master. This series will apply against lo-master also but will break compilation due to lack of opp framework support on lo-master.

This patch series has been tested on OMAP3430 SDP, OMAP3630 SDP and ZOOM3 with the following menuconfig options enabled.
System type -> TI OMAP Implementations -> Smartreflex Support System type -> TI OMAP Implementations ->
Class 3 mode of Smartreflex Implementation
Device Drivers -> Multifunction device drivers ->
Support power resources on TWL4030 family chips

Thara Gopinath (8):
OMAP3: PM: Adding voltage driver support for OMAP3
OMAP3: PM: Adding smartreflex driver support.
OMAP3: PM: Adding smartreflex device file.
OMAP3: PM: Adding smartreflex hwmod data
OMAP3: PM: Adding smartreflex class3 driver
OMAP3: PM: Adding T2 enabling of smartreflex support
OMAP: PM: Allowing an early init of pm debugfs driver.
OMAP3: PM: Adding debug support to Voltage and Smartreflex drivers

 arch/arm/mach-omap2/Makefile                  |    5 +-
 arch/arm/mach-omap2/board-3430sdp.c           |    2 +
 arch/arm/mach-omap2/board-3630sdp.c           |    2 +
 arch/arm/mach-omap2/board-zoom3.c             |    2 +
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c    |  209 +++++-
 arch/arm/mach-omap2/pm-debug.c                |   18 +-
 arch/arm/mach-omap2/smartreflex-class3.c      |   62 ++
 arch/arm/mach-omap2/smartreflex-class3.h      |   23 +
 arch/arm/mach-omap2/smartreflex.c             |  969 ++++++++++++++++++++
 arch/arm/mach-omap2/sr_device.c               |  177 ++++
 arch/arm/mach-omap2/voltage.c                 | 1199 +++++++++++++++++++++++++
 arch/arm/mach-omap2/voltage.h                 |  126 +++
 arch/arm/plat-omap/Kconfig                    |   41 +
 arch/arm/plat-omap/include/plat/control.h     |   27 +
 arch/arm/plat-omap/include/plat/smartreflex.h |  273 ++++++
 drivers/mfd/twl-core.c                        |    7 +-
 drivers/mfd/twl4030-power.c                   |   29 +
 include/linux/i2c/twl.h                       |    1 +
 18 files changed, 3166 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/mach-omap2/smartreflex-class3.c
 create mode 100644 arch/arm/mach-omap2/smartreflex-class3.h
 create mode 100644 arch/arm/mach-omap2/smartreflex.c
 create mode 100644 arch/arm/mach-omap2/sr_device.c
 create mode 100644 arch/arm/mach-omap2/voltage.c
 create mode 100644 arch/arm/mach-omap2/voltage.h
 create mode 100644 arch/arm/plat-omap/include/plat/smartreflex.h
#1 lore raw

PATCH 1/8 OMAP3: PM: Adding voltage driver support for OMAP3

This patch adds voltage driver support for OMAP3. The driver allows configuring the voltage controller and voltage processors during init and exports APIs to enable/disable voltage processors, scale voltage and reset voltage. The driver also maintains the global voltage table on a per VDD basis which contains the various voltages supported by the VDD along with per voltage dependent data like smartreflex n-target value, errminlimit and voltage processor errorgain. The driver allows scaling of VDD voltages either through "vc bypass method" or through "vp forceupdate method" the choice being configurable through the board file.

This patch contains code originally in linux omap pm branch smartreflex driver. Major contributors to this driver are Lesly A M, Rajendra Nayak, Kalle Jokiniemi, Paul Walmsley, Nishant Menon, Kevin Hilman.

---
 arch/arm/mach-omap2/Makefile  |    3 +-
 arch/arm/mach-omap2/voltage.c | 1059 +++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/voltage.h |  123 +++++
 3 files changed, 1184 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-omap2/voltage.c
 create mode 100644 arch/arm/mach-omap2/voltage.h
arch/arm/mach-omap2/Makefile +2 -1
index e975b43..e4c660d 100644
@@ -46,7 +46,8 @@ obj-$(CONFIG_ARCH_OMAP2)		+= sdrc2xxx.o
 ifeq ($(CONFIG_PM),y)
 obj-$(CONFIG_ARCH_OMAP2)		+= pm24xx.o
 obj-$(CONFIG_ARCH_OMAP2)		+= sleep24xx.o
-obj-$(CONFIG_ARCH_OMAP3)		+= pm34xx.o sleep34xx.o cpuidle34xx.o
+obj-$(CONFIG_ARCH_OMAP3)		+= pm34xx.o sleep34xx.o cpuidle34xx.o \
+					   voltage.o
 obj-$(CONFIG_PM_DEBUG)			+= pm-debug.o
 
 AFLAGS_sleep24xx.o			:=-Wa,-march=armv6
arch/arm/mach-omap2/voltage.c new file +1059 -0

1,059 lines not on this page · raw message

arch/arm/mach-omap2/voltage.h new file +123 -0

123 lines not on this page · raw message

Signature · 1 line
1.7.0.rc1.33.g07cf0f
#2 lore raw

PATCH 2/8 OMAP3: PM: Adding smartreflex driver support.

SmartReflex modules do adaptive voltage control for real-time voltage adjustments. With Smartreflex the power supply voltage can be adapted to the silicon performance(manufacturing process, temperature induced performance, age induced performance etc).

There are differnet classes of smartreflex implementation.
Class-0: Manufacturing Test Calibration
Class-1: Boot-Time Software Calibration
Class-2: Continuous Software Calibration
Class-3: Continuous Hardware Calibration
Class-4: Fully Integrated Power Management

OMAP3 has two smartreflex modules one associated with VDD1 and the other associated with VDD2.
This patch adds support for smartreflex driver. The driver is designed for Class-1 , Class-2 and Class-3 support and is a platform driver. Smartreflex driver can be enabled through a Kconfig option "SmartReflex support" under "System type"->"TI OMAP implementations" menu.

Smartreflex autocompensation feature can be enabled runtime through a debug fs option.
To enable smartreflex autocompensation feature
echo 1 > /debugfs/pm_debug/Smartreflex/SR<X>/autocomp
To disable smartreflex autocompensation feature
echo 0 > /debugfs/pm_debug/Smartreflex/SR<X>/autocomp

This patch contains code originally in linux omap pm branch. Major contributors to this driver are
Lesly A M, Rajendra Nayak, Kalle Jokiniemi, Paul Walmsley, Nishant Menon, Kevin Hilman.

---
 arch/arm/mach-omap2/Makefile                  |    1 +
 arch/arm/mach-omap2/pm-debug.c                |    3 +-
 arch/arm/mach-omap2/smartreflex.c             |  934 +++++++++++++++++++++++++
 arch/arm/plat-omap/Kconfig                    |   32 +
 arch/arm/plat-omap/include/plat/smartreflex.h |  275 ++++++++
 5 files changed, 1244 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-omap2/smartreflex.c
 create mode 100644 arch/arm/plat-omap/include/plat/smartreflex.h
arch/arm/mach-omap2/Makefile +1 -0
index e4c660d..9ff9869 100644
@@ -49,6 +49,7 @@ obj-$(CONFIG_ARCH_OMAP2)		+= sleep24xx.o
 obj-$(CONFIG_ARCH_OMAP3)		+= pm34xx.o sleep34xx.o cpuidle34xx.o \
 					   voltage.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/pm-debug.c +2 -1
index 6cac981..4280006 100644
@@ -162,7 +162,7 @@ void omap2_pm_dump(int mode, int resume, unsigned int us)
 
 static void pm_dbg_regset_store(u32 *ptr);
 
-struct dentry *pm_dbg_dir;
+struct dentry *pm_dbg_dir, *pm_dbg_main_dir;
 
 static int pm_dbg_init_done;
 
@@ -606,6 +606,7 @@ static int __init pm_dbg_init(void)
 				   &sleep_while_idle, &pm_dbg_option_fops);
 	(void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUGO, d,
 				   &wakeup_timer_seconds, &pm_dbg_option_fops);
+	pm_dbg_main_dir = d;
 	pm_dbg_init_done = 1;
 
 	return 0;
arch/arm/mach-omap2/smartreflex.c new file +934 -0

934 lines not on this page · raw message

arch/arm/plat-omap/Kconfig +32 -0
index 6da796e..34f265e 100644
@@ -53,6 +53,38 @@ 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 && 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
+	  /debug/pm_debug/Smartreflex/SR<X>/autocomp,
+	  where X is 1 or 2 for OMAP3
+
+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/smartreflex.h new file +275 -0

275 lines not on this page · raw message

Signature · 1 line
1.7.0.rc1.33.g07cf0f
#3 lore raw

PATCH 3/8 OMAP3: PM: Adding smartreflex device file.

This patch adds support for device registration of various smartreflex module present in the system. This patch introduces the platform data for smartreflex devices which include the efused and test n-target vaules, module enable/disable pointers and a parameter to indicate whether smartreflex autocompensation needs to be enabled on init or not. Currently auocompensation is enabled on init by default for OMAP3430 ES3.1 chip.

---
 arch/arm/mach-omap2/Makefile    |    2 +-
 arch/arm/mach-omap2/sr_device.c |  177 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 178 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-omap2/sr_device.c
arch/arm/mach-omap2/Makefile +1 -1
index 9ff9869..ab3772a 100644
@@ -49,7 +49,7 @@ obj-$(CONFIG_ARCH_OMAP2)		+= sleep24xx.o
 obj-$(CONFIG_ARCH_OMAP3)		+= pm34xx.o sleep34xx.o cpuidle34xx.o \
 					   voltage.o
 obj-$(CONFIG_PM_DEBUG)			+= pm-debug.o
-obj-$(CONFIG_OMAP_SMARTREFLEX)          += smartreflex.o
+obj-$(CONFIG_OMAP_SMARTREFLEX)          += sr_device.o smartreflex.o
 
 AFLAGS_sleep24xx.o			:=-Wa,-march=armv6
 AFLAGS_sleep34xx.o			:=-Wa,-march=armv7-a
arch/arm/mach-omap2/sr_device.c new file +177 -0

177 lines not on this page · raw message

Signature · 1 line
1.7.0.rc1.33.g07cf0f
#4 lore raw

PATCH 4/8 OMAP3: PM: Adding smartreflex hwmod data

This patch adds the smartreflex hwmod data for OMAP3430 and OMAP3630. A dev_attr is also added to the hwmod structure for each smartreflex module which contains SoC specific info like the efuse offsets, test n-values etc.

---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |  209 +++++++++++++++++++++++++++-
 arch/arm/plat-omap/include/plat/control.h  |   27 ++++
 2 files changed, 235 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +208 -1
index ed60840..43ffc8d 100644
@@ -17,9 +17,10 @@
 #include <mach/irqs.h>
 #include <plat/cpu.h>
 #include <plat/dma.h>
+#include <plat/control.h>
+#include <plat/smartreflex.h>
 
 #include "omap_hwmod_common_data.h"
-
 #include "prm-regbits-34xx.h"
 
 /*
@@ -35,6 +36,8 @@ static struct omap_hwmod omap3xxx_mpu_hwmod;
 static struct omap_hwmod omap3xxx_l3_hwmod;
 static struct omap_hwmod omap3xxx_l4_core_hwmod;
 static struct omap_hwmod omap3xxx_l4_per_hwmod;
+static struct omap_hwmod omap34xx_sr1_hwmod;
+static struct omap_hwmod omap34xx_sr2_hwmod;
 
 /* L3 -> L4_CORE interface */
 static struct omap_hwmod_ocp_if omap3xxx_l3__l4_core = {
@@ -88,9 +91,47 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = {
 	.user	= OCP_USER_MPU | OCP_USER_SDMA,
 };
 
+/* L4 CORE -> SR1 interface */
+static struct omap_hwmod_addr_space omap3_sr1_addr_space[] = {
+	{
+		.pa_start	= OMAP34XX_SR1_BASE,
+		.pa_end		= OMAP34XX_SR1_BASE + SZ_1K - 1,
+		.flags		= ADDR_TYPE_RT,
+	},
+};
+
+static struct omap_hwmod_ocp_if omap3_l4_core__sr1 = {
+	.master		= &omap3xxx_l4_core_hwmod,
+	.slave		= &omap34xx_sr1_hwmod,
+	.clk		= "sr_l4_ick",
+	.addr		= omap3_sr1_addr_space,
+	.addr_cnt	= ARRAY_SIZE(omap3_sr1_addr_space),
+	.user		= OCP_USER_MPU,
+};
+
+/* L4 CORE -> SR1 interface */
+static struct omap_hwmod_addr_space omap3_sr2_addr_space[] = {
+	{
+		.pa_start	= OMAP34XX_SR2_BASE,
+		.pa_end		= OMAP34XX_SR2_BASE + SZ_1K - 1,
+		.flags		= ADDR_TYPE_RT,
+	},
+};
+
+static struct omap_hwmod_ocp_if omap3_l4_core__sr2 = {
+	.master		= &omap3xxx_l4_core_hwmod,
+	.slave		= &omap34xx_sr2_hwmod,
+	.clk		= "sr_l4_ick",
+	.addr		= omap3_sr2_addr_space,
+	.addr_cnt	= ARRAY_SIZE(omap3_sr2_addr_space),
+	.user		= OCP_USER_MPU,
+};
+
 /* Slave interfaces on the L4_CORE interconnect */
 static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = {
 	&omap3xxx_l3__l4_core,
+	&omap3_l4_core__sr1,
+	&omap3_l4_core__sr2,
 };
 
 /* Master interfaces on the L4_CORE interconnect */
@@ -164,12 +205,178 @@ static struct omap_hwmod omap3xxx_mpu_hwmod = {
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
 };
 
+/* SR common */
+static struct omap_hwmod_sysc_fields omap34xx_sr_sysc_fields = {
+	.clkact_shift	= 20,
+};
+
+static struct omap_hwmod_class_sysconfig omap34xx_sr_sysc = {
+	.sysc_offs	= 0x24,
+	.sysc_flags	= (SYSC_HAS_CLOCKACTIVITY | SYSC_NO_CACHE),
+	.clockact	= CLOCKACT_TEST_ICLK,
+	.sysc_fields	= &omap34xx_sr_sysc_fields,
+};
+
+static struct omap_hwmod_class omap34xx_smartreflex_hwmod_class = {
+	.name = "smartreflex",
+	.sysc = &omap34xx_sr_sysc,
+	.rev  = 1,
+};
+
+static struct omap_hwmod_sysc_fields omap36xx_sr_sysc_fields = {
+	.sidle_shift	= 24,
+	.enwkup_shift	= 26
+};
+
+static struct omap_hwmod_class_sysconfig omap36xx_sr_sysc = {
+	.sysc_offs	= 0x38,
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+	.sysc_flags	= (SYSC_HAS_SIDLEMODE | SYSC_HAS_ENAWAKEUP |
+			SYSC_NO_CACHE),
+	.sysc_fields	= &omap36xx_sr_sysc_fields,
+};
+
+static struct omap_hwmod_class omap36xx_smartreflex_hwmod_class = {
+	.name = "smartreflex",
+	.sysc = &omap36xx_sr_sysc,
+	.rev  = 2,
+};
+
+/* SR1 */
+static struct omap_hwmod_ocp_if *omap3_sr1_slaves[] = {
+	&omap3_l4_core__sr1,
+};
+
+static u32 omap34xx_sr1_efuse_offs[] = {
+	OMAP343X_CONTROL_FUSE_OPP1_VDD1, OMAP343X_CONTROL_FUSE_OPP2_VDD1,
+	OMAP343X_CONTROL_FUSE_OPP3_VDD1, OMAP343X_CONTROL_FUSE_OPP4_VDD1,
+	OMAP343X_CONTROL_FUSE_OPP5_VDD1,
+};
+
+static u32 omap34xx_sr1_test_nvalues[] = {
+	0x9A90E6, 0xAABE9A, 0xBBF5C5, 0xBBB292, 0xBBF5C5,
+};
+
+static struct omap_sr_dev_data omap34xx_sr1_dev_attr = {
+	.efuse_sr_control	= OMAP343X_CONTROL_FUSE_SR,
+	.sennenable_shift	= OMAP343X_SR1_SENNENABLE_SHIFT,
+	.senpenable_shift	= OMAP343X_SR1_SENPENABLE_SHIFT,
+	.efuse_nvalues_offs	= omap34xx_sr1_efuse_offs,
+	.test_sennenable	= 0x3,
+	.test_senpenable	= 0x3,
+	.test_nvalues		= omap34xx_sr1_test_nvalues,
+};
+
+static struct omap_hwmod omap34xx_sr1_hwmod = {
+	.name		= "sr1_hwmod",
+	.class		= &omap34xx_smartreflex_hwmod_class,
+	.main_clk	= "sr1_fck",
+	.slaves		= omap3_sr1_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap3_sr1_slaves),
+	.dev_attr	= &omap34xx_sr1_dev_attr,
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 |
+					CHIP_IS_OMAP3430ES3_0 |
+					CHIP_IS_OMAP3430ES3_1),
+	.flags		= HWMOD_SET_DEFAULT_CLOCKACT,
+};
+
+static u32 omap36xx_sr1_efuse_offs[] = {
+	OMAP3630_CONTROL_FUSE_OPP50_VDD1, OMAP3630_CONTROL_FUSE_OPP100_VDD1,
+	OMAP3630_CONTROL_FUSE_OPP120_VDD1, OMAP3630_CONTROL_FUSE_OPP1G_VDD1,
+};
+
+static u32 omap36xx_sr1_test_nvalues[] = {
+	0x898beb, 0x999b83, 0xaac5a8, 0xaab197,
+};
+
+static struct omap_sr_dev_data omap36xx_sr1_dev_attr = {
+	.efuse_nvalues_offs	= omap36xx_sr1_efuse_offs,
+	.test_sennenable	= 0x1,
+	.test_senpenable	= 0x1,
+	.test_nvalues		= omap36xx_sr1_test_nvalues,
+};
+
+static struct omap_hwmod omap36xx_sr1_hwmod = {
+	.name		= "sr1_hwmod",
+	.class		= &omap36xx_smartreflex_hwmod_class,
+	.main_clk	= "sr1_fck",
+	.slaves		= omap3_sr1_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap3_sr1_slaves),
+	.dev_attr	= &omap36xx_sr1_dev_attr,
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
+};
+
+/* SR2 */
+static struct omap_hwmod_ocp_if *omap3_sr2_slaves[] = {
+	&omap3_l4_core__sr2,
+};
+
+static u32 omap34xx_sr2_efuse_offs[] = {
+	OMAP343X_CONTROL_FUSE_OPP1_VDD2, OMAP343X_CONTROL_FUSE_OPP2_VDD2,
+	OMAP343X_CONTROL_FUSE_OPP3_VDD2,
+};
+
+static u32 omap34xx_sr2_test_nvalues[] = {
+	0x0, 0xAAC098, 0xAB89D9
+};
+
+static struct omap_sr_dev_data omap34xx_sr2_dev_attr = {
+	.efuse_sr_control	= OMAP343X_CONTROL_FUSE_SR,
+	.sennenable_shift	= OMAP343X_SR2_SENNENABLE_SHIFT,
+	.senpenable_shift	= OMAP343X_SR2_SENPENABLE_SHIFT,
+	.efuse_nvalues_offs	= omap34xx_sr2_efuse_offs,
+	.test_sennenable	= 0x3,
+	.test_senpenable	= 0x3,
+	.test_nvalues		= omap34xx_sr2_test_nvalues,
+};
+
+static struct omap_hwmod omap34xx_sr2_hwmod = {
+	.name		= "sr2_hwmod",
+	.class		= &omap34xx_smartreflex_hwmod_class,
+	.main_clk	= "sr2_fck",
+	.slaves		= omap3_sr2_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap3_sr2_slaves),
+	.dev_attr	= &omap34xx_sr2_dev_attr,
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 |
+					CHIP_IS_OMAP3430ES3_0 |
+					CHIP_IS_OMAP3430ES3_1),
+	.flags		= HWMOD_SET_DEFAULT_CLOCKACT,
+};
+
+static u32 omap36xx_sr2_efuse_offs[] = {
+	OMAP3630_CONTROL_FUSE_OPP50_VDD2, OMAP3630_CONTROL_FUSE_OPP100_VDD2,
+};
+
+static u32 omap36xx_sr2_test_nvalues[] = {
+	0x898beb, 0x9a8cee,
+};
+
+static struct omap_sr_dev_data omap36xx_sr2_dev_attr = {
+	.efuse_nvalues_offs	= omap36xx_sr2_efuse_offs,
+	.test_sennenable	= 0x1,
+	.test_senpenable	= 0x1,
+	.test_nvalues		= omap36xx_sr2_test_nvalues,
+};
+
+static struct omap_hwmod omap36xx_sr2_hwmod = {
+	.name		= "sr2_hwmod",
+	.class		= &omap36xx_smartreflex_hwmod_class,
+	.main_clk	= "sr2_fck",
+	.slaves		= omap3_sr2_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap3_sr2_slaves),
+	.dev_attr	= &omap36xx_sr2_dev_attr,
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
+};
 static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
 	&omap3xxx_l3_hwmod,
 	&omap3xxx_l4_core_hwmod,
 	&omap3xxx_l4_per_hwmod,
 	&omap3xxx_l4_wkup_hwmod,
 	&omap3xxx_mpu_hwmod,
+	&omap34xx_sr1_hwmod,
+	&omap34xx_sr2_hwmod,
+	&omap36xx_sr1_hwmod,
+	&omap36xx_sr2_hwmod,
 	NULL,
 };
 
arch/arm/plat-omap/include/plat/control.h +27 -0
index a56deee..6c179ae 100644
@@ -144,6 +144,15 @@
 #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 \
@@ -160,6 +169,14 @@
 #define OMAP343X_CONTROL_SRAMLDO5	(OMAP2_CONTROL_GENERAL + 0x02C0)
 #define OMAP343X_CONTROL_CSI		(OMAP2_CONTROL_GENERAL + 0x02C4)
 
+/* OMAP3630 only CONTROL_GENERAL register offsets */
+#define OMAP3630_CONTROL_FUSE_OPP1G_VDD1        (OMAP2_CONTROL_GENERAL + 0x0110)
+#define OMAP3630_CONTROL_FUSE_OPP50_VDD1        (OMAP2_CONTROL_GENERAL + 0x0114)
+#define OMAP3630_CONTROL_FUSE_OPP100_VDD1       (OMAP2_CONTROL_GENERAL + 0x0118)
+#define OMAP3630_CONTROL_FUSE_OPP120_VDD1       (OMAP2_CONTROL_GENERAL + 0x0120)
+#define OMAP3630_CONTROL_FUSE_OPP50_VDD2        (OMAP2_CONTROL_GENERAL + 0x0128)
+#define OMAP3630_CONTROL_FUSE_OPP100_VDD2       (OMAP2_CONTROL_GENERAL + 0x012C)
+
 /* AM35XX only CONTROL_GENERAL register offsets */
 #define AM35XX_CONTROL_MSUSPENDMUX_6    (OMAP2_CONTROL_GENERAL + 0x0038)
 #define AM35XX_CONTROL_DEVCONF2         (OMAP2_CONTROL_GENERAL + 0x0310)
@@ -240,6 +257,16 @@
 #define OMAP2_SYSBOOT_1_MASK		(1 << 1)
 #define OMAP2_SYSBOOT_0_MASK		(1 << 0)
 
+/* CONTROL_FUSE_SR bits */
+#define OMAP343X_SR2_SENNENABLE_MASK    (0x3 << 10)
+#define OMAP343X_SR2_SENNENABLE_SHIFT   10
+#define OMAP343X_SR2_SENPENABLE_MASK    (0x3 << 8)
+#define OMAP343X_SR2_SENPENABLE_SHIFT   8
+#define OMAP343X_SR1_SENNENABLE_MASK    (0x3 << 2)
+#define OMAP343X_SR1_SENNENABLE_SHIFT   2
+#define OMAP343X_SR1_SENPENABLE_MASK    (0x3 << 0)
+#define OMAP343X_SR1_SENPENABLE_SHIFT   0
+
 /* CONTROL_PBIAS_LITE bits */
 #define OMAP343X_PBIASLITESUPPLY_HIGH1	(1 << 15)
 #define OMAP343X_PBIASLITEVMODEERROR1	(1 << 11)
Signature · 1 line
1.7.0.rc1.33.g07cf0f
#5 lore raw

PATCH 5/8 OMAP3: PM: Adding smartreflex class3 driver

Smartreflex Class3 implementation continuously monitors silicon performance and instructs the Voltage Processors to increase or decrease the voltage.
This patch adds smartreflex class 3 driver. This driver hooks up with the generic smartreflex driver smartreflex.c to abstract out class specific implementations out of the generic driver.

---
 arch/arm/mach-omap2/Makefile             |    1 +
 arch/arm/mach-omap2/board-3430sdp.c      |    2 +
 arch/arm/mach-omap2/board-3630sdp.c      |    2 +
 arch/arm/mach-omap2/board-zoom3.c        |    2 +
 arch/arm/mach-omap2/smartreflex-class3.c |   62 ++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/smartreflex-class3.h |   23 +++++++++++
 arch/arm/plat-omap/Kconfig               |    9 ++++
 7 files changed, 101 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/smartreflex-class3.c
 create mode 100644 arch/arm/mach-omap2/smartreflex-class3.h
arch/arm/mach-omap2/Makefile +1 -0
index ab3772a..116cffb 100644
@@ -50,6 +50,7 @@ obj-$(CONFIG_ARCH_OMAP3)		+= pm34xx.o sleep34xx.o cpuidle34xx.o \
 					   voltage.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
 
 AFLAGS_sleep24xx.o			:=-Wa,-march=armv6
 AFLAGS_sleep34xx.o			:=-Wa,-march=armv7-a
arch/arm/mach-omap2/board-3430sdp.c +2 -0
index da5cea5..ba650a5 100644
@@ -48,6 +48,7 @@
 #include "hsmmc.h"
 #include "pm.h"
 #include "omap3-opp.h"
+#include "smartreflex-class3.h"
 
 #define CONFIG_DISABLE_HFCLK 1
 
@@ -804,6 +805,7 @@ static void __init omap_3430sdp_init(void)
 	sdp3430_display_init();
 	enable_board_wakeup_source();
 	usb_ehci_init(&ehci_pdata);
+	sr_class3_init();
 }
 
 static void __init omap_3430sdp_map_io(void)
arch/arm/mach-omap2/board-3630sdp.c +2 -0
index b7c44eb..00aef0d 100644
@@ -27,6 +27,7 @@
 #include "sdram-hynix-h8mbx00u0mer-0em.h"
 #include "pm.h"
 #include "omap3-opp.h"
+#include "smartreflex-class3.h"
 
 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
 
@@ -107,6 +108,7 @@ static void __init omap_sdp_init(void)
 	board_smc91x_init();
 	enable_board_wakeup_source();
 	usb_ehci_init(&ehci_pdata);
+	sr_class3_init();
 }
 
 MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
arch/arm/mach-omap2/board-zoom3.c +2 -0
index 25ce6d6..99ade1c 100644
@@ -26,6 +26,7 @@
 #include "sdram-hynix-h8mbx00u0mer-0em.h"
 #include "pm.h"
 #include "omap3-opp.h"
+#include "smartreflex-class3.h"
 
 static void __init omap_zoom_map_io(void)
 {
@@ -76,6 +77,7 @@ static void __init omap_zoom_init(void)
 
 	omap_mux_init_gpio(64, OMAP_PIN_OUTPUT);
 	usb_ehci_init(&ehci_pdata);
+	sr_class3_init();
 }
 
 MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
arch/arm/mach-omap2/smartreflex-class3.c new file +62 -0

62 lines not on this page · raw message

arch/arm/mach-omap2/smartreflex-class3.h new file +23 -0
new file mode 100644
index 0000000..4d86037
@@ -0,0 +1,23 @@
+/*
+ * Smartreflex Class 3 Routines
+ *
+ * Author: Thara Gopinath      <[email protected]>
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc.
+ * Thara Gopinath <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ARCH_ARM_MACH_OMAP2_SMARTREFLEXCLASS3_H
+#define __ARCH_ARM_MACH_OMAP2_SMARTREFLEXCLASS3_H
+
+#ifdef CONFIG_OMAP_SMARTREFLEX_CLASS3
+int sr_class3_init(void);
+#else
+static int sr_class3_init(void) { return 0; }
+#endif
+
+#endif
arch/arm/plat-omap/Kconfig +9 -0
index 34f265e..33256d8 100644
@@ -85,6 +85,15 @@ config OMAP_SMARTREFLEX_TESTING
 
 	  WARNING: Enabling this option may cause your device to hang!
 
+config OMAP_SMARTREFLEX_CLASS3
+	bool "Class 3 mode of Smartreflex Implementation"
+	depends on OMAP_SMARTREFLEX && TWL4030_CORE
+	help
+	  Say Y to enable Class 3 implementation of Smartreflex
+
+	  Class 3 implementation of Smartreflex employs continuous hardware
+	  voltage caliberation.
+
 config OMAP_RESET_CLOCKS
 	bool "Reset unused clocks during boot"
 	depends on ARCH_OMAP
Signature · 1 line
1.7.0.rc1.33.g07cf0f
#6 lore raw

PATCH 6/8 OMAP3: PM: Adding T2 enabling of smartreflex support

This patch adds support in the twl4030 driver to hook up the API enabling smartreflex support on PMIC side with the smartreflex driver. Without this the OMAP smartreflex modules will not function.

---
 drivers/mfd/twl-core.c      |    7 +++++--
 drivers/mfd/twl4030-power.c |   29 +++++++++++++++++++++++++++++
 include/linux/i2c/twl.h     |    1 +
 3 files changed, 35 insertions(+), 2 deletions(-)
drivers/mfd/twl-core.c +5 -2
index 562cd49..fc14bd6 100644
@@ -1009,8 +1009,11 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
 	clocks_init(&client->dev, pdata->clock);
 
 	/* load power event scripts */
-	if (twl_has_power() && pdata->power)
-		twl4030_power_init(pdata->power);
+	if (twl_has_power()) {
+		twl4030_power_sr_init();
+		 if (pdata->power)
+			twl4030_power_init(pdata->power);
+	}
 
 	/* Maybe init the T2 Interrupt subsystem */
 	if (client->irq
drivers/mfd/twl4030-power.c +29 -0
index 7efa878..0e4d215 100644
@@ -31,6 +31,8 @@
 
 #include <asm/mach-types.h>
 
+#include <plat/smartreflex.h>
+
 static u8 twl4030_start_script_address = 0x2b;
 
 #define PWR_P1_SW_EVENTS	0x10
@@ -63,6 +65,10 @@ static u8 twl4030_start_script_address = 0x2b;
 #define R_MEMORY_ADDRESS	PHY_TO_OFF_PM_MASTER(0x59)
 #define R_MEMORY_DATA		PHY_TO_OFF_PM_MASTER(0x5a)
 
+/* Smartreflex Control */
+#define R_DCDC_GLOBAL_CFG	PHY_TO_OFF_PM_RECEIVER(0x61)
+#define CFG_ENABLE_SRFLX	0x08
+
 #define R_PROTECT_KEY		0x0E
 #define R_KEY_1			0xC0
 #define R_KEY_2			0x0C
@@ -511,6 +517,29 @@ int twl4030_remove_script(u8 flags)
 	return err;
 }
 
+/* API to enable smrtreflex on Triton side */
+static void twl4030_smartreflex_init(void)
+{
+	int ret = 0;
+	u8 read_val;
+
+	ret = twl_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &read_val,
+			R_DCDC_GLOBAL_CFG);
+	read_val |= CFG_ENABLE_SRFLX;
+	ret |= twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, read_val,
+			R_DCDC_GLOBAL_CFG);
+}
+
+struct omap_smartreflex_pmic_data twl4030_sr_data = {
+       .sr_pmic_init   = twl4030_smartreflex_init,
+};
+
+void __init twl4030_power_sr_init()
+{
+	/* Register the SR init API with the Smartreflex driver */
+	omap_sr_register_pmic(&twl4030_sr_data);
+}
+
 void __init twl4030_power_init(struct twl4030_power_data *twl4030_scripts)
 {
 	int err = 0;
include/linux/i2c/twl.h +1 -0
index fb6784e..3dc83fb 100644
@@ -550,6 +550,7 @@ struct twl4030_power_data {
 };
 
 extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
+extern void twl4030_power_sr_init(void);
 extern int twl4030_remove_script(u8 flags);
 
 struct twl4030_codec_audio_data {
Signature · 1 line
1.7.0.rc1.33.g07cf0f
#7 lore raw

PATCH 7/8 OMAP: PM: Allowing an early init of pm debugfs driver.

This patch changes the pm_db_init from arch initcall to a postcore initcall. With arch initcall, it is impossible for pm driver that gets initialized prior to this driver to use one of the pm debug fs entries during its init. Making it a postcore initcall ensures that this drver gets initialized early on before any pm drivers.

---
 arch/arm/mach-omap2/pm-debug.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/pm-debug.c +1 -1
index 4280006..b239c16 100644
@@ -611,6 +611,6 @@ static int __init pm_dbg_init(void)
 
 	return 0;
 }
-arch_initcall(pm_dbg_init);
+postcore_initcall(pm_dbg_init);
 
 #endif
Signature · 1 line
1.7.0.rc1.33.g07cf0f
#8 lore raw

PATCH 8/8 OMAP3: PM: Adding debug support to Voltage and Smartreflex drivers

This patch adds debug support to the voltage and smartreflex drivers. This means a whole bunch of voltage processor and smartreflex parameters are now visible through the pm debugfs. By default only a read of these parameters are permitted. If you need to write into them then
echo 1 > /pm_debug/enable_sr_vp_debug

The voltage parameters can be viewed at
/pm_debug/Voltage/VDD<X>/<parameter>
and the smartreflex parameters can be viewed at
/pm_debug/Smartreflex/SR<X>/<parameter>

where <X> is 1 or 2 for OMAP3.

---
 arch/arm/mach-omap2/pm-debug.c                |   13 ++
 arch/arm/mach-omap2/smartreflex.c             |   39 ++++++-
 arch/arm/mach-omap2/voltage.c                 |  148 ++++++++++++++++++++++++-
 arch/arm/mach-omap2/voltage.h                 |    3 +
 arch/arm/plat-omap/include/plat/smartreflex.h |    2 -
 5 files changed, 197 insertions(+), 8 deletions(-)
arch/arm/mach-omap2/pm-debug.c +13 -0
index b239c16..fbba94b 100644
@@ -35,6 +35,7 @@
 #include "prm.h"
 #include "cm.h"
 #include "pm.h"
+#include "voltage.h"
 
 int omap2_pm_debug;
 
@@ -552,6 +553,16 @@ static int option_set(void *data, u64 val)
 
 	if (option == &enable_off_mode)
 		omap3_pm_off_mode_enable(val);
+	if (option == &enable_sr_vp_debug && val)
+		pr_notice("Beware that enabling this option will allow user "
+			"to override the system defined vp and sr parameters "
+			"All the updated parameters will take effect next "
+			"time smartreflex is enabled. Also this option "
+			"disables the automatic vp errorgain and sr errormin "
+			"limit changes as per the voltage. Users will have "
+			"to explicitly write values into the debug fs "
+			"entries corresponding to these if they want to see "
+			"them changing according to the VDD voltage\n");
 
 	return 0;
 }
@@ -606,6 +617,8 @@ static int __init pm_dbg_init(void)
 				   &sleep_while_idle, &pm_dbg_option_fops);
 	(void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUGO, d,
 				   &wakeup_timer_seconds, &pm_dbg_option_fops);
+	(void) debugfs_create_file("enable_sr_vp_debug",  S_IRUGO | S_IWUGO, d,
+				   &enable_sr_vp_debug, &pm_dbg_option_fops);
 	pm_dbg_main_dir = d;
 	pm_dbg_init_done = 1;
 
arch/arm/mach-omap2/smartreflex.c +37 -2
index 74b7c0c..57fc9b2 100644
@@ -529,8 +529,13 @@ int sr_enable(int srid, unsigned long volt)
 		return -ENODATA;
 	}
 
-	/* errminlimit is opp dependent and hence linked to voltage */
-	sr->err_minlimit = volt_data->sr_errminlimit;
+	/*
+	 * errminlimit is opp dependent and hence linked to voltage
+	 * if the debug option is enabled, the user might have over ridden
+	 * this parameter so do not get it from voltage table
+	 */
+	if (!enable_sr_vp_debug)
+		sr->err_minlimit = volt_data->sr_errminlimit;
 
 	/* Enable the clocks */
 	if (!sr->is_sr_enable) {
@@ -785,8 +790,31 @@ static int omap_sr_autocomp_store(void *data, u64 val)
 	return 0;
 }
 
+static int omap_sr_params_show(void *data, u64 *val)
+{
+	u32 *param = data;
+
+	*val = *param;
+	return 0;
+}
+
+static int omap_sr_params_store(void *data, u64 val)
+{
+	if (enable_sr_vp_debug) {
+		u32 *option = data;
+		*option = val;
+	} else {
+		pr_notice("DEBUG option not enabled!\n	\
+			echo 1 > pm_debug/enable_sr_vp_debug - to enable\n");
+	}
+	return 0;
+}
+
 DEFINE_SIMPLE_ATTRIBUTE(pm_sr_fops, omap_sr_autocomp_show,
 		omap_sr_autocomp_store, "%llu\n");
+
+DEFINE_SIMPLE_ATTRIBUTE(sr_params_fops, omap_sr_params_show,
+		omap_sr_params_store, "%llu\n");
 #endif
 
 static int __init omap_smartreflex_probe(struct platform_device *pdev)
@@ -849,6 +877,13 @@ static int __init omap_smartreflex_probe(struct platform_device *pdev)
 	dbg_dir = debugfs_create_dir(name, sr_dbg_dir);
 	(void) debugfs_create_file("autocomp", S_IRUGO | S_IWUGO, dbg_dir,
 				(void *)sr_info, &pm_sr_fops);
+	(void) debugfs_create_file("errweight", S_IRUGO | S_IWUGO, dbg_dir,
+				&sr_info->err_weight, &sr_params_fops);
+	(void) debugfs_create_file("errmaxlimit", S_IRUGO | S_IWUGO, dbg_dir,
+				&sr_info->err_maxlimit, &sr_params_fops);
+	(void) debugfs_create_file("errminlimit", S_IRUGO | S_IWUGO, dbg_dir,
+				&sr_info->err_minlimit, &sr_params_fops);
+
 #endif
 
 	dev_info(&pdev->dev, "%s: SmartReflex driver initialized\n", __func__);
arch/arm/mach-omap2/voltage.c +144 -4

204 lines not on this page · raw message

arch/arm/mach-omap2/voltage.h +3 -0
index f2796b2..a7be515 100644
@@ -14,6 +14,9 @@
 #ifndef __ARCH_ARM_MACH_OMAP2_VOLTAGE_H
 #define __ARCH_ARM_MACH_OMAP2_VOLTAGE_H
 
+extern u32 enable_sr_vp_debug;
+extern struct dentry *pm_dbg_main_dir;
+
 /* VoltageDomain instances */
 #define VDD1	0
 #define VDD2	1
arch/arm/plat-omap/include/plat/smartreflex.h +0 -2
index 2225f27..1105db0 100644
@@ -22,8 +22,6 @@
 
 #include <linux/platform_device.h>
 
-extern struct dentry *pm_dbg_main_dir;
-
 /*
  * Different Smartreflex IPs version. The v1 is the 65nm version used in
  * OMAP3430. The v2 is the update for the 45nm version of the IP
Signature · 1 line
1.7.0.rc1.33.g07cf0f
#9 lore raw

Re: [PATCH 8/8] OMAP3: PM: Adding debug support to Voltage and Smartreflex drivers

Quoted 14 lines · Thara Gopinath

From: Thara Gopinath <[email protected]>
Subject: [PATCH 8/8] OMAP3: PM: Adding debug support to Voltage and Smartreflex drivers
To: [email protected]
Cc: [email protected], [email protected], [email protected],
[email protected], [email protected], Thara Gopinath <[email protected]>
Date: Sat, 29 May 2010 22:02:28 +0530

This patch adds debug support to the voltage and smartreflex drivers. This means a whole bunch of voltage processor and smartreflex parameters are now visible through the pm debugfs. By default only a read of these parameters are permitted. If you need to write into them then
echo 1 > /pm_debug/enable_sr_vp_debug

Quoted 4 lines

The voltage parameters can be viewed at
/pm_debug/Voltage/VDD<X>/<parameter>
and the smartreflex parameters can be viewed at
/pm_debug/Smartreflex/SR<X>/<parameter>

Minor nit: there's no hard rule for this, but these debugfs files and directories are typically all lower-case. Please continue that convention.

Kevin

#10 lore raw

Re: [PATCH 7/8] OMAP: PM: Allowing an early init of pm debugfs driver.

In reply to Thara Gopinath
Quoted 17 lines · Thara Gopinath

This patch changes the pm_db_init from arch initcall to a postcore initcall. With arch initcall, it is impossible for pm driver that gets initialized prior to this driver to use one of the pm debug fs entries during its init. Making it a postcore initcall ensures that this drver gets initialized early on before any pm drivers.

---
 arch/arm/mach-omap2/pm-debug.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/pm-debug.c +0 -0
index 4280006..b239c16 100644

arch/arm/mach-omap2/pm-debug.c static int __init pm_dbg_init(void) · line 614

Quoted 5 lines
arch/arm/mach-omap2/pm-debug.c +1 -1
@@ -611,6 +611,6 @@ static int __init pm_dbg_init(void)
 
 	return 0;
 }
-arch_initcall(pm_dbg_init);
+postcore_initcall(pm_dbg_init);

There's already a 'pm_dbg_init_done' flag in this code being used for that purpose. That should be re-used instead.

Kevin

#11 lore raw

Re: [PATCH 4/8] OMAP3: PM: Adding smartreflex hwmod data

In reply to Thara Gopinath
Quoted 7 lines · Thara Gopinath

This patch adds the smartreflex hwmod data for OMAP3430 and OMAP3630. A dev_attr is also added to the hwmod structure for each smartreflex module which contains SoC specific info like the efuse offsets, test n-values etc.

[...]

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = { · line 109

Quoted 7 lines
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +7 -0
+static struct omap_hwmod_ocp_if omap3_l4_core__sr1 = {
+	.master		= &omap3xxx_l4_core_hwmod,
+	.slave		= &omap34xx_sr1_hwmod,
+	.clk		= "sr_l4_ick",
+	.addr		= omap3_sr1_addr_space,
+	.addr_cnt	= ARRAY_SIZE(omap3_sr1_addr_space),
+	.user		= OCP_USER_MPU,

For enable to work, these all nee the .prcm.omap2 sub struct filled out.

Kevin

#12 lore raw

Re: [PATCH 2/8] OMAP3: PM: Adding smartreflex driver support.

In reply to Thara Gopinath
Quoted 36 lines · Thara Gopinath

SmartReflex modules do adaptive voltage control for real-time voltage adjustments. With Smartreflex the power supply voltage can be adapted to the silicon performance(manufacturing process, temperature induced performance, age induced performance etc).

There are differnet classes of smartreflex implementation.
Class-0: Manufacturing Test Calibration
Class-1: Boot-Time Software Calibration
Class-2: Continuous Software Calibration
Class-3: Continuous Hardware Calibration
Class-4: Fully Integrated Power Management

OMAP3 has two smartreflex modules one associated with VDD1 and the other associated with VDD2.
This patch adds support for smartreflex driver. The driver is designed for Class-1 , Class-2 and Class-3 support and is a platform driver. Smartreflex driver can be enabled through a Kconfig option "SmartReflex support" under "System type"->"TI OMAP implementations" menu.

Smartreflex autocompensation feature can be enabled runtime through a debug fs option.
To enable smartreflex autocompensation feature
echo 1 > /debugfs/pm_debug/Smartreflex/SR<X>/autocomp
To disable smartreflex autocompensation feature
echo 0 > /debugfs/pm_debug/Smartreflex/SR<X>/autocomp

This patch contains code originally in linux omap pm branch. Major contributors to this driver are
Lesly A M, Rajendra Nayak, Kalle Jokiniemi, Paul Walmsley, Nishant Menon, Kevin Hilman.

---
 arch/arm/mach-omap2/Makefile                  |    1 +
 arch/arm/mach-omap2/pm-debug.c                |    3 +-
 arch/arm/mach-omap2/smartreflex.c             |  934 +++++++++++++++++++++++++

[...]

Quoted 14 lines
arch/arm/mach-omap2/pm-debug.c +1 -1
index 6cac981..4280006 100644
@@ -162,7 +162,7 @@ void omap2_pm_dump(int mode, int resume, unsigned int us)
 
 static void pm_dbg_regset_store(u32 *ptr);
 
-struct dentry *pm_dbg_dir;
+struct dentry *pm_dbg_dir, *pm_dbg_main_dir;
 
 static int pm_dbg_init_done;
 

arch/arm/mach-omap2/pm-debug.c static int __init pm_dbg_init(void) · line 612

Quoted 7 lines
arch/arm/mach-omap2/pm-debug.c +1 -0
@@ -606,6 +606,7 @@ static int __init pm_dbg_init(void)
 				   &sleep_while_idle, &pm_dbg_option_fops);
 	(void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUGO, d,
 				   &wakeup_timer_seconds, &pm_dbg_option_fops);
+	pm_dbg_main_dir = d;
 	pm_dbg_init_done = 1;
 
 	return 0;

Not clear what this change is doing in this patch. I think this belongs with PATCH 8/8.

Kevin

#13 lore raw

Re: [PATCH 1/8] OMAP3: PM: Adding voltage driver support for OMAP3

In reply to Thara Gopinath
Quoted 12 lines · Thara Gopinath

This patch adds voltage driver support for OMAP3. The driver allows configuring the voltage controller and voltage processors during init and exports APIs to enable/disable voltage processors, scale voltage and reset voltage. The driver also maintains the global voltage table on a per VDD basis which contains the various voltages supported by the VDD along with per voltage dependent data like smartreflex n-target value, errminlimit and voltage processor errorgain. The driver allows scaling of VDD voltages either through "vc bypass method" or through "vp forceupdate method" the choice being configurable through the board file.

Quoted 6 lines

This patch contains code originally in linux omap pm branch smartreflex driver. Major contributors to this driver are Lesly A M, Rajendra Nayak, Kalle Jokiniemi, Paul Walmsley, Nishant Menon, Kevin Hilman.

First some general comments:

I thought we had agreed that all the internal functions should not need to take a VDD ID, but instead they could be just passed a vdd_info pointer.

I would greatly improve readability to see all usage of vdd_info[vdd_id] go away.

In the exported functions that take vdd_id as an argument, just do something like

          struct omap_vdd_info *vdd = vdd_info[vdd_id];

at the beginning, then replace all the instances of vdd_info[vdd_id] with 'vdd->'

In the rest of the internal functions, make them take the pointer as the argument instead of the id.

Also, we have a bunch of stuff in the current pm-vc branch which allows boards to override settings. Are you planning to address that in this series? or is Lesly going to continue that work?

Some other comments below...

Quoted 59 lines
---
 arch/arm/mach-omap2/Makefile  |    3 +-
 arch/arm/mach-omap2/voltage.c | 1059 +++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/voltage.h |  123 +++++
 3 files changed, 1184 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-omap2/voltage.c
 create mode 100644 arch/arm/mach-omap2/voltage.h
arch/arm/mach-omap2/Makefile +2 -1
index e975b43..e4c660d 100644
@@ -46,7 +46,8 @@ obj-$(CONFIG_ARCH_OMAP2)		+= sdrc2xxx.o
 ifeq ($(CONFIG_PM),y)
 obj-$(CONFIG_ARCH_OMAP2)		+= pm24xx.o
 obj-$(CONFIG_ARCH_OMAP2)		+= sleep24xx.o
-obj-$(CONFIG_ARCH_OMAP3)		+= pm34xx.o sleep34xx.o cpuidle34xx.o
+obj-$(CONFIG_ARCH_OMAP3)		+= pm34xx.o sleep34xx.o cpuidle34xx.o \
+					   voltage.o
 obj-$(CONFIG_PM_DEBUG)			+= pm-debug.o
 
 AFLAGS_sleep24xx.o			:=-Wa,-march=armv6
arch/arm/mach-omap2/voltage.c new file +31 -0
new file mode 100644
index 0000000..657e322
@@ -0,0 +1,1059 @@
+/*
+ * OMAP3/OMAP4 Voltage Management Routines
+ *
+ * Author: Thara Gopinath	<[email protected]>
+ *
+ * Copyright (C) 2007 Texas Instruments, Inc.
+ * Rajendra Nayak <[email protected]>
+ * Lesly A M <[email protected]>
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ * Kalle Jokiniemi
+ *
+ * Copyright (C) 2010 Texas Instruments, Inc.
+ * Thara Gopinath <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/pm.h>
+#include <linux/delay.h>
+#include <linux/io.h>
+#include <linux/clk.h>
+#include <linux/err.h>
+
+#include <plat/omap-pm.h>
+#include <plat/omap34xx.h>
+#include <plat/opp.h>
+#include <plat/opp_twl_tps.h>
+#include <plat/clock.h>

arch/arm/mach-omap2/voltage.c line 41

Quoted 10 lines
arch/arm/mach-omap2/voltage.c new file +10 -0
+#include <plat/common.h>
+
+#include "prm-regbits-34xx.h"
+#include "voltage.h"
+
+#define VP_IDLE_TIMEOUT		200
+#define VP_TRANXDONE_TIMEOUT	300
+
+/* PRM voltage module */
+u32 volt_mod;

should be static

arch/arm/mach-omap2/voltage.c line 51

Quoted 9 lines
arch/arm/mach-omap2/voltage.c new file +9 -0
+/* Voltage processor register offsets */
+struct vp_reg_offs {
+	u8 vpconfig_reg;
+	u8 vstepmin_reg;
+	u8 vstepmax_reg;
+	u8 vlimitto_reg;
+	u8 status_reg;
+	u8 voltage_reg;
+};

Minor issue, but the _reg suffix is not really needed on all these names.

[...]

arch/arm/mach-omap2/voltage.c line 439

Quoted 3 lines
arch/arm/mach-omap2/voltage.c new file +3 -0
+
+/* Generic voltage init functions */
+static void __init init_voltageprocesor(int vp_id)

was mystified why I wasn't finding this function when grepping and discovered there should be two 's's in processor in this function name.

[...]

arch/arm/mach-omap2/voltage.h

Quoted 1 line
arch/arm/mach-omap2/voltage.h +0 -0

[...]

For the naming, rather than the long names voltagecontroller, voltageprocessor, I'd suggest just using vc and vp. For the external functions, they can have the omap_ prefix.

arch/arm/mach-omap2/voltage.h line 110

Quoted 3 lines
arch/arm/mach-omap2/voltage.h +3 -0
+unsigned long omap_voltageprocessor_get_curr_volt(int vp_id);
+void omap_voltageprocessor_enable(int vp_id);
+void omap_voltageprocessor_disable(int vp_id);

these should be omap_vp_*

arch/arm/mach-omap2/voltage.h line 112

Quoted 2 lines
arch/arm/mach-omap2/voltage.h +2 -0
+int omap_voltage_scale(int vdd, unsigned long target_volt);
+void omap_reset_voltage(int vdd);

omap_voltage_reset()

Quoted 1 line

+int omap_get_voltage_table(int vdd, struct omap_volt_data **volt_data);

omap_voltage_get_table()

Quoted 1 line

+struct omap_volt_data *omap_get_volt_data(int vdd, unsigned long volt);

omap_voltage_get_data()

arch/arm/mach-omap2/voltage.h line 116

Quoted 2 lines
arch/arm/mach-omap2/voltage.h +2 -0
+void omap_voltage_register_pmic(struct omap_volt_pmic_info *pmic_info);
+unsigned long get_curr_voltage(int vdd);

omap_voltage_get()

Quoted 9 lines
arch/arm/mach-omap2/voltage.h +7 -0
+#ifdef CONFIG_PM
+void omap_voltage_init_vc(struct omap_volt_vc_data *setup_vc);
+#else
+static inline void omap_voltage_init_vc(struct omap_volt_vc_data *setup_vc) {}
+#endif
+
+#endif
Signature · 1 line
1.7.0.rc1.33.g07cf0f

Kevin

#14 lore raw

Re: [PATCH 1/8] OMAP3: PM: Adding voltage driver support for OMAP3

In reply to Thara Gopinath
Quoted 18 lines · Thara Gopinath

This patch adds voltage driver support for OMAP3. The driver allows configuring the voltage controller and voltage processors during init and exports APIs to enable/disable voltage processors, scale voltage and reset voltage. The driver also maintains the global voltage table on a per VDD basis which contains the various voltages supported by the VDD along with per voltage dependent data like smartreflex n-target value, errminlimit and voltage processor errorgain. The driver allows scaling of VDD voltages either through "vc bypass method" or through "vp forceupdate method" the choice being configurable through the board file.

This patch contains code originally in linux omap pm branch smartreflex driver. Major contributors to this driver are Lesly A M, Rajendra Nayak, Kalle Jokiniemi, Paul Walmsley, Nishant Menon, Kevin Hilman.

[...]

Quoted 25 lines
arch/arm/mach-omap2/voltage.c new file +25 -0
+/**
+ * get_curr_vdd_voltage : Gets the current non-auto-compensated voltage
+ * @vdd	: the VDD for which current voltage info is needed
+ *
+ * API to get the current non-auto-compensated voltage for a VDD.
+ * Returns 0 in case of error else returns the current voltage for the VDD.
+ */
+unsigned long get_curr_voltage(int vdd)
+{
+	struct omap_opp *opp;
+	unsigned long freq;
+
+	if (check_voltage_domain(vdd)) {
+		pr_warning("%s: VDD %d does not exist!\n", __func__, vdd);
+		return 0;
+	}
+
+	freq = vdd_info[vdd].volt_clk->rate;
+	opp = opp_find_freq_ceil(vdd_info[vdd].opp_type, &freq);
+	if (IS_ERR(opp)) {
+		pr_warning("%s: Unable to find OPP for VDD%d freq%ld\n",
+			__func__, vdd + 1, freq);
+		return 0;
+	}
+

arch/arm/mach-omap2/voltage.c line 758

Quoted 10 lines
arch/arm/mach-omap2/voltage.c new file +10 -0
+	/*
+	 * Use higher freq voltage even if an exact match is not available
+	 * we are probably masking a clock framework bug, so warn
+	 */
+	if (unlikely(freq != vdd_info[vdd].volt_clk->rate))
+		pr_warning("%s: Available freq %ld != dpll freq %ld.\n",
+			__func__, freq, vdd_info[vdd].volt_clk->rate);
+
+	return opp_get_voltage(opp);
+}

Rather than having to do an OPP lookup each time based on current clock rate, why not just store the current voltage into vdd_info and update it whenever it changes. This function could then just return that value.

Kevin

#15 lore raw
In reply to Thara Gopinath
Quoted 9 lines · Thara Gopinath

This patch series introduces smartreflex and voltage driver support for OMAP3430 and OMAP3630. SmartReflex modules do adaptive voltage control for real-time voltage adjustments.

Originally all the functionalities introduced in this patch were present in arch/arm/mach-omap2/smartreflex.c file in Kevin's pm tree. This patch series does a major rewrite of this file and introduces a separate voltage driver. Major contributors to the original driver are

This is excellent, thanks for the rebase/reorg/compress.

While not yet get getting to a full review of this series, I'd like it to get some broader testing. To that end, I've replaced the pm-sr branch in my pm tree with this series, and rebuilt a new PM branch using it.

Note that it is also based on top of a new pm-opp branch which is Nishanth's condensed version which is also upstream bound for the next merge window.

I had to do a couple minor fixes to apply against v2.6.35-rc1 (mainly fixing usage of #defines that were renamed to have a _MASK suffix.)

It currently boots fine on OMAP3EVM (no efuse values, so no SR) but when I try it on Zoom3, I get repeated errors:

Wake up daisy chain activation failed.

I haven't fully isolated the root cause yet, but it looks like it might be because omap3_enable_io_chain() seems confused about whether it should be writing PM_WKEN or PM_WKST reg.

The patch below (on top of new PM branch) seems to have fixed that problem for Zoom3.

Kevin

arch/arm/mach-omap2/pm34xx.c +2 -2
index e531621..207905d 100644
@@ -115,7 +115,7 @@ static void omap3_enable_io_chain(void)
 		/* Do a readback to assure write has been done */
 		prm_read_mod_reg(WKUP_MOD, PM_WKEN);
 
-		while (!(prm_read_mod_reg(WKUP_MOD, PM_WKST) &
+		while (!(prm_read_mod_reg(WKUP_MOD, PM_WKEN) &
 			 OMAP3430_ST_IO_CHAIN_MASK)) {
 			timeout++;
 			if (timeout > 1000) {
@@ -124,7 +124,7 @@ static void omap3_enable_io_chain(void)
 				return;
 			}
 			prm_set_mod_reg_bits(OMAP3430_ST_IO_CHAIN_MASK,
-					     WKUP_MOD, PM_WKST);
+					     WKUP_MOD, PM_WKEN);
 		}
 	}
 }
#16 lore raw
Quoted 29 lines · Kevin Hilman
Quoted 9 lines · Thara Gopinath

This patch series introduces smartreflex and voltage driver support for OMAP3430 and OMAP3630. SmartReflex modules do adaptive voltage control for real-time voltage adjustments.

Originally all the functionalities introduced in this patch were present in arch/arm/mach-omap2/smartreflex.c file in Kevin's pm tree. This patch series does a major rewrite of this file and introduces a separate voltage driver. Major contributors to the original driver are

This is excellent, thanks for the rebase/reorg/compress.

While not yet get getting to a full review of this series, I'd like it to get some broader testing. To that end, I've replaced the pm-sr branch in my pm tree with this series, and rebuilt a new PM branch using it.

Note that it is also based on top of a new pm-opp branch which is Nishanth's condensed version which is also upstream bound for the next merge window.

I had to do a couple minor fixes to apply against v2.6.35-rc1 (mainly fixing usage of #defines that were renamed to have a _MASK suffix.)

It currently boots fine on OMAP3EVM (no efuse values, so no SR) but when I try it on Zoom3, I get repeated errors:

Quoted 8 lines

Wake up daisy chain activation failed.

I haven't fully isolated the root cause yet, but it looks like it might be because omap3_enable_io_chain() seems confused about whether it should be writing PM_WKEN or PM_WKST reg.

The patch below (on top of new PM branch) seems to have fixed that problem for Zoom3.

FYI... I've posted this patch below and it is now in my pm-fixes branch which is part of the PM branch.

Kevin

Quoted 23 lines
arch/arm/mach-omap2/pm34xx.c +2 -2
index e531621..207905d 100644
@@ -115,7 +115,7 @@ static void omap3_enable_io_chain(void)
 		/* Do a readback to assure write has been done */
 		prm_read_mod_reg(WKUP_MOD, PM_WKEN);
 
-		while (!(prm_read_mod_reg(WKUP_MOD, PM_WKST) &
+		while (!(prm_read_mod_reg(WKUP_MOD, PM_WKEN) &
 			 OMAP3430_ST_IO_CHAIN_MASK)) {
 			timeout++;
 			if (timeout > 1000) {
@@ -124,7 +124,7 @@ static void omap3_enable_io_chain(void)
 				return;
 			}
 			prm_set_mod_reg_bits(OMAP3430_ST_IO_CHAIN_MASK,
-					     WKUP_MOD, PM_WKST);
+					     WKUP_MOD, PM_WKEN);
 		}
 	}
 }
#17 lore raw
In reply to Thara Gopinath
Quoted 9 lines · Thara Gopinath

This patch series introduces smartreflex and voltage driver support for OMAP3430 and OMAP3630. SmartReflex modules do adaptive voltage control for real-time voltage adjustments.

Originally all the functionalities introduced in this patch were present in arch/arm/mach-omap2/smartreflex.c file in Kevin's pm tree. This patch series does a major rewrite of this file and introduces a separate voltage driver. Major contributors to the original driver are

I just noticed that one thing missing from this series compared to what was in the previous PM branch is the disable/enable of SR in the idle path, so SR is not getting exercised during idle anymore in the current PM branch.

Could you rememdy that please with another patch on top of this series (the new pm-sr branch?)

Kevin

Quoted 104 lines

Eduardo Valentin (1):
OMAP3: PM: SmartReflex: Fix scheduled while atomic problem

Kalle Jokiniemi (1):
OMAP3: PM: SmartReflex driver integration

Kevin Hilman (2):
temp: SR: IO_ADDRESS conversion
OMAP: SR: OPP interfaces removed from OMAP PM layer

Nishanth Menon (1):
omap3: pm: sr: replace get_opp with freq_to_opp

Paul Walmsley (2):
OMAP SR: use opp_find_opp_by_opp_id()
OMAP SR: use OPP API for OPP ID, remove direct access

Phil Carmody (2):
OMAP3: PM: Don't do unnecessary searches in omap_sr_vdd*_autocomp_store
OMAP3: PM: Early exit on invalid parameters

Rajendra Nayak (9):
OMAP3: SR: Fix init voltage on OPP change
OMAP3: SR: Update VDD1/2 voltages at boot
OMAP3: SR: Use sysclk for SR CLKLENGTH calc
OMAP3: SR: Reset voltage level on SR disable
OMAP3: SR: Replace printk's with pr_* calls
OMAP3: SR: Remove redundant defines
OMAP3: SR: Fix SR driver to check for omap-pm return values
OMAP3: PM: Put optimal SMPS stabilization delay
OMAP3: SR: Wait for VP idle before a VP disable

Roger Quadros (4):
OMAP3: PM: Fix Smartreflex when used with PM_NOOP layer
OMAP3: PM: Make Smartreflex driver independent of SRF
OMAP3: PM: Do not Enable SmartReflex if OPP tables not defined
OMAP3: PM: Smartreflex: Fix VDD2 OPP determining logic

Romit Dasgupta (1):
omap: pm: SR: use enum for OPP types

Teerth Reddy (1):
OMAP3: SR: Replace SR_PASS/FAIL,SR_TRUE/FALSE

Tero Kristo (1):
Smartreflex: Avoid unnecessary spam

This patch series is based against origin/opp branch off Kevin's pm tree which in turn is based off lo-master. This series will apply against lo-master also but will break compilation due to lack of opp framework support on lo-master.

This patch series has been tested on OMAP3430 SDP, OMAP3630 SDP and ZOOM3 with the following menuconfig options enabled.
System type -> TI OMAP Implementations -> Smartreflex Support System type -> TI OMAP Implementations ->
Class 3 mode of Smartreflex Implementation
Device Drivers -> Multifunction device drivers ->
Support power resources on TWL4030 family chips

Thara Gopinath (8):
OMAP3: PM: Adding voltage driver support for OMAP3
OMAP3: PM: Adding smartreflex driver support.
OMAP3: PM: Adding smartreflex device file.
OMAP3: PM: Adding smartreflex hwmod data
OMAP3: PM: Adding smartreflex class3 driver
OMAP3: PM: Adding T2 enabling of smartreflex support
OMAP: PM: Allowing an early init of pm debugfs driver.
OMAP3: PM: Adding debug support to Voltage and Smartreflex drivers

 arch/arm/mach-omap2/Makefile                  |    5 +-
 arch/arm/mach-omap2/board-3430sdp.c           |    2 +
 arch/arm/mach-omap2/board-3630sdp.c           |    2 +
 arch/arm/mach-omap2/board-zoom3.c             |    2 +
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c    |  209 +++++-
 arch/arm/mach-omap2/pm-debug.c                |   18 +-
 arch/arm/mach-omap2/smartreflex-class3.c      |   62 ++
 arch/arm/mach-omap2/smartreflex-class3.h      |   23 +
 arch/arm/mach-omap2/smartreflex.c             |  969 ++++++++++++++++++++
 arch/arm/mach-omap2/sr_device.c               |  177 ++++
 arch/arm/mach-omap2/voltage.c                 | 1199 +++++++++++++++++++++++++
 arch/arm/mach-omap2/voltage.h                 |  126 +++
 arch/arm/plat-omap/Kconfig                    |   41 +
 arch/arm/plat-omap/include/plat/control.h     |   27 +
 arch/arm/plat-omap/include/plat/smartreflex.h |  273 ++++++
 drivers/mfd/twl-core.c                        |    7 +-
 drivers/mfd/twl4030-power.c                   |   29 +
 include/linux/i2c/twl.h                       |    1 +
 18 files changed, 3166 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/mach-omap2/smartreflex-class3.c
 create mode 100644 arch/arm/mach-omap2/smartreflex-class3.h
 create mode 100644 arch/arm/mach-omap2/smartreflex.c
 create mode 100644 arch/arm/mach-omap2/sr_device.c
 create mode 100644 arch/arm/mach-omap2/voltage.c
 create mode 100644 arch/arm/mach-omap2/voltage.h
 create mode 100644 arch/arm/plat-omap/include/plat/smartreflex.h

--
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

#18 lore raw
Quoted 26 lines
Quoted 26 lines

-----Original Message-----
From: Kevin Hilman [mailto:[email protected]]
Sent: Friday, June 25, 2010 4:55 AM
To: Gopinath, Thara
Cc: [email protected]; [email protected]; Cousson, Benoit; Sripathy, Vishwanath; Sawant, Anand
Subject: Re: [PATCH 0/8] OMAP3: Adding Smartreflex and Voltage driver support

Quoted 9 lines · Thara Gopinath

This patch series introduces smartreflex and voltage driver support for OMAP3430 and OMAP3630. SmartReflex modules do adaptive voltage control for real-time voltage adjustments.

Originally all the functionalities introduced in this patch were present in arch/arm/mach-omap2/smartreflex.c file in Kevin's pm tree. This patch series does a major rewrite of this file and introduces a separate voltage driver. Major contributors to the original driver are

I just noticed that one thing missing from this series compared to what was in the previous PM branch is the disable/enable of SR in the idle path, so SR is not getting exercised during idle anymore in the current PM branch.

Quoted 4 lines
Quoted 4 lines

Could you rememdy that please with another patch on top of this series (the new pm-sr branch?)

Kevin

Hello Kevin,

This was intentional as there is not voltage scaling happening in the idle thread in pm-sr branch. Smartreflex needs to be disabled only if a voltage scaling is done during retention/off. I had submitted a patch for addressing this and removing all voltage refrences in pm34xx.c against origin/pm branch the link to which is below

	https://patchwork.kernel.org/patch/103086/

Regards
Thara