* [PATCH 1/3] OMAP3: PM: Fix the way OPP rate tables are initialized
@ 2009-10-12 13:42 Rajendra Nayak
2009-10-12 13:42 ` [PATCH 2/3] OMAP3: PM: Configure PRM setup times from board files Rajendra Nayak
0 siblings, 1 reply; 6+ messages in thread
From: Rajendra Nayak @ 2009-10-12 13:42 UTC (permalink / raw)
To: linux-omap; +Cc: khilman, Rajendra Nayak
Remove rate tables being passed to omap2_init_common_hw, instead
pass them as arguments to omap3_pm_early_init and
call this function from board files.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
arch/arm/mach-omap2/board-3430sdp.c | 5 +++--
arch/arm/mach-omap2/board-apollon.c | 3 ++-
arch/arm/mach-omap2/board-generic.c | 3 ++-
arch/arm/mach-omap2/board-h4.c | 3 ++-
arch/arm/mach-omap2/board-ldp.c | 3 ++-
arch/arm/mach-omap2/board-omap3beagle.c | 5 +++--
arch/arm/mach-omap2/board-omap3evm.c | 5 +++--
arch/arm/mach-omap2/board-overo.c | 4 +++-
arch/arm/mach-omap2/board-rx51.c | 6 ++++--
arch/arm/mach-omap2/board-zoom2.c | 6 ++++--
arch/arm/mach-omap2/io.c | 6 +-----
arch/arm/mach-omap2/pm.h | 4 +++-
arch/arm/mach-omap2/pm34xx.c | 16 +++++++++++-----
arch/arm/plat-omap/include/mach/io.h | 5 +----
14 files changed, 44 insertions(+), 30 deletions(-)
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 97b61cd..425f5ac 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -185,8 +185,9 @@ static void __init omap_3430sdp_init_irq(void)
{
omap_board_config = sdp3430_config;
omap_board_config_size = ARRAY_SIZE(sdp3430_config);
- omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL, omap3_mpu_rate_table,
- omap3_dsp_rate_table, omap3_l3_rate_table);
+ omap3_pm_early_init(omap3_mpu_rate_table, omap3_dsp_rate_table,
+ omap3_l3_rate_table);
+ omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL);
omap_init_irq();
omap_gpio_init();
}
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index 9cc984f..6a5c338 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -267,7 +267,8 @@ static void __init omap_apollon_init_irq(void)
{
omap_board_config = apollon_config;
omap_board_config_size = ARRAY_SIZE(apollon_config);
- omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
+ omap3_pm_early_init(NULL, NULL, NULL);
+ omap2_init_common_hw(NULL, NULL);
omap_init_irq();
omap_gpio_init();
apollon_init_smc91x();
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 5a834c1..55e1f11 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -38,7 +38,8 @@ static void __init omap_generic_init_irq(void)
{
omap_board_config = generic_config;
omap_board_config_size = ARRAY_SIZE(generic_config);
- omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
+ omap3_pm_early_init(NULL, NULL, NULL);
+ omap2_init_common_hw(NULL, NULL);
omap_init_irq();
}
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 500aebb..e8b5f6a 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -313,7 +313,8 @@ static void __init omap_h4_init_irq(void)
{
omap_board_config = h4_config;
omap_board_config_size = ARRAY_SIZE(h4_config);
- omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
+ omap3_pm_early_init(NULL, NULL, NULL)
+ omap2_init_common_hw(NULL, NULL);
omap_init_irq();
omap_gpio_init();
h4_init_flash();
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 335185f..009fe39 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -289,7 +289,8 @@ static void __init omap_ldp_init_irq(void)
{
omap_board_config = ldp_config;
omap_board_config_size = ARRAY_SIZE(ldp_config);
- omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
+ omap3_pm_early_init(NULL, NULL, NULL);
+ omap2_init_common_hw(NULL, NULL);
omap_init_irq();
omap_gpio_init();
ldp_init_smsc911x();
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 9ba2514..097810b 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -351,9 +351,10 @@ static void __init omap3_beagle_init_irq(void)
{
omap_board_config = omap3_beagle_config;
omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
+ omap3_pm_early_init(omap3_mpu_rate_table, omap3_dsp_rate_table,
+ omap3_l3_rate_table);
omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
- mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table,
- omap3_dsp_rate_table, omap3_l3_rate_table);
+ mt46h32m32lf6_sdrc_params);
omap_init_irq();
#ifdef CONFIG_OMAP_32K_TIMER
omap2_gp_clockevent_set_gptimer(12);
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 3900151..3d05923 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -290,8 +290,9 @@ static void __init omap3_evm_init_irq(void)
{
omap_board_config = omap3_evm_config;
omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
- omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL, omap3_mpu_rate_table,
- omap3_dsp_rate_table, omap3_l3_rate_table);
+ omap3_pm_early_init(omap3_mpu_rate_table, omap3_dsp_rate_table,
+ omap3_l3_rate_table);
+ omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL);
omap_init_irq();
omap_gpio_init();
omap3evm_init_smc911x();
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 2cdced7..d487942 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -49,6 +49,7 @@
#include "sdram-micron-mt46h32m32lf-6.h"
#include "mmc-twl4030.h"
+#include "pm.h"
#define OVERO_GPIO_BT_XGATE 15
#define OVERO_GPIO_W2W_NRESET 16
@@ -374,8 +375,9 @@ static void __init overo_init_irq(void)
{
omap_board_config = overo_config;
omap_board_config_size = ARRAY_SIZE(overo_config);
+ omap3_pm_early_init(NULL, NULL, NULL);
omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
- mt46h32m32lf6_sdrc_params, NULL, NULL, NULL);
+ mt46h32m32lf6_sdrc_params);
omap_init_irq();
omap_gpio_init();
}
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 7ae3ab8..26313ee 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -33,6 +33,7 @@
#include <mach/usb.h>
#include "omap3-opp.h"
+#include "pm.h"
#define RX51_GPIO_SLEEP_IND 162
@@ -85,9 +86,10 @@ static void __init rx51_init_irq(void)
{
omap_board_config = rx51_config;
omap_board_config_size = ARRAY_SIZE(rx51_config);
+ omap3_pm_early_init(omap3_mpu_rate_table, omap3_dsp_rate_table,
+ omap3_l3_rate_table);
omap2_init_common_hw(rx51_get_sdram_timings(),
- rx51_get_sdram_timings(), omap3_mpu_rate_table,
- omap3_dsp_rate_table, omap3_l3_rate_table);
+ rx51_get_sdram_timings());
omap_init_irq();
omap_gpio_init();
}
diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c
index 97df2e4..607f144 100644
--- a/arch/arm/mach-omap2/board-zoom2.c
+++ b/arch/arm/mach-omap2/board-zoom2.c
@@ -26,6 +26,7 @@
#include "mmc-twl4030.h"
#include "omap3-opp.h"
+#include "pm.h"
/* Zoom2 has Qwerty keyboard*/
static int board_keymap[] = {
@@ -214,8 +215,9 @@ static void __init omap_zoom2_init_irq(void)
{
omap_board_config = zoom2_config;
omap_board_config_size = ARRAY_SIZE(zoom2_config);
- omap2_init_common_hw(NULL, NULL, omap3_mpu_rate_table,
- omap3_dsp_rate_table, omap3_l3_rate_table);
+ omap3_pm_early_init(omap3_mpu_rate_table, omap3_dsp_rate_table,
+ omap3_l3_rate_table);
+ omap2_init_common_hw(NULL, NULL);
omap_init_irq();
omap_gpio_init();
}
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 8e0d005..3567bbe 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -283,10 +283,7 @@ static int __init _omap2_init_reprogram_sdrc(void)
}
void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
- struct omap_sdrc_params *sdrc_cs1,
- struct omap_opp *mpu_opps,
- struct omap_opp *dsp_opps,
- struct omap_opp *l3_opps)
+ struct omap_sdrc_params *sdrc_cs1)
{
struct omap_hwmod **hwmods = NULL;
@@ -301,7 +298,6 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
/* The OPP tables have to be registered before a clk init */
omap_hwmod_init(hwmods);
omap2_mux_init();
- omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
pwrdm_init(powerdomains_omap);
clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps);
omap2_clk_init();
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index f8d11a2..f535a14 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -84,5 +84,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 omap3_pm_early_init(struct omap_opp *mpu_opps,
+ struct omap_opp *dsp_opps,
+ struct omap_opp *l3_opps);
#endif
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index cea3bca..2242d23 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -39,6 +39,7 @@
#include <mach/gpmc.h>
#include <mach/dma.h>
#include <mach/dmtimer.h>
+#include <mach/omap-pm.h>
#include <asm/tlbflush.h>
@@ -1229,6 +1230,11 @@ err2:
list_del(&pwrst->node);
kfree(pwrst);
}
+
+ /* Do this late in the pm init */
+ pm_dbg_regset_init(1);
+ pm_dbg_regset_init(2);
+
return ret;
}
@@ -1275,20 +1281,20 @@ static void __init configure_vc(void)
prm_write_mod_reg(prm_setup.voltsetup2, OMAP3430_GR_MOD,
OMAP3_PRM_VOLTSETUP2_OFFSET);
- pm_dbg_regset_init(1);
- pm_dbg_regset_init(2);
}
-static int __init omap3_pm_early_init(void)
+void omap3_pm_early_init(struct omap_opp *mpu_opps,
+ struct omap_opp *dsp_opps,
+ struct omap_opp *l3_opps)
{
prm_clear_mod_reg_bits(OMAP3430_OFFMODE_POL, OMAP3430_GR_MOD,
OMAP3_PRM_POLCTRL_OFFSET);
configure_vc();
+ omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
- return 0;
+ return;
}
-arch_initcall(omap3_pm_early_init);
late_initcall(omap3_pm_init);
diff --git a/arch/arm/plat-omap/include/mach/io.h b/arch/arm/plat-omap/include/mach/io.h
index 9699030..fce5f7f 100644
--- a/arch/arm/plat-omap/include/mach/io.h
+++ b/arch/arm/plat-omap/include/mach/io.h
@@ -229,10 +229,7 @@ extern void omap1_init_common_hw(void);
extern void omap2_map_common_io(void);
extern void omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
- struct omap_sdrc_params *sdrc_cs1,
- struct omap_opp *mpu_opps,
- struct omap_opp *dsp_opps,
- struct omap_opp *l3_opps);
+ struct omap_sdrc_params *sdrc_cs1);
#define __arch_ioremap(p,s,t) omap_ioremap(p,s,t)
#define __arch_iounmap(v) omap_iounmap(v)
--
1.5.4.7
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] OMAP3: PM: Configure PRM setup times from board files
2009-10-12 13:42 [PATCH 1/3] OMAP3: PM: Fix the way OPP rate tables are initialized Rajendra Nayak
@ 2009-10-12 13:42 ` Rajendra Nayak
2009-10-12 13:42 ` [PATCH 3/3] OMAP3: PM: Configure CPUidle latencies/thresholds " Rajendra Nayak
2009-10-13 19:35 ` [PATCH 2/3] OMAP3: PM: Configure PRM setup times " Kevin Hilman
0 siblings, 2 replies; 6+ messages in thread
From: Rajendra Nayak @ 2009-10-12 13:42 UTC (permalink / raw)
To: linux-omap; +Cc: khilman, 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.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
arch/arm/mach-omap2/board-3430sdp.c | 19 ++++++++++++++++++-
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/pm.h | 3 ++-
arch/arm/mach-omap2/pm34xx.c | 7 ++++++-
12 files changed, 35 insertions(+), 12 deletions(-)
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 425f5ac..0f4ffb2 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -56,6 +56,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 board_keymap[] = {
KEY(0, 0, KEY_LEFT),
KEY(0, 1, KEY_RIGHT),
@@ -186,7 +203,7 @@ static void __init omap_3430sdp_init_irq(void)
omap_board_config = sdp3430_config;
omap_board_config_size = ARRAY_SIZE(sdp3430_config);
omap3_pm_early_init(omap3_mpu_rate_table, omap3_dsp_rate_table,
- omap3_l3_rate_table);
+ omap3_l3_rate_table, &omap3_setuptime_table);
omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL);
omap_init_irq();
omap_gpio_init();
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index 6a5c338..c6014d7 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -267,7 +267,7 @@ static void __init omap_apollon_init_irq(void)
{
omap_board_config = apollon_config;
omap_board_config_size = ARRAY_SIZE(apollon_config);
- omap3_pm_early_init(NULL, NULL, NULL);
+ omap3_pm_early_init(NULL, NULL, NULL, NULL);
omap2_init_common_hw(NULL, NULL);
omap_init_irq();
omap_gpio_init();
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 55e1f11..20f6dfe 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -38,7 +38,7 @@ static void __init omap_generic_init_irq(void)
{
omap_board_config = generic_config;
omap_board_config_size = ARRAY_SIZE(generic_config);
- omap3_pm_early_init(NULL, NULL, NULL);
+ omap3_pm_early_init(NULL, NULL, NULL, NULL);
omap2_init_common_hw(NULL, NULL);
omap_init_irq();
}
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index e8b5f6a..2757b16 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -313,7 +313,7 @@ static void __init omap_h4_init_irq(void)
{
omap_board_config = h4_config;
omap_board_config_size = ARRAY_SIZE(h4_config);
- omap3_pm_early_init(NULL, NULL, NULL)
+ omap3_pm_early_init(NULL, NULL, NULL, NULL)
omap2_init_common_hw(NULL, NULL);
omap_init_irq();
omap_gpio_init();
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 009fe39..21fae1a 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -289,7 +289,7 @@ static void __init omap_ldp_init_irq(void)
{
omap_board_config = ldp_config;
omap_board_config_size = ARRAY_SIZE(ldp_config);
- omap3_pm_early_init(NULL, NULL, NULL);
+ omap3_pm_early_init(NULL, NULL, NULL, NULL);
omap2_init_common_hw(NULL, NULL);
omap_init_irq();
omap_gpio_init();
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 097810b..056c086 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -352,7 +352,7 @@ static void __init omap3_beagle_init_irq(void)
omap_board_config = omap3_beagle_config;
omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
omap3_pm_early_init(omap3_mpu_rate_table, omap3_dsp_rate_table,
- omap3_l3_rate_table);
+ omap3_l3_rate_table, NULL);
omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params);
omap_init_irq();
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 3d05923..d1328dd 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -291,7 +291,7 @@ static void __init omap3_evm_init_irq(void)
omap_board_config = omap3_evm_config;
omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
omap3_pm_early_init(omap3_mpu_rate_table, omap3_dsp_rate_table,
- omap3_l3_rate_table);
+ omap3_l3_rate_table, NULL);
omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL);
omap_init_irq();
omap_gpio_init();
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index d487942..68bb994 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -375,7 +375,7 @@ static void __init overo_init_irq(void)
{
omap_board_config = overo_config;
omap_board_config_size = ARRAY_SIZE(overo_config);
- omap3_pm_early_init(NULL, NULL, NULL);
+ omap3_pm_early_init(NULL, NULL, NULL, NULL);
omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params);
omap_init_irq();
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 26313ee..ea51c21 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -87,7 +87,7 @@ static void __init rx51_init_irq(void)
omap_board_config = rx51_config;
omap_board_config_size = ARRAY_SIZE(rx51_config);
omap3_pm_early_init(omap3_mpu_rate_table, omap3_dsp_rate_table,
- omap3_l3_rate_table);
+ omap3_l3_rate_table, NULL);
omap2_init_common_hw(rx51_get_sdram_timings(),
rx51_get_sdram_timings());
omap_init_irq();
diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c
index 607f144..270f788 100644
--- a/arch/arm/mach-omap2/board-zoom2.c
+++ b/arch/arm/mach-omap2/board-zoom2.c
@@ -216,7 +216,7 @@ static void __init omap_zoom2_init_irq(void)
omap_board_config = zoom2_config;
omap_board_config_size = ARRAY_SIZE(zoom2_config);
omap3_pm_early_init(omap3_mpu_rate_table, omap3_dsp_rate_table,
- omap3_l3_rate_table);
+ omap3_l3_rate_table, NULL);
omap2_init_common_hw(NULL, NULL);
omap_init_irq();
omap_gpio_init();
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index f535a14..3330d7b 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -86,5 +86,6 @@ extern unsigned int omap24xx_cpu_suspend_sz;
extern unsigned int omap34xx_cpu_suspend_sz;
void omap3_pm_early_init(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);
#endif
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 2242d23..6f2fb51 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -1084,6 +1084,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;
@@ -1285,13 +1288,15 @@ static void __init configure_vc(void)
void omap3_pm_early_init(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)
{
prm_clear_mod_reg_bits(OMAP3430_OFFMODE_POL, OMAP3430_GR_MOD,
OMAP3_PRM_POLCTRL_OFFSET);
configure_vc();
omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
+ omap3_set_prm_setup_vc(setup_times);
return;
}
--
1.5.4.7
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] OMAP3: PM: Configure CPUidle latencies/thresholds from board files
2009-10-12 13:42 ` [PATCH 2/3] OMAP3: PM: Configure PRM setup times from board files Rajendra Nayak
@ 2009-10-12 13:42 ` Rajendra Nayak
2009-10-13 19:35 ` [PATCH 2/3] OMAP3: PM: Configure PRM setup times " Kevin Hilman
1 sibling, 0 replies; 6+ messages in thread
From: Rajendra Nayak @ 2009-10-12 13:42 UTC (permalink / raw)
To: linux-omap; +Cc: khilman, 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.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
arch/arm/mach-omap2/board-3430sdp.c | 21 ++++++-
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/cpuidle34xx.c | 105 ++++++++++++++++++++++++------
arch/arm/mach-omap2/pm.h | 12 +++-
arch/arm/mach-omap2/pm34xx.c | 4 +-
13 files changed, 126 insertions(+), 34 deletions(-)
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 0f4ffb2..fb0cd4c 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -73,6 +73,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 board_keymap[] = {
KEY(0, 0, KEY_LEFT),
KEY(0, 1, KEY_RIGHT),
@@ -203,7 +221,8 @@ static void __init omap_3430sdp_init_irq(void)
omap_board_config = sdp3430_config;
omap_board_config_size = ARRAY_SIZE(sdp3430_config);
omap3_pm_early_init(omap3_mpu_rate_table, omap3_dsp_rate_table,
- omap3_l3_rate_table, &omap3_setuptime_table);
+ omap3_l3_rate_table, &omap3_setuptime_table,
+ omap3_cpuidle_params_table);
omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL);
omap_init_irq();
omap_gpio_init();
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index c6014d7..c847718 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -267,7 +267,7 @@ static void __init omap_apollon_init_irq(void)
{
omap_board_config = apollon_config;
omap_board_config_size = ARRAY_SIZE(apollon_config);
- omap3_pm_early_init(NULL, NULL, NULL, NULL);
+ omap3_pm_early_init(NULL, NULL, NULL, NULL, NULL);
omap2_init_common_hw(NULL, NULL);
omap_init_irq();
omap_gpio_init();
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 20f6dfe..3053768 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -38,7 +38,7 @@ static void __init omap_generic_init_irq(void)
{
omap_board_config = generic_config;
omap_board_config_size = ARRAY_SIZE(generic_config);
- omap3_pm_early_init(NULL, NULL, NULL, NULL);
+ omap3_pm_early_init(NULL, NULL, NULL, NULL, NULL);
omap2_init_common_hw(NULL, NULL);
omap_init_irq();
}
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 2757b16..d6fc5f0 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -313,7 +313,7 @@ static void __init omap_h4_init_irq(void)
{
omap_board_config = h4_config;
omap_board_config_size = ARRAY_SIZE(h4_config);
- omap3_pm_early_init(NULL, NULL, NULL, NULL)
+ omap3_pm_early_init(NULL, NULL, NULL, NULL, NULL)
omap2_init_common_hw(NULL, NULL);
omap_init_irq();
omap_gpio_init();
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 21fae1a..dc5ce14 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -289,7 +289,7 @@ static void __init omap_ldp_init_irq(void)
{
omap_board_config = ldp_config;
omap_board_config_size = ARRAY_SIZE(ldp_config);
- omap3_pm_early_init(NULL, NULL, NULL, NULL);
+ omap3_pm_early_init(NULL, NULL, NULL, NULL, NULL);
omap2_init_common_hw(NULL, NULL);
omap_init_irq();
omap_gpio_init();
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 056c086..4856028 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -352,7 +352,7 @@ static void __init omap3_beagle_init_irq(void)
omap_board_config = omap3_beagle_config;
omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
omap3_pm_early_init(omap3_mpu_rate_table, omap3_dsp_rate_table,
- omap3_l3_rate_table, NULL);
+ omap3_l3_rate_table, NULL, NULL);
omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params);
omap_init_irq();
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index d1328dd..bb98748 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -291,7 +291,7 @@ static void __init omap3_evm_init_irq(void)
omap_board_config = omap3_evm_config;
omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
omap3_pm_early_init(omap3_mpu_rate_table, omap3_dsp_rate_table,
- omap3_l3_rate_table, NULL);
+ omap3_l3_rate_table, NULL, NULL);
omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL);
omap_init_irq();
omap_gpio_init();
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 68bb994..a560a56 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -375,7 +375,7 @@ static void __init overo_init_irq(void)
{
omap_board_config = overo_config;
omap_board_config_size = ARRAY_SIZE(overo_config);
- omap3_pm_early_init(NULL, NULL, NULL, NULL);
+ omap3_pm_early_init(NULL, NULL, NULL, NULL, NULL);
omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
mt46h32m32lf6_sdrc_params);
omap_init_irq();
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index ea51c21..23553b7 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -87,7 +87,7 @@ static void __init rx51_init_irq(void)
omap_board_config = rx51_config;
omap_board_config_size = ARRAY_SIZE(rx51_config);
omap3_pm_early_init(omap3_mpu_rate_table, omap3_dsp_rate_table,
- omap3_l3_rate_table, NULL);
+ omap3_l3_rate_table, NULL, NULL);
omap2_init_common_hw(rx51_get_sdram_timings(),
rx51_get_sdram_timings());
omap_init_irq();
diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c
index 270f788..6d14406 100644
--- a/arch/arm/mach-omap2/board-zoom2.c
+++ b/arch/arm/mach-omap2/board-zoom2.c
@@ -216,7 +216,7 @@ static void __init omap_zoom2_init_irq(void)
omap_board_config = zoom2_config;
omap_board_config_size = ARRAY_SIZE(zoom2_config);
omap3_pm_early_init(omap3_mpu_rate_table, omap3_dsp_rate_table,
- omap3_l3_rate_table, NULL);
+ omap3_l3_rate_table, NULL, NULL);
omap2_init_common_hw(NULL, NULL);
omap_init_irq();
omap_gpio_init();
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index c44a942..ea0917d 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index 3330d7b..83dd31a 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -41,8 +41,15 @@ struct prm_setup_vc {
u16 vdd1_ret;
u16 vdd1_off;
};
-extern void omap3_set_prm_setup_vc(struct prm_setup_vc *setup_vc);
+struct cpuidle_params {
+ u32 sleep_latency;
+ u32 wake_latency;
+ u32 threshold;
+};
+
+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);
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)
@@ -87,5 +94,6 @@ extern unsigned int omap34xx_cpu_suspend_sz;
void omap3_pm_early_init(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);
#endif
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 6f2fb51..5b8d948 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -1289,7 +1289,8 @@ static void __init configure_vc(void)
void omap3_pm_early_init(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)
{
prm_clear_mod_reg_bits(OMAP3430_OFFMODE_POL, OMAP3430_GR_MOD,
OMAP3_PRM_POLCTRL_OFFSET);
@@ -1297,6 +1298,7 @@ void omap3_pm_early_init(struct omap_opp *mpu_opps,
configure_vc();
omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
omap3_set_prm_setup_vc(setup_times);
+ omap3_set_idle_params(idle_params);
return;
}
--
1.5.4.7
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] OMAP3: PM: Configure PRM setup times from board files
2009-10-12 13:42 ` [PATCH 2/3] OMAP3: PM: Configure PRM setup times from board files Rajendra Nayak
2009-10-12 13:42 ` [PATCH 3/3] OMAP3: PM: Configure CPUidle latencies/thresholds " Rajendra Nayak
@ 2009-10-13 19:35 ` Kevin Hilman
2009-10-14 12:21 ` Nayak, Rajendra
1 sibling, 1 reply; 6+ messages in thread
From: Kevin Hilman @ 2009-10-13 19:35 UTC (permalink / raw)
To: Rajendra Nayak; +Cc: linux-omap
Rajendra Nayak <rnayak@ti.com> writes:
> 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.
>
> Signed-off-by: Rajendra Nayak <rnayak@ti.com>
[...]
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> index 2242d23..6f2fb51 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -1084,6 +1084,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;
> @@ -1285,13 +1288,15 @@ static void __init configure_vc(void)
>
> void omap3_pm_early_init(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)
> {
> prm_clear_mod_reg_bits(OMAP3430_OFFMODE_POL, OMAP3430_GR_MOD,
> OMAP3_PRM_POLCTRL_OFFSET);
>
> configure_vc();
> omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
> + omap3_set_prm_setup_vc(setup_times);
I think there's an ordering problem here since the configure_vc()
which uses the values is called before the setup_vc().
Also, if setup_times is passed as NULL, configure_vc() will be writing
wrong values with undefined results to the VC.
Also, if my proposed omap3_pm_init_vc() approach is taken and it is
optional, some sort of defaults should probably be set.
Kevin
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 2/3] OMAP3: PM: Configure PRM setup times from board files
2009-10-13 19:35 ` [PATCH 2/3] OMAP3: PM: Configure PRM setup times " Kevin Hilman
@ 2009-10-14 12:21 ` Nayak, Rajendra
2009-10-14 13:10 ` Kevin Hilman
0 siblings, 1 reply; 6+ messages in thread
From: Nayak, Rajendra @ 2009-10-14 12:21 UTC (permalink / raw)
To: Kevin Hilman; +Cc: linux-omap@vger.kernel.org
>-----Original Message-----
>From: Kevin Hilman [mailto:khilman@deeprootsystems.com]
>Sent: Wednesday, October 14, 2009 1:05 AM
>To: Nayak, Rajendra
>Cc: linux-omap@vger.kernel.org
>Subject: Re: [PATCH 2/3] OMAP3: PM: Configure PRM setup times
>from board files
>
>Rajendra Nayak <rnayak@ti.com> writes:
>
>> 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.
>>
>> Signed-off-by: Rajendra Nayak <rnayak@ti.com>
>
>[...]
>
>> diff --git a/arch/arm/mach-omap2/pm34xx.c
>b/arch/arm/mach-omap2/pm34xx.c
>> index 2242d23..6f2fb51 100644
>> --- a/arch/arm/mach-omap2/pm34xx.c
>> +++ b/arch/arm/mach-omap2/pm34xx.c
>> @@ -1084,6 +1084,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;
>> @@ -1285,13 +1288,15 @@ static void __init configure_vc(void)
>>
>> void omap3_pm_early_init(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)
>> {
>> prm_clear_mod_reg_bits(OMAP3430_OFFMODE_POL, OMAP3430_GR_MOD,
>> OMAP3_PRM_POLCTRL_OFFSET);
>>
>> configure_vc();
>> omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
>> + omap3_set_prm_setup_vc(setup_times);
>
>I think there's an ordering problem here since the configure_vc()
>which uses the values is called before the setup_vc().
Yes, the ordering seems to be certainly wrong. I will fix that in the
updated patch-set.
>
>Also, if setup_times is passed as NULL, configure_vc() will be writing
>wrong values with undefined results to the VC.
I guess not, since it uses default values from the prm_setup table defined
in pm34xx.c which are not optimal but certainally not wrong. No?
Same is the case with cpuidle params as well.
>
>Also, if my proposed omap3_pm_init_vc() approach is taken and it is
>optional, some sort of defaults should probably be set.
>
>Kevin
>
>
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] OMAP3: PM: Configure PRM setup times from board files
2009-10-14 12:21 ` Nayak, Rajendra
@ 2009-10-14 13:10 ` Kevin Hilman
0 siblings, 0 replies; 6+ messages in thread
From: Kevin Hilman @ 2009-10-14 13:10 UTC (permalink / raw)
To: Nayak, Rajendra; +Cc: linux-omap@vger.kernel.org
"Nayak, Rajendra" <rnayak@ti.com> writes:
>>
>>[...]
>>
>>> diff --git a/arch/arm/mach-omap2/pm34xx.c
>>b/arch/arm/mach-omap2/pm34xx.c
>>> index 2242d23..6f2fb51 100644
>>> --- a/arch/arm/mach-omap2/pm34xx.c
>>> +++ b/arch/arm/mach-omap2/pm34xx.c
>>> @@ -1084,6 +1084,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;
>>> @@ -1285,13 +1288,15 @@ static void __init configure_vc(void)
>>>
>>> void omap3_pm_early_init(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)
>>> {
>>> prm_clear_mod_reg_bits(OMAP3430_OFFMODE_POL, OMAP3430_GR_MOD,
>>> OMAP3_PRM_POLCTRL_OFFSET);
>>>
>>> configure_vc();
>>> omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
>>> + omap3_set_prm_setup_vc(setup_times);
>>
>>I think there's an ordering problem here since the configure_vc()
>>which uses the values is called before the setup_vc().
>
> Yes, the ordering seems to be certainly wrong. I will fix that in the
> updated patch-set.
>
>>
>>Also, if setup_times is passed as NULL, configure_vc() will be writing
>>wrong values with undefined results to the VC.
>
> I guess not, since it uses default values from the prm_setup table defined
> in pm34xx.c which are not optimal but certainally not wrong. No?
> Same is the case with cpuidle params as well.
Ah, you're right. I saw the defaults in cpuidle, but not in pm34xx.c.
That should be fine. Then, having these defaults will make the init
call optional and only needed in boards that want to override.
Thanks,
Kevin
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-10-14 13:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-12 13:42 [PATCH 1/3] OMAP3: PM: Fix the way OPP rate tables are initialized Rajendra Nayak
2009-10-12 13:42 ` [PATCH 2/3] OMAP3: PM: Configure PRM setup times from board files Rajendra Nayak
2009-10-12 13:42 ` [PATCH 3/3] OMAP3: PM: Configure CPUidle latencies/thresholds " Rajendra Nayak
2009-10-13 19:35 ` [PATCH 2/3] OMAP3: PM: Configure PRM setup times " Kevin Hilman
2009-10-14 12:21 ` Nayak, Rajendra
2009-10-14 13:10 ` Kevin Hilman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox