Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] sh: Make peripheral clock frequency setting mandatory

Pretty much every subtype does this now anyways, and as we depend on it in a
few places being set to something sensible quite early on, it's better for a
new subtype to simply set a sensible default.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Paul Mundt and committed by
Linus Torvalds
134ed142 74017294

+1 -18
-6
arch/sh/Kconfig
··· 396 396 397 397 source "arch/sh/boards/renesas/rts7751r2d/Kconfig" 398 398 399 - config SH_PCLK_FREQ_BOOL 400 - bool "Set default pclk frequency" 401 - default y if !SH_RTC 402 - default n 403 - 404 399 config SH_PCLK_FREQ 405 400 int "Peripheral clock frequency (in Hz)" 406 - depends on SH_PCLK_FREQ_BOOL 407 401 default "50000000" if CPU_SUBTYPE_SH7750 || CPU_SUBTYPE_SH7780 408 402 default "60000000" if CPU_SUBTYPE_SH7751 409 403 default "33333333" if CPU_SUBTYPE_SH7300 || CPU_SUBTYPE_SH7770 || CPU_SUBTYPE_SH7760
+1 -12
arch/sh/kernel/cpu/clock.c
··· 38 38 static struct clk master_clk = { 39 39 .name = "master_clk", 40 40 .flags = CLK_ALWAYS_ENABLED | CLK_RATE_PROPAGATES, 41 - #ifdef CONFIG_SH_PCLK_FREQ_BOOL 42 41 .rate = CONFIG_SH_PCLK_FREQ, 43 - #endif 44 42 }; 45 43 46 44 static struct clk module_clk = { ··· 225 227 { 226 228 int i, ret = 0; 227 229 228 - if (unlikely(!master_clk.rate)) 229 - /* 230 - * NOTE: This will break if the default divisor has been 231 - * changed. 232 - * 233 - * No one should be changing the default on us however, 234 - * expect that a sane value for CONFIG_SH_PCLK_FREQ will 235 - * be defined in the event of a different divisor. 236 - */ 237 - master_clk.rate = get_timer_frequency() * 4; 230 + BUG_ON(unlikely(!master_clk.rate)); 238 231 239 232 for (i = 0; i < ARRAY_SIZE(onchip_clocks); i++) { 240 233 struct clk *clk = onchip_clocks[i];