Commit ae78dcf7 authored by Tony Lindgren's avatar Tony Lindgren

ARM: OMAP: Avoid sleeping during arch_reset

If we call clk_get() from arch_reset we get ugly messages before
reboot.
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 7c250413
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
static struct prcm_config *curr_prcm_set; static struct prcm_config *curr_prcm_set;
static u32 curr_perf_level = PRCM_FULL_SPEED; static u32 curr_perf_level = PRCM_FULL_SPEED;
static struct clk *vclk;
static struct clk *sclk;
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* Omap2 specific clock functions * Omap2 specific clock functions
...@@ -984,6 +986,20 @@ static void __init omap2_get_crystal_rate(struct clk *osc, struct clk *sys) ...@@ -984,6 +986,20 @@ static void __init omap2_get_crystal_rate(struct clk *osc, struct clk *sys)
sys->rate = sclk; 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 #ifdef CONFIG_OMAP_RESET_CLOCKS
static void __init omap2_disable_unused_clocks(void) static void __init omap2_disable_unused_clocks(void)
{ {
...@@ -1080,5 +1096,9 @@ int __init omap2_clk_init(void) ...@@ -1080,5 +1096,9 @@ int __init omap2_clk_init(void)
if (cpu_is_omap2430()) if (cpu_is_omap2430())
clk_enable(&sdrc_ick); 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; return 0;
} }
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#include "prcm-regs.h" #include "prcm-regs.h"
extern void omap2_clk_prepare_for_reboot(void);
u32 omap_prcm_get_reset_sources(void) u32 omap_prcm_get_reset_sources(void)
{ {
return RM_RSTST_WKUP & 0x7f; return RM_RSTST_WKUP & 0x7f;
...@@ -28,12 +30,6 @@ EXPORT_SYMBOL(omap_prcm_get_reset_sources); ...@@ -28,12 +30,6 @@ EXPORT_SYMBOL(omap_prcm_get_reset_sources);
/* Resets clock rates and reboots the system. Only called from system.h */ /* Resets clock rates and reboots the system. Only called from system.h */
void omap_prcm_arch_reset(char mode) void omap_prcm_arch_reset(char mode)
{ {
u32 rate; omap2_clk_prepare_for_reboot();
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 */
RM_RSTCTRL_WKUP |= 2; RM_RSTCTRL_WKUP |= 2;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment