diff mbox series

[4/4] lib: sbi: Initialize the console as early as possible

Message ID 20240606091723.896477-5-wxjstz@126.com
State Changes Requested
Headers show
Series Initialize the console as early as possible | expand

Commit Message

Xiang W June 6, 2024, 9:17 a.m. UTC
Move console initialization to the front of init_coldboot so that
more information can be output

Signed-off-by: Xiang W <wxjstz@126.com>
---
 lib/sbi/sbi_init.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c
index 389172a..b14cd03 100644
--- a/lib/sbi/sbi_init.c
+++ b/lib/sbi/sbi_init.c
@@ -214,6 +214,10 @@  static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
 	unsigned long *count;
 	const struct sbi_platform *plat = sbi_platform_ptr(scratch);
 
+	rc = sbi_console_init(scratch);
+	if (rc)
+		sbi_hart_hang();
+
 	/* Note: This has to be first thing in coldboot init sequence */
 	rc = sbi_scratch_init(scratch);
 	if (rc)
@@ -260,10 +264,6 @@  static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
 	if (rc)
 		sbi_hart_hang();
 
-	rc = sbi_console_init(scratch);
-	if (rc)
-		sbi_hart_hang();
-
 	rc = sbi_sse_init(scratch, true);
 	if (rc) {
 		sbi_printf("%s: sse init failed (error %d)\n", __func__, rc);