riscv: Defer `init_riscv()` until after config is initalised
diff --git a/common/entry.s3.c b/common/entry.s3.c
index f6422d4c..9eb2497d 100644
--- a/common/entry.s3.c
+++ b/common/entry.s3.c
@@ -186,8 +186,6 @@ noreturn void stage3_common(void) {
if (rv_proto == NULL || rv_proto->GetBootHartId(rv_proto, &bsp_hartid) != EFI_SUCCESS) {
panic(false, "failed to get BSP's hartid");
}
-
- init_riscv(NULL);
#else
#error riscv: only UEFI is supported
#endif
diff --git a/common/menu.c b/common/menu.c
index a8fb83e0..9dafe02d 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -779,6 +779,10 @@ noreturn void _menu(bool first_run) {
}
}
+#if defined (__riscv)
+ init_riscv(NULL);
+#endif
+
char *quiet_str = config_get_value(NULL, 0, "QUIET");
quiet = quiet_str != NULL && strcmp(quiet_str, "yes") == 0;
