linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sh: migrate to the generic rule for built-in DTB
@ 2024-12-22  0:32 Masahiro Yamada
  2025-01-30  8:39 ` John Paul Adrian Glaubitz
  0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2024-12-22  0:32 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker, John Paul Adrian Glaubitz, linux-sh
  Cc: linux-kernel, Masahiro Yamada, Conor Dooley, Krzysztof Kozlowski,
	Rob Herring, devicetree

Commit 654102df2ac2 ("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_USE_BUILTIN_DTB to CONFIG_BUILTIN_DTB, and
CONFIG_BUILTIN_DTB_SOURCE to CONFIG_BUILTIN_DTB_NAME.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 arch/sh/Kbuild            | 1 -
 arch/sh/Kconfig           | 7 ++++---
 arch/sh/boot/dts/Makefile | 2 +-
 arch/sh/kernel/setup.c    | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/sh/Kbuild b/arch/sh/Kbuild
index 056efec72c2a..0da6c6d6821a 100644
--- a/arch/sh/Kbuild
+++ b/arch/sh/Kbuild
@@ -1,7 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0-only
 obj-y				+= kernel/ mm/ boards/
 obj-$(CONFIG_SH_FPU_EMU)	+= math-emu/
-obj-$(CONFIG_USE_BUILTIN_DTB)	+= boot/dts/
 
 obj-$(CONFIG_HD6446X_SERIES)	+= cchips/hd6446x/
 
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 04ff5fb9242e..89185af7bcc9 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -648,10 +648,11 @@ endmenu
 
 menu "Boot options"
 
-config USE_BUILTIN_DTB
+config BUILTIN_DTB
 	bool "Use builtin DTB"
 	default n
 	depends on SH_DEVICE_TREE
+	select GENERIC_BUILTIN_DTB
 	help
 	  Link a device tree blob for particular hardware into the kernel,
 	  suppressing use of the DTB pointer provided by the bootloader.
@@ -659,10 +660,10 @@ config USE_BUILTIN_DTB
 	  not capable of providing a DTB to the kernel, or for experimental
 	  hardware without stable device tree bindings.
 
-config BUILTIN_DTB_SOURCE
+config BUILTIN_DTB_NAME
 	string "Source file for builtin DTB"
 	default ""
-	depends on USE_BUILTIN_DTB
+	depends on BUILTIN_DTB
 	help
 	  Base name (without suffix, relative to arch/sh/boot/dts) for the
 	  a DTS file that will be used to produce the DTB linked into the
diff --git a/arch/sh/boot/dts/Makefile b/arch/sh/boot/dts/Makefile
index 4a6dec9714a9..d109978a5eb9 100644
--- a/arch/sh/boot/dts/Makefile
+++ b/arch/sh/boot/dts/Makefile
@@ -1,2 +1,2 @@
 # SPDX-License-Identifier: GPL-2.0-only
-obj-$(CONFIG_USE_BUILTIN_DTB) += $(addsuffix .dtb.o, $(CONFIG_BUILTIN_DTB_SOURCE))
+obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .dtb.o, $(CONFIG_BUILTIN_DTB_NAME))
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index f2b6f16a46b8..039a51291002 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -249,7 +249,7 @@ void __ref sh_fdt_init(phys_addr_t dt_phys)
 	/* Avoid calling an __init function on secondary cpus. */
 	if (done) return;
 
-#ifdef CONFIG_USE_BUILTIN_DTB
+#ifdef CONFIG_BUILTIN_DTB
 	dt_virt = __dtb_start;
 #else
 	dt_virt = phys_to_virt(dt_phys);
@@ -323,7 +323,7 @@ void __init setup_arch(char **cmdline_p)
 	sh_early_platform_driver_probe("earlyprintk", 1, 1);
 
 #ifdef CONFIG_OF_EARLY_FLATTREE
-#ifdef CONFIG_USE_BUILTIN_DTB
+#ifdef CONFIG_BUILTIN_DTB
 	unflatten_and_copy_device_tree();
 #else
 	unflatten_device_tree();
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] sh: migrate to the generic rule for built-in DTB
  2024-12-22  0:32 [PATCH] sh: migrate to the generic rule for built-in DTB Masahiro Yamada
@ 2025-01-30  8:39 ` John Paul Adrian Glaubitz
  0 siblings, 0 replies; 2+ messages in thread
From: John Paul Adrian Glaubitz @ 2025-01-30  8:39 UTC (permalink / raw)
  To: Masahiro Yamada, Yoshinori Sato, Rich Felker, linux-sh
  Cc: linux-kernel, Conor Dooley, Krzysztof Kozlowski, Rob Herring,
	devicetree

Hi Masahiro,

On Sun, 2024-12-22 at 09:32 +0900, Masahiro Yamada wrote:
> Commit 654102df2ac2 ("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_USE_BUILTIN_DTB to CONFIG_BUILTIN_DTB, and
> CONFIG_BUILTIN_DTB_SOURCE to CONFIG_BUILTIN_DTB_NAME.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  arch/sh/Kbuild            | 1 -
>  arch/sh/Kconfig           | 7 ++++---
>  arch/sh/boot/dts/Makefile | 2 +-
>  arch/sh/kernel/setup.c    | 4 ++--
>  4 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/sh/Kbuild b/arch/sh/Kbuild
> index 056efec72c2a..0da6c6d6821a 100644
> --- a/arch/sh/Kbuild
> +++ b/arch/sh/Kbuild
> @@ -1,7 +1,6 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  obj-y				+= kernel/ mm/ boards/
>  obj-$(CONFIG_SH_FPU_EMU)	+= math-emu/
> -obj-$(CONFIG_USE_BUILTIN_DTB)	+= boot/dts/
>  
>  obj-$(CONFIG_HD6446X_SERIES)	+= cchips/hd6446x/
>  
> diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
> index 04ff5fb9242e..89185af7bcc9 100644
> --- a/arch/sh/Kconfig
> +++ b/arch/sh/Kconfig
> @@ -648,10 +648,11 @@ endmenu
>  
>  menu "Boot options"
>  
> -config USE_BUILTIN_DTB
> +config BUILTIN_DTB
>  	bool "Use builtin DTB"
>  	default n
>  	depends on SH_DEVICE_TREE
> +	select GENERIC_BUILTIN_DTB
>  	help
>  	  Link a device tree blob for particular hardware into the kernel,
>  	  suppressing use of the DTB pointer provided by the bootloader.
> @@ -659,10 +660,10 @@ config USE_BUILTIN_DTB
>  	  not capable of providing a DTB to the kernel, or for experimental
>  	  hardware without stable device tree bindings.
>  
> -config BUILTIN_DTB_SOURCE
> +config BUILTIN_DTB_NAME
>  	string "Source file for builtin DTB"
>  	default ""
> -	depends on USE_BUILTIN_DTB
> +	depends on BUILTIN_DTB
>  	help
>  	  Base name (without suffix, relative to arch/sh/boot/dts) for the
>  	  a DTS file that will be used to produce the DTB linked into the
> diff --git a/arch/sh/boot/dts/Makefile b/arch/sh/boot/dts/Makefile
> index 4a6dec9714a9..d109978a5eb9 100644
> --- a/arch/sh/boot/dts/Makefile
> +++ b/arch/sh/boot/dts/Makefile
> @@ -1,2 +1,2 @@
>  # SPDX-License-Identifier: GPL-2.0-only
> -obj-$(CONFIG_USE_BUILTIN_DTB) += $(addsuffix .dtb.o, $(CONFIG_BUILTIN_DTB_SOURCE))
> +obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .dtb.o, $(CONFIG_BUILTIN_DTB_NAME))
> diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
> index f2b6f16a46b8..039a51291002 100644
> --- a/arch/sh/kernel/setup.c
> +++ b/arch/sh/kernel/setup.c
> @@ -249,7 +249,7 @@ void __ref sh_fdt_init(phys_addr_t dt_phys)
>  	/* Avoid calling an __init function on secondary cpus. */
>  	if (done) return;
>  
> -#ifdef CONFIG_USE_BUILTIN_DTB
> +#ifdef CONFIG_BUILTIN_DTB
>  	dt_virt = __dtb_start;
>  #else
>  	dt_virt = phys_to_virt(dt_phys);
> @@ -323,7 +323,7 @@ void __init setup_arch(char **cmdline_p)
>  	sh_early_platform_driver_probe("earlyprintk", 1, 1);
>  
>  #ifdef CONFIG_OF_EARLY_FLATTREE
> -#ifdef CONFIG_USE_BUILTIN_DTB
> +#ifdef CONFIG_BUILTIN_DTB
>  	unflatten_and_copy_device_tree();
>  #else
>  	unflatten_device_tree();

Looks like a good idea to address possible race conditions during build.

Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

Thanks,
Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-30  8:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-22  0:32 [PATCH] sh: migrate to the generic rule for built-in DTB Masahiro Yamada
2025-01-30  8:39 ` John Paul Adrian Glaubitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).