From: Vagrant Cascadian <vagrant@debian.org>
To: Tom Rini <trini@konsulko.com>, Marek Vasut <marek.vasut@mailbox.org>
Cc: u-boot@lists.denx.de, Green Wan <green.wan@sifive.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Leo Yu-Chi Liang <ycliang@andestech.com>,
Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH] board: unmatched: Workaround failure to find .dtb file.
Date: Mon, 19 Jan 2026 16:46:47 -0800 [thread overview]
Message-ID: <87pl75p0ug.fsf@wireframe> (raw)
In-Reply-To: <20260119191841.GE3416603@bill-the-cat>
[-- Attachment #1: Type: text/plain, Size: 5242 bytes --]
On 2026-01-19, Tom Rini wrote:
> On Mon, Jan 19, 2026 at 07:42:59AM +0100, Marek Vasut wrote:
>> On 1/19/26 1:09 AM, Vagrant Cascadian wrote:
>> > The fdtdfile variable contains quotes:
>> >
>> > printenv fdtfile
>> > fdtfile="sifive/hifive-unmatched-a00.dtb"
>> >
>> > But this leads to issues which booting with an extlinux.conf format
>> > file failing to find the .dtb file:
>> >
>> > Retrieving file: /usr/lib/linux-image-6.12.63+deb13-riscv64/"sifive/hifive-unmatched-a00.dtb"
>> > Skipping fdtdir /usr/lib/linux-image-6.12.63+deb13-riscv64/ for failure retrieving dts
>> >
>> > Other platforms (e.g. rockpro64-rk3399) do not contain quotes in the
>> > fdtfile variable, and work properly out of the box.
>> >
>> > The workaround suggested by marex is to hard-code the correct .dtb
>> > value, which works for me.
>> >
>> > This has been present at least since version 2025.01, also present in
>> > 2026.01. I have not yet tested against git master branch.
>> >
>> > This could probably be properly fixed by stripping the quotes in
>> > whatever processes the .env file. There are numerous other boards that
>> > have the same way of setting the fdtfile variable, which might
>> > similarly be effected by this issue.
>> >
>> > Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
>> >
>> > Not sure who all to CC on this, please feel free to forward
>> > appropriately!
>>
>> ./scripts/get_maintainer.pl -f board/sifive/unmatched/
>>
>> produces a few names, added
>>
>> > ---
>> > board/sifive/unmatched/unmatched.env | 2 +-
>> > 1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/board/sifive/unmatched/unmatched.env b/board/sifive/unmatched/unmatched.env
>> > index 34425dc9efa..cdba2c8ae0e 100644
>> > --- a/board/sifive/unmatched/unmatched.env
>> > +++ b/board/sifive/unmatched/unmatched.env
>> > @@ -16,4 +16,4 @@ partitions=
>> > name=loader1,start=17K,size=1M,type=${type_guid_gpt_loader1};
>> > name=loader2,size=4MB,type=${type_guid_gpt_loader2};
>> > name=system,size=-,bootable,type=${type_guid_gpt_system};
>> > -fdtfile=CONFIG_DEFAULT_FDT_FILE
>> > +fdtfile=sifive/hifive-unmatched-a00.dtb
>>
>> Also +CC Peng because iMX is also affected.
>
> I'm setting aside the question of why we have both DEFAULT_FDT_FILE and
> DEFAULT_DEVICE_TREE and pointing to:
> commit d085e692c98d0d7b57cc577ed9befda159cd4a40
> Author: Simon Glass <sjg@chromium.org>
> Date: Wed Nov 13 08:09:37 2024 -0700
>
> env: Provide a work-around for unquoting fdtfile
>
> Some boards use a CONFIG option to specify the value of this variable.
> This is normally handled by efi_get_distro_fdt_name() but in the case
> of sunxi this does not work, since 'soc' is sunxi, but the files are
> in the allwinner directory.
>
> Provide a work-around for this particular case.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Tom Rini <trini@konsulko.com>
>
> As how to address this issue as well, unless someone discovers something
> still more clever to deal with quoting.
Thanks for the hint! So a quick and dirty stab at getting this to work:
diff --git a/Makefile b/Makefile
index 50737f93850..2e3280bb87b 100644
--- a/Makefile
+++ b/Makefile
@@ -2137,7 +2137,7 @@ quiet_cmd_gen_envp = ENVP $@
$(CPP) -P $(cpp_flags) -x assembler-with-cpp -undef \
-D__ASSEMBLY__ \
-D__UBOOT_CONFIG__ \
- -DDEFAULT_DEVICE_TREE=$(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE)) \
+ -DDEFAULT_FDT_FILE=$(subst ",,$(CONFIG_DEFAULT_FDT_FILE)) \
-I . -I include -I $(srctree)/include \
-include linux/kconfig.h -include include/config.h \
-I$(srctree)/arch/$(ARCH)/include \
diff --git a/board/sifive/unmatched/unmatched.env b/board/sifive/unmatched/unmatched.env
index 34425dc9efa..f309229481b 100644
--- a/board/sifive/unmatched/unmatched.env
+++ b/board/sifive/unmatched/unmatched.env
@@ -16,4 +16,4 @@ partitions=
name=loader1,start=17K,size=1M,type=${type_guid_gpt_loader1};
name=loader2,size=4MB,type=${type_guid_gpt_loader2};
name=system,size=-,bootable,type=${type_guid_gpt_system};
-fdtfile=CONFIG_DEFAULT_FDT_FILE
+fdtfile=DEFAULT_FDT_FILE
Though obviously any boards relying on DEFAULT_DEVICE_TREE would need
adapting with my quick patch above...
I did not successfully just add -DDEFAULT_FDT_FILE without removing
-DDEFAULT_DEVICE_TREE ... probably just need to cut-and-paste more lines
in the Makefile... or try to do something even more clever. :)
That would also require the other handfull of boards using
CONFIG_DEFAULT_FDT_FILE to switch to DEFAULT_FDT_FILE, presumably.
I also tried switching the unmatched board to use DEFAULT_DEVICE_TREE
instead, but that does not contain the vendor prefix
(e.g. hifive-unmatched-a00 vs. sifive/hifive-unmatched-a00.dtb) and so
the file was still not found. Should CONFIG_DEFAULT_DEVICE_TREE and
CONFIG_DEFAULT_FDT_FILE both contain the vendor dir?
live well,
vagrant
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]
next prev parent reply other threads:[~2026-01-20 0:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-19 0:09 [PATCH] board: unmatched: Workaround failure to find .dtb file Vagrant Cascadian
2026-01-19 6:42 ` Marek Vasut
2026-01-19 19:18 ` Tom Rini
2026-01-20 0:46 ` Vagrant Cascadian [this message]
2026-01-20 14:59 ` Tom Rini
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=87pl75p0ug.fsf@wireframe \
--to=vagrant@debian.org \
--cc=green.wan@sifive.com \
--cc=marek.vasut@mailbox.org \
--cc=paul.walmsley@sifive.com \
--cc=peng.fan@nxp.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=ycliang@andestech.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