From c0017c73578a91c4a40bf033f641ce293cd3df2e Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 3 Nov 2024 02:41:41 +0000 Subject: Experimental U-Boot payload (32-bit dtb, U-Boot) NOTE: Support added for xarch target x86_64-elf, but U-Boot failed to build with this error: OBJCOPY lib/efi_loader/helloworld.efi x86_64-elf-objcopy: lib/efi_loader/helloworld_efi.so: invalid bfd target make[2]: *** [scripts/Makefile.lib:476: lib/efi_loader/helloworld.efi] Error 1 Since I'm building U-Boot for x86_64 *on* an x86-64 host, and since that is currently the recommended type of machine to use for lbmk development, and since the other x86 payloads currently don't cross compile anyway, this is an acceptable compromise for now. This is because at present, I'm not making U-Boot the primary payload on x86, instead preferring to chain it from GRUB and SeaBIOS. The target.cfg file for x86 u-boot shows xarch/xtree commented. Uncomment these to compile on crossgcc instead of hostcc. I mention 64-bit because I initially did this first, but decided to do 32-bit first. I'll work on the 64-bit one next (SPL). It's only enabled in QEMU for now. Signed-off-by: Leah Rowe --- config/grub/default/config/payload | 6 ++++++ config/grub/nvme/config/payload | 6 ++++++ config/grub/xhci/config/payload | 6 ++++++ 3 files changed, 18 insertions(+) (limited to 'config/grub') diff --git a/config/grub/default/config/payload b/config/grub/default/config/payload index cdd6c0f0..e5bf52bd 100644 --- a/config/grub/default/config/payload +++ b/config/grub/default/config/payload @@ -216,6 +216,12 @@ menuentry 'Load test configuration (grubtest.cfg) inside of CBFS [t]' --hotkey= fi } fi +if [ -f (cbfsdisk)/u-boot ]; then +menuentry 'Load U-Boot (payload) [b]' --hotkey='u' { + set root='cbfsdisk' + chainloader /u-boot +} +fi if [ -f (cbfsdisk)/seabios.elf ]; then menuentry 'Load SeaBIOS (payload) [b]' --hotkey='b' { set root='cbfsdisk' diff --git a/config/grub/nvme/config/payload b/config/grub/nvme/config/payload index 2f9c7114..aa1fcb91 100644 --- a/config/grub/nvme/config/payload +++ b/config/grub/nvme/config/payload @@ -234,6 +234,12 @@ menuentry 'Load test configuration (grubtest.cfg) inside of CBFS [t]' --hotkey= fi } fi +if [ -f (cbfsdisk)/u-boot ]; then +menuentry 'Load U-Boot (payload) [b]' --hotkey='u' { + set root='cbfsdisk' + chainloader /u-boot +} +fi if [ -f (cbfsdisk)/seabios.elf ]; then menuentry 'Load SeaBIOS (payload) [b]' --hotkey='b' { set root='cbfsdisk' diff --git a/config/grub/xhci/config/payload b/config/grub/xhci/config/payload index 923e3551..ee3e6aaf 100644 --- a/config/grub/xhci/config/payload +++ b/config/grub/xhci/config/payload @@ -235,6 +235,12 @@ menuentry 'Load test configuration (grubtest.cfg) in CBFS [t]' --hotkey='t' { fi } fi +if [ -f (cbfsdisk)/u-boot ]; then +menuentry 'Load U-Boot (payload) [b]' --hotkey='u' { + set root='cbfsdisk' + chainloader /u-boot +} +fi if [ -f (cbfsdisk)/seabios.elf ]; then menuentry 'Load SeaBIOS (payload) [b]' --hotkey='b' { set root='cbfsdisk' -- cgit v1.2.1