From 1d3dbd49e14e9dec14a6bfa4d69fa56b62406784 Mon Sep 17 00:00:00 2001 From: Tomasz Bursztyka Date: Wed, 16 Mar 2022 10:14:44 +0100 Subject: [PATCH] arch/x86: Initialize early serial a tiny bit later In case of EFI, efi_init must be called before initializing early serial: if that one as X86_SOC_EARLY_SERIAL_PCIDEV defined, its pcie access will try to initialise pcie mmio access which one will try to find an ACPI table. At this point, calling ACPI API prior to initialize EFI will make RSDP looked up already... and since it cannot find it without EFI being initialized first, ACPI is then broken. Just moving early serial to initialize after multiboot/efi being setup. Signed-off-by: Tomasz Bursztyka --- arch/x86/core/prep_c.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/core/prep_c.c b/arch/x86/core/prep_c.c index 2421209f378..bd7aede78f7 100644 --- a/arch/x86/core/prep_c.c +++ b/arch/x86/core/prep_c.c @@ -36,10 +36,6 @@ FUNC_NORETURN void z_x86_prep_c(void *arg) z_loapic_enable(0); #endif -#ifdef CONFIG_X86_VERY_EARLY_CONSOLE - z_x86_early_serial_init(); -#endif - #ifdef CONFIG_X86_64 x86_64_irq_init(); #endif @@ -54,6 +50,10 @@ if (IS_ENABLED(CONFIG_MULTIBOOT_INFO) && ARG_UNUSED(cpu_arg); } +#ifdef CONFIG_X86_VERY_EARLY_CONSOLE + z_x86_early_serial_init(); +#endif + #if CONFIG_X86_STACK_PROTECTION for (int i = 0; i < CONFIG_MP_NUM_CPUS; i++) { z_x86_set_stack_guard(z_interrupt_stacks[i]);