aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Felker <dalias@libc.org>2016-07-30 23:11:30 -0400
committerRich Felker <dalias@libc.org>2016-08-04 23:29:45 -0400
commit15f0c8f2f378a05fe7b25e545c353a6b5cf5126a (patch)
treea197be242f661f87b455def1c68ca349f0ce8833
parent74bdaa611fa69368fb4032ad437af073d31116bd (diff)
sh: use common clock framework with device tree boards
Enable common clk framework for DT-based boards and disable code that depends on the legacy sh clk framework when common clk is enabled. Once legacy drivers are converted over, the old code can be removed entirely. Signed-off-by: Rich Felker <dalias@libc.org>
-rw-r--r--arch/sh/boards/Kconfig1
-rw-r--r--arch/sh/kernel/cpu/clock.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig
index e0db04664e2e..e9c2c42031fe 100644
--- a/arch/sh/boards/Kconfig
+++ b/arch/sh/boards/Kconfig
@@ -11,6 +11,7 @@ config SH_DEVICE_TREE
11 select OF 11 select OF
12 select OF_EARLY_FLATTREE 12 select OF_EARLY_FLATTREE
13 select CLKSRC_OF 13 select CLKSRC_OF
14 select COMMON_CLK
14 select GENERIC_CALIBRATE_DELAY 15 select GENERIC_CALIBRATE_DELAY
15 help 16 help
16 Select Board Described by Device Tree to build a kernel that 17 Select Board Described by Device Tree to build a kernel that
diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c
index 4187cf4fe185..fca9b1e78a63 100644
--- a/arch/sh/kernel/cpu/clock.c
+++ b/arch/sh/kernel/cpu/clock.c
@@ -24,11 +24,13 @@ int __init clk_init(void)
24{ 24{
25 int ret; 25 int ret;
26 26
27#ifndef CONFIG_COMMON_CLK
27 ret = arch_clk_init(); 28 ret = arch_clk_init();
28 if (unlikely(ret)) { 29 if (unlikely(ret)) {
29 pr_err("%s: CPU clock registration failed.\n", __func__); 30 pr_err("%s: CPU clock registration failed.\n", __func__);
30 return ret; 31 return ret;
31 } 32 }
33#endif
32 34
33 if (sh_mv.mv_clk_init) { 35 if (sh_mv.mv_clk_init) {
34 ret = sh_mv.mv_clk_init(); 36 ret = sh_mv.mv_clk_init();
@@ -39,11 +41,13 @@ int __init clk_init(void)
39 } 41 }
40 } 42 }
41 43
44#ifndef CONFIG_COMMON_CLK
42 /* Kick the child clocks.. */ 45 /* Kick the child clocks.. */
43 recalculate_root_clocks(); 46 recalculate_root_clocks();
44 47
45 /* Enable the necessary init clocks */ 48 /* Enable the necessary init clocks */
46 clk_enable_init_clocks(); 49 clk_enable_init_clocks();
50#endif
47 51
48 return ret; 52 return ret;
49} 53}