Question about BUILTIN_DTB support in RISCV

Masahiro Yamada masahiroy at kernel.org
Fri Dec 1 10:45:00 PST 2023


Hi.

I have a question about CONFIG_BUILTIN_DTB for riscv.

Please see this commit history.


[1]
2d2682512f0faf4d09a696184bf3c0bb6838baca
added built-in DTB support, attempting
to include multiple DTB into vmlinux
by using SOC_BUILTIN_DTB_DECLARE() macro.


[2]
d5805af9fe9ffe4a9d975e9bc39496f57a161076
pointed out that choosing the correct DTB
is impossible. It fell back to the single
built-in DTB support, like other architectures.

[3]
0ddd7eaffa644baa78e247bbd220ab7195b1eed6
added BUILTIN_DTB support for sifive and microchip,
while apparently multiple DTBs are embedded into vmlinux.



So, how does it work?


With
CONFIG_ARCH_MICROCHIP_POLARFIRE=y
CONFIG_ARCH_SIFIVE=y
CONFIG_BUILTIN_DTB=y

7 DTB files are embedded in vmlinux.


masahiro at zoe:~/ref/linux(master)$ riscv64-linux-gnu-nm -n vmlinux |
grep -A15 dtb_start
ffffffff82112620 D __dtb_start
ffffffff82115a2c D __dtb_mpfs_icicle_kit_end
ffffffff82115a40 D __dtb_mpfs_m100pfsevp_begin
ffffffff82118b3b D __dtb_mpfs_m100pfsevp_end
ffffffff82118b40 D __dtb_mpfs_polarberry_begin
ffffffff8211b9c2 D __dtb_mpfs_polarberry_end
ffffffff8211b9e0 D __dtb_mpfs_sev_kit_begin
ffffffff8211e7bb D __dtb_mpfs_sev_kit_end
ffffffff8211e7c0 D __dtb_mpfs_tysom_m_begin
ffffffff8212162e D __dtb_mpfs_tysom_m_end
ffffffff82121640 D __dtb_hifive_unleashed_a00_begin
ffffffff821236af D __dtb_hifive_unleashed_a00_end
ffffffff821236c0 D __dtb_hifive_unmatched_a00_begin
ffffffff8212621b D __dtb_hifive_unmatched_a00_end
ffffffff82126220 D __dtb_end


In my understanding, the first one
(mpfs-icicle-kit.dtb) is always used.

You cannot use the other 6 DTBs.
Am I missing something?



arch/riscv64/boot/dts/canaan/Makefile
is correct because only one DTB is embedded
if CONFIG_ARCH_CANAAN_K210_DTB_SOURCE contains
a single word.



-- 
Best Regards
Masahiro Yamada



More information about the linux-riscv mailing list