kumquat-buildroot/board/versal/post-image.sh
Neal Frager 122c85985f board/versal/post-image.sh: do not require xilinx/ prefix for .dts files
If using BR2_LINUX_KERNEL_CUSTOM_DTS_PATH to copy .dts files from
buildroot into the linux tree, these .dts files are copied to
arch/arm64/boot. Unfortunately, the post-image.sh script expects to find
them in arch/arm64/boot/xilinx.

This patch does not require the xilinx/ prefix to be present when
symlinking the device-tree to system.dtb where u-boot expects to find
it.

It is effectively applying the below patch for zynqmp to versal as well:
https://patchwork.ozlabs.org/project/buildroot/patch/20230201195956.1758827-1-gsmecher@threespeedlogic.com/

Signed-off-by: Neal Frager <neal.frager@amd.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2023-02-05 13:24:10 +01:00

36 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
# By default U-Boot loads DTB from a file named "system.dtb", so
# let's use a symlink with that name that points to the *first*
# devicetree listed in the config.
FIRST_DT=$(sed -nr \
-e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="(xilinx/)?([-_/[:alnum:]\\.]*).*"$|\2|p' \
${BR2_CONFIG})
[ -z "${FIRST_DT}" ] || ln -fs ${FIRST_DT}.dtb ${BINARIES_DIR}/system.dtb
BOARD_DIR="$(dirname $0)"
BOARD_NAME=$4
mkdir -p "${BINARIES_DIR}"
cat <<-__HEADER_EOF > "${BINARIES_DIR}/bootgen.bif"
the_ROM_image:
{
image {
{ type=bootimage, file=${BINARIES_DIR}/${BOARD_NAME}_vpl_gen_fixed.pdi }
{ type=bootloader, file=${BINARIES_DIR}/${BOARD_NAME}_plm.elf }
{ core=psm, file=${BINARIES_DIR}/${BOARD_NAME}_psmfw.elf }
}
image {
id = 0x1c000000, name=apu_subsystem
{ type=raw, load=0x00001000, file=${BINARIES_DIR}/u-boot.dtb }
{ core=a72-0, exception_level=el-3, trustzone, file=${BINARIES_DIR}/bl31.elf }
{ core=a72-0, exception_level=el-2, file=${BINARIES_DIR}/u-boot.elf }
}
}
__HEADER_EOF
${HOST_DIR}/bin/bootgen -arch versal -image ${BINARIES_DIR}/bootgen.bif -o ${BINARIES_DIR}/boot.bin -w on
support/scripts/genimage.sh -c ${BOARD_DIR}/genimage.cfg