[PATCH] arch/i386: Fix the AMD Elan SC520 PIT clock source to 1.18920MHz

From: Ognjen Jovandić
Date: Thu Jul 07 2022 - 14:27:19 EST


From: Ognjen Jovandić <ognjen.jovandic.5@xxxxxxxxxx>

x86/i386: Fix the AMD Elan SC520 PIT clock source to 1.18920MHz, which deviates from
standard PC/AT clones.
Signed-off-by: Ognjen Jovandić <ognjen.jovandic.5@xxxxxxxxxx>
---
Changed PIT_TICK_RATE to 1189200ul which i found in Élan™SC520
Microcontroller User’s Manual Chapter 5 CLOCK GENERATION AND CONTROL.
Found problem while trying to port OpeWrt 21.04 to Soekris net4501.
--- a/arch/x86/include/asm/timex.h
+++ b/arch/x86/include/asm/timex.h
@@ -5,9 +5,19 @@
#include <asm/processor.h>
#include <asm/tsc.h>

+
+#ifdef CONFIG_MELAN
+
+#define CLOCK_TICK_RATE 1189200ul
+
+#else
+
/* Assume we use the PIT time source for the clock tick */
#define CLOCK_TICK_RATE PIT_TICK_RATE

+#endif
+
+
#define ARCH_HAS_READ_CURRENT_TIMER

#endif /* _ASM_X86_TIMEX_H */