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

sh: Only provide a PCLK definition for legacy CPG CPUs.

As CPUs are migrated over to more fully-featured clock frameworks of
their own and off of the legacy CPG code, they no longer have any real
need for defining the PCLK value. The PCLK define in itself is already
fairly misleading, as many boards get their input clocks from different
sources, making this value fairly arbitrary anyways.

Outside of the legacy CPG clock framework, the only place where this
value is used is for deriving CLOCK_TICK_RATE, which we set back to the
legacy PIT value that it was before the PCLK definitions were added in
the first place.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+19 -7
+9 -7
arch/sh/Kconfig
··· 540 540 541 541 config SH_PCLK_FREQ 542 542 int "Peripheral clock frequency (in Hz)" 543 - default "27000000" if CPU_SUBTYPE_SH7343 543 + depends on SH_CLK_CPG_LEGACY 544 544 default "31250000" if CPU_SUBTYPE_SH7619 545 - default "32000000" if CPU_SUBTYPE_SH7722 546 - default "33333333" if CPU_SUBTYPE_SH7770 || CPU_SUBTYPE_SH7723 || \ 547 - CPU_SUBTYPE_SH7760 || CPU_SUBTYPE_SH7705 || \ 548 - CPU_SUBTYPE_SH7203 || CPU_SUBTYPE_SH7206 || \ 549 - CPU_SUBTYPE_SH7263 || CPU_SUBTYPE_MXG || \ 550 - CPU_SUBTYPE_SH7786 || CPU_SUBTYPE_SH7724 545 + default "33333333" if CPU_SUBTYPE_SH7770 || \ 546 + CPU_SUBTYPE_SH7760 || \ 547 + CPU_SUBTYPE_SH7705 || \ 548 + CPU_SUBTYPE_SH7203 || \ 549 + CPU_SUBTYPE_SH7206 || \ 550 + CPU_SUBTYPE_SH7263 || \ 551 + CPU_SUBTYPE_MXG || \ 552 + CPU_SUBTYPE_SH7786 551 553 default "60000000" if CPU_SUBTYPE_SH7751 || CPU_SUBTYPE_SH7751R 552 554 default "66000000" if CPU_SUBTYPE_SH4_202 553 555 default "50000000"
+10
arch/sh/include/asm/timex.h
··· 6 6 #ifndef __ASM_SH_TIMEX_H 7 7 #define __ASM_SH_TIMEX_H 8 8 9 + /* 10 + * Only parts using the legacy CPG code for their clock framework 11 + * implementation need to define their own Pclk value. If provided, this 12 + * can be used for accurately setting CLOCK_TICK_RATE, otherwise we 13 + * simply fall back on the i8253 PIT value. 14 + */ 15 + #ifdef CONFIG_SH_PCLK_FREQ 9 16 #define CLOCK_TICK_RATE (CONFIG_SH_PCLK_FREQ / 4) /* Underlying HZ */ 17 + #else 18 + #define CLOCK_TICK_RATE 1193180 19 + #endif 10 20 11 21 #include <asm-generic/timex.h> 12 22