public inbox for buildroot@busybox.net
 help / color / mirror / Atom feed
From: Luca Ceresoli via buildroot <buildroot@buildroot.org>
To: "Neal Frager" <neal.frager@amd.com>, <buildroot@buildroot.org>
Cc: ibai.erkiaga-elorza@amd.com, yann.morin@orange.com,
	brandon.maier@collins.com, fiona.klute@gmx.de, ju.o@free.fr,
	thomas.petazzoni@bootlin.com, romain.naour@smile.fr,
	michal.simek@amd.com, romain.naour@gmail.com
Subject: Re: [Buildroot] [PATCH v5 3/3] board/versal2/post-image.sh: add custom hardware support
Date: Tue, 17 Mar 2026 09:52:29 +0100	[thread overview]
Message-ID: <DH4XHHBDH12D.1EWBIUX2NHFBJ@bootlin.com> (raw)
In-Reply-To: <20260315154343.3144013-3-neal.frager@amd.com>

On Sun Mar 15, 2026 at 4:43 PM CET, Neal Frager wrote:
> Users will ultimately need the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR config to
> import custom dts files for custom versal2 hardware. Improve the post-image.sh
> to support either the default device tree which comes from u-boot or a
> custom device tree for custom hardware.
>
> 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 or overlays.
>
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> ---
> V1->V2:
> - new to patch series
> V2->V5:
> - fixed shellcheck issue
> - merged with zynqmp and versal patch set
> ---
>  board/versal2/post-image.sh | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/board/versal2/post-image.sh b/board/versal2/post-image.sh
> index af50909fb1..3037e0a5ab 100755
> --- a/board/versal2/post-image.sh
> +++ b/board/versal2/post-image.sh
> @@ -1,9 +1,17 @@
>  #!/bin/sh
>
> -# By default U-Boot loads DTB from a file named "system.dtb", and
> -# with versal2, the Linux DTB is the same as the U-Boot DTB, so
> -# let's use a symlink since the DTB is the same.
> -ln -fs "u-boot.dtb" "${BINARIES_DIR}/system.dtb"
> +# By default U-Boot loads DTB from a file named "system.dtb".
> +# With versal2, there is no default dts in the Linux kernel tree
> +# because the default is the same as the u-boot.dtb. This means
> +# it is necessary to cover two cases, a custom dts or the default.
> +# The BR2_LINUX_KERNEL_DTS_SUPPORT will only be set for custom dts
> +# files

Out of my ignorance, is this assumption always correct? What if the main
dtb comes from u-boot but the kernel package is used to build some overlays
(and no dtb)? This patch would break such configs, because is would link
system.dtb to some dtbo instead of u-boot.dtb.

Is this a valid use case in the first place?

> , so it can be used for checking which case is configured.
> +if grep -Eq "^BR2_LINUX_KERNEL_DTS_SUPPORT=y$" "${BR2_CONFIG}"; then
> +	LINUX_DTBS="$(make --no-print-directory VARS=LINUX_DTBS printvars)"
> +	ln -fs "$(basename "${LINUX_DTBS%% *}")" "${BINARIES_DIR}/system.dtb"
> +else
> +	ln -fs "u-boot.dtb" "${BINARIES_DIR}/system.dtb"
> +fi

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2026-03-17  8:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-15 15:43 [Buildroot] [PATCH v5 1/3] board/zynqmp/post-image.sh: add custom hardware support Neal Frager via buildroot
2026-03-15 15:43 ` [Buildroot] [PATCH v5 2/3] board/versal/post-image.sh: " Neal Frager via buildroot
2026-03-17  8:52   ` Luca Ceresoli via buildroot
2026-03-15 15:43 ` [Buildroot] [PATCH v5 3/3] board/versal2/post-image.sh: " Neal Frager via buildroot
2026-03-17  8:52   ` Luca Ceresoli via buildroot [this message]
2026-03-17  9:20     ` Frager, Neal via buildroot
2026-03-17  8:52 ` [Buildroot] [PATCH v5 1/3] board/zynqmp/post-image.sh: " Luca Ceresoli via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DH4XHHBDH12D.1EWBIUX2NHFBJ@bootlin.com \
    --to=buildroot@buildroot.org \
    --cc=brandon.maier@collins.com \
    --cc=fiona.klute@gmx.de \
    --cc=ibai.erkiaga-elorza@amd.com \
    --cc=ju.o@free.fr \
    --cc=luca.ceresoli@bootlin.com \
    --cc=michal.simek@amd.com \
    --cc=neal.frager@amd.com \
    --cc=romain.naour@gmail.com \
    --cc=romain.naour@smile.fr \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yann.morin@orange.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox