diff options
| author | Alper Nebi Yasak <alpernebiyasak@gmail.com> | 2022-12-09 14:50:03 +0300 | 
|---|---|---|
| committer | Alper Nebi Yasak <alpernebiyasak@gmail.com> | 2022-12-10 14:19:00 +0300 | 
| commit | 1c62b003ad6014288114300de65844496dffaf72 (patch) | |
| tree | 3d770553466d481f78668892b77999df56ab316c /resources/scripts/build | |
| parent | 6cabcec51d39a6d4c6176de4486a95cbb492fc24 (diff) | |
build/roms: Support using "u-boot" ELF file as U-Boot payload
U-Boot runtime configuration is done with a device-tree file, which is
built alongside the executable in the upstream build system, and must be
available to U-Boot at runtime.
This device-tree is normally not linked into the default "u-boot" ELF
file. So far we have been handling it by re-creating a "u-boot.elf" from
the raw binary parts by setting REMAKE_ELF, and using that as the
coreboot payload. Unfortunately, that fails to build for x86 boards,
more specificly the "coreboot" boards upstream.
It's also possible (but discouraged) to set OF_EMBED to embed the
device-tree file into the U-Boot itself, in which case we could use the
"u-boot" file as the payload on the "coreboot" boards. Add support for
using the "u-boot" file as the payload if "u-boot.elf" doesn't exist.
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Diffstat (limited to 'resources/scripts/build')
| -rwxr-xr-x | resources/scripts/build/boot/roms_helper | 23 | 
1 files changed, 16 insertions, 7 deletions
| diff --git a/resources/scripts/build/boot/roms_helper b/resources/scripts/build/boot/roms_helper index f533e6ab..66a7be8f 100755 --- a/resources/scripts/build/boot/roms_helper +++ b/resources/scripts/build/boot/roms_helper @@ -268,14 +268,17 @@ if [ "${payload_grub}" = "y" ] || [ "${payload_seabios_withgrub}" = "y" ]; then  fi  if [ "${payload_uboot}" = "y" ]; then -	if [ "${uboot_config}" = "default" ] && \ -		[ -f "payload/u-boot/${board}/u-boot.elf" ]; then -			ubootelf="payload/u-boot/${board}/u-boot.elf" +	if [ "${uboot_config}" = "default" ]; then +		ubdir="payload/u-boot/${board}"  	else -		ubootelf="payload/u-boot/${board}/${uboot_config}/u-boot.elf" +		ubdir="payload/u-boot/${board}/${uboot_config}"  	fi -	if [ ! -f "${ubootelf}" ]; then +	if [ -f "${ubdir}/u-boot.elf" ]; then +		ubootelf="${ubdir}/u-boot.elf" +	elif [ -f "${ubdir}/u-boot" ]; then +		ubootelf="${ubdir}/u-boot" +	else  		printf "Required U-Boot payloads not yet built. Building now:\n"  		rm -Rf "payload/u-boot/${board}" # just in case  		./build payload u-boot "${board}" @@ -397,9 +400,15 @@ make_uboot_payload_rom() {  	cbfstool_path="${4}"  	if [ "${target_uboot_config}" = "default" ]; then -		target_ubootelf="payload/u-boot/${board}/u-boot.elf" +		target_ubdir="payload/u-boot/${board}"  	else -		target_ubootelf="payload/u-boot/${board}/${target_uboot_config}/u-boot.elf" +		target_ubdir="payload/u-boot/${board}/${target_uboot_config}" +	fi + +	if [ -f "${target_ubdir}/u-boot.elf" ]; then +		target_ubootelf="${target_ubdir}/u-boot.elf" +	elif [ -f "${target_ubdir}/u-boot" ]; then +		target_ubootelf="${target_ubdir}/u-boot"  	fi  	tmprom=$(mktemp -t coreboot_rom.XXXXXXXXXX) | 
