[PATCH v3 03/16] configs: k1: enable early timer support

Raymond Mao raymondmaoca at gmail.com
Wed Mar 25 23:32:19 CET 2026


From: Raymond Mao <raymond.mao at riscstar.com>

Enable CONFIG_TIMER_EARLY to allow udelay() calls during
early initialization phases. This is required for proper
timing operations before the full timer driver is available.

Signed-off-by: Raymond Mao <raymond.mao at riscstar.com>
---
Changes in v3:
- None.

 configs/spacemit_k1_defconfig | 2 ++
 include/configs/k1.h          | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/configs/spacemit_k1_defconfig b/configs/spacemit_k1_defconfig
index 3cf199e4032..9d7d1041247 100644
--- a/configs/spacemit_k1_defconfig
+++ b/configs/spacemit_k1_defconfig
@@ -21,6 +21,7 @@ CONFIG_SYS_LOAD_ADDR=0x200000
 CONFIG_ARCH_RV64I=y
 CONFIG_RISCV_SMODE=y
 CONFIG_TARGET_SPACEMIT_K1=y
+CONFIG_SPL_RISCV_SMODE=y
 CONFIG_FIT=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_OF_BOARD_SETUP=y
@@ -41,3 +42,4 @@ CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_DEBUG_UART_NS16550=y
 CONFIG_DEBUG_UART_ANNOUNCE=y
 # CONFIG_DEBUG_SBI_CONSOLE is not set
+CONFIG_TIMER_EARLY=y
diff --git a/include/configs/k1.h b/include/configs/k1.h
index e0b05c50b70..8e148803dea 100644
--- a/include/configs/k1.h
+++ b/include/configs/k1.h
@@ -13,4 +13,7 @@
 #define CFG_SYS_NS16550_CLK	    14700000
 #define CFG_SYS_NS16550_IER	    0x40 /* UART Unit Enable */
 
+#define RISCV_MMODE_TIMER_FREQ	    24000000
+#define RISCV_SMODE_TIMER_FREQ	    24000000
+
 #endif /* __CONFIG_H */
-- 
2.25.1



More information about the U-Boot mailing list