From: Andrew Davis <afd@ti.com>
To: Shawn Guo <shawnguo@kernel.org>, Li Yang <leoyang.li@nxp.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Nishanth Menon <nm@ti.com>, Vignesh Raghavendra <vigneshr@ti.com>,
Masahiro Yamada <masahiroy@kernel.org>,
Michal Marek <michal.lkml@markovi.net>,
Nick Desaulniers <ndesaulniers@google.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Frank Rowand <frowand.list@gmail.com>
Cc: <devicetree@vger.kernel.org>, <linux-kbuild@vger.kernel.org>,
<linux-renesas-soc@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, Andrew Davis <afd@ti.com>
Subject: [PATCH 2/6] kbuild: Allow DTB overlays to built into .dtso.S files
Date: Sun, 23 Oct 2022 13:24:33 -0500 [thread overview]
Message-ID: <20221023182437.15263-3-afd@ti.com> (raw)
In-Reply-To: <20221023182437.15263-1-afd@ti.com>
DTB files can be built into the kernel by converting them to assembly
files then assembling them into object files. We extend this here
for DTB overlays with the .dtso extensions.
We change the start and end delimiting tag prefix to make it clear that
this data came from overlay files.
[Based on patch by Frank Rowand <frank.rowand@sony.com>]
Signed-off-by: Andrew Davis <afd@ti.com>
---
scripts/Makefile.lib | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 0376a6f18bfb1..250b9fd73f6d2 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -358,7 +358,7 @@ DTC_FLAGS += $(DTC_FLAGS_$(basetarget))
DTC_FLAGS += $(if $(filter $(patsubst $(obj)/%,%,$@), $(base-dtb-y)), -@)
# Generate an assembly file to wrap the output of the device tree compiler
-quiet_cmd_dt_S_dtb= DTB $@
+quiet_cmd_dt_S_dtb= DTBS $@
cmd_dt_S_dtb= \
{ \
echo '\#include <asm-generic/vmlinux.lds.h>'; \
@@ -375,6 +375,24 @@ cmd_dt_S_dtb= \
$(obj)/%.dtb.S: $(obj)/%.dtb FORCE
$(call if_changed,dt_S_dtb)
+# Generate an assembly file to wrap the output of the device tree compiler
+quiet_cmd_dt_S_dtbo= DTBOS $@
+cmd_dt_S_dtbo= \
+{ \
+ echo '\#include <asm-generic/vmlinux.lds.h>'; \
+ echo '.section .dtb.init.rodata,"a"'; \
+ echo '.balign STRUCT_ALIGNMENT'; \
+ echo '.global __dtbo_$(subst -,_,$(*F))_begin'; \
+ echo '__dtbo_$(subst -,_,$(*F))_begin:'; \
+ echo '.incbin "$<" '; \
+ echo '__dtbo_$(subst -,_,$(*F))_end:'; \
+ echo '.global __dtbo_$(subst -,_,$(*F))_end'; \
+ echo '.balign STRUCT_ALIGNMENT'; \
+} > $@
+
+$(obj)/%.dtbo.S: $(obj)/%.dtbo FORCE
+ $(call if_changed,dt_S_dtbo)
+
quiet_cmd_dtc = DTC $@
cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
$(DTC) -o $@ -b 0 \
--
2.37.3
next prev parent reply other threads:[~2022-10-23 18:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-23 18:24 [PATCH 0/6] Rename DTB overlay source files Andrew Davis
2022-10-23 18:24 ` [PATCH 1/6] kbuild: Allow DTB overlays to built from .dtso named " Andrew Davis
2022-10-24 11:47 ` Geert Uytterhoeven
2022-10-23 18:24 ` Andrew Davis [this message]
2022-10-24 12:07 ` [PATCH 2/6] kbuild: Allow DTB overlays to built into .dtso.S files Geert Uytterhoeven
2022-10-23 18:24 ` [PATCH 3/6] of: overlay: rename overlay source files from .dts to .dtso Andrew Davis
2022-10-24 12:09 ` Geert Uytterhoeven
2022-10-23 18:24 ` [PATCH 4/6] arm64: dts: freescale: Rename DTB " Andrew Davis
2022-10-24 12:19 ` Geert Uytterhoeven
2022-10-23 18:24 ` [PATCH 5/6] arm64: dts: renesas: " Andrew Davis
2022-10-24 12:20 ` Geert Uytterhoeven
2022-10-23 18:24 ` [PATCH 6/6] arm64: dts: xilinx: " Andrew Davis
2022-10-24 12:20 ` Geert Uytterhoeven
2022-10-24 12:28 ` [PATCH 0/6] Rename DTB overlay source files Geert Uytterhoeven
2022-10-24 17:29 ` Andrew Davis
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=20221023182437.15263-3-afd@ti.com \
--to=afd@ti.com \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=geert@linux-m68k.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=leoyang.li@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=michal.lkml@markovi.net \
--cc=ndesaulniers@google.com \
--cc=nm@ti.com \
--cc=robh+dt@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=vigneshr@ti.com \
/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;
as well as URLs for NNTP newsgroup(s).