mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-01 21:23:51 -09:00
Add a defconfig to build an AArch64 disk image with a U-Boot based firmware implementing the subset of UEFI defined by EBBR[1], as well as a Linux OS booting with UEFI, to run on the IOT-GATE-iMX8 from Compulab. The generated firmware binary can also be used to install or run another OS supporting the EBBR specification. This configuration is based on the work of Paul Liu[2] and is not related with the official BSP from Compulab. This has been tested on actual hardware. While at it, add this defconfig to myself in DEVELOPERS. [1] https://github.com/ARM-software/ebbr [2] https://git.linaro.org/plugins/gitiles/people/paul.liu/systemready/build-scripts Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com> Cc: Ying-Chun Liu (Paul Liu) <paul.liu@linaro.org> Signed-off-by: Julien Olivain <ju.o@free.fr>
70 lines
1.8 KiB
Bash
Executable File
70 lines
1.8 KiB
Bash
Executable File
#!/bin/sh
|
|
set -eux
|
|
|
|
BOARD_DIR=$(dirname "$0")
|
|
|
|
# Override the default GRUB configuration file with our own.
|
|
cp -vf "${BOARD_DIR}/grub.cfg" "${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg"
|
|
|
|
BINMAN_DIR="$BINARIES_DIR/binman"
|
|
BINMAN_DTB="$BINMAN_DIR/u-boot.dtb"
|
|
UBOOT_DIR=$(find "$BUILD_DIR" -maxdepth 1 -type d -name 'uboot-*')
|
|
|
|
# Adjust binman dtb.
|
|
rm -fr "$BINMAN_DIR"
|
|
mkdir -v "$BINMAN_DIR"
|
|
cp -v "$UBOOT_DIR/u-boot.dtb" "$BINMAN_DTB"
|
|
# Add the fip image to the list of loadables.
|
|
fdtput -t s "$BINMAN_DTB" /binman/section/fit/configurations/@config-SEQ loadables atf fip
|
|
# Remove the tee node to avoid duplicate, as it is in the FIP image.
|
|
fdtput --remove "$BINMAN_DTB" /binman/section/fit/images/tee
|
|
|
|
# Generate flash image with binman.
|
|
# We do this here to break the build dependency loop involving tf-a, op-tee, and
|
|
# u-boot.
|
|
# We use BL2 instead of BL31 in this configuration.
|
|
(cd "${UBOOT_DIR}" && \
|
|
./tools/binman/binman \
|
|
--toolpath ./tools \
|
|
-v5 \
|
|
build \
|
|
-u \
|
|
-d "$BINMAN_DTB" \
|
|
-O . \
|
|
-m \
|
|
--allow-missing \
|
|
--fake-ext-blobs \
|
|
-I "$BINMAN_DIR" \
|
|
-I . \
|
|
-I ./board/compulab/imx8mm-cl-iot-gate \
|
|
-I arch/arm/dts \
|
|
-a of-list="imx8mm-cl-iot-gate-optee" \
|
|
-I "$BINARIES_DIR" \
|
|
-a atf-bl31-path=bl2.bin \
|
|
-a tee-os-path= \
|
|
-a ti-dm-path= \
|
|
-a opensbi-path= \
|
|
-a default-dt="imx8mm-cl-iot-gate-optee" \
|
|
-a scp-path= \
|
|
-a rockchip-tpl-path= \
|
|
-a spl-bss-pad= \
|
|
-a tpl-bss-pad=1 \
|
|
-a vpl-bss-pad=1 \
|
|
-a spl-dtb=y \
|
|
-a tpl-dtb= \
|
|
-a vpl-dtb= \
|
|
-a pre-load-key-path= \
|
|
-a of-spl-remove-props="interrupt-parent interrupts" \
|
|
)
|
|
|
|
# Copy the flash image.
|
|
cp -v "$UBOOT_DIR/flash.bin" "$BINARIES_DIR/"
|
|
|
|
# Verify that it will fit in the eMMC boot partition.
|
|
size=$(du -b "$BINARIES_DIR/flash.bin" |cut -f 1)
|
|
|
|
if [ "$size" -gt 4160512 ]; then
|
|
echo "Flash image is too big! (${size} bytes)" >&2
|
|
exit 1
|
|
fi
|