diff options
author | Tony Lindgren <tony@atomide.com> | 2006-09-25 05:41:20 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2006-09-25 05:41:20 -0400 |
commit | ae78dcf79aefa98a1ed245898467eb6d3bfc11e6 (patch) | |
tree | 9aa69ece663dd5c8ed4ec5ec1cb776be04ec25b6 /arch/arm/mach-omap2 | |
parent | 7c250413e5b7c3dfae89354725b70c76d7621395 (diff) |
ARM: OMAP: Avoid sleeping during arch_reset
If we call clk_get() from arch_reset we get ugly messages before
reboot.
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/clock.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prcm.c | 10 |
2 files changed, 23 insertions, 7 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index d1b648a4efbf..3d0792e0366b 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
@@ -36,6 +36,8 @@ | |||
36 | 36 | ||
37 | static struct prcm_config *curr_prcm_set; | 37 | static struct prcm_config *curr_prcm_set; |
38 | static u32 curr_perf_level = PRCM_FULL_SPEED; | 38 | static u32 curr_perf_level = PRCM_FULL_SPEED; |
39 | static struct clk *vclk; | ||
40 | static struct clk *sclk; | ||
39 | 41 | ||
40 | /*------------------------------------------------------------------------- | 42 | /*------------------------------------------------------------------------- |
41 | * Omap2 specific clock functions | 43 | * Omap2 specific clock functions |
@@ -984,6 +986,20 @@ static void __init omap2_get_crystal_rate(struct clk *osc, struct clk *sys) | |||
984 | sys->rate = sclk; | 986 | sys->rate = sclk; |
985 | } | 987 | } |
986 | 988 | ||
989 | /* | ||
990 | * Set clocks for bypass mode for reboot to work. | ||
991 | */ | ||
992 | void omap2_clk_prepare_for_reboot(void) | ||
993 | { | ||
994 | u32 rate; | ||
995 | |||
996 | if (vclk == NULL || sclk == NULL) | ||
997 | return; | ||
998 | |||
999 | rate = clk_get_rate(sclk); | ||
1000 | clk_set_rate(vclk, rate); | ||
1001 | } | ||
1002 | |||
987 | #ifdef CONFIG_OMAP_RESET_CLOCKS | 1003 | #ifdef CONFIG_OMAP_RESET_CLOCKS |
988 | static void __init omap2_disable_unused_clocks(void) | 1004 | static void __init omap2_disable_unused_clocks(void) |
989 | { | 1005 | { |
@@ -1080,5 +1096,9 @@ int __init omap2_clk_init(void) | |||
1080 | if (cpu_is_omap2430()) | 1096 | if (cpu_is_omap2430()) |
1081 | clk_enable(&sdrc_ick); | 1097 | clk_enable(&sdrc_ick); |
1082 | 1098 | ||
1099 | /* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */ | ||
1100 | vclk = clk_get(NULL, "virt_prcm_set"); | ||
1101 | sclk = clk_get(NULL, "sys_ck"); | ||
1102 | |||
1083 | return 0; | 1103 | return 0; |
1084 | } | 1104 | } |
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c index c2bf57ef6825..90f530540c65 100644 --- a/arch/arm/mach-omap2/prcm.c +++ b/arch/arm/mach-omap2/prcm.c | |||
@@ -19,6 +19,8 @@ | |||
19 | 19 | ||
20 | #include "prcm-regs.h" | 20 | #include "prcm-regs.h" |
21 | 21 | ||
22 | extern void omap2_clk_prepare_for_reboot(void); | ||
23 | |||
22 | u32 omap_prcm_get_reset_sources(void) | 24 | u32 omap_prcm_get_reset_sources(void) |
23 | { | 25 | { |
24 | return RM_RSTST_WKUP & 0x7f; | 26 | return RM_RSTST_WKUP & 0x7f; |
@@ -28,12 +30,6 @@ EXPORT_SYMBOL(omap_prcm_get_reset_sources); | |||
28 | /* Resets clock rates and reboots the system. Only called from system.h */ | 30 | /* Resets clock rates and reboots the system. Only called from system.h */ |
29 | void omap_prcm_arch_reset(char mode) | 31 | void omap_prcm_arch_reset(char mode) |
30 | { | 32 | { |
31 | u32 rate; | 33 | omap2_clk_prepare_for_reboot(); |
32 | struct clk *vclk, *sclk; | ||
33 | |||
34 | vclk = clk_get(NULL, "virt_prcm_set"); | ||
35 | sclk = clk_get(NULL, "sys_ck"); | ||
36 | rate = clk_get_rate(sclk); | ||
37 | clk_set_rate(vclk, rate); /* go to bypass for OMAP limitation */ | ||
38 | RM_RSTCTRL_WKUP |= 2; | 34 | RM_RSTCTRL_WKUP |= 2; |
39 | } | 35 | } |