nios2: migrate to the generic rule for built-in DTB

Commit 654102df2a ("kbuild: add generic support for built-in boot
DTBs") introduced generic support for built-in DTBs.

Select GENERIC_BUILTIN_DTB when built-in DTB support is enabled.

To keep consistency across architectures, this commit also renames
CONFIG_NIOS2_DTB_SOURCE_BOOL to CONFIG_BUILTIN_DTB, and
CONFIG_NIOS2_DTB_SOURCE to CONFIG_BUILTIN_DTB_NAME.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
pull/1196/head
Masahiro Yamada 2024-12-22 09:30:53 +09:00
parent 2c8725c1dc
commit 3b8241f64c
4 changed files with 10 additions and 9 deletions

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
obj-y += kernel/ mm/ platform/ boot/dts/ obj-y += kernel/ mm/ platform/
# for cleaning # for cleaning
subdir- += boot subdir- += boot

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
obj-y := $(patsubst %.dts,%.dtb.o,$(CONFIG_NIOS2_DTB_SOURCE)) dtb-y := $(addsuffix .dtb, $(CONFIG_BUILTIN_DTB_NAME))
dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(src)/%.dts,%.dtb, $(wildcard $(src)/*.dts)) dtb-$(CONFIG_OF_ALL_DTBS) += $(patsubst $(src)/%.dts,%.dtb, $(wildcard $(src)/*.dts))

View File

@ -32,7 +32,7 @@ void __init early_init_devtree(void *params)
} }
#endif #endif
#ifdef CONFIG_NIOS2_DTB_SOURCE_BOOL #ifdef CONFIG_BUILTIN_DTB
if (be32_to_cpu((__be32) *dtb) == OF_DT_HEADER) if (be32_to_cpu((__be32) *dtb) == OF_DT_HEADER)
params = (void *)__dtb_start; params = (void *)__dtb_start;
#endif #endif

View File

@ -35,19 +35,20 @@ config NIOS2_DTB_PHYS_ADDR
help help
Physical address of a dtb blob. Physical address of a dtb blob.
config NIOS2_DTB_SOURCE_BOOL config BUILTIN_DTB
bool "Compile and link device tree into kernel image" bool "Compile and link device tree into kernel image"
depends on !COMPILE_TEST depends on !COMPILE_TEST
select GENERIC_BUILTIN_DTB
help help
This allows you to specify a dts (device tree source) file This allows you to specify a dts (device tree source) file
which will be compiled and linked into the kernel image. which will be compiled and linked into the kernel image.
config NIOS2_DTB_SOURCE config BUILTIN_DTB_NAME
string "Device tree source file" string "Built-in device tree name"
depends on NIOS2_DTB_SOURCE_BOOL depends on BUILTIN_DTB
default "" default ""
help help
Absolute path to the device tree source (dts) file describing your Relative path to the device tree without suffix describing your
system. system.
comment "Nios II instructions" comment "Nios II instructions"