summaryrefslogtreecommitdiff
path: root/payloads/libpayload/arch/x86/main.c
diff options
context:
space:
mode:
authorRaul E Rangel <rrangel@chromium.org>2018-08-20 11:14:44 -0600
committerMartin Roth <martinroth@google.com>2018-09-12 14:14:46 +0000
commitac8ebd0e73774c83bfa5cb3dd460c662000e0d19 (patch)
tree793e8e859456e8bca38f9d14887fdbc05c08158b /payloads/libpayload/arch/x86/main.c
parent3d398ad37af84bdbe15e5dc82d39213b8437dd12 (diff)
downloadcoreboot-ac8ebd0e73774c83bfa5cb3dd460c662000e0d19.tar.xz
libpayload/arch/x86: Add support for initializing the APIC
This is just the bare minimum required to initialize the APIC. I only support xAPIC and chose not to support x2APIC. We can add that functionality later when it's required. I also made the exception dispatcher call apic_eoi so that the callbacks won't forget to call it. BUG=b:109749762 TEST=Booted grunt and verified that depthcharge continued to function and that linux booted correctly. Also verified GDB still works. Change-Id: I420a4eadae84df088525e727b481089ef615183f Signed-off-by: Raul E Rangel <rrangel@chromium.org> Reviewed-on: https://review.coreboot.org/28241 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'payloads/libpayload/arch/x86/main.c')
-rw-r--r--payloads/libpayload/arch/x86/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/payloads/libpayload/arch/x86/main.c b/payloads/libpayload/arch/x86/main.c
index f9a5e2cf83..05ffa0d83b 100644
--- a/payloads/libpayload/arch/x86/main.c
+++ b/payloads/libpayload/arch/x86/main.c
@@ -29,6 +29,7 @@
#include <exception.h>
#include <libpayload.h>
+#include <arch/apic.h>
unsigned long loader_eax; /**< The value of EAX passed from the loader */
unsigned long loader_ebx; /**< The value of EBX passed from the loader */
@@ -57,6 +58,12 @@ int start_main(void)
exception_init();
+ if (IS_ENABLED(CONFIG_LP_ENABLE_APIC)) {
+ apic_init();
+
+ enable_interrupts();
+ }
+
/*
* Any other system init that has to happen before the
* user gets control goes here.