]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Avoid sleeping during arch_reset
authorTony Lindgren <tony@atomide.com>
Thu, 3 Aug 2006 10:46:57 +0000 (13:46 +0300)
committerTony Lindgren <tony@atomide.com>
Thu, 3 Aug 2006 10:46:57 +0000 (13:46 +0300)
If we call clk_get() from arch_reset we get ugly messages before
reboot.

Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/clock.c
arch/arm/mach-omap2/prcm.c

index 6789dd4029a1acb71efb63d83704ca149001d92d..dc5fe5f65364e76173c6e3a1c25ad29b665e303c 100644 (file)
@@ -37,6 +37,8 @@
 
 static struct prcm_config *curr_prcm_set;
 static u32 curr_perf_level = PRCM_FULL_SPEED;
+static struct clk *vclk;
+static struct clk *sclk;
 
 /*-------------------------------------------------------------------------
  * Omap2 specific clock functions
@@ -985,6 +987,20 @@ static void __init omap2_get_crystal_rate(struct clk *osc, struct clk *sys)
        sys->rate = sclk;
 }
 
+/*
+ * Set clocks for bypass mode for reboot to work.
+ */
+void omap2_clk_prepare_for_reboot(void)
+{
+       u32 rate;
+
+       if (vclk == NULL || sclk == NULL)
+               return;
+
+       rate = clk_get_rate(sclk);
+       clk_set_rate(vclk, rate);
+}
+
 #ifdef CONFIG_OMAP_RESET_CLOCKS
 static void __init omap2_disable_unused_clocks(void)
 {
@@ -1081,5 +1097,9 @@ int __init omap2_clk_init(void)
        if (cpu_is_omap2430())
                clk_enable(&sdrc_ick);
 
+       /* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */
+       vclk = clk_get(NULL, "virt_prcm_set");
+       sclk = clk_get(NULL, "sys_ck");
+
        return 0;
 }
index 8893479dc7e0262777e7fa612eef298a2958839b..7c9b669be37d1aa3a0452ccdf752f397c42d3678 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "prcm-regs.h"
 
+extern void omap2_clk_prepare_for_reboot(void);
+
 u32 omap_prcm_get_reset_sources(void)
 {
        return RM_RSTST_WKUP & 0x7f;
@@ -29,12 +31,6 @@ EXPORT_SYMBOL(omap_prcm_get_reset_sources);
 /* Resets clock rates and reboots the system. Only called from system.h */
 void omap_prcm_arch_reset(char mode)
 {
-       u32 rate;
-       struct clk *vclk, *sclk;
-
-       vclk = clk_get(NULL, "virt_prcm_set");
-       sclk = clk_get(NULL, "sys_ck");
-       rate = clk_get_rate(sclk);
-       clk_set_rate(vclk, rate);       /* go to bypass for OMAP limitation */
+       omap2_clk_prepare_for_reboot();
        RM_RSTCTRL_WKUP |= 2;
 }