diff mbox

[U-Boot,v4,14/14] x86: Enable EFI loader support

Message ID 1478533636-17577-15-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Alexander Graf
Headers show

Commit Message

Simon Glass Nov. 7, 2016, 3:47 p.m. UTC
Enable this so that EFI applications (notably grub) can be run under U-Boot
on x86 platforms.

At present the 'hello world' EFI application is not supported for the
qemu-x86_efi_payload64 board. That board builds a payload consisting of a
64-bit header and a 32-bit U-Boot, which is incompatible with the way the
EFI loader builds its EFI application. The following error is obtained:

x86_64-linux-ld.bfd: i386 architecture of input file
   `lib/efi_loader/helloworld.o' is incompatible with i386:x86-64 output

This could be corrected with additional Makefile rules. For now, this
feature is disabled for that board.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---

Changes in v4:
- Drop the binary 'hello world' program

Changes in v3: None
Changes in v2:
- Remove EFI support from README.x86 TODO list

 configs/efi-x86_defconfig                | 1 +
 configs/qemu-x86_efi_payload64_defconfig | 1 +
 configs/stm32f429-discovery_defconfig    | 1 +
 doc/README.x86                           | 1 -
 lib/efi_loader/Kconfig                   | 2 +-
 5 files changed, 4 insertions(+), 2 deletions(-)

Comments

Alexander Graf Nov. 14, 2016, 11:05 p.m. UTC | #1
> Enable this so that EFI applications (notably grub) can be run under U-Boot
> on x86 platforms.
> 
> At present the 'hello world' EFI application is not supported for the
> qemu-x86_efi_payload64 board. That board builds a payload consisting of a
> 64-bit header and a 32-bit U-Boot, which is incompatible with the way the
> EFI loader builds its EFI application. The following error is obtained:
> 
> x86_64-linux-ld.bfd: i386 architecture of input file
>    `lib/efi_loader/helloworld.o' is incompatible with i386:x86-64 output
> 
> This could be corrected with additional Makefile rules. For now, this
> feature is disabled for that board.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Thanks, applied to efi-next

Alex
diff mbox

Patch

diff --git a/configs/efi-x86_defconfig b/configs/efi-x86_defconfig
index b31c73b..1fe6142 100644
--- a/configs/efi-x86_defconfig
+++ b/configs/efi-x86_defconfig
@@ -34,3 +34,4 @@  CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_EFI=y
+# CONFIG_EFI_LOADER is not set
diff --git a/configs/qemu-x86_efi_payload64_defconfig b/configs/qemu-x86_efi_payload64_defconfig
index c081ead..a9ffd92 100644
--- a/configs/qemu-x86_efi_payload64_defconfig
+++ b/configs/qemu-x86_efi_payload64_defconfig
@@ -52,3 +52,4 @@  CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_EFI=y
 CONFIG_EFI_STUB=y
 CONFIG_EFI_STUB_64BIT=y
+# CONFIG_CMD_BOOTEFI_HELLO is not set
diff --git a/configs/stm32f429-discovery_defconfig b/configs/stm32f429-discovery_defconfig
index 24e2221..a68494b 100644
--- a/configs/stm32f429-discovery_defconfig
+++ b/configs/stm32f429-discovery_defconfig
@@ -10,3 +10,4 @@  CONFIG_SYS_PROMPT="U-Boot > "
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIMER=y
 CONFIG_OF_LIBFDT=y
+# CONFIG_CMD_BOOTEFI_HELLO is not set
diff --git a/doc/README.x86 b/doc/README.x86
index 6799559..a38cc1b 100644
--- a/doc/README.x86
+++ b/doc/README.x86
@@ -1077,7 +1077,6 @@  TODO List
 ---------
 - Audio
 - Chrome OS verified boot
-- Support for CONFIG_EFI_LOADER
 - Building U-Boot to run in 64-bit mode
 
 References
diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
index 48563aa..8e7e8a5 100644
--- a/lib/efi_loader/Kconfig
+++ b/lib/efi_loader/Kconfig
@@ -1,6 +1,6 @@ 
 config EFI_LOADER
 	bool "Support running EFI Applications in U-Boot"
-	depends on (ARM64 || ARM) && OF_LIBFDT
+	depends on (ARM64 || ARM || X86) && OF_LIBFDT
 	default y
 	help
 	  Select this option if you want to run EFI applications (like grub2)