omap: Enable GPMC clock in gpmc_init
Subsystems (6)
PATCH 1/1 omap: Enable GPMC clock in gpmc_init
Don't assume that gpmc_l3_clk is on, enable it before touching configuration registers.
arch/arm/mach-omap2/gpmc.c +2 -0
@@ -534,6 +534,8 @@ void __init gpmc_init(void)BUG (); } +clk_enable (gpmc_l3_clk); + l =gpmc_read_reg (GPMC_REVISION );printk (KERN_INFO "GPMC revision %d.%d\n" , (l >>4 ) &0x0f , l &0x0f );/* Set smart idle mode and automatic L3 clock gating */
Tony Lindgren
maintainerQuoted 2 lines · Olof Johansson
Don't assume that
gpmc_l3_clkis on, enable it before touching configuration registers.
Seems like this is OK to do even though we do not disable it anywhere currently since we're setting smart idle and L3 autogating also in gpmc_init. So adding to omap-fixes.
Regards,
Tony
Quoted 16 lines
Signed-off-by Olof Johansson <[email protected]>arch/arm/mach-omap2/gpmc.c +2
-0@@ -534,6 +534,8 @@ void __init gpmc_init(void)BUG (); } +clk_enable (gpmc_l3_clk); + l =gpmc_read_reg (GPMC_REVISION );printk (KERN_INFO "GPMC revision %d.%d\n" , (l >>4 ) &0x0f , l &0x0f );/* Set smart idle mode and automatic L3 clock gating */
Tony Lindgren
maintainerPATCH 1/1 omap: Enable GPMC clock in gpmc_init
In reply to Olof JohanssonThis patch has been applied to the linux-omap
by youw fwiendly patch wobot.
Branch in linux-omap: omap-fixes
Initial commit ID (Likely to change): adbf7434abf0c710a5253438fd7a7d12db26272a
PatchWorks
http://patchwork.kernel.org/patch/74138/
Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=adbf7434abf0c710a5253438fd7a7d12db26272a
Paul Walmsley
maintainerHello Olof,
Quoted 11 lines · Olof Johansson
Don't assume that
gpmc_l3_clkis on, enable it before touching configuration registers.Signed-off-by Olof Johansson <[email protected]>arch/arm/mach-omap2/gpmc.c +0
-0
arch/arm/mach-omap2/gpmc.c void __init gpmc_init(void) · line 541
Quoted 8 lines
arch/arm/mach-omap2/gpmc.c +2
-0@@ -534,6 +534,8 @@ void __init gpmc_init(void)BUG (); } +clk_enable (gpmc_l3_clk); + l =gpmc_read_reg (GPMC_REVISION );printk (KERN_INFO "GPMC revision %d.%d\n" , (l >>4 ) &0x0f , l &0x0f );/* Set smart idle mode and automatic L3 clock gating */
Care to try an approach similar to the following? Compile-tested, but otherwise untested.
- Paul
Quoted 1 line
From
93bef5c90eed5247cfeada601beacdc734891924Mon Sep 17 00:00:00 2001
From: Paul Walmsley <[email protected]>
Date: Wed, 20 Jan 2010 18:16:18 -0700
Subject: [PATCH] OMAP GPMC: add fine-grained clock control
OMAP4 GPMC has a software-controllable GPMC clock gate, so, take advantage of it by only enabling the GPMC clock when needed. Since OMAP2xxx/3 don't have a separate software-controllable GPMC clock, this change should not affect these platforms, aside from slowing some of the gpmc.c functions down slightly.
Also rename "gpmc_l3_clk" to the more generic "gpmc_clk".
Since the GPMC clock is now enabled and disabled on demand, the ENABLE_ON_INIT clock flag can be removed from the GPMC clocks; do so.
While here, add some to-do items to the initial comment block.
Finally, add a gpmc_ocp_barrier() function, intended to ensure that all register writes to the GPMC are complete before disabling the GPMC clock. Barriers are added where they appear to be needed.
--- arch/arm/mach-omap2/clock2xxx_data.c | 1 - arch/arm/mach-omap2/clock34xx_data.c | 1 - arch/arm/mach-omap2/gpmc.c | 92 ++++++++++++++++++++++++++++------ 3 files changed, 76 insertions(+), 18 deletions(-)
arch/arm/mach-omap2/clock2xxx_data.c +0 -1
@@ -1804,7 +1804,6 @@ static struct clk gpmc_fck = { .name = "gpmc_fck", .ops = &clkops_null, /* RMK: missing? */ .parent = &core_l3_ck, - .flags = ENABLE_ON_INIT, .clkdm_name = "core_l3_clkdm", .recalc = &followparent_recalc, };
arch/arm/mach-omap2/clock34xx_data.c +0 -1
@@ -1654,7 +1654,6 @@ static struct clk gpmc_fck = { .name = "gpmc_fck", .ops = &clkops_null, .parent = &core_l3_ick, - .flags = ENABLE_ON_INIT, /* huh? */ .clkdm_name = "core_l3_clkdm", .recalc = &followparent_recalc, };
arch/arm/mach-omap2/gpmc.c +76 -16
259 lines not on this page · raw message
Signature · 1 line
1.6.6.rc2.5.g49666
Paul Walmsley
maintainerI forgot to mention, it applies on top of your patch.
- Paul