From f49c20d28ff6867752f2795107ff8287162301c4 Mon Sep 17 00:00:00 2001 From: Stuart Ianna Date: Tue, 24 Jan 2023 12:40:07 +1100 Subject: [PATCH] litex: System clock frequency selectable from Kconfig. --- arch/risc-v/src/litex/Kconfig | 6 ++++++ arch/risc-v/src/litex/litex_clockconfig.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/risc-v/src/litex/Kconfig b/arch/risc-v/src/litex/Kconfig index 1f20f37372..846bed7109 100644 --- a/arch/risc-v/src/litex/Kconfig +++ b/arch/risc-v/src/litex/Kconfig @@ -5,6 +5,12 @@ comment "LITEX Configuration Options" +config LITEX_SYS_CORE_FREQ_HZ + int "Risc-V system core frequency (Hz)" + default 100000000 + ---help--- + This value should match default frequency of the FPGA fabric system clock. + menu "LITEX Peripheral Support" # These "hidden" settings determine whether a peripheral option is available diff --git a/arch/risc-v/src/litex/litex_clockconfig.c b/arch/risc-v/src/litex/litex_clockconfig.c index 00bc573e88..c72f9e2e43 100644 --- a/arch/risc-v/src/litex/litex_clockconfig.c +++ b/arch/risc-v/src/litex/litex_clockconfig.c @@ -50,7 +50,7 @@ uint32_t litex_get_hfclk(void) { /* fpga fabric default sys frequency */ - return 100000000UL; + return CONFIG_LITEX_SYS_CORE_FREQ_HZ; } /****************************************************************************