public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: E Shattow <e@freeshell.de>
To: Johannes Krottmayer <krotti83@proton.me>, u-boot@lists.denx.de
Subject: Re: How to build U-Boot with a custom out-of-tree device tree
Date: Sat, 18 Apr 2026 09:56:13 -0700	[thread overview]
Message-ID: <4d549ae6-4dbb-472f-bacc-8f9ca7224a13@freeshell.de> (raw)
In-Reply-To: <034a4ae4-b579-42b0-b6b0-3a204737156f@proton.me>


On 4/18/26 07:40, Johannes Krottmayer wrote:
> Hello,
> 
> This question is generic and also valid for none RISC-V boards.
> I think it's maybe already asked, but didn't find any useful
> information this time. My question is, is it possible to pass
> a specific device tree blob to the build system from U-Boot?
> 
> Example: RISC-V board Starfive VisionFive 2 8GiB variant
> 
> The default in-source-tree device tree from the VisionFive 2 has
> only 4GiB RAM. I own the 8GiB (RAM-IC BiWin BMWZCX32H2A-64G-X)
> variant. So therefore can I pass the device tree blob directly
> to U-Boot's build system without modifying CONFIG_DEFAULT_DEVICE_TREE
> in the device configuration? Exists there an environment variable?
> 
> Want to use U-Boot's EFI subsystem as loader for bare-metal
> environments. And I think when I want to get the memory map
> via EFI there will with the default device tree only <4GiB free
> usable memory shown, although there are 8GiB.
> 
> Thanks in advance!
> 
> Kind regards,
> 
> Johannes K.

What you're asking about VisionFive 2 can be done simply. It is arranged
so that arch/riscv/dts/starfive-visionfive2-u-boot.dtsi is named in
starfive_visionfive2_defconfig DEVICE_TREE_INCLUDES and then that acts
with dts syntax to include the binman specific
starfive_visionfive2-binman.dtsi

Additionally there is the automatic dts inclusion mechanism from
scripts/Makefile.lib approximately source line 230 you can see the
precedence there; An example of this, look at some of my patch series
when I posted before the necessary files to support the series had
landed in devicetree-rebasing, my approach was to create empty
directory/files as necessary in the devicetree-rebasing subtree but to
create the special "<"
whatever-we're-currently-doing-in-the-build-system-u-boot.dtsi which
happens to be the board variant specific empty file I created in
devicetree-rebasing subtree and with our -u-boot.dtsi automatic
inclusion prefix.  It's simple, it just is not easy for me to explain
clearly so I hope you may follow what I am describing.

As long as there is a directory and/or file (may be empty, cannot be
missing entirely) in the subtree for devicetree-rebasing, and suitable
variant board is named in the OF_LIST, then the build will recurse into
the upstream-rebasing for those file targets.

For local testing one approach I've had good success with is to replace
the dts/upstream/src/riscv/starfive directory with a symbolic link to a
local checkout of the linux repository arch/riscv/boot/dts/starfive and
I make my changes in linux repository, then simply recompile U-Boot. I
wish this were a U-Boot compile time option to refer to a local Linux
repository;  I looked into making this change but it's very specific to
devicetree-rebasing with many hardcoded assumptions.

-E

      reply	other threads:[~2026-04-18 16:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-18 14:40 How to build U-Boot with a custom out-of-tree device tree Johannes Krottmayer
2026-04-18 16:56 ` E Shattow [this message]

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=4d549ae6-4dbb-472f-bacc-8f9ca7224a13@freeshell.de \
    --to=e@freeshell.de \
    --cc=krotti83@proton.me \
    --cc=u-boot@lists.denx.de \
    /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