diff options
author | Simon Glass <sjg@chromium.org> | 2021-03-15 08:00:23 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-03-27 05:04:29 +0300 |
commit | e7bae8283fea94cf470542916a063182c9e5771a (patch) | |
tree | f6b0fe28d2ff03e1ec7472f23482dbb4ed320478 /arch/x86/lib/zimage.c | |
parent | 1058ab37f7176370e835d53299c2ae44437925e3 (diff) | |
download | u-boot-e7bae8283fea94cf470542916a063182c9e5771a.tar.xz |
x86: Allow installing an e820 when booting from coreboot
Move this code into a generic location so that it can be used by other x86
boards which want to boot from coreboot. Also ensure that this is called
if booting from coreboot.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/x86/lib/zimage.c')
-rw-r--r-- | arch/x86/lib/zimage.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index 602788e016..90fc8a466d 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -18,6 +18,7 @@ #include <bootm.h> #include <command.h> #include <env.h> +#include <init.h> #include <irq_func.h> #include <log.h> #include <malloc.h> @@ -28,6 +29,7 @@ #include <asm/byteorder.h> #include <asm/bootm.h> #include <asm/bootparam.h> +#include <asm/global_data.h> #ifdef CONFIG_SYS_COREBOOT #include <asm/arch/timestamp.h> #endif @@ -35,6 +37,8 @@ #include <linux/ctype.h> #include <linux/libfdt.h> +DECLARE_GLOBAL_DATA_PTR; + /* * Memory lay-out: * @@ -309,8 +313,13 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot, int bootproto = get_boot_protocol(hdr, false); log_debug("Setup E820 entries\n"); - setup_base->e820_entries = install_e820_map( - ARRAY_SIZE(setup_base->e820_map), setup_base->e820_map); + if (ll_boot_init()) { + setup_base->e820_entries = install_e820_map( + ARRAY_SIZE(setup_base->e820_map), setup_base->e820_map); + } else if (IS_ENABLED(CONFIG_COREBOOT_SYSINFO)) { + setup_base->e820_entries = cb_install_e820_map( + ARRAY_SIZE(setup_base->e820_map), setup_base->e820_map); + } if (bootproto == 0x0100) { setup_base->screen_info.cl_magic = COMMAND_LINE_MAGIC; |