public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kbuild@vger.kernel.org
Cc: linux-arch@vger.kernel.org, linux-snps-arc@lists.infradead.org,
	linux-kernel@vger.kernel.org, Michal Simek <monstr@monstr.eu>,
	Rob Herring <robh@kernel.org>,
	devicetree@vger.kernel.org, linux-mips@vger.kernel.org,
	linux-openrisc@vger.kernel.org, Dinh Nguyen <dinguyen@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>
Subject: [PATCH 13/15] microblaze: migrate to the generic rule for built-in DTB
Date: Thu,  5 Sep 2024 08:47:49 +0900	[thread overview]
Message-ID: <20240904234803.698424-14-masahiroy@kernel.org> (raw)
In-Reply-To: <20240904234803.698424-1-masahiroy@kernel.org>

Select GENERIC_BUILTIN_DTB to use the generic rule to support built-in
DTB.

MicroBlaze is the only architecture that embeds the boot DTB into its
own section, __fdt_blob, and hard-codes the section size to 64kB.

All other architectures that support embedded DTBs use the
.dtb.init.rodata handled by include/asm-generic/vmlinux.lds.h.

For safety, arch/microblaze/boot/dts/system.dtb is still placed in the
__fdt_blob section, but removing the MicroBlaze-specific section should
be considered.

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

 arch/microblaze/Kbuild                | 1 -
 arch/microblaze/Kconfig               | 5 +++++
 arch/microblaze/boot/dts/Makefile     | 5 -----
 arch/microblaze/boot/dts/linked_dtb.S | 2 --
 arch/microblaze/kernel/vmlinux.lds.S  | 2 +-
 5 files changed, 6 insertions(+), 9 deletions(-)
 delete mode 100644 arch/microblaze/boot/dts/linked_dtb.S

diff --git a/arch/microblaze/Kbuild b/arch/microblaze/Kbuild
index 077a0b8e9615..70510389eb92 100644
--- a/arch/microblaze/Kbuild
+++ b/arch/microblaze/Kbuild
@@ -2,7 +2,6 @@
 obj-y			+= kernel/
 obj-y			+= mm/
 obj-$(CONFIG_PCI)	+= pci/
-obj-y			+= boot/dts/
 
 # for cleaning
 subdir- += boot
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index f18ec02ddeb2..4ed8ca89f0c9 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -10,6 +10,7 @@ config MICROBLAZE
 	select ARCH_MIGHT_HAVE_PC_PARPORT
 	select ARCH_WANT_IPC_PARSE_VERSION
 	select BUILDTIME_TABLE_SORT
+	select GENERIC_BUILTIN_DTB
 	select TIMER_OF
 	select CLONE_BACKWARDS3
 	select COMMON_CLK
@@ -47,6 +48,10 @@ config MICROBLAZE
 	select TRACE_IRQFLAGS_SUPPORT
 	select GENERIC_IRQ_MULTI_HANDLER
 
+config BUILTIN_DTB_NAME
+	string
+	default "system"
+
 # Endianness selection
 choice
 	prompt "Endianness selection"
diff --git a/arch/microblaze/boot/dts/Makefile b/arch/microblaze/boot/dts/Makefile
index b84e2cbb20ee..87c1d25ff096 100644
--- a/arch/microblaze/boot/dts/Makefile
+++ b/arch/microblaze/boot/dts/Makefile
@@ -4,11 +4,6 @@
 dtb-y := system.dtb
 
 ifneq ($(DTB),)
-obj-y += linked_dtb.o
-
-# Ensure system.dtb exists
-$(obj)/linked_dtb.o: $(obj)/system.dtb
-
 # Generate system.dtb from $(DTB).dtb
 ifneq ($(DTB),system)
 $(obj)/system.dtb: $(obj)/$(DTB).dtb
diff --git a/arch/microblaze/boot/dts/linked_dtb.S b/arch/microblaze/boot/dts/linked_dtb.S
deleted file mode 100644
index 23345af3721f..000000000000
--- a/arch/microblaze/boot/dts/linked_dtb.S
+++ /dev/null
@@ -1,2 +0,0 @@
-.section __fdt_blob,"a"
-.incbin "arch/microblaze/boot/dts/system.dtb"
diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S
index ae50d3d04a7d..e86f9ca8e979 100644
--- a/arch/microblaze/kernel/vmlinux.lds.S
+++ b/arch/microblaze/kernel/vmlinux.lds.S
@@ -47,7 +47,7 @@ SECTIONS {
 	. = ALIGN (8) ;
 	__fdt_blob : AT(ADDR(__fdt_blob) - LOAD_OFFSET) {
 		_fdt_start = . ;		/* place for fdt blob */
-		*(__fdt_blob) ;			/* Any link-placed DTB */
+		*(.dtb.init.rodata) ;		/* Any link-placed DTB */
 	        . = _fdt_start + 0x10000;	/* Pad up to 64kbyte */
 		_fdt_end = . ;
 	}
-- 
2.43.0


  parent reply	other threads:[~2024-09-04 23:48 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-04 23:47 [PATCH 00/15] kbuild: refactor DTB build rules, introduce a generic built-in boot DTB support Masahiro Yamada
2024-09-04 23:47 ` [PATCH 01/15] kbuild: add intermediate targets for Flex/Bison in scripts/Makefile.host Masahiro Yamada
2024-09-04 23:47 ` [PATCH 02/15] kbuild: split device tree build rules into scripts/Makefile.dtbs Masahiro Yamada
2024-09-05 13:44   ` Rob Herring
2024-09-04 23:47 ` [PATCH 03/15] kbuild: move non-boot builtin DTBs to .init.rodata section Masahiro Yamada
2024-09-05 13:47   ` Rob Herring
2024-09-04 23:47 ` [PATCH 04/15] kbuild: add generic support for built-in boot DTBs Masahiro Yamada
2024-09-05 14:17   ` Rob Herring
2024-09-06  1:56     ` Masahiro Yamada
2024-09-10  9:35     ` Masahiro Yamada
2024-09-04 23:47 ` [PATCH 05/15] MIPS: migrate to generic rule for built-in DTBs Masahiro Yamada
2024-09-04 23:47 ` [PATCH 06/15] riscv: migrate to the generic rule for built-in DTB Masahiro Yamada
2024-09-09 16:30   ` Conor Dooley
2024-09-04 23:47 ` [PATCH 07/15] LoongArch: " Masahiro Yamada
2024-09-04 23:47 ` [PATCH 08/15] ARC: " Masahiro Yamada
2024-09-04 23:47 ` [PATCH 09/15] openrisc: " Masahiro Yamada
2024-09-04 23:47 ` [PATCH 10/15] xtensa: " Masahiro Yamada
2024-09-04 23:47 ` [PATCH 11/15] nios2: " Masahiro Yamada
2024-09-04 23:47 ` [PATCH 12/15] sh: " Masahiro Yamada
2024-09-04 23:47 ` Masahiro Yamada [this message]
2024-09-04 23:47 ` [PATCH 14/15] kbuild: rename CONFIG_GENERIC_BUILTIN_DTB to CONFIG_BUILTIN_DTB Masahiro Yamada
2024-09-05 14:38   ` Rob Herring
2024-09-06  0:27     ` Masahiro Yamada
2024-09-04 23:47 ` [PATCH 15/15] kbuild: use .init.rodata section unconditionally for cmd_wrap_S_dtb Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240904234803.698424-14-masahiroy@kernel.org \
    --to=masahiroy@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dinguyen@kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-openrisc@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=monstr@monstr.eu \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox