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

From: Conor Dooley
Date: Thu Feb 22 2024 - 16:06:09 EST


Hey,

On Wed, Feb 21, 2024 at 03:03:57AM +0800, 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.
>
> Signed-off-by: Yangyu Chen <cyy@xxxxxxxxxxxx>
> ---
> 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(-)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index b49016bb5077..23d501561e64 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -996,7 +996,21 @@ config RISCV_ISA_FALLBACK
> config BUILTIN_DTB
> bool "Built-in device tree"
> depends on OF && NONPORTABLE
> - default y if XIP_KERNEL
> + default y if XIP_KERNEL || SOC_CANAAN

s/SOC/ARCH/

> + help
> + Build a device tree into the Linux image.
> + This option should be selected if no bootloader is being used.
> + If unsure, say Y.
> +
> +
> +config BUILTIN_DTB_SOURCE
> + string "Built-in device tree source"
> + depends on BUILTIN_DTB

> + default "canaan/k210_generic" if SOC_CANAAN

I think we should drop this default, I don't think that "k210_generic"
should really exist in the first place. And suggest that there are
platform-wide default devicetrees isn't something I think should be
encouraged.

> + help
> + DTS file path (without suffix, relative to arch/riscv/boot/dts)
> + for the DTS file that will be used to produce the DTB linked into the
> + kernel.
>
> endmenu # "Boot options"

> -config SOC_CANAAN_K210_DTB_BUILTIN
> -config SOC_CANAAN_K210_DTB_SOURCE

> diff --git a/arch/riscv/boot/dts/canaan/Makefile b/arch/riscv/boot/dts/canaan/Makefile
> index 520623264c87..987d1f0c41f0 100644
> --- a/arch/riscv/boot/dts/canaan/Makefile
> +++ b/arch/riscv/boot/dts/canaan/Makefile
> @@ -5,5 +5,3 @@ dtb-$(CONFIG_ARCH_CANAAN) += sipeed_maix_bit.dtb
> dtb-$(CONFIG_ARCH_CANAAN) += sipeed_maix_dock.dtb
> dtb-$(CONFIG_ARCH_CANAAN) += sipeed_maix_go.dtb
> dtb-$(CONFIG_ARCH_CANAAN) += sipeed_maixduino.dtb
> -
> -obj-$(CONFIG_ARCH_CANAAN_K210_DTB_BUILTIN) += $(addsuffix .dtb.o, $(CONFIG_ARCH_CANAAN_K210_DTB_SOURCE))

There are two more instances of this that need to be removed.

Thanks,
Conor.

Attachment: signature.asc
Description: PGP signature