[RFC PATCH 0/1] riscv: dts: Allow BUILTIN_DTB for all socs

Alexandre Ghiti alex at ghiti.fr
Tue Feb 20 12:46:57 PST 2024


Hi Yangyu,

On 20/02/2024 20:01, Yangyu Chen wrote:
> The BUILTIN_DTB kernel feature on RISC-V only works on K210 SoC only. This
> patch moved this configuration to entire riscv.
>
> Although BUILTIN_DTB is not a good choice for most platforms, it is likely
> to be a debug feature when some bootloader will always override something
> like the memory node in the device tree to adjust the memory size from SPD
> or configuration resistor, which makes it hard to do some debugging. As an
> example, some platforms with numa like sg2042 only support sv39 will fail
> to boot when there is no ZONE_HIGHMEM patch with 128G memory. If we want


Orthogonal to this patch, but if needs be, we can fix this issue with 
128G on sv39 by changing the sv39 address space layout, we still have 
room to gain the 4G you miss, at that time I was pretty sure that amount 
of memory would come with sv48 :)

Thanks,

Alex


> a kernel without this patch to boot, we need to write the memory nodes
> in the DT manually.
>
> Also, changing DT on some platforms is not easy. For Milk-V Pioneer, the
> boot procedure is ZSBL -> OpenSBI -> LinuxBoot -> Linux. If DT gets
> changed, OpenSBI or LinuxBoot may refuse to boot. And there is some bug on
> LinuxBoot now which does not consume --dtb argument on kexec and always
> uses DT from memory. So I would like to do debugging on DT using
> BUILTIN_DTB, which makes it very simple, I can even install the kernel in
> the distro's way and provide a kernel package for other users to test.
>
> Yangyu Chen (1):
>    riscv: dts: Allow BUILTIN_DTB for all socs
>
>   arch/riscv/Kconfig                  | 16 ++++++++++++++-
>   arch/riscv/Kconfig.socs             | 32 -----------------------------
>   arch/riscv/boot/dts/Makefile        |  2 +-
>   arch/riscv/boot/dts/canaan/Makefile |  2 --
>   4 files changed, 16 insertions(+), 36 deletions(-)
>



More information about the linux-riscv mailing list