[PATCH v2 03/16] configs: k1: enable early timer support
Raymond Mao
raymondmaoca at gmail.com
Tue Feb 10 16:14:46 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>
---
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 d794170bc5b..617fe9d2aae 100644
--- a/configs/spacemit_k1_defconfig
+++ b/configs/spacemit_k1_defconfig
@@ -20,6 +20,7 @@ CONFIG_SYS_BOOTM_LEN=0xa000000
CONFIG_SYS_LOAD_ADDR=0x200000
CONFIG_ARCH_RV64I=y
CONFIG_RISCV_SMODE=y
+CONFIG_SPL_RISCV_SMODE=y
CONFIG_ARCH_K1=y
CONFIG_TARGET_BANANAPI_F3=y
CONFIG_FIT=y
@@ -42,3 +43,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