From 8697b99a2ebe6f2f2c113b74c33f93eb9d849f21 Mon Sep 17 00:00:00 2001 From: Neal Frager Date: Sun, 15 Mar 2026 15:43:41 +0000 Subject: [PATCH] board/zynqmp/post-image.sh: add custom hardware support By switching to the LINUX_DTBS variable, the post-image.sh script can now work regardless of whether a user is using BR2_LINUX_KERNEL_INTREE_DTS_NAME or the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR for custom hardware. This simplifies the transition users will make when migrating from a zynqmp evaluation board to a zynqmp custom platform. To keep the example post-image script as simple as possible, it assumes that the first DTB in the LINUX_DTBS list is the one for creating the system.dtb filename that u-boot will use for booting. Users are free to implement their own post-image scripts for use cases with multiple DTBs. Signed-off-by: Neal Frager Reviewed-by: Luca Ceresoli Signed-off-by: Arnout Vandecappelle --- board/zynqmp/post-image.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/board/zynqmp/post-image.sh b/board/zynqmp/post-image.sh index f44b66342d..67b0be65b7 100755 --- a/board/zynqmp/post-image.sh +++ b/board/zynqmp/post-image.sh @@ -2,13 +2,9 @@ # 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" +# devicetree in the LINUX_DTBS list. +LINUX_DTBS="$(make --no-print-directory VARS=LINUX_DTBS printvars)" +ln -fs "$(basename "${LINUX_DTBS%% *}")" "${BINARIES_DIR}/system.dtb" BOARD_DIR="$(dirname "$0")"