* [PM][PATCH] omap3: cpufreq: allow default opp table init
@ 2010-05-20 1:14 Nishanth Menon
2010-05-28 18:38 ` Kevin Hilman
0 siblings, 1 reply; 2+ messages in thread
From: Nishanth Menon @ 2010-05-20 1:14 UTC (permalink / raw)
To: linux-omap; +Cc: Nishanth Menon, Cliff Brake, Kevin Hilman
For board files which choose to override the defaults, the existing
mechanism will work, for boards that would like to work with defaults,
allow init_common_hw to call init_opp_table to initialize if not
already initialized. this will allow all omap boards which have opp
tables predefined for a silicon to use the same.
Originally reported for overo:
http://marc.info/?t=127265269400004&r=1&w=2
Signed-off-by: Nishanth Menon <nm@ti.com>
Reported-by: Peter Tseng <tsenpet09@gmail.com>
Cc: Cliff Brake <cliff.brake@gmail.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
---
NOTE: This makes rest of the current board omap3_pm_init_opp_table
calls redundant, but also allows for custom boards to go ahead and
customize their own custom OPPs in parallel.
arch/arm/mach-omap2/cpufreq34xx.c | 11 +++++++++++
arch/arm/mach-omap2/io.c | 4 ++++
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/cpufreq34xx.c b/arch/arm/mach-omap2/cpufreq34xx.c
index 8747dd6..b9d75cf 100644
--- a/arch/arm/mach-omap2/cpufreq34xx.c
+++ b/arch/arm/mach-omap2/cpufreq34xx.c
@@ -110,6 +110,9 @@ static struct omap_opp_def __initdata omap36xx_dsp_rate_table[] = {
OMAP_OPP_DEF(0, 0, 0)
};
+/* Temp variable to allow multiple calls */
+static u8 __initdata omap3_table_init;
+
int __init omap3_pm_init_opp_table(void)
{
int i, r;
@@ -130,6 +133,14 @@ int __init omap3_pm_init_opp_table(void)
OPP_DSP
};
+ /*
+ * Allow multiple calls, but initialize only if not already initalized
+ * even if the previous call failed, coz, no reason we'd succeed again
+ */
+ if (omap3_table_init)
+ return 0;
+ omap3_table_init = 1;
+
omap3_opp_def_list = cpu_is_omap3630() ? omap36xx_opp_def_list :
omap34xx_opp_def_list;
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 984bdbf..203c7e8 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -47,6 +47,7 @@
#include "clockdomains.h"
#include <plat/omap_hwmod.h>
+#include "omap3-opp.h"
/*
* The machine specific code may provide the extra mapping besides the
* default mapping provided here.
@@ -307,6 +308,9 @@ 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)
{
+ /* initialize the opp table if board file has not done so */
+ omap3_pm_init_opp_table();
+
pwrdm_init(powerdomains_omap);
clkdm_init(clockdomains_omap, clkdm_autodeps);
if (cpu_is_omap242x())
--
1.6.3.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PM][PATCH] omap3: cpufreq: allow default opp table init
2010-05-20 1:14 [PM][PATCH] omap3: cpufreq: allow default opp table init Nishanth Menon
@ 2010-05-28 18:38 ` Kevin Hilman
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Hilman @ 2010-05-28 18:38 UTC (permalink / raw)
To: Nishanth Menon; +Cc: linux-omap, Cliff Brake
Nishanth Menon <nm@ti.com> writes:
> For board files which choose to override the defaults, the existing
> mechanism will work, for boards that would like to work with defaults,
> allow init_common_hw to call init_opp_table to initialize if not
> already initialized. this will allow all omap boards which have opp
> tables predefined for a silicon to use the same.
>
> Originally reported for overo:
> http://marc.info/?t=127265269400004&r=1&w=2
>
> Signed-off-by: Nishanth Menon <nm@ti.com>
> Reported-by: Peter Tseng <tsenpet09@gmail.com>
> Cc: Cliff Brake <cliff.brake@gmail.com>
> Cc: Kevin Hilman <khilman@deeprootsystems.com>
I like this better than having all the board files having to
explicitly call this.
Adding it to the pm-cpufreq branch, to be posted after the OPP
series (hopefully later today, or Monday.)
Kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-28 18:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-20 1:14 [PM][PATCH] omap3: cpufreq: allow default opp table init Nishanth Menon
2010-05-28 18:38 ` Kevin Hilman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.