From 3b9a346fe770ae5ec3b1f4c0aae8f2ad9e708b43 Mon Sep 17 00:00:00 2001 From: Yanfeng Liu Date: Mon, 22 Jul 2024 13:14:52 +0800 Subject: [PATCH] riscv/nsbi: unblock up_udelay This fixes the always zero time in NuttSBI case as the `error` field contains the correct timestamp. This in turn also fixes the block of `up_udelay()` which further leads to boot failure of `canmv230:master` config. Signed-off-by: Yanfeng Liu --- arch/risc-v/src/common/supervisor/riscv_sbi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/risc-v/src/common/supervisor/riscv_sbi.c b/arch/risc-v/src/common/supervisor/riscv_sbi.c index 0daceece06..c8bdd9425e 100644 --- a/arch/risc-v/src/common/supervisor/riscv_sbi.c +++ b/arch/risc-v/src/common/supervisor/riscv_sbi.c @@ -111,7 +111,7 @@ uint64_t riscv_sbi_get_time(void) sbiret_t ret = sbi_ecall(SBI_EXT_FIRMWARE, SBI_EXT_FIRMWARE_GET_MTIME, 0, 0, 0, 0, 0, 0); - return ret.value; + return ret.error; #elif defined(CONFIG_ARCH_RV64) return READ_CSR(CSR_TIME); #else