Skip to contentSkip to conversation

OMAP3: PM: Configure PRM setup times from board files

PATCH Superseded Rajendra Nayak 4 participants 7 messages Jun 29, 2009 – Oct 6, 2009

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 OMAP3: PM: Configure PRM setup times from board files

The setup times to be programmed in the PRM module on OMAP (for clksetup, voltsetup etc) are board specific.
They depend heavily on the PMIC used and even on different boards with the same PMIC, they vary based on the sleep/wake sequence used, system clock speed et al.

This patch makes it possible for these setup values to be configured from different board files.

---
 arch/arm/mach-omap2/board-3430sdp.c     |   20 +++++++++++++++++++-
 arch/arm/mach-omap2/board-apollon.c     |    2 +-
 arch/arm/mach-omap2/board-generic.c     |    2 +-
 arch/arm/mach-omap2/board-h4.c          |    2 +-
 arch/arm/mach-omap2/board-ldp.c         |    2 +-
 arch/arm/mach-omap2/board-omap3beagle.c |    2 +-
 arch/arm/mach-omap2/board-omap3evm.c    |    2 +-
 arch/arm/mach-omap2/board-overo.c       |    2 +-
 arch/arm/mach-omap2/board-rx51.c        |    2 +-
 arch/arm/mach-omap2/board-zoom2.c       |    2 +-
 arch/arm/mach-omap2/io.c                |    5 ++++-
 arch/arm/mach-omap2/pm.c                |    7 +++++++
 arch/arm/mach-omap2/pm.h                |   16 +++++++++-------
 arch/arm/mach-omap2/pm34xx.c            |   10 ++++++++++
 arch/arm/plat-omap/include/mach/io.h    |    4 +++-
 15 files changed, 61 insertions(+), 19 deletions(-)
arch/arm/mach-omap2/board-3430sdp.c +19 -1
index e9a4d10..b43cf94 100644
@@ -58,6 +58,23 @@
 
 #define TWL4030_MSECURE_GPIO 22
 
+/* FIXME: These are not the optimal setup values to be used on 3430sdp*/
+static struct prm_setup_vc omap3_setuptime_table = {
+	.clksetup = 0xff,
+	.voltsetup_time1 = 0xfff,
+	.voltsetup_time2 = 0xfff,
+	.voltoffset = 0xff,
+	.voltsetup2 = 0xff,
+	.vdd0_on = 0x30,
+	.vdd0_onlp = 0x20,
+	.vdd0_ret = 0x1e,
+	.vdd0_off = 0x00,
+	.vdd1_on = 0x2c,
+	.vdd1_onlp = 0x20,
+	.vdd1_ret = 0x1e,
+	.vdd1_off = 0x00,
+};
+
 static int sdp3430_keymap[] = {
 	KEY(0, 0, KEY_LEFT),
 	KEY(0, 1, KEY_RIGHT),
@@ -174,7 +191,8 @@ static struct platform_device *sdp3430_devices[] __initdata = {
 static void __init omap_3430sdp_init_irq(void)
 {
 	omap2_init_common_hw(hyb18m512160af6_sdrc_params, omap3_mpu_rate_table,
-			     omap3_dsp_rate_table, omap3_l3_rate_table);
+			     omap3_dsp_rate_table, omap3_l3_rate_table,
+			     &omap3_setuptime_table);
 	omap_init_irq();
 	omap_gpio_init();
 }
arch/arm/mach-omap2/board-apollon.c +1 -1
index 1a7fb81..293a9b2 100644
@@ -250,7 +250,7 @@ out:
 
 static void __init omap_apollon_init_irq(void)
 {
-	omap2_init_common_hw(NULL, NULL, NULL, NULL);
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 	apollon_init_smc91x();
arch/arm/mach-omap2/board-generic.c +1 -1
index 23583da..dfc1b49 100644
@@ -33,7 +33,7 @@
 
 static void __init omap_generic_init_irq(void)
 {
-	omap2_init_common_hw(NULL, NULL, NULL, NULL);
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 }
 
arch/arm/mach-omap2/board-h4.c +1 -1
index de6adf7..af0ebaf 100644
@@ -270,7 +270,7 @@ static void __init h4_init_flash(void)
 
 static void __init omap_h4_init_irq(void)
 {
-	omap2_init_common_hw(NULL, NULL, NULL, NULL);
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 	h4_init_flash();
arch/arm/mach-omap2/board-ldp.c +1 -1
index 3b662ff..eb5e2e0 100644
@@ -270,7 +270,7 @@ static inline void __init ldp_init_smsc911x(void)
 
 static void __init omap_ldp_init_irq(void)
 {
-	omap2_init_common_hw(NULL, NULL, NULL, NULL);
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 	ldp_init_smsc911x();
arch/arm/mach-omap2/board-omap3beagle.c +1 -1
index 36b4bfb..e0be6bd 100644
@@ -289,7 +289,7 @@ static int __init omap3_beagle_i2c_init(void)
 static void __init omap3_beagle_init_irq(void)
 {
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table,
-			     omap3_dsp_rate_table, omap3_l3_rate_table);
+			     omap3_dsp_rate_table, omap3_l3_rate_table, NULL);
 	omap_init_irq();
 #ifdef CONFIG_OMAP_32K_TIMER
 	omap2_gp_clockevent_set_gptimer(12);
arch/arm/mach-omap2/board-omap3evm.c +1 -1
index e300a9e..eaab39b 100644
@@ -284,7 +284,7 @@ struct spi_board_info omap3evm_spi_board_info[] = {
 static void __init omap3_evm_init_irq(void)
 {
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table,
-	                     omap3_dsp_rate_table, omap3_l3_rate_table);
+			omap3_dsp_rate_table, omap3_l3_rate_table, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 	omap3evm_init_smc911x();
arch/arm/mach-omap2/board-overo.c +1 -1
index 0bff181..f159e18 100644
@@ -360,7 +360,7 @@ static int __init overo_i2c_init(void)
 
 static void __init overo_init_irq(void)
 {
-	omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL, NULL, NULL);
+	omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 }
arch/arm/mach-omap2/board-rx51.c +1 -1
index 4733e4e..3629a0e 100644
@@ -66,7 +66,7 @@ static struct omap_board_config_kernel rx51_config[] = {
 static void __init rx51_init_irq(void)
 {
 	omap2_init_common_hw(rx51_get_sdram_timings(), omap3_mpu_rate_table,
-			     omap3_dsp_rate_table, omap3_l3_rate_table);
+			     omap3_dsp_rate_table, omap3_l3_rate_table, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 }
arch/arm/mach-omap2/board-zoom2.c +1 -1
index 981f28e..e63bfa0 100644
@@ -27,7 +27,7 @@
 static void __init omap_zoom2_init_irq(void)
 {
 	omap2_init_common_hw(NULL, omap3_mpu_rate_table,
-	                     omap3_dsp_rate_table, omap3_l3_rate_table);
+			omap3_dsp_rate_table, omap3_l3_rate_table, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 }
arch/arm/mach-omap2/io.c +4 -1
index 980322d..266a5a1 100644
@@ -44,6 +44,7 @@
 
 #include <mach/clockdomain.h>
 #include "clockdomains.h"
+#include "pm.h"
 #endif
 /*
  * The machine specific code may provide the extra mapping besides the
@@ -281,12 +282,14 @@ static int __init _omap2_init_reprogram_sdrc(void)
 void __init omap2_init_common_hw(struct omap_sdrc_params *sp,
 				 struct omap_opp *mpu_opps,
 				 struct omap_opp *dsp_opps,
-				 struct omap_opp *l3_opps)
+				 struct omap_opp *l3_opps,
+				 struct prm_setup_vc *setup_times)
 {
 	omap2_mux_init();
 #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */
 	/* The OPP tables have to be registered before a clk init */
 	omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
+	omap_pm_early_init(setup_times);
 	pwrdm_init(powerdomains_omap);
 	clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps);
 	omapdev_init(omapdevs);
arch/arm/mach-omap2/pm.c +7 -0
index 1192e01..b81ba3b 100644
@@ -236,6 +236,13 @@ unsigned get_last_off_on_transaction_id(struct device *dev)
 	return 0;
 }
 
+void __init omap_pm_early_init(struct prm_setup_vc *setup_times)
+{
+	if (cpu_is_omap34xx())
+		omap3_set_prm_setup_vc(setup_times);
+	return;
+}
+
 static int __init omap_pm_init(void)
 {
 	int error = -1;
arch/arm/mach-omap2/pm.h +9 -7
index ddc9453..0beb32d 100644
@@ -13,12 +13,6 @@
 
 #include <mach/powerdomain.h>
 
-#ifdef CONFIG_ARCH_OMAP3
-extern unsigned short enable_dyn_sleep;
-extern unsigned short enable_off_mode;
-extern unsigned short voltage_off_while_idle;
-extern void *omap3_secure_ram_storage;
-
 struct prm_setup_vc {
 	u16 clksetup;
 	u16 voltsetup_time1;
@@ -37,6 +31,11 @@ struct prm_setup_vc {
 	u16 vdd1_off;
 };
 
+#ifdef CONFIG_ARCH_OMAP3
+extern unsigned short enable_dyn_sleep;
+extern unsigned short enable_off_mode;
+extern unsigned short voltage_off_while_idle;
+extern void *omap3_secure_ram_storage;
 extern void omap3_pm_off_mode_enable(int);
 extern void omap_sram_idle(void);
 extern int omap3_can_sleep(void);
@@ -44,13 +43,15 @@ extern int set_pwrdm_state(struct powerdomain *pwrdm, u32 state);
 extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm);
 extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state);
 extern void omap3_set_prm_setup_vc(struct prm_setup_vc *setup_vc);
-
 #ifdef CONFIG_CPU_IDLE
 int omap3_idle_init(void);
 #else
 static inline int omap3_idle_init(void) { return 0; }
 #endif
 
+#else /* CONFIG_ARCH_OMAP3 */
+#define omap3_set_prm_setup_vc(setup_vc) do {} while (0);
+
 #endif /* CONFIG_ARCH_OMAP3 */
 extern int resource_set_opp_level(int res, u32 target_level, int flags);
 extern int resource_access_opp_lock(int res, int delta);
@@ -90,5 +91,6 @@ extern unsigned int omap34xx_suspend_sz;
 extern unsigned int save_secure_ram_context_sz;
 extern unsigned int omap24xx_cpu_suspend_sz;
 extern unsigned int omap34xx_cpu_suspend_sz;
+void __init omap_pm_early_init(struct prm_setup_vc *setup_times);
 
 #endif
arch/arm/mach-omap2/pm34xx.c +10 -0
index 7a4a525..7b05244 100644
@@ -77,6 +77,13 @@ static struct powerdomain *mpu_pwrdm, *neon_pwrdm;
 static struct powerdomain *core_pwrdm, *per_pwrdm;
 static struct powerdomain *cam_pwrdm;
 
+/*
+ * These values are board specific and have to be passed from
+ * the respective board files.
+ * The values used here are just worst case values which will
+ * be used on boards which do not pass on these values from
+ * the board files.
+ */
 static struct prm_setup_vc prm_setup = {
 	.clksetup = 0xff,
 	.voltsetup_time1 = 0xfff,
@@ -985,6 +992,9 @@ int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state)
 
 void omap3_set_prm_setup_vc(struct prm_setup_vc *setup_vc)
 {
+	if (!setup_vc)
+		return;
+
 	prm_setup.clksetup = setup_vc->clksetup;
 	prm_setup.voltsetup_time1 = setup_vc->voltsetup_time1;
 	prm_setup.voltsetup_time2 = setup_vc->voltsetup_time2;
arch/arm/plat-omap/include/mach/io.h +3 -1
index 142f7e2..3582bef 100644
@@ -224,6 +224,7 @@
 
 struct omap_sdrc_params;
 struct omap_opp;
+struct prm_setup_vc;
 
 extern void omap1_map_common_io(void);
 extern void omap1_init_common_hw(void);
@@ -232,7 +233,8 @@ extern void omap2_map_common_io(void);
 extern void omap2_init_common_hw(struct omap_sdrc_params *sp,
 				 struct omap_opp *mpu_opps,
 				 struct omap_opp *dsp_opps,
-				 struct omap_opp *l3_opps);
+				 struct omap_opp *l3_opps,
+				 struct prm_setup_vc *setup_times);
 
 #define __arch_ioremap(p,s,t)	omap_ioremap(p,s,t)
 #define __arch_iounmap(v)	omap_iounmap(v)
Signature · 1 line
1.5.4.7
#1 lore raw

PATCH 2/2 OMAP3: PM: Configure CPUidle latencies/thresholds from board files

The CPUidle C state latencies and thresholds are dependent on various board specific details.
Hence this patch makes it possible to configure these values from the respective board files.

---
 arch/arm/mach-omap2/board-3430sdp.c     |   22 ++++++-
 arch/arm/mach-omap2/board-apollon.c     |    2 +-
 arch/arm/mach-omap2/board-generic.c     |    2 +-
 arch/arm/mach-omap2/board-h4.c          |    2 +-
 arch/arm/mach-omap2/board-ldp.c         |    2 +-
 arch/arm/mach-omap2/board-omap3beagle.c |    2 +-
 arch/arm/mach-omap2/board-omap3evm.c    |    2 +-
 arch/arm/mach-omap2/board-overo.c       |    3 +-
 arch/arm/mach-omap2/board-rx51.c        |    2 +-
 arch/arm/mach-omap2/board-zoom2.c       |    2 +-
 arch/arm/mach-omap2/cpuidle34xx.c       |  105 ++++++++++++++++++++++++------
 arch/arm/mach-omap2/io.c                |    5 +-
 arch/arm/mach-omap2/pm.c                |    7 ++-
 arch/arm/mach-omap2/pm.h                |   12 +++-
 arch/arm/plat-omap/include/mach/io.h    |    4 +-
 15 files changed, 136 insertions(+), 38 deletions(-)
arch/arm/mach-omap2/board-3430sdp.c +20 -2
index b43cf94..750d841 100644
@@ -75,6 +75,24 @@ static struct prm_setup_vc omap3_setuptime_table = {
 	.vdd1_off = 0x00,
 };
 
+/* FIXME: These values need to be updated based on more profiling on 3430sdp*/
+static struct cpuidle_params omap3_cpuidle_params_table[] = {
+	/* C1 */
+	{2, 2, 5},
+	/* C2 */
+	{10, 10, 30},
+	/* C3 */
+	{50, 50, 300},
+	/* C4 */
+	{1500, 1800, 4000},
+	/* C5 */
+	{2500, 7500, 12000},
+	/* C6 */
+	{3000, 8500, 15000},
+	/* C7 */
+	{10000, 30000, 300000},
+};
+
 static int sdp3430_keymap[] = {
 	KEY(0, 0, KEY_LEFT),
 	KEY(0, 1, KEY_RIGHT),
@@ -191,8 +209,8 @@ static struct platform_device *sdp3430_devices[] __initdata = {
 static void __init omap_3430sdp_init_irq(void)
 {
 	omap2_init_common_hw(hyb18m512160af6_sdrc_params, omap3_mpu_rate_table,
-			     omap3_dsp_rate_table, omap3_l3_rate_table,
-			     &omap3_setuptime_table);
+			omap3_dsp_rate_table, omap3_l3_rate_table,
+			&omap3_setuptime_table, omap3_cpuidle_params_table);
 	omap_init_irq();
 	omap_gpio_init();
 }
arch/arm/mach-omap2/board-apollon.c +1 -1
index 293a9b2..fe625a9 100644
@@ -250,7 +250,7 @@ out:
 
 static void __init omap_apollon_init_irq(void)
 {
-	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 	apollon_init_smc91x();
arch/arm/mach-omap2/board-generic.c +1 -1
index dfc1b49..ecf2c45 100644
@@ -33,7 +33,7 @@
 
 static void __init omap_generic_init_irq(void)
 {
-	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 }
 
arch/arm/mach-omap2/board-h4.c +1 -1
index af0ebaf..365bc69 100644
@@ -270,7 +270,7 @@ static void __init h4_init_flash(void)
 
 static void __init omap_h4_init_irq(void)
 {
-	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 	h4_init_flash();
arch/arm/mach-omap2/board-ldp.c +1 -1
index eb5e2e0..1265a12 100644
@@ -270,7 +270,7 @@ static inline void __init ldp_init_smsc911x(void)
 
 static void __init omap_ldp_init_irq(void)
 {
-	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 	ldp_init_smsc911x();
arch/arm/mach-omap2/board-omap3beagle.c +1 -1
index e0be6bd..da1f3f6 100644
@@ -289,7 +289,7 @@ static int __init omap3_beagle_i2c_init(void)
 static void __init omap3_beagle_init_irq(void)
 {
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table,
-			     omap3_dsp_rate_table, omap3_l3_rate_table, NULL);
+			omap3_dsp_rate_table, omap3_l3_rate_table, NULL, NULL);
 	omap_init_irq();
 #ifdef CONFIG_OMAP_32K_TIMER
 	omap2_gp_clockevent_set_gptimer(12);
arch/arm/mach-omap2/board-omap3evm.c +1 -1
index eaab39b..4a287b9 100644
@@ -284,7 +284,7 @@ struct spi_board_info omap3evm_spi_board_info[] = {
 static void __init omap3_evm_init_irq(void)
 {
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table,
-			omap3_dsp_rate_table, omap3_l3_rate_table, NULL);
+			omap3_dsp_rate_table, omap3_l3_rate_table, NULL, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 	omap3evm_init_smc911x();
arch/arm/mach-omap2/board-overo.c +2 -1
index f159e18..a673921 100644
@@ -360,7 +360,8 @@ static int __init overo_i2c_init(void)
 
 static void __init overo_init_irq(void)
 {
-	omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL, NULL, NULL, NULL);
+	omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
+				 NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 }
arch/arm/mach-omap2/board-rx51.c +1 -1
index 3629a0e..6cb8715 100644
@@ -66,7 +66,7 @@ static struct omap_board_config_kernel rx51_config[] = {
 static void __init rx51_init_irq(void)
 {
 	omap2_init_common_hw(rx51_get_sdram_timings(), omap3_mpu_rate_table,
-			     omap3_dsp_rate_table, omap3_l3_rate_table, NULL);
+		omap3_dsp_rate_table, omap3_l3_rate_table, NULL, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 }
arch/arm/mach-omap2/board-zoom2.c +1 -1
index e63bfa0..0fcd0ff 100644
@@ -27,7 +27,7 @@
 static void __init omap_zoom2_init_irq(void)
 {
 	omap2_init_common_hw(NULL, omap3_mpu_rate_table,
-			omap3_dsp_rate_table, omap3_l3_rate_table, NULL);
+			omap3_dsp_rate_table, omap3_l3_rate_table, NULL, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 }
arch/arm/mach-omap2/cpuidle34xx.c +84 -21

159 lines not on this page · raw message

arch/arm/mach-omap2/io.c +3 -2
index 266a5a1..d8d10aa 100644
@@ -283,13 +283,14 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sp,
 				 struct omap_opp *mpu_opps,
 				 struct omap_opp *dsp_opps,
 				 struct omap_opp *l3_opps,
-				 struct prm_setup_vc *setup_times)
+				 struct prm_setup_vc *setup_times,
+				 struct cpuidle_params *idle_params)
 {
 	omap2_mux_init();
 #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */
 	/* The OPP tables have to be registered before a clk init */
 	omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
-	omap_pm_early_init(setup_times);
+	omap_pm_early_init(setup_times, idle_params);
 	pwrdm_init(powerdomains_omap);
 	clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps);
 	omapdev_init(omapdevs);
arch/arm/mach-omap2/pm.c +5 -2
index b81ba3b..5c5c59e 100644
@@ -236,10 +236,13 @@ unsigned get_last_off_on_transaction_id(struct device *dev)
 	return 0;
 }
 
-void __init omap_pm_early_init(struct prm_setup_vc *setup_times)
+void __init omap_pm_early_init(struct prm_setup_vc *setup_times,
+					struct cpuidle_params *idle_params)
 {
-	if (cpu_is_omap34xx())
+	if (cpu_is_omap34xx()) {
 		omap3_set_prm_setup_vc(setup_times);
+		omap3_set_idle_params(idle_params);
+	}
 	return;
 }
 
arch/arm/mach-omap2/pm.h +11 -1
index 0beb32d..8759053 100644
@@ -31,6 +31,12 @@ struct prm_setup_vc {
 	u16 vdd1_off;
 };
 
+struct cpuidle_params {
+	u32 sleep_latency;
+	u32 wake_latency;
+	u32 threshold;
+};
+
 #ifdef CONFIG_ARCH_OMAP3
 extern unsigned short enable_dyn_sleep;
 extern unsigned short enable_off_mode;
@@ -43,6 +49,7 @@ extern int set_pwrdm_state(struct powerdomain *pwrdm, u32 state);
 extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm);
 extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state);
 extern void omap3_set_prm_setup_vc(struct prm_setup_vc *setup_vc);
+extern void omap3_set_idle_params(struct cpuidle_params *cpuidle_board_params);
 #ifdef CONFIG_CPU_IDLE
 int omap3_idle_init(void);
 #else
@@ -51,8 +58,10 @@ static inline int omap3_idle_init(void) { return 0; }
 
 #else /* CONFIG_ARCH_OMAP3 */
 #define omap3_set_prm_setup_vc(setup_vc) do {} while (0);
+#define omap3_set_idle_params(parmas, board_params) do {} while (0);
 
 #endif /* CONFIG_ARCH_OMAP3 */
+
 extern int resource_set_opp_level(int res, u32 target_level, int flags);
 extern int resource_access_opp_lock(int res, int delta);
 #define resource_lock_opp(res) resource_access_opp_lock(res, 1)
@@ -91,6 +100,7 @@ extern unsigned int omap34xx_suspend_sz;
 extern unsigned int save_secure_ram_context_sz;
 extern unsigned int omap24xx_cpu_suspend_sz;
 extern unsigned int omap34xx_cpu_suspend_sz;
-void __init omap_pm_early_init(struct prm_setup_vc *setup_times);
+void __init omap_pm_early_init(struct prm_setup_vc *setup_times,
+					struct cpuidle_params *idle_params);
 
 #endif
arch/arm/plat-omap/include/mach/io.h +3 -1
index 3582bef..d143bd9 100644
@@ -225,6 +225,7 @@
 struct omap_sdrc_params;
 struct omap_opp;
 struct prm_setup_vc;
+struct cpuidle_params;
 
 extern void omap1_map_common_io(void);
 extern void omap1_init_common_hw(void);
@@ -234,7 +235,8 @@ extern void omap2_init_common_hw(struct omap_sdrc_params *sp,
 				 struct omap_opp *mpu_opps,
 				 struct omap_opp *dsp_opps,
 				 struct omap_opp *l3_opps,
-				 struct prm_setup_vc *setup_times);
+				 struct prm_setup_vc *setup_times,
+				 struct cpuidle_params *idle_params);
 
 #define __arch_ioremap(p,s,t)	omap_ioremap(p,s,t)
 #define __arch_iounmap(v)	omap_iounmap(v)
Signature · 1 line
1.5.4.7
#2 lore raw

Re: [PATCH 2/2] OMAP3: PM: Configure CPUidle latencies/thresholds from board files

Quoted 7 lines · Rajendra Nayak

The CPUidle C state latencies and thresholds are dependent on various board specific details.
Hence this patch makes it possible to configure these values from the respective board files.

---

I think cpufreq could probably use something similar. The transition latency set in the policy is set in cpu-omap.c and is a hard-coded value. I wonder if its reasonable to piggyback off these values for the transition latencies, or extend the struct to include those?

-- Mike

Quoted 458 lines
 arch/arm/mach-omap2/board-3430sdp.c     |   22 ++++++-
 arch/arm/mach-omap2/board-apollon.c     |    2 +-
 arch/arm/mach-omap2/board-generic.c     |    2 +-

 arch/arm/mach-omap2/board-h4.c          |    2 +- arch/arm/mach-omap2/board-ldp.c         |    2 +- arch/arm/mach-omap2/board-omap3beagle.c |    2 +- arch/arm/mach-omap2/board-omap3evm.c    |    2 +- arch/arm/mach-omap2/board-overo.c       |    3 +- arch/arm/mach-omap2/board-rx51.c        |    2 +- arch/arm/mach-omap2/board-zoom2.c       |    2 +- arch/arm/mach-omap2/cpuidle34xx.c       |  105 ++++++++++++++++++++++++------

 arch/arm/mach-omap2/io.c                |    5 +-
 arch/arm/mach-omap2/pm.c                |    7 ++-
 arch/arm/mach-omap2/pm.h                |   12 +++-
 arch/arm/plat-omap/include/mach/io.h    |    4 +-
 15 files changed, 136 insertions(+), 38 deletions(-)
arch/arm/mach-omap2/board-3430sdp.c +20 -2
index b43cf94..750d841 100644
@@ -75,6 +75,24 @@ static struct prm_setup_vc omap3_setuptime_table = {
        .vdd1_off = 0x00,
  };
 
+/* FIXME: These values need to be updated based on more profiling on 3430sdp*/
+static struct cpuidle_params omap3_cpuidle_params_table[] = {
+       /* C1 */
+       {2, 2, 5},
+       /* C2 */
+       {10, 10, 30},
+       /* C3 */
+       {50, 50, 300},
+       /* C4 */
+       {1500, 1800, 4000},
+       /* C5 */
+       {2500, 7500, 12000},
+       /* C6 */
+       {3000, 8500, 15000},
+       /* C7 */
+       {10000, 30000, 300000},
+};
+
  static int sdp3430_keymap[] = {
        KEY(0, 0, KEY_LEFT),
        KEY(0, 1, KEY_RIGHT),
@@ -191,8 +209,8 @@ static struct platform_device *sdp3430_devices[] __initdata = {
  static void __init omap_3430sdp_init_irq(void)
  {
        omap2_init_common_hw(hyb18m512160af6_sdrc_params, omap3_mpu_rate_table,
-                            omap3_dsp_rate_table, omap3_l3_rate_table,
-                            &omap3_setuptime_table);
+                       omap3_dsp_rate_table, omap3_l3_rate_table,
+                       &omap3_setuptime_table, omap3_cpuidle_params_table);
        omap_init_irq();
        omap_gpio_init();
  }
arch/arm/mach-omap2/board-apollon.c +1 -1
index 293a9b2..fe625a9 100644
@@ -250,7 +250,7 @@ out:
 
  static void __init omap_apollon_init_irq(void)
  {
-       omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
+       omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL, NULL);
        omap_init_irq();
        omap_gpio_init();
        apollon_init_smc91x();
arch/arm/mach-omap2/board-generic.c +1 -1
index dfc1b49..ecf2c45 100644
@@ -33,7 +33,7 @@
 
  static void __init omap_generic_init_irq(void)
  {
-       omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
+       omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL, NULL);
        omap_init_irq();
  }
 
arch/arm/mach-omap2/board-h4.c +1 -1
index af0ebaf..365bc69 100644
@@ -270,7 +270,7 @@ static void __init h4_init_flash(void)
 
  static void __init omap_h4_init_irq(void)
  {
-       omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
+       omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL, NULL);
        omap_init_irq();
        omap_gpio_init();
        h4_init_flash();
arch/arm/mach-omap2/board-ldp.c +1 -1
index eb5e2e0..1265a12 100644
@@ -270,7 +270,7 @@ static inline void __init ldp_init_smsc911x(void)
 
  static void __init omap_ldp_init_irq(void)
  {
-       omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
+       omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL, NULL);
        omap_init_irq();
        omap_gpio_init();
        ldp_init_smsc911x();
arch/arm/mach-omap2/board-omap3beagle.c +1 -1
index e0be6bd..da1f3f6 100644
@@ -289,7 +289,7 @@ static int __init omap3_beagle_i2c_init(void)
  static void __init omap3_beagle_init_irq(void)
  {
        omap2_init_common_hw(mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table,
-                            omap3_dsp_rate_table, omap3_l3_rate_table, NULL);
+                       omap3_dsp_rate_table, omap3_l3_rate_table, NULL, NULL);
        omap_init_irq();
  #ifdef CONFIG_OMAP_32K_TIMER
        omap2_gp_clockevent_set_gptimer(12);
arch/arm/mach-omap2/board-omap3evm.c +1 -1
index eaab39b..4a287b9 100644
@@ -284,7 +284,7 @@ struct spi_board_info omap3evm_spi_board_info[] = {
  static void __init omap3_evm_init_irq(void)
  {
        omap2_init_common_hw(mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table,
-                       omap3_dsp_rate_table, omap3_l3_rate_table, NULL);
+                       omap3_dsp_rate_table, omap3_l3_rate_table, NULL, NULL);
        omap_init_irq();
        omap_gpio_init();
        omap3evm_init_smc911x();
arch/arm/mach-omap2/board-overo.c +2 -1
index f159e18..a673921 100644
@@ -360,7 +360,8 @@ static int __init overo_i2c_init(void)
 
  static void __init overo_init_irq(void)
  {
-       omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL, NULL, NULL, NULL);
+       omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
+                                NULL, NULL, NULL, NULL, NULL);
        omap_init_irq();
        omap_gpio_init();
  }
arch/arm/mach-omap2/board-rx51.c +1 -1
index 3629a0e..6cb8715 100644
@@ -66,7 +66,7 @@ static struct omap_board_config_kernel rx51_config[] = {
  static void __init rx51_init_irq(void)
  {
        omap2_init_common_hw(rx51_get_sdram_timings(), omap3_mpu_rate_table,
-                            omap3_dsp_rate_table, omap3_l3_rate_table, NULL);
+               omap3_dsp_rate_table, omap3_l3_rate_table, NULL, NULL);
        omap_init_irq();
        omap_gpio_init();
  }
arch/arm/mach-omap2/board-zoom2.c +1 -1
index e63bfa0..0fcd0ff 100644
@@ -27,7 +27,7 @@
  static void __init omap_zoom2_init_irq(void)
  {
        omap2_init_common_hw(NULL, omap3_mpu_rate_table,
-                       omap3_dsp_rate_table, omap3_l3_rate_table, NULL);
+                       omap3_dsp_rate_table, omap3_l3_rate_table, NULL, NULL);
        omap_init_irq();
        omap_gpio_init();
  }
arch/arm/mach-omap2/cpuidle34xx.c +60 -9
index 7bbec90..3d6c55a 100644
@@ -60,6 +60,30 @@ struct omap3_processor_cx omap3_power_states[OMAP3_MAX_STATES];
  struct omap3_processor_cx current_cx_state;
  struct powerdomain *mpu_pd, *core_pd, *per_pd;
 
+/*
+ * The latencies/thresholds for various C states have
+ * to be configured from the respective board files.
+ * These are some default values (which might not provide
+ * the best power savings) used on boards which do not
+ * pass these details from the board file.
+ */
+static struct cpuidle_params cpuidle_params_table[] = {
+       /* C1 */
+       {2, 2, 5},
+       /* C2 */
+       {10, 10, 30},
+       /* C3 */
+       {50, 50, 300},
+       /* C4 */
+       {1500, 1800, 4000},
+       /* C5 */
+       {2500, 7500, 12000},
+       /* C6 */
+       {3000, 8500, 15000},
+       /* C7 */
+       {10000, 30000, 300000},
+};
+
  static int omap3_idle_bm_check(void)
  {
        if (!omap3_can_sleep())
@@ -165,6 +189,24 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
 
  DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev);
 
+void omap3_set_idle_params(struct cpuidle_params *cpuidle_board_params)
+{
+       int i;
+
+       if (!cpuidle_board_params)
+               return;
+
+       for (i = OMAP3_STATE_C1; i < OMAP3_MAX_STATES; i++) {
+               cpuidle_params_table[i].sleep_latency =
+                                       cpuidle_board_params[i].sleep_latency;
+               cpuidle_params_table[i].wake_latency =
+                                       cpuidle_board_params[i].wake_latency;
+               cpuidle_params_table[i].threshold =
+                                       cpuidle_board_params[i].threshold;
+       }
+       return;
+}
+
  /* omap3_init_power_states - Initialises the OMAP3 specific C states.
  *
  * Below is the desciption of each C state.
@@ -181,9 +223,12 @@ void omap_init_power_states(void)
        /* C1 . MPU WFI + Core active */
        omap3_power_states[OMAP3_STATE_C1].valid = 1;
        omap3_power_states[OMAP3_STATE_C1].type = OMAP3_STATE_C1;
-       omap3_power_states[OMAP3_STATE_C1].sleep_latency = 2;
-       omap3_power_states[OMAP3_STATE_C1].wakeup_latency = 2;
-       omap3_power_states[OMAP3_STATE_C1].threshold = 5;
+       omap3_power_states[OMAP3_STATE_C1].sleep_latency =
+                       cpuidle_params_table[OMAP3_STATE_C1].sleep_latency;
+       omap3_power_states[OMAP3_STATE_C1].wakeup_latency =
+                       cpuidle_params_table[OMAP3_STATE_C1].wake_latency;
+       omap3_power_states[OMAP3_STATE_C1].threshold =
+                       cpuidle_params_table[OMAP3_STATE_C1].threshold;
        omap3_power_states[OMAP3_STATE_C1].mpu_state = PWRDM_POWER_ON;
        omap3_power_states[OMAP3_STATE_C1].core_state = PWRDM_POWER_ON;
        omap3_power_states[OMAP3_STATE_C1].flags = CPUIDLE_FLAG_TIME_VALID;
@@ -191,9 +236,12 @@ void omap_init_power_states(void)
        /* C2 . MPU WFI + Core inactive */
        omap3_power_states[OMAP3_STATE_C2].valid = 1;
        omap3_power_states[OMAP3_STATE_C2].type = OMAP3_STATE_C2;
-       omap3_power_states[OMAP3_STATE_C2].sleep_latency = 10;
-       omap3_power_states[OMAP3_STATE_C2].wakeup_latency = 10;
-       omap3_power_states[OMAP3_STATE_C2].threshold = 30;
+       omap3_power_states[OMAP3_STATE_C2].sleep_latency =
+                       cpuidle_params_table[OMAP3_STATE_C2].sleep_latency;;
+       omap3_power_states[OMAP3_STATE_C2].wakeup_latency =
+                       cpuidle_params_table[OMAP3_STATE_C2].wake_latency;;
+       omap3_power_states[OMAP3_STATE_C2].threshold =
+                       cpuidle_params_table[OMAP3_STATE_C2].threshold;;
        omap3_power_states[OMAP3_STATE_C2].mpu_state = PWRDM_POWER_ON;
        omap3_power_states[OMAP3_STATE_C2].core_state = PWRDM_POWER_ON;
        omap3_power_states[OMAP3_STATE_C2].flags = CPUIDLE_FLAG_TIME_VALID;
@@ -201,9 +249,12 @@ void omap_init_power_states(void)
        /* C3 . MPU CSWR + Core inactive */
        omap3_power_states[OMAP3_STATE_C3].valid = 1;
        omap3_power_states[OMAP3_STATE_C3].type = OMAP3_STATE_C3;
-       omap3_power_states[OMAP3_STATE_C3].sleep_latency = 50;
-       omap3_power_states[OMAP3_STATE_C3].wakeup_latency = 50;
-       omap3_power_states[OMAP3_STATE_C3].threshold = 300;
+       omap3_power_states[OMAP3_STATE_C3].sleep_latency =
+                       cpuidle_params_table[OMAP3_STATE_C3].sleep_latency;
+       omap3_power_states[OMAP3_STATE_C3].wakeup_latency =
+                       cpuidle_params_table[OMAP3_STATE_C3].wake_latency;
+       omap3_power_states[OMAP3_STATE_C3].threshold =
+                       cpuidle_params_table[OMAP3_STATE_C3].threshold;
        omap3_power_states[OMAP3_STATE_C3].mpu_state = PWRDM_POWER_RET;
        omap3_power_states[OMAP3_STATE_C3].core_state = PWRDM_POWER_ON;

       omap3_power_states[OMAP3_STATE_C3].flags = CPUIDLE_FLAG_TIME_VALID |

arch/arm/mach-omap2/cpuidle34xx.c +6 -3
@@ -212,9 +263,12 @@ void omap_init_power_states(void)
        /* C4 . MPU OFF + Core inactive */
        omap3_power_states[OMAP3_STATE_C4].valid = 1;
        omap3_power_states[OMAP3_STATE_C4].type = OMAP3_STATE_C4;
-       omap3_power_states[OMAP3_STATE_C4].sleep_latency = 1500;
-       omap3_power_states[OMAP3_STATE_C4].wakeup_latency = 1800;
-       omap3_power_states[OMAP3_STATE_C4].threshold = 4000;
+       omap3_power_states[OMAP3_STATE_C4].sleep_latency =
+                       cpuidle_params_table[OMAP3_STATE_C4].sleep_latency;
+       omap3_power_states[OMAP3_STATE_C4].wakeup_latency =
+                       cpuidle_params_table[OMAP3_STATE_C4].wake_latency;
+       omap3_power_states[OMAP3_STATE_C4].threshold =
+                       cpuidle_params_table[OMAP3_STATE_C4].threshold;
        omap3_power_states[OMAP3_STATE_C4].mpu_state = PWRDM_POWER_OFF;
        omap3_power_states[OMAP3_STATE_C4].core_state = PWRDM_POWER_ON;

       omap3_power_states[OMAP3_STATE_C4].flags = CPUIDLE_FLAG_TIME_VALID |

arch/arm/mach-omap2/cpuidle34xx.c +6 -3
@@ -223,9 +277,12 @@ void omap_init_power_states(void)
        /* C5 . MPU CSWR + Core CSWR*/
        omap3_power_states[OMAP3_STATE_C5].valid = 1;
        omap3_power_states[OMAP3_STATE_C5].type = OMAP3_STATE_C5;
-       omap3_power_states[OMAP3_STATE_C5].sleep_latency = 2500;
-       omap3_power_states[OMAP3_STATE_C5].wakeup_latency = 7500;
-       omap3_power_states[OMAP3_STATE_C5].threshold = 12000;
+       omap3_power_states[OMAP3_STATE_C5].sleep_latency =
+                       cpuidle_params_table[OMAP3_STATE_C5].sleep_latency;
+       omap3_power_states[OMAP3_STATE_C5].wakeup_latency =
+                       cpuidle_params_table[OMAP3_STATE_C5].wake_latency;
+       omap3_power_states[OMAP3_STATE_C5].threshold =
+                       cpuidle_params_table[OMAP3_STATE_C5].threshold;
        omap3_power_states[OMAP3_STATE_C5].mpu_state = PWRDM_POWER_RET;
        omap3_power_states[OMAP3_STATE_C5].core_state = PWRDM_POWER_RET;

       omap3_power_states[OMAP3_STATE_C5].flags = CPUIDLE_FLAG_TIME_VALID |

arch/arm/mach-omap2/cpuidle34xx.c +6 -3
@@ -234,9 +291,12 @@ void omap_init_power_states(void)
        /* C6 . MPU OFF + Core CSWR */
        omap3_power_states[OMAP3_STATE_C6].valid = 1;
        omap3_power_states[OMAP3_STATE_C6].type = OMAP3_STATE_C6;
-       omap3_power_states[OMAP3_STATE_C6].sleep_latency = 3000;
-       omap3_power_states[OMAP3_STATE_C6].wakeup_latency = 8500;
-       omap3_power_states[OMAP3_STATE_C6].threshold = 15000;
+       omap3_power_states[OMAP3_STATE_C6].sleep_latency =
+                       cpuidle_params_table[OMAP3_STATE_C6].sleep_latency;
+       omap3_power_states[OMAP3_STATE_C6].wakeup_latency =
+                       cpuidle_params_table[OMAP3_STATE_C6].wake_latency;
+       omap3_power_states[OMAP3_STATE_C6].threshold =
+                       cpuidle_params_table[OMAP3_STATE_C6].threshold;
        omap3_power_states[OMAP3_STATE_C6].mpu_state = PWRDM_POWER_OFF;
        omap3_power_states[OMAP3_STATE_C6].core_state = PWRDM_POWER_RET;

       omap3_power_states[OMAP3_STATE_C6].flags = CPUIDLE_FLAG_TIME_VALID |

arch/arm/mach-omap2/cpuidle34xx.c +6 -3
@@ -245,9 +305,12 @@ void omap_init_power_states(void)
        /* C7 . MPU OFF + Core OFF */
        omap3_power_states[OMAP3_STATE_C7].valid = 1;
        omap3_power_states[OMAP3_STATE_C7].type = OMAP3_STATE_C7;
-       omap3_power_states[OMAP3_STATE_C7].sleep_latency = 10000;
-       omap3_power_states[OMAP3_STATE_C7].wakeup_latency = 30000;
-       omap3_power_states[OMAP3_STATE_C7].threshold = 300000;
+       omap3_power_states[OMAP3_STATE_C7].sleep_latency =
+                       cpuidle_params_table[OMAP3_STATE_C7].sleep_latency;
+       omap3_power_states[OMAP3_STATE_C7].wakeup_latency =
+                       cpuidle_params_table[OMAP3_STATE_C7].wake_latency;
+       omap3_power_states[OMAP3_STATE_C7].threshold =
+                       cpuidle_params_table[OMAP3_STATE_C7].threshold;
        omap3_power_states[OMAP3_STATE_C7].mpu_state = PWRDM_POWER_OFF;
        omap3_power_states[OMAP3_STATE_C7].core_state = PWRDM_POWER_OFF;

       omap3_power_states[OMAP3_STATE_C7].flags = CPUIDLE_FLAG_TIME_VALID |

arch/arm/mach-omap2/io.c +3 -2
index 266a5a1..d8d10aa 100644
@@ -283,13 +283,14 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sp,
                                 struct omap_opp *mpu_opps,
                                 struct omap_opp *dsp_opps,
                                 struct omap_opp *l3_opps,
-                                struct prm_setup_vc *setup_times)
+                                struct prm_setup_vc *setup_times,
+                                struct cpuidle_params *idle_params)
  {
        omap2_mux_init();
  #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */
        /* The OPP tables have to be registered before a clk init */
        omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
-       omap_pm_early_init(setup_times);
+       omap_pm_early_init(setup_times, idle_params);
        pwrdm_init(powerdomains_omap);
        clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps);
        omapdev_init(omapdevs);
arch/arm/mach-omap2/pm.c +5 -2
index b81ba3b..5c5c59e 100644
@@ -236,10 +236,13 @@ unsigned get_last_off_on_transaction_id(struct device *dev)
        return 0;
  }
 
-void __init omap_pm_early_init(struct prm_setup_vc *setup_times)
+void __init omap_pm_early_init(struct prm_setup_vc *setup_times,
+                                       struct cpuidle_params *idle_params)
  {
-       if (cpu_is_omap34xx())
+       if (cpu_is_omap34xx()) {
                omap3_set_prm_setup_vc(setup_times);
+               omap3_set_idle_params(idle_params);
+       }
        return;
  }
 
arch/arm/mach-omap2/pm.h +11 -1
index 0beb32d..8759053 100644
@@ -31,6 +31,12 @@ struct prm_setup_vc {
        u16 vdd1_off;
  };
 
+struct cpuidle_params {
+       u32 sleep_latency;
+       u32 wake_latency;
+       u32 threshold;
+};
+
  #ifdef CONFIG_ARCH_OMAP3
  extern unsigned short enable_dyn_sleep;
  extern unsigned short enable_off_mode;
@@ -43,6 +49,7 @@ extern int set_pwrdm_state(struct powerdomain *pwrdm, u32 state);
  extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm);
  extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state);
  extern void omap3_set_prm_setup_vc(struct prm_setup_vc *setup_vc);
+extern void omap3_set_idle_params(struct cpuidle_params *cpuidle_board_params);
  #ifdef CONFIG_CPU_IDLE
  int omap3_idle_init(void);
  #else
@@ -51,8 +58,10 @@ static inline int omap3_idle_init(void) { return 0; }
 
  #else /* CONFIG_ARCH_OMAP3 */
  #define omap3_set_prm_setup_vc(setup_vc) do {} while (0);
+#define omap3_set_idle_params(parmas, board_params) do {} while (0);
 
  #endif /* CONFIG_ARCH_OMAP3 */
+
  extern int resource_set_opp_level(int res, u32 target_level, int flags);
  extern int resource_access_opp_lock(int res, int delta);
  #define resource_lock_opp(res) resource_access_opp_lock(res, 1)
@@ -91,6 +100,7 @@ extern unsigned int omap34xx_suspend_sz;
  extern unsigned int save_secure_ram_context_sz;
  extern unsigned int omap24xx_cpu_suspend_sz;
  extern unsigned int omap34xx_cpu_suspend_sz;
-void __init omap_pm_early_init(struct prm_setup_vc *setup_times);
+void __init omap_pm_early_init(struct prm_setup_vc *setup_times,
+                                       struct cpuidle_params *idle_params);
 
  #endif
arch/arm/plat-omap/include/mach/io.h +3 -2
index 3582bef..d143bd9 100644
@@ -225,6 +225,7 @@
  struct omap_sdrc_params;
  struct omap_opp;
  struct prm_setup_vc;
+struct cpuidle_params;
 
  extern void omap1_map_common_io(void);
  extern void omap1_init_common_hw(void);
@@ -234,7 +235,8 @@ extern void omap2_init_common_hw(struct omap_sdrc_params *sp,
                                 struct omap_opp *mpu_opps,
                                 struct omap_opp *dsp_opps,
                                 struct omap_opp *l3_opps,
-                                struct prm_setup_vc *setup_times);
+                                struct prm_setup_vc *setup_times,
+                                struct cpuidle_params *idle_params);
 
  #define __arch_ioremap(p,s,t)  omap_ioremap(p,s,t)
  #define __arch_iounmap(v)      omap_iounmap(v)
--

1.5.4.7

Quoted 5 lines

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

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

#3 lore raw

RE: [PATCH 2/2] OMAP3: PM: Configure CPUidle latencies/thresholds from board files

In reply to Rajendra Nayak
Quoted 27 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Nayak, Rajendra
Sent: Monday, June 29, 2009 8:05 PM
To: [email protected]
Cc: Nayak, Rajendra
Subject: [PATCH 2/2] OMAP3: PM: Configure CPUidle latencies/thresholds from board files

The CPUidle C state latencies and thresholds are dependent on various board specific details.
Hence this patch makes it possible to configure these values from the respective board files.

---
 arch/arm/mach-omap2/board-3430sdp.c     |   22 ++++++-
 arch/arm/mach-omap2/board-apollon.c     |    2 +-
 arch/arm/mach-omap2/board-generic.c     |    2 +-
 arch/arm/mach-omap2/board-h4.c          |    2 +-
 arch/arm/mach-omap2/board-ldp.c         |    2 +-
 arch/arm/mach-omap2/board-omap3beagle.c |    2 +-
 arch/arm/mach-omap2/board-omap3evm.c    |    2 +-
 arch/arm/mach-omap2/board-overo.c       |    3 +-
 arch/arm/mach-omap2/board-rx51.c        |    2 +-
Quoted 9 lines
 arch/arm/mach-omap2/board-zoom2.c       |    2 +-
 arch/arm/mach-omap2/cpuidle34xx.c       |  105 
++++++++++++++++++++++++------
 arch/arm/mach-omap2/io.c                |    5 +-
 arch/arm/mach-omap2/pm.c                |    7 ++-
 arch/arm/mach-omap2/pm.h                |   12 +++-
 arch/arm/plat-omap/include/mach/io.h    |    4 +-
 15 files changed, 136 insertions(+), 38 deletions(-)

[snip]---[snip]

Quoted 14 lines
arch/arm/plat-omap/include/mach/io.h +1 -0
index 3582bef..d143bd9 100644
@@ -225,6 +225,7 @@
 struct omap_sdrc_params;
 struct omap_opp;
 struct prm_setup_vc;
+struct cpuidle_params;
 
 extern void omap1_map_common_io(void);
 extern void omap1_init_common_hw(void);

arch/arm/plat-omap/include/mach/io.h extern void omap2_init_common_hw(struct · line 240

Quoted 7 lines
arch/arm/plat-omap/include/mach/io.h +2 -1
@@ -234,7 +235,8 @@ extern void omap2_init_common_hw(struct 
 omap_sdrc_params *sp,
 				 struct omap_opp *mpu_opps,
 				 struct omap_opp *dsp_opps,
 				 struct omap_opp *l3_opps,
-				 struct prm_setup_vc *setup_times);
+				 struct prm_setup_vc *setup_times,
+				 struct cpuidle_params *idle_params);

Rajendra, all,

Aren't we 'overloading' omap2_init_common_hw() each time we add another argument to it?

Shouldn't we defined define a function specific for PM initialization? Some of the initialization actually doesn't even touch the HW.

Best regards,
Sanjeev

Quoted 13 lines
arch/arm/plat-omap/include/mach/io.h +0 -0
 #define __arch_ioremap(p,s,t)	omap_ioremap(p,s,t)
 #define __arch_iounmap(v)	omap_iounmap(v)
Signature · 7 lines
1.5.4.7

--
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
#4 lore raw

Re: [PATCH 2/2] OMAP3: PM: Configure CPUidle latencies/thresholds from board files

Quoted 13 lines · Sanjeev

arch/arm/plat-omap/include/mach/io.h extern void omap2_init_common_hw(struct · line 240

Quoted 10 lines

extern void omap1_map_common_io(void);
extern void omap1_init_common_hw(void);

arch/arm/plat-omap/include/mach/io.h +2 -1
@@ -234,7 +235,8 @@ extern void omap2_init_common_hw(struct 
 omap_sdrc_params *sp,
 				 struct omap_opp *mpu_opps,
 				 struct omap_opp *dsp_opps,
 				 struct omap_opp *l3_opps,
-				 struct prm_setup_vc *setup_times);
+				 struct prm_setup_vc *setup_times,
+				 struct cpuidle_params *idle_params);

Rajendra, all,

Quoted 6 lines

Aren't we 'overloading' omap2_init_common_hw() each time we add another argument to it?

Shouldn't we defined define a function specific for PM initialization? Some of the initialization actually doesn't even touch the HW.

Completely agree.

We are absolutely overloading init_common_hw() and this is on the list of things I'd like to see changed before those change go upstream. I just haven't got to that yet.

I would happily welcome any proposals or cleanups to this.

My current feeling is that I think these board-specific settings should just be using platform_driver/platform_device model and then board-specifics could be passed via platform_data. If not settings are given, conservative defaults can be used. But honestly, I haven't given it much more thought, other than I *really* don't like the current overloading of that function.

Kevin

#5 lore raw
In reply to Rajendra Nayak
Quoted 10 lines · Rajendra Nayak

The setup times to be programmed in the PRM module on OMAP (for clksetup, voltsetup etc) are board specific.
They depend heavily on the PMIC used and even on different boards with the same PMIC, they vary based on the sleep/wake sequence used, system clock speed et al.

This patch makes it possible for these setup values to be configured from different board files.

Hi Rajendra,

Sorry about this, but your series slipped through cracks on my side.

I like this approach, but it needs to be rebased against current PM branch since lots of the code that it touches has been reworked.

Also, instead of continuing to overload init_common_hw, how about adding something like omap_pm_register() which takes the various rate tables and setup times, or possibly adding the rate tables and setup times as arguments to omap3_pm_earlly_init() and making it explicitly called by board code instead of an arch_initcall().

Kevin

Quoted 329 lines
---
 arch/arm/mach-omap2/board-3430sdp.c     |   20 +++++++++++++++++++-
 arch/arm/mach-omap2/board-apollon.c     |    2 +-
 arch/arm/mach-omap2/board-generic.c     |    2 +-
 arch/arm/mach-omap2/board-h4.c          |    2 +-
 arch/arm/mach-omap2/board-ldp.c         |    2 +-
 arch/arm/mach-omap2/board-omap3beagle.c |    2 +-
 arch/arm/mach-omap2/board-omap3evm.c    |    2 +-
 arch/arm/mach-omap2/board-overo.c       |    2 +-
 arch/arm/mach-omap2/board-rx51.c        |    2 +-
 arch/arm/mach-omap2/board-zoom2.c       |    2 +-
 arch/arm/mach-omap2/io.c                |    5 ++++-
 arch/arm/mach-omap2/pm.c                |    7 +++++++
 arch/arm/mach-omap2/pm.h                |   16 +++++++++-------
 arch/arm/mach-omap2/pm34xx.c            |   10 ++++++++++
 arch/arm/plat-omap/include/mach/io.h    |    4 +++-
 15 files changed, 61 insertions(+), 19 deletions(-)
arch/arm/mach-omap2/board-3430sdp.c +19 -1
index e9a4d10..b43cf94 100644
@@ -58,6 +58,23 @@
 
 #define TWL4030_MSECURE_GPIO 22
 
+/* FIXME: These are not the optimal setup values to be used on 3430sdp*/
+static struct prm_setup_vc omap3_setuptime_table = {
+	.clksetup = 0xff,
+	.voltsetup_time1 = 0xfff,
+	.voltsetup_time2 = 0xfff,
+	.voltoffset = 0xff,
+	.voltsetup2 = 0xff,
+	.vdd0_on = 0x30,
+	.vdd0_onlp = 0x20,
+	.vdd0_ret = 0x1e,
+	.vdd0_off = 0x00,
+	.vdd1_on = 0x2c,
+	.vdd1_onlp = 0x20,
+	.vdd1_ret = 0x1e,
+	.vdd1_off = 0x00,
+};
+
 static int sdp3430_keymap[] = {
 	KEY(0, 0, KEY_LEFT),
 	KEY(0, 1, KEY_RIGHT),
@@ -174,7 +191,8 @@ static struct platform_device *sdp3430_devices[] __initdata = {
 static void __init omap_3430sdp_init_irq(void)
 {
 	omap2_init_common_hw(hyb18m512160af6_sdrc_params, omap3_mpu_rate_table,
-			     omap3_dsp_rate_table, omap3_l3_rate_table);
+			     omap3_dsp_rate_table, omap3_l3_rate_table,
+			     &omap3_setuptime_table);
 	omap_init_irq();
 	omap_gpio_init();
 }
arch/arm/mach-omap2/board-apollon.c +1 -1
index 1a7fb81..293a9b2 100644
@@ -250,7 +250,7 @@ out:
 
 static void __init omap_apollon_init_irq(void)
 {
-	omap2_init_common_hw(NULL, NULL, NULL, NULL);
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 	apollon_init_smc91x();
arch/arm/mach-omap2/board-generic.c +1 -1
index 23583da..dfc1b49 100644
@@ -33,7 +33,7 @@
 
 static void __init omap_generic_init_irq(void)
 {
-	omap2_init_common_hw(NULL, NULL, NULL, NULL);
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 }
 
arch/arm/mach-omap2/board-h4.c +1 -1
index de6adf7..af0ebaf 100644
@@ -270,7 +270,7 @@ static void __init h4_init_flash(void)
 
 static void __init omap_h4_init_irq(void)
 {
-	omap2_init_common_hw(NULL, NULL, NULL, NULL);
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 	h4_init_flash();
arch/arm/mach-omap2/board-ldp.c +1 -1
index 3b662ff..eb5e2e0 100644
@@ -270,7 +270,7 @@ static inline void __init ldp_init_smsc911x(void)
 
 static void __init omap_ldp_init_irq(void)
 {
-	omap2_init_common_hw(NULL, NULL, NULL, NULL);
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 	ldp_init_smsc911x();
arch/arm/mach-omap2/board-omap3beagle.c +1 -1
index 36b4bfb..e0be6bd 100644
@@ -289,7 +289,7 @@ static int __init omap3_beagle_i2c_init(void)
 static void __init omap3_beagle_init_irq(void)
 {
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table,
-			     omap3_dsp_rate_table, omap3_l3_rate_table);
+			     omap3_dsp_rate_table, omap3_l3_rate_table, NULL);
 	omap_init_irq();
 #ifdef CONFIG_OMAP_32K_TIMER
 	omap2_gp_clockevent_set_gptimer(12);
arch/arm/mach-omap2/board-omap3evm.c +1 -1
index e300a9e..eaab39b 100644
@@ -284,7 +284,7 @@ struct spi_board_info omap3evm_spi_board_info[] = {
 static void __init omap3_evm_init_irq(void)
 {
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table,
-	                     omap3_dsp_rate_table, omap3_l3_rate_table);
+			omap3_dsp_rate_table, omap3_l3_rate_table, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 	omap3evm_init_smc911x();
arch/arm/mach-omap2/board-overo.c +1 -1
index 0bff181..f159e18 100644
@@ -360,7 +360,7 @@ static int __init overo_i2c_init(void)
 
 static void __init overo_init_irq(void)
 {
-	omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL, NULL, NULL);
+	omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 }
arch/arm/mach-omap2/board-rx51.c +1 -1
index 4733e4e..3629a0e 100644
@@ -66,7 +66,7 @@ static struct omap_board_config_kernel rx51_config[] = {
 static void __init rx51_init_irq(void)
 {
 	omap2_init_common_hw(rx51_get_sdram_timings(), omap3_mpu_rate_table,
-			     omap3_dsp_rate_table, omap3_l3_rate_table);
+			     omap3_dsp_rate_table, omap3_l3_rate_table, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 }
arch/arm/mach-omap2/board-zoom2.c +1 -1
index 981f28e..e63bfa0 100644
@@ -27,7 +27,7 @@
 static void __init omap_zoom2_init_irq(void)
 {
 	omap2_init_common_hw(NULL, omap3_mpu_rate_table,
-	                     omap3_dsp_rate_table, omap3_l3_rate_table);
+			omap3_dsp_rate_table, omap3_l3_rate_table, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 }
arch/arm/mach-omap2/io.c +4 -1
index 980322d..266a5a1 100644
@@ -44,6 +44,7 @@
 
 #include <mach/clockdomain.h>
 #include "clockdomains.h"
+#include "pm.h"
 #endif
 /*
  * The machine specific code may provide the extra mapping besides the
@@ -281,12 +282,14 @@ static int __init _omap2_init_reprogram_sdrc(void)
 void __init omap2_init_common_hw(struct omap_sdrc_params *sp,
 				 struct omap_opp *mpu_opps,
 				 struct omap_opp *dsp_opps,
-				 struct omap_opp *l3_opps)
+				 struct omap_opp *l3_opps,
+				 struct prm_setup_vc *setup_times)
 {
 	omap2_mux_init();
 #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */
 	/* The OPP tables have to be registered before a clk init */
 	omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
+	omap_pm_early_init(setup_times);
 	pwrdm_init(powerdomains_omap);
 	clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps);
 	omapdev_init(omapdevs);
arch/arm/mach-omap2/pm.c +7 -0
index 1192e01..b81ba3b 100644
@@ -236,6 +236,13 @@ unsigned get_last_off_on_transaction_id(struct device *dev)
 	return 0;
 }
 
+void __init omap_pm_early_init(struct prm_setup_vc *setup_times)
+{
+	if (cpu_is_omap34xx())
+		omap3_set_prm_setup_vc(setup_times);
+	return;
+}
+
 static int __init omap_pm_init(void)
 {
 	int error = -1;
arch/arm/mach-omap2/pm.h +9 -7
index ddc9453..0beb32d 100644
@@ -13,12 +13,6 @@
 
 #include <mach/powerdomain.h>
 
-#ifdef CONFIG_ARCH_OMAP3
-extern unsigned short enable_dyn_sleep;
-extern unsigned short enable_off_mode;
-extern unsigned short voltage_off_while_idle;
-extern void *omap3_secure_ram_storage;
-
 struct prm_setup_vc {
 	u16 clksetup;
 	u16 voltsetup_time1;
@@ -37,6 +31,11 @@ struct prm_setup_vc {
 	u16 vdd1_off;
 };
 
+#ifdef CONFIG_ARCH_OMAP3
+extern unsigned short enable_dyn_sleep;
+extern unsigned short enable_off_mode;
+extern unsigned short voltage_off_while_idle;
+extern void *omap3_secure_ram_storage;
 extern void omap3_pm_off_mode_enable(int);
 extern void omap_sram_idle(void);
 extern int omap3_can_sleep(void);
@@ -44,13 +43,15 @@ extern int set_pwrdm_state(struct powerdomain *pwrdm, u32 state);
 extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm);
 extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state);
 extern void omap3_set_prm_setup_vc(struct prm_setup_vc *setup_vc);
-
 #ifdef CONFIG_CPU_IDLE
 int omap3_idle_init(void);
 #else
 static inline int omap3_idle_init(void) { return 0; }
 #endif
 
+#else /* CONFIG_ARCH_OMAP3 */
+#define omap3_set_prm_setup_vc(setup_vc) do {} while (0);
+
 #endif /* CONFIG_ARCH_OMAP3 */
 extern int resource_set_opp_level(int res, u32 target_level, int flags);
 extern int resource_access_opp_lock(int res, int delta);
@@ -90,5 +91,6 @@ extern unsigned int omap34xx_suspend_sz;
 extern unsigned int save_secure_ram_context_sz;
 extern unsigned int omap24xx_cpu_suspend_sz;
 extern unsigned int omap34xx_cpu_suspend_sz;
+void __init omap_pm_early_init(struct prm_setup_vc *setup_times);
 
 #endif
arch/arm/mach-omap2/pm34xx.c +10 -0
index 7a4a525..7b05244 100644
@@ -77,6 +77,13 @@ static struct powerdomain *mpu_pwrdm, *neon_pwrdm;
 static struct powerdomain *core_pwrdm, *per_pwrdm;
 static struct powerdomain *cam_pwrdm;
 
+/*
+ * These values are board specific and have to be passed from
+ * the respective board files.
+ * The values used here are just worst case values which will
+ * be used on boards which do not pass on these values from
+ * the board files.
+ */
 static struct prm_setup_vc prm_setup = {
 	.clksetup = 0xff,
 	.voltsetup_time1 = 0xfff,
@@ -985,6 +992,9 @@ int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state)
 
 void omap3_set_prm_setup_vc(struct prm_setup_vc *setup_vc)
 {
+	if (!setup_vc)
+		return;
+
 	prm_setup.clksetup = setup_vc->clksetup;
 	prm_setup.voltsetup_time1 = setup_vc->voltsetup_time1;
 	prm_setup.voltsetup_time2 = setup_vc->voltsetup_time2;
arch/arm/plat-omap/include/mach/io.h +3 -1
index 142f7e2..3582bef 100644
@@ -224,6 +224,7 @@
 
 struct omap_sdrc_params;
 struct omap_opp;
+struct prm_setup_vc;
 
 extern void omap1_map_common_io(void);
 extern void omap1_init_common_hw(void);
@@ -232,7 +233,8 @@ extern void omap2_map_common_io(void);
 extern void omap2_init_common_hw(struct omap_sdrc_params *sp,
 				 struct omap_opp *mpu_opps,
 				 struct omap_opp *dsp_opps,
-				 struct omap_opp *l3_opps);
+				 struct omap_opp *l3_opps,
+				 struct prm_setup_vc *setup_times);
 
 #define __arch_ioremap(p,s,t)	omap_ioremap(p,s,t)
 #define __arch_iounmap(v)	omap_iounmap(v)
Signature · 6 lines
1.5.4.7

--
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
#6 lore raw
Quoted 26 lines

-----Original Message-----
From: Kevin Hilman [mailto:[email protected]]
Sent: Thursday, October 01, 2009 12:44 AM
To: Nayak, Rajendra
Cc: [email protected]
Subject: Re: [PATCH 1/2] OMAP3: PM: Configure PRM setup times from board files

Quoted 10 lines · Rajendra Nayak

The setup times to be programmed in the PRM module on OMAP (for clksetup, voltsetup etc) are board specific.
They depend heavily on the PMIC used and even on different boards with the same PMIC, they vary based on the sleep/wake sequence used, system clock speed et al.

This patch makes it possible for these setup values to be configured from different board files.

Hi Rajendra,

Sorry about this, but your series slipped through cracks on my side.

Quoted 8 lines

I like this approach, but it needs to be rebased against current PM branch since lots of the code that it touches has been reworked.

Also, instead of continuing to overload init_common_hw, how about adding something like omap_pm_register() which takes the various rate tables and setup times, or possibly adding the rate tables and setup times as arguments to omap3_pm_earlly_init() and making it explicitly called by board code instead of an arch_initcall().

Hi Kevin,

Yes, I will rework this patch and repost in a couple days.

regards,
Rajendra

Quoted 369 lines

Kevin

Quoted 18 lines
---
 arch/arm/mach-omap2/board-3430sdp.c     |   20 +++++++++++++++++++-
 arch/arm/mach-omap2/board-apollon.c     |    2 +-
 arch/arm/mach-omap2/board-generic.c     |    2 +-
 arch/arm/mach-omap2/board-h4.c          |    2 +-
 arch/arm/mach-omap2/board-ldp.c         |    2 +-
 arch/arm/mach-omap2/board-omap3beagle.c |    2 +-
 arch/arm/mach-omap2/board-omap3evm.c    |    2 +-
 arch/arm/mach-omap2/board-overo.c       |    2 +-
 arch/arm/mach-omap2/board-rx51.c        |    2 +-
 arch/arm/mach-omap2/board-zoom2.c       |    2 +-
 arch/arm/mach-omap2/io.c                |    5 ++++-
 arch/arm/mach-omap2/pm.c                |    7 +++++++
 arch/arm/mach-omap2/pm.h                |   16 +++++++++-------
 arch/arm/mach-omap2/pm34xx.c            |   10 ++++++++++
 arch/arm/plat-omap/include/mach/io.h    |    4 +++-
 15 files changed, 61 insertions(+), 19 deletions(-)

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-3430sdp.c

arch/arm/mach-omap2/board-3430sdp.c line 61

Quoted 8 lines

index e9a4d10..b43cf94 100644

arch/arm/mach-omap2/board-3430sdp.c +1 -0
@@ -58,6 +58,23 @@
 
 #define TWL4030_MSECURE_GPIO 22
 
+/* FIXME: These are not the optimal setup values to be used 

on 3430sdp*/

arch/arm/mach-omap2/board-3430sdp.c static struct platform_device

Quoted 20 lines
arch/arm/mach-omap2/board-3430sdp.c +16 -0
+static struct prm_setup_vc omap3_setuptime_table = {
+	.clksetup = 0xff,
+	.voltsetup_time1 = 0xfff,
+	.voltsetup_time2 = 0xfff,
+	.voltoffset = 0xff,
+	.voltsetup2 = 0xff,
+	.vdd0_on = 0x30,
+	.vdd0_onlp = 0x20,
+	.vdd0_ret = 0x1e,
+	.vdd0_off = 0x00,
+	.vdd1_on = 0x2c,
+	.vdd1_onlp = 0x20,
+	.vdd1_ret = 0x1e,
+	.vdd1_off = 0x00,
+};
+
 static int sdp3430_keymap[] = {
 	KEY(0, 0, KEY_LEFT),
 	KEY(0, 1, KEY_RIGHT),
@@ -174,7 +191,8 @@ static struct platform_device 

*sdp3430_devices[] __initdata = {

arch/arm/mach-omap2/board-3430sdp.c static struct platform_device *sdp3430_devices[] __initdata = {

Quoted 3 lines
arch/arm/mach-omap2/board-3430sdp.c +0 -0
 static void __init omap_3430sdp_init_irq(void)
 {
 	omap2_init_common_hw(hyb18m512160af6_sdrc_params, 

omap3_mpu_rate_table,

Review

Quoted 7 lines
arch/arm/mach-omap2/board-3430sdp.c +2 -1
-			     omap3_dsp_rate_table, omap3_l3_rate_table);
+			     omap3_dsp_rate_table, omap3_l3_rate_table,
+			     &omap3_setuptime_table);
 	omap_init_irq();
 	omap_gpio_init();
 }
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-apollon.c

Review

Quoted 13 lines

index 1a7fb81..293a9b2 100644

arch/arm/mach-omap2/board-apollon.c +1 -1
@@ -250,7 +250,7 @@ out:
 
 static void __init omap_apollon_init_irq(void)
 {
-	omap2_init_common_hw(NULL, NULL, NULL, NULL);
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 	apollon_init_smc91x();
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-generic.c

Review

Quoted 13 lines

index 23583da..dfc1b49 100644

arch/arm/mach-omap2/board-generic.c +1 -1
@@ -33,7 +33,7 @@
 
 static void __init omap_generic_init_irq(void)
 {
-	omap2_init_common_hw(NULL, NULL, NULL, NULL);
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 }
 
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-h4.c

Review

Quoted 13 lines

index de6adf7..af0ebaf 100644

arch/arm/mach-omap2/board-h4.c +1 -1
@@ -270,7 +270,7 @@ static void __init h4_init_flash(void)
 
 static void __init omap_h4_init_irq(void)
 {
-	omap2_init_common_hw(NULL, NULL, NULL, NULL);
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 	h4_init_flash();
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-ldp.c

Review

Quoted 13 lines

index 3b662ff..eb5e2e0 100644

arch/arm/mach-omap2/board-ldp.c +1 -1
@@ -270,7 +270,7 @@ static inline void __init ldp_init_smsc911x(void)
 
 static void __init omap_ldp_init_irq(void)
 {
-	omap2_init_common_hw(NULL, NULL, NULL, NULL);
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 	ldp_init_smsc911x();
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-omap3beagle.c

arch/arm/mach-omap2/board-omap3beagle.c static int __init omap3_beagle_i2c_init(void) · line 291

Quoted 7 lines

index 36b4bfb..e0be6bd 100644

arch/arm/mach-omap2/board-omap3beagle.c +0 -0
@@ -289,7 +289,7 @@ static int __init omap3_beagle_i2c_init(void)
 static void __init omap3_beagle_init_irq(void)
 {
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 

omap3_mpu_rate_table,

arch/arm/mach-omap2/board-omap3beagle.c static int __init omap3_beagle_i2c_init(void) · line 292

Quoted 2 lines
arch/arm/mach-omap2/board-omap3beagle.c +1 -1
-			     omap3_dsp_rate_table, omap3_l3_rate_table);
+			     omap3_dsp_rate_table, 

omap3_l3_rate_table, NULL);

Review

Quoted 4 lines
arch/arm/mach-omap2/board-omap3beagle.c +0 -0
 	omap_init_irq();
 #ifdef CONFIG_OMAP_32K_TIMER
 	omap2_gp_clockevent_set_gptimer(12);
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-omap3evm.c

arch/arm/mach-omap2/board-omap3evm.c struct spi_board_info

Quoted 4 lines

index e300a9e..eaab39b 100644

arch/arm/mach-omap2/board-omap3evm.c +0 -0
@@ -284,7 +284,7 @@ struct spi_board_info 

omap3evm_spi_board_info[] = {

arch/arm/mach-omap2/board-omap3evm.c struct spi_board_info omap3evm_spi_board_info[] = {

Quoted 3 lines
arch/arm/mach-omap2/board-omap3evm.c +0 -0
 static void __init omap3_evm_init_irq(void)
 {
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 

omap3_mpu_rate_table,

arch/arm/mach-omap2/board-omap3evm.c struct spi_board_info · line 287

Quoted 2 lines
arch/arm/mach-omap2/board-omap3evm.c +1 -1
-	                     omap3_dsp_rate_table, omap3_l3_rate_table);
+			omap3_dsp_rate_table, 

omap3_l3_rate_table, NULL);

Review

Quoted 4 lines
arch/arm/mach-omap2/board-omap3evm.c +0 -0
 	omap_init_irq();
 	omap_gpio_init();
 	omap3evm_init_smc911x();
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-overo.c

arch/arm/mach-omap2/board-overo.c static int __init overo_i2c_init(void) · line 363

Quoted 8 lines

index 0bff181..f159e18 100644

arch/arm/mach-omap2/board-overo.c +0 -1
@@ -360,7 +360,7 @@ static int __init overo_i2c_init(void)
 
 static void __init overo_init_irq(void)
 {
-	omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL, 

NULL, NULL);

arch/arm/mach-omap2/board-overo.c static int __init overo_i2c_init(void) · line 363

Quoted 1 line
arch/arm/mach-omap2/board-overo.c +1 -0
+	omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL, 

NULL, NULL, NULL);

Review

Quoted 4 lines
arch/arm/mach-omap2/board-overo.c +0 -0
 	omap_init_irq();
 	omap_gpio_init();
 }
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-rx51.c

arch/arm/mach-omap2/board-rx51.c static struct omap_board_config_kernel

Quoted 4 lines

index 4733e4e..3629a0e 100644

arch/arm/mach-omap2/board-rx51.c +0 -0
@@ -66,7 +66,7 @@ static struct omap_board_config_kernel 

rx51_config[] = {

arch/arm/mach-omap2/board-rx51.c static struct omap_board_config_kernel rx51_config[] = {

Quoted 3 lines
arch/arm/mach-omap2/board-rx51.c +0 -0
 static void __init rx51_init_irq(void)
 {
 	omap2_init_common_hw(rx51_get_sdram_timings(), 

omap3_mpu_rate_table,

arch/arm/mach-omap2/board-rx51.c static struct omap_board_config_kernel · line 69

Quoted 2 lines
arch/arm/mach-omap2/board-rx51.c +1 -1
-			     omap3_dsp_rate_table, omap3_l3_rate_table);
+			     omap3_dsp_rate_table, 

omap3_l3_rate_table, NULL);

Review

Quoted 4 lines
arch/arm/mach-omap2/board-rx51.c +0 -0
 	omap_init_irq();
 	omap_gpio_init();
 }
(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-zoom2.c

arch/arm/mach-omap2/board-zoom2.c line 30

Quoted 9 lines

index 981f28e..e63bfa0 100644

arch/arm/mach-omap2/board-zoom2.c +1 -1
@@ -27,7 +27,7 @@
 static void __init omap_zoom2_init_irq(void)
 {
 	omap2_init_common_hw(NULL, omap3_mpu_rate_table,
-	                     omap3_dsp_rate_table, omap3_l3_rate_table);
+			omap3_dsp_rate_table, 

omap3_l3_rate_table, NULL);

Quoted 8 lines
arch/arm/mach-omap2/board-zoom2.c +0 -0
 	omap_init_irq();
 	omap_gpio_init();
 }
arch/arm/mach-omap2/io.c +0 -0
index 980322d..266a5a1 100644

arch/arm/mach-omap2/io.c line 50

Quoted 7 lines
arch/arm/mach-omap2/io.c +1 -0
@@ -44,6 +44,7 @@
 
 #include <mach/clockdomain.h>
 #include "clockdomains.h"
+#include "pm.h"
 #endif
 /*
  * The machine specific code may provide the extra mapping 

besides the

arch/arm/mach-omap2/io.c static int __init

Quoted 1 line
arch/arm/mach-omap2/io.c +0 -0
@@ -281,12 +282,14 @@ static int __init 

_omap2_init_reprogram_sdrc(void)

arch/arm/mach-omap2/io.c static int __init _omap2_init_reprogram_sdrc(void)

Quoted 9 lines
arch/arm/mach-omap2/io.c +2 -1
 void __init omap2_init_common_hw(struct omap_sdrc_params *sp,
 				 struct omap_opp *mpu_opps,
 				 struct omap_opp *dsp_opps,
-				 struct omap_opp *l3_opps)
+				 struct omap_opp *l3_opps,
+				 struct prm_setup_vc *setup_times)
 {
 	omap2_mux_init();
 #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the 

clkdev is ready */

arch/arm/mach-omap2/pm.c unsigned

Quoted 11 lines
arch/arm/mach-omap2/io.c +1 -0
 	/* The OPP tables have to be registered before a clk init */
 	omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
+	omap_pm_early_init(setup_times);
 	pwrdm_init(powerdomains_omap);
 	clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps);
 	omapdev_init(omapdevs);
arch/arm/mach-omap2/pm.c +0 -0
index 1192e01..b81ba3b 100644
@@ -236,6 +236,13 @@ unsigned 

get_last_off_on_transaction_id(struct device *dev)

arch/arm/mach-omap2/pm.h extern int set_pwrdm_state(struct

Quoted 43 lines
arch/arm/mach-omap2/pm.c +7 -0
 	return 0;
 }
 
+void __init omap_pm_early_init(struct prm_setup_vc *setup_times)
+{
+	if (cpu_is_omap34xx())
+		omap3_set_prm_setup_vc(setup_times);
+	return;
+}
+
 static int __init omap_pm_init(void)
 {
 	int error = -1;
arch/arm/mach-omap2/pm.h +5 -6
index ddc9453..0beb32d 100644
@@ -13,12 +13,6 @@
 
 #include <mach/powerdomain.h>
 
-#ifdef CONFIG_ARCH_OMAP3
-extern unsigned short enable_dyn_sleep;
-extern unsigned short enable_off_mode;
-extern unsigned short voltage_off_while_idle;
-extern void *omap3_secure_ram_storage;
-
 struct prm_setup_vc {
 	u16 clksetup;
 	u16 voltsetup_time1;
@@ -37,6 +31,11 @@ struct prm_setup_vc {
 	u16 vdd1_off;
 };
 
+#ifdef CONFIG_ARCH_OMAP3
+extern unsigned short enable_dyn_sleep;
+extern unsigned short enable_off_mode;
+extern unsigned short voltage_off_while_idle;
+extern void *omap3_secure_ram_storage;
 extern void omap3_pm_off_mode_enable(int);
 extern void omap_sram_idle(void);
 extern int omap3_can_sleep(void);
@@ -44,13 +43,15 @@ extern int set_pwrdm_state(struct 

powerdomain *pwrdm, u32 state);

arch/arm/mach-omap2/pm.h extern int set_pwrdm_state(struct · line 44

Quoted 2 lines
arch/arm/mach-omap2/pm.h +0 -0
 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/pm.h extern int set_pwrdm_state(struct powerdomain *pwrdm, u32 state);

Quoted 13 lines
arch/arm/mach-omap2/pm.h +3 -1
 extern void omap3_set_prm_setup_vc(struct prm_setup_vc *setup_vc);
-
 #ifdef CONFIG_CPU_IDLE
 int omap3_idle_init(void);
 #else
 static inline int omap3_idle_init(void) { return 0; }
 #endif
 
+#else /* CONFIG_ARCH_OMAP3 */
+#define omap3_set_prm_setup_vc(setup_vc) do {} while (0);
+
 #endif /* CONFIG_ARCH_OMAP3 */
 extern int resource_set_opp_level(int res, u32 

target_level, int flags);

Review

Quoted 9 lines
arch/arm/mach-omap2/pm.h +1 -0
 extern int resource_access_opp_lock(int res, int delta);
@@ -90,5 +91,6 @@ extern unsigned int omap34xx_suspend_sz;
 extern unsigned int save_secure_ram_context_sz;
 extern unsigned int omap24xx_cpu_suspend_sz;
 extern unsigned int omap34xx_cpu_suspend_sz;
+void __init omap_pm_early_init(struct prm_setup_vc *setup_times);
 
 #endif
(quoted diff) +0 -0

b/arch/arm/mach-omap2/pm34xx.c

arch/arm/mach-omap2/pm34xx.c int omap3_pm_set_suspend_state(struct

Quoted 18 lines

index 7a4a525..7b05244 100644

arch/arm/mach-omap2/pm34xx.c +7 -0
@@ -77,6 +77,13 @@ static struct powerdomain *mpu_pwrdm, *neon_pwrdm;
 static struct powerdomain *core_pwrdm, *per_pwrdm;
 static struct powerdomain *cam_pwrdm;
 
+/*
+ * These values are board specific and have to be passed from
+ * the respective board files.
+ * The values used here are just worst case values which will
+ * be used on boards which do not pass on these values from
+ * the board files.
+ */
 static struct prm_setup_vc prm_setup = {
 	.clksetup = 0xff,
 	.voltsetup_time1 = 0xfff,
@@ -985,6 +992,9 @@ int omap3_pm_set_suspend_state(struct 

powerdomain *pwrdm, int state)

Review

Quoted 10 lines
arch/arm/mach-omap2/pm34xx.c +3 -0
 void omap3_set_prm_setup_vc(struct prm_setup_vc *setup_vc)
 {
+	if (!setup_vc)
+		return;
+
 	prm_setup.clksetup = setup_vc->clksetup;
 	prm_setup.voltsetup_time1 = setup_vc->voltsetup_time1;
 	prm_setup.voltsetup_time2 = setup_vc->voltsetup_time2;
(quoted diff) +0 -0

b/arch/arm/plat-omap/include/mach/io.h

Quoted 26 lines

index 142f7e2..3582bef 100644

arch/arm/plat-omap/include/mach/io.h +3 -1
@@ -224,6 +224,7 @@
 
 struct omap_sdrc_params;
 struct omap_opp;
+struct prm_setup_vc;
 
 extern void omap1_map_common_io(void);
 extern void omap1_init_common_hw(void);
@@ -232,7 +233,8 @@ extern void omap2_map_common_io(void);
 extern void omap2_init_common_hw(struct omap_sdrc_params *sp,
 				 struct omap_opp *mpu_opps,
 				 struct omap_opp *dsp_opps,
-				 struct omap_opp *l3_opps);
+				 struct omap_opp *l3_opps,
+				 struct prm_setup_vc *setup_times);
 
 #define __arch_ioremap(p,s,t)	omap_ioremap(p,s,t)
 #define __arch_iounmap(v)	omap_iounmap(v)
Signature · 4 lines
1.5.4.7

--
To unsubscribe from this list: send the line "unsubscribe 

linux-omap" in

Quoted 2 lines

the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html