From: Stephen Warren <swarren@wwwdotorg.org>
To: David Gibson <david@gibson.dropbear.id.au>,
Jon Loeliger <jdl@jdl.com>,
Grant Likely <grant.likely@secretlab.ca>,
Rob Herring <rob.herring@calxeda.com>,
Scott Wood <scottwood@freescale.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: devicetree-discuss@lists.ozlabs.org,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
Stephen Warren <swarren@nvidia.com>
Subject: [RFC PATCH 2/2] kbuild: introduce cmd_dtc_cpp
Date: Fri, 28 Sep 2012 13:32:11 -0600 [thread overview]
Message-ID: <1348860731-20868-3-git-send-email-swarren@wwwdotorg.org> (raw)
In-Reply-To: <1348860731-20868-1-git-send-email-swarren@wwwdotorg.org>
From: Stephen Warren <swarren@nvidia.com>
cmd_dtc_cpp runs the C pre-processor on the input .dts file before
passing it to dtc for final compilation. This allows used of #define
within the .dts file.
Introduce a new rule for %.dtsp -> %.dtb, which uses cmd_dtc_cpp. A new
file extension is introduced for this purpose, since use of the pre-
processor must be optional; any property or node name that starts with
"#" must be escaped to prevent the pre-processor attempting to interpret
it as a directive. For this reason, skeleton.dtsi-cpp is introduced for
*.dts-cpp to include.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
arch/arm/boot/dts/skeleton.dtsip | 13 +++++++++++++
scripts/Makefile.lib | 6 ++++++
2 files changed, 19 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/boot/dts/skeleton.dtsip
diff --git a/arch/arm/boot/dts/skeleton.dtsip b/arch/arm/boot/dts/skeleton.dtsip
new file mode 100644
index 0000000..8bf6729
--- /dev/null
+++ b/arch/arm/boot/dts/skeleton.dtsip
@@ -0,0 +1,13 @@
+/*
+ * Skeleton device tree; the bare minimum needed to boot; just include and
+ * add a compatible value. The bootloader will typically populate the memory
+ * node.
+ */
+
+/ {
+ \#address-cells = <1>;
+ \#size-cells = <1>;
+ chosen { };
+ aliases { };
+ memory { device_type = "memory"; reg = <0 0>; };
+};
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 425578e..9dd81c0 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -269,6 +269,12 @@ cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile
$(obj)/%.dtb: $(src)/dts/%.dts FORCE
$(call if_changed_dep,dtc)
+quiet_cmd_dtc_cpp = DTC+CPP $@
+cmd_dtc_cpp = $(CC) -E -Wp,-MD,$(depfile) -xc $< | $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -
+
+$(obj)/%.dtb: $(src)/dts/%.dtsp FORCE
+ $(call if_changed_dep,dtc_cpp)
+
# Bzip2
# ---------------------------------------------------------------------------
--
1.7.0.4
next prev parent reply other threads:[~2012-09-28 19:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-28 19:32 [RFC PATCH 0/2] dtc: enable use of pre-processor Stephen Warren
2012-09-28 19:32 ` [RFC PATCH 1/2] kbuild: centralize .dts->.dtb rule Stephen Warren
2012-09-29 20:08 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-01 15:36 ` Stephen Warren
2012-09-28 19:32 ` Stephen Warren [this message]
2012-09-29 20:02 ` [RFC PATCH 2/2] kbuild: introduce cmd_dtc_cpp Jean-Christophe PLAGNIOL-VILLARD
2012-09-28 20:39 ` [RFC PATCH 0/2] dtc: enable use of pre-processor Jon Loeliger
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=1348860731-20868-3-git-send-email-swarren@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=david@gibson.dropbear.id.au \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=jdl@jdl.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=plagnioj@jcrosoft.com \
--cc=rob.herring@calxeda.com \
--cc=scottwood@freescale.com \
--cc=swarren@nvidia.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
all inboxes | Powered by JetHome®