lib: hardwaremain: Call exception_init() as soon as possible
Call exception_init() before calling cbmem_initialize() because
ARMv8 on QEMU uses an exception handler to detect a ram size.
Signed-off-by: Asami Doi <d0iasm.pub@gmail.com>
Change-Id: If010234a6576414e7e174c075b599a4aa4c19eab
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35022
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c
index 3c6fb93..a4c154e 100644
--- a/src/lib/hardwaremain.c
+++ b/src/lib/hardwaremain.c
@@ -451,9 +451,10 @@
/* console_init() MUST PRECEDE ALL printk()! Additionally, ensure
* it is the very first thing done in ramstage.*/
console_init();
-
post_code(POST_CONSOLE_READY);
+ exception_init();
+
/*
* CBMEM needs to be recovered because timestamps, ACPI, etc rely on
* the cbmem infrastructure being around. Explicitly recover it.
@@ -470,8 +471,6 @@
#if CONFIG(HAVE_ACPI_RESUME)
acpi_is_wakeup();
#endif
-
- exception_init();
threads_initialize();
/* Schedule the static boot state entries. */