Skip to content

Commit 15f0c8f

Browse files
author
Rich Felker
committed
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>
1 parent 74bdaa6 commit 15f0c8f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

arch/sh/boards/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ config SH_DEVICE_TREE
1111
select OF
1212
select OF_EARLY_FLATTREE
1313
select CLKSRC_OF
14+
select COMMON_CLK
1415
select GENERIC_CALIBRATE_DELAY
1516
help
1617
Select Board Described by Device Tree to build a kernel that

arch/sh/kernel/cpu/clock.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ int __init clk_init(void)
2424
{
2525
int ret;
2626

27+
#ifndef CONFIG_COMMON_CLK
2728
ret = arch_clk_init();
2829
if (unlikely(ret)) {
2930
pr_err("%s: CPU clock registration failed.\n", __func__);
3031
return ret;
3132
}
33+
#endif
3234

3335
if (sh_mv.mv_clk_init) {
3436
ret = sh_mv.mv_clk_init();
@@ -39,11 +41,13 @@ int __init clk_init(void)
3941
}
4042
}
4143

44+
#ifndef CONFIG_COMMON_CLK
4245
/* Kick the child clocks.. */
4346
recalculate_root_clocks();
4447

4548
/* Enable the necessary init clocks */
4649
clk_enable_init_clocks();
50+
#endif
4751

4852
return ret;
4953
}

0 commit comments

Comments
 (0)