devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] ARM: use C pre-processor with dtc
@ 2012-09-25 19:06 Stephen Warren
       [not found] ` <1348599998-2729-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  0 siblings, 1 reply; 19+ messages in thread
From: Stephen Warren @ 2012-09-25 19:06 UTC (permalink / raw)
  To: David Gibson, Jon Loeliger, Arnd Bergmann, Olof Johansson,
	Russell King, Grant Likely, Rob Herring
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Stephen Warren,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

This series adds some build rules to run cpp on *.dts-cpp prior to
invoking dtc, and converts Tegra to the new rule as an example. What do
people think?

I assume that you've applied the dtc patches I sent yesterday. They
aren't in this series. See:

https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-September/020182.html
https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-September/020183.html
https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-September/020181.html

Note: those patches are against upstream dtc. If you wish to test this
series, apply the dtc patches to upstream dtc, build it, and copy the
resultant dtc binary over the top of scripts/dtc/dtc.

Stephen Warren (3):
  kbuild: introduce cmd_dtc_cpp
  ARM: use cmd_dtc_cpp for compilation of *.dts-cpp to *.dtb
  ARM: tegra: compile all DT files with cpp

 arch/arm/boot/Makefile                             |    3 ++
 arch/arm/boot/dts/skeleton.dtsi-cpp                |   13 +++++++
 ...tegra20-harmony.dts => tegra20-harmony.dts-cpp} |   10 +++---
 ...medcom-wide.dts => tegra20-medcom-wide.dts-cpp} |    4 +-
 .../{tegra20-paz00.dts => tegra20-paz00.dts-cpp}   |   14 ++++----
 .../{tegra20-plutux.dts => tegra20-plutux.dts-cpp} |    4 +-
 ...gra20-seaboard.dts => tegra20-seaboard.dts-cpp} |   22 ++++++------
 ...a20-tamonten.dtsi => tegra20-tamonten.dtsi-cpp} |    8 ++--
 .../dts/{tegra20-tec.dts => tegra20-tec.dts-cpp}   |    4 +-
 ...a20-trimslice.dts => tegra20-trimslice.dts-cpp} |    2 +-
 ...tegra20-ventana.dts => tegra20-ventana.dts-cpp} |   10 +++---
 ...gra20-whistler.dts => tegra20-whistler.dts-cpp} |    8 ++--
 .../boot/dts/{tegra20.dtsi => tegra20.dtsi-cpp}    |   30 +++++++++---------
 ...0-cardhu-a02.dts => tegra30-cardhu-a02.dts-cpp} |    6 ++--
 ...0-cardhu-a04.dts => tegra30-cardhu-a04.dts-cpp} |    6 ++--
 ...tegra30-cardhu.dtsi => tegra30-cardhu.dtsi-cpp} |   12 +++---
 .../boot/dts/{tegra30.dtsi => tegra30.dtsi-cpp}    |   34 ++++++++++----------
 scripts/Makefile.lib                               |    3 ++
 18 files changed, 106 insertions(+), 87 deletions(-)
 create mode 100644 arch/arm/boot/dts/skeleton.dtsi-cpp
 rename arch/arm/boot/dts/{tegra20-harmony.dts => tegra20-harmony.dts-cpp} (98%)
 rename arch/arm/boot/dts/{tegra20-medcom-wide.dts => tegra20-medcom-wide.dts-cpp} (95%)
 rename arch/arm/boot/dts/{tegra20-paz00.dts => tegra20-paz00.dts-cpp} (98%)
 rename arch/arm/boot/dts/{tegra20-plutux.dts => tegra20-plutux.dts-cpp} (94%)
 rename arch/arm/boot/dts/{tegra20-seaboard.dts => tegra20-seaboard.dts-cpp} (98%)
 rename arch/arm/boot/dts/{tegra20-tamonten.dtsi => tegra20-tamonten.dtsi-cpp} (98%)
 rename arch/arm/boot/dts/{tegra20-tec.dts => tegra20-tec.dts-cpp} (94%)
 rename arch/arm/boot/dts/{tegra20-trimslice.dts => tegra20-trimslice.dts-cpp} (99%)
 rename arch/arm/boot/dts/{tegra20-ventana.dts => tegra20-ventana.dts-cpp} (98%)
 rename arch/arm/boot/dts/{tegra20-whistler.dts => tegra20-whistler.dts-cpp} (99%)
 rename arch/arm/boot/dts/{tegra20.dtsi => tegra20.dtsi-cpp} (93%)
 rename arch/arm/boot/dts/{tegra30-cardhu-a02.dts => tegra30-cardhu-a02.dts-cpp} (96%)
 rename arch/arm/boot/dts/{tegra30-cardhu-a04.dts => tegra30-cardhu-a04.dts-cpp} (96%)
 rename arch/arm/boot/dts/{tegra30-cardhu.dtsi => tegra30-cardhu.dtsi-cpp} (98%)
 rename arch/arm/boot/dts/{tegra30.dtsi => tegra30.dtsi-cpp} (93%)

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

* [RFC PATCH 1/3] kbuild: introduce cmd_dtc_cpp
       [not found] ` <1348599998-2729-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2012-09-25 19:06   ` Stephen Warren
  2012-09-27  5:44     ` Jean-Christophe PLAGNIOL-VILLARD
  2012-09-25 19:06   ` [RFC PATCH 2/3] ARM: use cmd_dtc_cpp for compilation of *.dts-cpp to *.dtb Stephen Warren
                     ` (3 subsequent siblings)
  4 siblings, 1 reply; 19+ messages in thread
From: Stephen Warren @ 2012-09-25 19:06 UTC (permalink / raw)
  To: David Gibson, Jon Loeliger, Arnd Bergmann, Olof Johansson,
	Russell King, Grant Likely, Rob Herring
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Stephen Warren,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

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.

Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 scripts/Makefile.lib |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 0be6f11..e3a149e 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -266,6 +266,9 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
 quiet_cmd_dtc = DTC     $@
 cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $<
 
+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) -
+
 # Bzip2
 # ---------------------------------------------------------------------------
 
-- 
1.7.0.4

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

* [RFC PATCH 2/3] ARM: use cmd_dtc_cpp for compilation of *.dts-cpp to *.dtb
       [not found] ` <1348599998-2729-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  2012-09-25 19:06   ` [RFC PATCH 1/3] kbuild: introduce cmd_dtc_cpp Stephen Warren
@ 2012-09-25 19:06   ` Stephen Warren
       [not found]     ` <1348599998-2729-3-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  2012-09-25 19:06   ` [RFC PATCH 3/3] ARM: tegra: compile all DT files with cpp Stephen Warren
                     ` (2 subsequent siblings)
  4 siblings, 1 reply; 19+ messages in thread
From: Stephen Warren @ 2012-09-25 19:06 UTC (permalink / raw)
  To: David Gibson, Jon Loeliger, Arnd Bergmann, Olof Johansson,
	Russell King, Grant Likely, Rob Herring
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Stephen Warren,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

This allows DT source files to use the C pre-processor. 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-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 arch/arm/boot/Makefile              |    3 +++
 arch/arm/boot/dts/skeleton.dtsi-cpp |   13 +++++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/skeleton.dtsi-cpp

diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index 3fdab01..c5d7fca 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -65,6 +65,9 @@ targets += $(dtb-y)
 $(obj)/%.dtb: $(src)/dts/%.dts FORCE
 	$(call if_changed_dep,dtc)
 
+$(obj)/%.dtb: $(src)/dts/%.dts-cpp FORCE
+	$(call if_changed_dep,dtc_cpp)
+
 $(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y))
 
 clean-files := *.dtb
diff --git a/arch/arm/boot/dts/skeleton.dtsi-cpp b/arch/arm/boot/dts/skeleton.dtsi-cpp
new file mode 100644
index 0000000..8bf6729
--- /dev/null
+++ b/arch/arm/boot/dts/skeleton.dtsi-cpp
@@ -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>; };
+};
-- 
1.7.0.4

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

* [RFC PATCH 3/3] ARM: tegra: compile all DT files with cpp
       [not found] ` <1348599998-2729-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  2012-09-25 19:06   ` [RFC PATCH 1/3] kbuild: introduce cmd_dtc_cpp Stephen Warren
  2012-09-25 19:06   ` [RFC PATCH 2/3] ARM: use cmd_dtc_cpp for compilation of *.dts-cpp to *.dtb Stephen Warren
@ 2012-09-25 19:06   ` Stephen Warren
  2012-09-25 19:35   ` [RFC PATCH 0/3] ARM: use C pre-processor with dtc Scott Wood
  2012-09-27  5:40   ` Jean-Christophe PLAGNIOL-VILLARD
  4 siblings, 0 replies; 19+ messages in thread
From: Stephen Warren @ 2012-09-25 19:06 UTC (permalink / raw)
  To: David Gibson, Jon Loeliger, Arnd Bergmann, Olof Johansson,
	Russell King, Grant Likely, Rob Herring
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Stephen Warren,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

We perform the minimum set of changes to convert the Tegra *.dts to
compile using the C pre-processor before dtc:

* Rename all the files to trigger the new build rule.
* Escape all property names that start with a # so they aren't seen as
  C pre-processor directives.

Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 ...tegra20-harmony.dts => tegra20-harmony.dts-cpp} |   10 +++---
 ...medcom-wide.dts => tegra20-medcom-wide.dts-cpp} |    4 +-
 .../{tegra20-paz00.dts => tegra20-paz00.dts-cpp}   |   14 ++++----
 .../{tegra20-plutux.dts => tegra20-plutux.dts-cpp} |    4 +-
 ...gra20-seaboard.dts => tegra20-seaboard.dts-cpp} |   22 ++++++------
 ...a20-tamonten.dtsi => tegra20-tamonten.dtsi-cpp} |    8 ++--
 .../dts/{tegra20-tec.dts => tegra20-tec.dts-cpp}   |    4 +-
 ...a20-trimslice.dts => tegra20-trimslice.dts-cpp} |    2 +-
 ...tegra20-ventana.dts => tegra20-ventana.dts-cpp} |   10 +++---
 ...gra20-whistler.dts => tegra20-whistler.dts-cpp} |    8 ++--
 .../boot/dts/{tegra20.dtsi => tegra20.dtsi-cpp}    |   30 +++++++++---------
 ...0-cardhu-a02.dts => tegra30-cardhu-a02.dts-cpp} |    6 ++--
 ...0-cardhu-a04.dts => tegra30-cardhu-a04.dts-cpp} |    6 ++--
 ...tegra30-cardhu.dtsi => tegra30-cardhu.dtsi-cpp} |   12 +++---
 .../boot/dts/{tegra30.dtsi => tegra30.dtsi-cpp}    |   34 ++++++++++----------
 15 files changed, 87 insertions(+), 87 deletions(-)
 rename arch/arm/boot/dts/{tegra20-harmony.dts => tegra20-harmony.dts-cpp} (98%)
 rename arch/arm/boot/dts/{tegra20-medcom-wide.dts => tegra20-medcom-wide.dts-cpp} (95%)
 rename arch/arm/boot/dts/{tegra20-paz00.dts => tegra20-paz00.dts-cpp} (98%)
 rename arch/arm/boot/dts/{tegra20-plutux.dts => tegra20-plutux.dts-cpp} (94%)
 rename arch/arm/boot/dts/{tegra20-seaboard.dts => tegra20-seaboard.dts-cpp} (98%)
 rename arch/arm/boot/dts/{tegra20-tamonten.dtsi => tegra20-tamonten.dtsi-cpp} (98%)
 rename arch/arm/boot/dts/{tegra20-tec.dts => tegra20-tec.dts-cpp} (94%)
 rename arch/arm/boot/dts/{tegra20-trimslice.dts => tegra20-trimslice.dts-cpp} (99%)
 rename arch/arm/boot/dts/{tegra20-ventana.dts => tegra20-ventana.dts-cpp} (98%)
 rename arch/arm/boot/dts/{tegra20-whistler.dts => tegra20-whistler.dts-cpp} (99%)
 rename arch/arm/boot/dts/{tegra20.dtsi => tegra20.dtsi-cpp} (93%)
 rename arch/arm/boot/dts/{tegra30-cardhu-a02.dts => tegra30-cardhu-a02.dts-cpp} (96%)
 rename arch/arm/boot/dts/{tegra30-cardhu-a04.dts => tegra30-cardhu-a04.dts-cpp} (96%)
 rename arch/arm/boot/dts/{tegra30-cardhu.dtsi => tegra30-cardhu.dtsi-cpp} (98%)
 rename arch/arm/boot/dts/{tegra30.dtsi => tegra30.dtsi-cpp} (93%)

diff --git a/arch/arm/boot/dts/tegra20-harmony.dts b/arch/arm/boot/dts/tegra20-harmony.dts-cpp
similarity index 98%
rename from arch/arm/boot/dts/tegra20-harmony.dts
rename to arch/arm/boot/dts/tegra20-harmony.dts-cpp
index 74b8a47..b956919 100644
--- a/arch/arm/boot/dts/tegra20-harmony.dts
+++ b/arch/arm/boot/dts/tegra20-harmony.dts-cpp
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "tegra20.dtsi"
+#include "tegra20.dtsi-cpp"
 
 / {
 	model = "NVIDIA Tegra2 Harmony evaluation board";
@@ -254,7 +254,7 @@
 			interrupts = <187 0x04>;
 
 			gpio-controller;
-			#gpio-cells = <2>;
+			\#gpio-cells = <2>;
 
 			micdet-cfg = <0>;
 			micdet-delay = <100>;
@@ -283,7 +283,7 @@
 
 			ti,system-power-controller;
 
-			#gpio-cells = <2>;
+			\#gpio-cells = <2>;
 			gpio-controller;
 
 			sys-supply = <&vdd_5v0_reg>;
@@ -433,8 +433,8 @@
 
 	regulators {
 		compatible = "simple-bus";
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 
 		vdd_5v0_reg: regulator@0 {
 			compatible = "regulator-fixed";
diff --git a/arch/arm/boot/dts/tegra20-medcom-wide.dts b/arch/arm/boot/dts/tegra20-medcom-wide.dts-cpp
similarity index 95%
rename from arch/arm/boot/dts/tegra20-medcom-wide.dts
rename to arch/arm/boot/dts/tegra20-medcom-wide.dts-cpp
index a2d6d65..087c547 100644
--- a/arch/arm/boot/dts/tegra20-medcom-wide.dts
+++ b/arch/arm/boot/dts/tegra20-medcom-wide.dts-cpp
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "tegra20-tamonten.dtsi"
+#include "tegra20-tamonten.dtsi-cpp"
 
 / {
 	model = "Avionic Design Medcom-Wide board";
@@ -14,7 +14,7 @@
 			interrupts = <187 0x04>;
 
 			gpio-controller;
-			#gpio-cells = <2>;
+			\#gpio-cells = <2>;
 
 			micdet-cfg = <0>;
 			micdet-delay = <100>;
diff --git a/arch/arm/boot/dts/tegra20-paz00.dts b/arch/arm/boot/dts/tegra20-paz00.dts-cpp
similarity index 98%
rename from arch/arm/boot/dts/tegra20-paz00.dts
rename to arch/arm/boot/dts/tegra20-paz00.dts-cpp
index 6a93d14..9df43c0 100644
--- a/arch/arm/boot/dts/tegra20-paz00.dts
+++ b/arch/arm/boot/dts/tegra20-paz00.dts-cpp
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "tegra20.dtsi"
+#include "tegra20.dtsi-cpp"
 
 / {
 	model = "Toshiba AC100 / Dynabook AZ";
@@ -248,7 +248,7 @@
 			compatible = "realtek,alc5632";
 			reg = <0x1e>;
 			gpio-controller;
-			#gpio-cells = <2>;
+			\#gpio-cells = <2>;
 		};
 	};
 
@@ -261,8 +261,8 @@
 		compatible = "nvidia,nvec";
 		reg = <0x7000c500 0x100>;
 		interrupts = <0 92 0x04>;
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 		clock-frequency = <80000>;
 		request-gpios = <&gpio 170 0>; /* gpio PV2 */
 		slave-addr = <138>;
@@ -277,7 +277,7 @@
 			reg = <0x34>;
 			interrupts = <0 86 0x4>;
 
-			#gpio-cells = <2>;
+			\#gpio-cells = <2>;
 			gpio-controller;
 
 			sys-supply = <&p5valw_reg>;
@@ -454,8 +454,8 @@
 
 	regulators {
 		compatible = "simple-bus";
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 
 		p5valw_reg: regulator@0 {
 			compatible = "regulator-fixed";
diff --git a/arch/arm/boot/dts/tegra20-plutux.dts b/arch/arm/boot/dts/tegra20-plutux.dts-cpp
similarity index 94%
rename from arch/arm/boot/dts/tegra20-plutux.dts
rename to arch/arm/boot/dts/tegra20-plutux.dts-cpp
index 331a3ef..67045ab 100644
--- a/arch/arm/boot/dts/tegra20-plutux.dts
+++ b/arch/arm/boot/dts/tegra20-plutux.dts-cpp
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "tegra20-tamonten.dtsi"
+#include "tegra20-tamonten.dtsi-cpp"
 
 / {
 	model = "Avionic Design Plutux board";
@@ -14,7 +14,7 @@
 			interrupts = <187 0x04>;
 
 			gpio-controller;
-			#gpio-cells = <2>;
+			\#gpio-cells = <2>;
 
 			micdet-cfg = <0>;
 			micdet-delay = <100>;
diff --git a/arch/arm/boot/dts/tegra20-seaboard.dts b/arch/arm/boot/dts/tegra20-seaboard.dts-cpp
similarity index 98%
rename from arch/arm/boot/dts/tegra20-seaboard.dts
rename to arch/arm/boot/dts/tegra20-seaboard.dts-cpp
index 33ae813..2f7f039 100644
--- a/arch/arm/boot/dts/tegra20-seaboard.dts
+++ b/arch/arm/boot/dts/tegra20-seaboard.dts-cpp
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "tegra20.dtsi"
+#include "tegra20.dtsi-cpp"
 
 / {
 	model = "NVIDIA Seaboard";
@@ -305,7 +305,7 @@
 			interrupts = <187 0x04>;
 
 			gpio-controller;
-			#gpio-cells = <2>;
+			\#gpio-cells = <2>;
 
 			micdet-cfg = <0>;
 			micdet-delay = <100>;
@@ -335,8 +335,8 @@
 
 	i2cmux {
 		compatible = "i2c-mux-pinctrl";
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 
 		i2c-parent = <&{/i2c@7000c400}>;
 
@@ -347,14 +347,14 @@
 
 		i2c@0 {
 			reg = <0>;
-			#address-cells = <1>;
-			#size-cells = <0>;
+			\#address-cells = <1>;
+			\#size-cells = <0>;
 		};
 
 		i2c@1 {
 			reg = <1>;
-			#address-cells = <1>;
-			#size-cells = <0>;
+			\#address-cells = <1>;
+			\#size-cells = <0>;
 
 			smart-battery@b {
 				compatible = "ti,bq20z75", "smart-battery-1.1";
@@ -381,7 +381,7 @@
 
 			ti,system-power-controller;
 
-			#gpio-cells = <2>;
+			\#gpio-cells = <2>;
 			gpio-controller;
 
 			sys-supply = <&vdd_5v0_reg>;
@@ -596,8 +596,8 @@
 
 	regulators {
 		compatible = "simple-bus";
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 
 		vdd_5v0_reg: regulator@0 {
 			compatible = "regulator-fixed";
diff --git a/arch/arm/boot/dts/tegra20-tamonten.dtsi b/arch/arm/boot/dts/tegra20-tamonten.dtsi-cpp
similarity index 98%
rename from arch/arm/boot/dts/tegra20-tamonten.dtsi
rename to arch/arm/boot/dts/tegra20-tamonten.dtsi-cpp
index 5b3d8b1..2e964f0 100644
--- a/arch/arm/boot/dts/tegra20-tamonten.dtsi
+++ b/arch/arm/boot/dts/tegra20-tamonten.dtsi-cpp
@@ -1,4 +1,4 @@
-/include/ "tegra20.dtsi"
+#include "tegra20.dtsi-cpp"
 
 / {
 	model = "Avionic Design Tamonten SOM";
@@ -257,7 +257,7 @@
 
 			ti,system-power-controller;
 
-			#gpio-cells = <2>;
+			\#gpio-cells = <2>;
 			gpio-controller;
 
 			sys-supply = <&vdd_5v0_reg>;
@@ -401,8 +401,8 @@
 	regulators {
 		compatible = "simple-bus";
 
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 
 		vdd_5v0_reg: regulator@0 {
 			compatible = "regulator-fixed";
diff --git a/arch/arm/boot/dts/tegra20-tec.dts b/arch/arm/boot/dts/tegra20-tec.dts-cpp
similarity index 94%
rename from arch/arm/boot/dts/tegra20-tec.dts
rename to arch/arm/boot/dts/tegra20-tec.dts-cpp
index 9aff31b..a84ac4d 100644
--- a/arch/arm/boot/dts/tegra20-tec.dts
+++ b/arch/arm/boot/dts/tegra20-tec.dts-cpp
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "tegra20-tamonten.dtsi"
+#include "tegra20-tamonten.dtsi-cpp"
 
 / {
 	model = "Avionic Design Tamonten Evaluation Carrier";
@@ -17,7 +17,7 @@
 			interrupts = <187 0x04>;
 
 			gpio-controller;
-			#gpio-cells = <2>;
+			\#gpio-cells = <2>;
 
 			micdet-cfg = <0>;
 			micdet-delay = <100>;
diff --git a/arch/arm/boot/dts/tegra20-trimslice.dts b/arch/arm/boot/dts/tegra20-trimslice.dts-cpp
similarity index 99%
rename from arch/arm/boot/dts/tegra20-trimslice.dts
rename to arch/arm/boot/dts/tegra20-trimslice.dts-cpp
index 27fb8a6..de0bef8 100644
--- a/arch/arm/boot/dts/tegra20-trimslice.dts
+++ b/arch/arm/boot/dts/tegra20-trimslice.dts-cpp
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "tegra20.dtsi"
+#include "tegra20.dtsi-cpp"
 
 / {
 	model = "Compulab TrimSlice board";
diff --git a/arch/arm/boot/dts/tegra20-ventana.dts b/arch/arm/boot/dts/tegra20-ventana.dts-cpp
similarity index 98%
rename from arch/arm/boot/dts/tegra20-ventana.dts
rename to arch/arm/boot/dts/tegra20-ventana.dts-cpp
index 86854f1..6cff59d 100644
--- a/arch/arm/boot/dts/tegra20-ventana.dts
+++ b/arch/arm/boot/dts/tegra20-ventana.dts-cpp
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "tegra20.dtsi"
+#include "tegra20.dtsi-cpp"
 
 / {
 	model = "NVIDIA Tegra2 Ventana evaluation board";
@@ -260,7 +260,7 @@
 			interrupts = <187 0x04>;
 
 			gpio-controller;
-			#gpio-cells = <2>;
+			\#gpio-cells = <2>;
 
 			micdet-cfg = <0>;
 			micdet-delay = <100>;
@@ -297,7 +297,7 @@
 
 			ti,system-power-controller;
 
-			#gpio-cells = <2>;
+			\#gpio-cells = <2>;
 			gpio-controller;
 
 			sys-supply = <&vdd_5v0_reg>;
@@ -440,8 +440,8 @@
 
 	regulators {
 		compatible = "simple-bus";
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 
 		vdd_5v0_reg: regulator@0 {
 			compatible = "regulator-fixed";
diff --git a/arch/arm/boot/dts/tegra20-whistler.dts b/arch/arm/boot/dts/tegra20-whistler.dts-cpp
similarity index 99%
rename from arch/arm/boot/dts/tegra20-whistler.dts
rename to arch/arm/boot/dts/tegra20-whistler.dts-cpp
index 94a71c9..8657151 100644
--- a/arch/arm/boot/dts/tegra20-whistler.dts
+++ b/arch/arm/boot/dts/tegra20-whistler.dts-cpp
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "tegra20.dtsi"
+#include "tegra20.dtsi-cpp"
 
 / {
 	model = "NVIDIA Tegra2 Whistler evaluation board";
@@ -259,7 +259,7 @@
 			compatible = "ti,tca6416";
 			reg = <0x20>;
 			gpio-controller;
-			#gpio-cells = <2>;
+			\#gpio-cells = <2>;
 		};
 
 		max8907@3c {
@@ -505,8 +505,8 @@
 
 	regulators {
 		compatible = "simple-bus";
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 
 		usb0_vbus_reg: regulator {
 			compatible = "regulator-fixed";
diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi-cpp
similarity index 93%
rename from arch/arm/boot/dts/tegra20.dtsi
rename to arch/arm/boot/dts/tegra20.dtsi-cpp
index 6934bca..729d0f6 100644
--- a/arch/arm/boot/dts/tegra20.dtsi
+++ b/arch/arm/boot/dts/tegra20.dtsi-cpp
@@ -1,4 +1,4 @@
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi-cpp"
 
 / {
 	compatible = "nvidia,tegra20";
@@ -15,7 +15,7 @@
 		reg = <0x50041000 0x1000
 		       0x50040100 0x0100>;
 		interrupt-controller;
-		#interrupt-cells = <3>;
+		\#interrupt-cells = <3>;
 	};
 
 	timer@60005000 {
@@ -63,9 +63,9 @@
 			      0 55 0x04
 			      0 87 0x04
 			      0 89 0x04>;
-		#gpio-cells = <2>;
+		\#gpio-cells = <2>;
 		gpio-controller;
-		#interrupt-cells = <2>;
+		\#interrupt-cells = <2>;
 		interrupt-controller;
 	};
 
@@ -141,7 +141,7 @@
 	pwm: pwm {
 		compatible = "nvidia,tegra20-pwm";
 		reg = <0x7000a000 0x100>;
-		#pwm-cells = <2>;
+		\#pwm-cells = <2>;
 	};
 
 	rtc {
@@ -154,8 +154,8 @@
 		compatible = "nvidia,tegra20-i2c";
 		reg = <0x7000c000 0x100>;
 		interrupts = <0 38 0x04>;
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 		status = "disabled";
 	};
 
@@ -163,8 +163,8 @@
 		compatible = "nvidia,tegra20-i2c";
 		reg = <0x7000c400 0x100>;
 		interrupts = <0 84 0x04>;
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 		status = "disabled";
 	};
 
@@ -172,8 +172,8 @@
 		compatible = "nvidia,tegra20-i2c";
 		reg = <0x7000c500 0x100>;
 		interrupts = <0 92 0x04>;
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 		status = "disabled";
 	};
 
@@ -181,8 +181,8 @@
 		compatible = "nvidia,tegra20-i2c-dvc";
 		reg = <0x7000d000 0x200>;
 		interrupts = <0 53 0x04>;
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 		status = "disabled";
 	};
 
@@ -207,8 +207,8 @@
 	memory-controller@7000f400 {
 		compatible = "nvidia,tegra20-emc";
 		reg = <0x7000f400 0x200>;
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 	};
 
 	usb@c5000000 {
diff --git a/arch/arm/boot/dts/tegra30-cardhu-a02.dts b/arch/arm/boot/dts/tegra30-cardhu-a02.dts-cpp
similarity index 96%
rename from arch/arm/boot/dts/tegra30-cardhu-a02.dts
rename to arch/arm/boot/dts/tegra30-cardhu-a02.dts-cpp
index dd4222f..e5285c8 100644
--- a/arch/arm/boot/dts/tegra30-cardhu-a02.dts
+++ b/arch/arm/boot/dts/tegra30-cardhu-a02.dts-cpp
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "tegra30-cardhu.dtsi"
+#include "tegra30-cardhu.dtsi-cpp"
 
 /* This dts file support the cardhu A02 version of board */
 
@@ -10,8 +10,8 @@
 
 	regulators {
 		compatible = "simple-bus";
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 
 		ddr_reg: regulator@100 {
 			compatible = "regulator-fixed";
diff --git a/arch/arm/boot/dts/tegra30-cardhu-a04.dts b/arch/arm/boot/dts/tegra30-cardhu-a04.dts-cpp
similarity index 96%
rename from arch/arm/boot/dts/tegra30-cardhu-a04.dts
rename to arch/arm/boot/dts/tegra30-cardhu-a04.dts-cpp
index 0828f09..2f10bfb 100644
--- a/arch/arm/boot/dts/tegra30-cardhu-a04.dts
+++ b/arch/arm/boot/dts/tegra30-cardhu-a04.dts-cpp
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "tegra30-cardhu.dtsi"
+#include "tegra30-cardhu.dtsi-cpp"
 
 /* This dts file support the cardhu A04 and later versions of board */
 
@@ -10,8 +10,8 @@
 
 	regulators {
 		compatible = "simple-bus";
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 
 		ddr_reg: regulator@100 {
 			compatible = "regulator-fixed";
diff --git a/arch/arm/boot/dts/tegra30-cardhu.dtsi b/arch/arm/boot/dts/tegra30-cardhu.dtsi-cpp
similarity index 98%
rename from arch/arm/boot/dts/tegra30-cardhu.dtsi
rename to arch/arm/boot/dts/tegra30-cardhu.dtsi-cpp
index b1271a8..45017b3 100644
--- a/arch/arm/boot/dts/tegra30-cardhu.dtsi
+++ b/arch/arm/boot/dts/tegra30-cardhu.dtsi-cpp
@@ -1,4 +1,4 @@
-/include/ "tegra30.dtsi"
+#include "tegra30.dtsi-cpp"
 
 /**
  * This file contains common DT entry for all fab version of Cardhu.
@@ -128,7 +128,7 @@
 			interrupts = <179 0x04>; /* gpio PW3 */
 
 			gpio-controller;
-			#gpio-cells = <2>;
+			\#gpio-cells = <2>;
 
 			micdet-cfg = <0>;
 			micdet-delay = <100>;
@@ -153,12 +153,12 @@
 			reg = <0x2d>;
 
 			interrupts = <0 86 0x4>;
-			#interrupt-cells = <2>;
+			\#interrupt-cells = <2>;
 			interrupt-controller;
 
 			ti,system-power-controller;
 
-			#gpio-cells = <2>;
+			\#gpio-cells = <2>;
 			gpio-controller;
 
 			vcc1-supply = <&vdd_ac_bat_reg>;
@@ -276,8 +276,8 @@
 
 	regulators {
 		compatible = "simple-bus";
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 
 		vdd_ac_bat_reg: regulator@0 {
 			compatible = "regulator-fixed";
diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi-cpp
similarity index 93%
rename from arch/arm/boot/dts/tegra30.dtsi
rename to arch/arm/boot/dts/tegra30.dtsi-cpp
index 81f5df4..6f44e59 100644
--- a/arch/arm/boot/dts/tegra30.dtsi
+++ b/arch/arm/boot/dts/tegra30.dtsi-cpp
@@ -1,4 +1,4 @@
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi-cpp"
 
 / {
 	compatible = "nvidia,tegra30";
@@ -15,7 +15,7 @@
 		reg = <0x50041000 0x1000
 		       0x50040100 0x0100>;
 		interrupt-controller;
-		#interrupt-cells = <3>;
+		\#interrupt-cells = <3>;
 	};
 
 	timer@60005000 {
@@ -82,9 +82,9 @@
 			      0 87 0x04
 			      0 89 0x04
 			      0 125 0x04>;
-		#gpio-cells = <2>;
+		\#gpio-cells = <2>;
 		gpio-controller;
-		#interrupt-cells = <2>;
+		\#interrupt-cells = <2>;
 		interrupt-controller;
 	};
 
@@ -137,7 +137,7 @@
 	pwm: pwm {
 		compatible = "nvidia,tegra30-pwm", "nvidia,tegra20-pwm";
 		reg = <0x7000a000 0x100>;
-		#pwm-cells = <2>;
+		\#pwm-cells = <2>;
 	};
 
 	rtc {
@@ -150,8 +150,8 @@
 		compatible =  "nvidia,tegra30-i2c", "nvidia,tegra20-i2c";
 		reg = <0x7000c000 0x100>;
 		interrupts = <0 38 0x04>;
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 		status = "disabled";
 	};
 
@@ -159,8 +159,8 @@
 		compatible = "nvidia,tegra30-i2c", "nvidia,tegra20-i2c";
 		reg = <0x7000c400 0x100>;
 		interrupts = <0 84 0x04>;
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 		status = "disabled";
 	};
 
@@ -168,8 +168,8 @@
 		compatible = "nvidia,tegra30-i2c", "nvidia,tegra20-i2c";
 		reg = <0x7000c500 0x100>;
 		interrupts = <0 92 0x04>;
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 		status = "disabled";
 	};
 
@@ -177,8 +177,8 @@
 		compatible = "nvidia,tegra30-i2c", "nvidia,tegra20-i2c";
 		reg = <0x7000c700 0x100>;
 		interrupts = <0 120 0x04>;
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 		status = "disabled";
 	};
 
@@ -186,8 +186,8 @@
 		compatible = "nvidia,tegra30-i2c", "nvidia,tegra20-i2c";
 		reg = <0x7000d000 0x100>;
 		interrupts = <0 53 0x04>;
-		#address-cells = <1>;
-		#size-cells = <0>;
+		\#address-cells = <1>;
+		\#size-cells = <0>;
 		status = "disabled";
 	};
 
@@ -223,8 +223,8 @@
 		nvidia,dma-request-selector = <&apbdma 1>;
 
 		ranges;
-		#address-cells = <1>;
-		#size-cells = <1>;
+		\#address-cells = <1>;
+		\#size-cells = <1>;
 
 		tegra_i2s0: i2s@70080300 {
 			compatible = "nvidia,tegra30-i2s";
-- 
1.7.0.4

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

* Re: [RFC PATCH 0/3] ARM: use C pre-processor with dtc
       [not found] ` <1348599998-2729-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
                     ` (2 preceding siblings ...)
  2012-09-25 19:06   ` [RFC PATCH 3/3] ARM: tegra: compile all DT files with cpp Stephen Warren
@ 2012-09-25 19:35   ` Scott Wood
  2012-09-25 19:51     ` Mark Brown
  2012-09-25 19:51     ` Stephen Warren
  2012-09-27  5:40   ` Jean-Christophe PLAGNIOL-VILLARD
  4 siblings, 2 replies; 19+ messages in thread
From: Scott Wood @ 2012-09-25 19:35 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Russell King, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	Rob Herring, Stephen Warren,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 09/25/2012 02:06:35 PM, Stephen Warren wrote:
> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> 
> This series adds some build rules to run cpp on *.dts-cpp prior to
> invoking dtc, and converts Tegra to the new rule as an example. What  
> do
> people think?
> 
> I assume that you've applied the dtc patches I sent yesterday. They
> aren't in this series. See:
> 
> https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-September/020182.html
> https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-September/020183.html
> https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-September/020181.html
> 
> Note: those patches are against upstream dtc. If you wish to test this
> series, apply the dtc patches to upstream dtc, build it, and copy the
> resultant dtc binary over the top of scripts/dtc/dtc.
> 
> Stephen Warren (3):
>   kbuild: introduce cmd_dtc_cpp
>   ARM: use cmd_dtc_cpp for compilation of *.dts-cpp to *.dtb
>   ARM: tegra: compile all DT files with cpp

Do you have an example of where you'd actually benefit from this?  I'd  
think most things could either be done reasonably well with what's  
built into DTC (see what we've done in arch/powerpc/boot/dts/fsl), or  
would need math expression support in DTC (or has that been added?).

-Scott

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

* Re: [RFC PATCH 0/3] ARM: use C pre-processor with dtc
  2012-09-25 19:35   ` [RFC PATCH 0/3] ARM: use C pre-processor with dtc Scott Wood
@ 2012-09-25 19:51     ` Mark Brown
       [not found]       ` <20120925195127.GA19350-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
  2012-09-25 19:51     ` Stephen Warren
  1 sibling, 1 reply; 19+ messages in thread
From: Mark Brown @ 2012-09-25 19:51 UTC (permalink / raw)
  To: Scott Wood
  Cc: Stephen Warren, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	Rob Herring, Russell King,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Tue, Sep 25, 2012 at 02:35:46PM -0500, Scott Wood wrote:

> Do you have an example of where you'd actually benefit from this?
> I'd think most things could either be done reasonably well with
> what's built into DTC (see what we've done in
> arch/powerpc/boot/dts/fsl), or would need math expression support in
> DTC (or has that been added?).

The constant example is the magic numbers we need to embed into DTs for
things like interrupt modes, making them human readable would be a real
win.

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

* Re: [RFC PATCH 0/3] ARM: use C pre-processor with dtc
  2012-09-25 19:35   ` [RFC PATCH 0/3] ARM: use C pre-processor with dtc Scott Wood
  2012-09-25 19:51     ` Mark Brown
@ 2012-09-25 19:51     ` Stephen Warren
       [not found]       ` <50620B5B.5020904-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  1 sibling, 1 reply; 19+ messages in thread
From: Stephen Warren @ 2012-09-25 19:51 UTC (permalink / raw)
  To: Scott Wood
  Cc: Russell King, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	Rob Herring, Stephen Warren,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 09/25/2012 01:35 PM, Scott Wood wrote:
> On 09/25/2012 02:06:35 PM, Stephen Warren wrote:
>> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>>
>> This series adds some build rules to run cpp on *.dts-cpp prior to
>> invoking dtc, and converts Tegra to the new rule as an example. What do
>> people think?
>>
>> I assume that you've applied the dtc patches I sent yesterday. They
>> aren't in this series. See:
>>
>> https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-September/020182.html
>>
>> https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-September/020183.html
>>
>> https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-September/020181.html
>>
>>
>> Note: those patches are against upstream dtc. If you wish to test this
>> series, apply the dtc patches to upstream dtc, build it, and copy the
>> resultant dtc binary over the top of scripts/dtc/dtc.
>>
>> Stephen Warren (3):
>>   kbuild: introduce cmd_dtc_cpp
>>   ARM: use cmd_dtc_cpp for compilation of *.dts-cpp to *.dtb
>>   ARM: tegra: compile all DT files with cpp
> 
> Do you have an example of where you'd actually benefit from this?  I'd
> think most things could either be done reasonably well with what's built
> into DTC (see what we've done in arch/powerpc/boot/dts/fsl), or would
> need math expression support in DTC (or has that been added?).

Yes, support for basic integer math in cell values has indeed been
recently added to upstream dtc. I don't believe this has been ported
into the in-kernel dtc yet though.

The primary motivation here is probably naming constants and associated
readability. For example, instead of:

nvidia,phy-reset-gpio = <&gpio 169 0>; /* gpio PV1 */

You could write:

nvidia,phy-reset-gpio = <&gpio TEGRA_GPIO_PV1 0>;

No more opaque numbers!

Equally, a number of recent bindings have tended towards using strings
rather than integers solely in order to make the DT readable without
having to know 10000 numbers off the top of your head:

pinmux {
...
    state_default: pinmux {
...
        atb {
            nvidia,pins = "atb", "gma", "gme";
            nvidia,function = "sdio4";


could be:

    state_default: pinmux {
...
        atb {
            nvidia,pins = <TEGRA_PIN_ATB, TEGRA_PIN_GMA, TEGRA_PIN_GME>;
            nvidia,function = <TEGRA_FUNCTION_SDIO4>;

This would improve parsing speed (eliminate strcmps), perhaps reduce DT
size (assuming average string length > 4 characters), eliminate the
possibility of typos in strings, and allow .dts and drivers to include
the same header file to define those constants, thus guaranteeing they
be in sync.

Equally, there has been some discussion of using named constants with
the math expression feature e.g.:

interrupts = <0 104 0x03>;

could be:

interrupts = <BANK_FOO INT_GPIO5 (INT_EDGE_RISING | INT_EDGE_FALLING)>;

I believe many many users of this feature would come out of the woodwork
once it's available.

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

* Re: [RFC PATCH 0/3] ARM: use C pre-processor with dtc
       [not found]       ` <20120925195127.GA19350-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
@ 2012-09-25 19:59         ` Scott Wood
  2012-09-25 20:05           ` Stephen Warren
  2012-09-25 20:05           ` Mark Brown
  0 siblings, 2 replies; 19+ messages in thread
From: Scott Wood @ 2012-09-25 19:59 UTC (permalink / raw)
  To: Mark Brown
  Cc: Stephen Warren, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	Rob Herring, Russell King,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 09/25/2012 02:51:27 PM, Mark Brown wrote:
> On Tue, Sep 25, 2012 at 02:35:46PM -0500, Scott Wood wrote:
> 
> > Do you have an example of where you'd actually benefit from this?
> > I'd think most things could either be done reasonably well with
> > what's built into DTC (see what we've done in
> > arch/powerpc/boot/dts/fsl), or would need math expression support in
> > DTC (or has that been added?).
> 
> The constant example is the magic numbers we need to embed into DTs  
> for
> things like interrupt modes, making them human readable would be a  
> real
> win.

Wasn't there a patch for named constant support in dtc a while back?
Hmm:  
https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-January/011184.html

I'm not sure that going down the CPP path is better than the  
possibility of named constants having a different syntax from  
macros/functions.  It would be one thing if someone were actively  
working on the latter, but this paralysis seems to be a case of the  
perfect being the enemy of the good.

-Scott

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

* Re: [RFC PATCH 0/3] ARM: use C pre-processor with dtc
  2012-09-25 19:59         ` Scott Wood
@ 2012-09-25 20:05           ` Stephen Warren
  2012-09-25 20:05           ` Mark Brown
  1 sibling, 0 replies; 19+ messages in thread
From: Stephen Warren @ 2012-09-25 20:05 UTC (permalink / raw)
  To: Scott Wood
  Cc: Stephen Warren, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	Mark Brown, Rob Herring, Russell King,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 09/25/2012 01:59 PM, Scott Wood wrote:
> On 09/25/2012 02:51:27 PM, Mark Brown wrote:
>> On Tue, Sep 25, 2012 at 02:35:46PM -0500, Scott Wood wrote:
>>
>> > Do you have an example of where you'd actually benefit from this?
>> > I'd think most things could either be done reasonably well with
>> > what's built into DTC (see what we've done in
>> > arch/powerpc/boot/dts/fsl), or would need math expression support in
>> > DTC (or has that been added?).
>>
>> The constant example is the magic numbers we need to embed into DTs for
>> things like interrupt modes, making them human readable would be a real
>> win.
> 
> Wasn't there a patch for named constant support in dtc a while back?
> Hmm:
> https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-January/011184.html

Yes. There has basically been zero traction on that front. I'm trying to
push a scheme that requires minimal changes to dtc itself in the hope
that will move /something/ forward at greater than zero speed.

> I'm not sure that going down the CPP path is better than the possibility
> of named constants having a different syntax from macros/functions.

I've come around to thinking that using something external to dtc is
actually very advantageous. The main benefit here is that a C-syntax
(well, cpp-syntax) header file can be included by both DT code and C
code, and hence there's no need to duplicate the constant definitions.
Equally, this way, anyone is free to go ahead and use whatever tools
they want for the pre-processing; as long as a valid DT comes out the
end of it, dtc can eat it. This gives us flexibility to change solutions
without having to change dtc. Plus, we don't all have to be
language-lawyers and invent yet another language inside dtc; all the
parts are already written for us, except for a tiny amount of glue.

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

* Re: [RFC PATCH 0/3] ARM: use C pre-processor with dtc
  2012-09-25 19:59         ` Scott Wood
  2012-09-25 20:05           ` Stephen Warren
@ 2012-09-25 20:05           ` Mark Brown
  1 sibling, 0 replies; 19+ messages in thread
From: Mark Brown @ 2012-09-25 20:05 UTC (permalink / raw)
  To: Scott Wood
  Cc: Stephen Warren, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	Rob Herring, Russell King,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Tue, Sep 25, 2012 at 02:59:11PM -0500, Scott Wood wrote:
> On 09/25/2012 02:51:27 PM, Mark Brown wrote:

> >The constant example is the magic numbers we need to embed into
> >DTs for
> >things like interrupt modes, making them human readable would be a
> >real
> >win.

> Wasn't there a patch for named constant support in dtc a while back?
> Hmm: https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-January/011184.html

> I'm not sure that going down the CPP path is better than the
> possibility of named constants having a different syntax from
> macros/functions.  It would be one thing if someone were actively
> working on the latter, but this paralysis seems to be a case of the
> perfect being the enemy of the good.

I don't know, it doesn't appear to have been integrated (and we still
need to be able to or things together).

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

* Re: [RFC PATCH 0/3] ARM: use C pre-processor with dtc
       [not found]       ` <50620B5B.5020904-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2012-09-25 23:46         ` Tony Lindgren
  0 siblings, 0 replies; 19+ messages in thread
From: Tony Lindgren @ 2012-09-25 23:46 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Stephen Warren, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	Rob Herring, Scott Wood, Russell King,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

* Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> [120925 12:53]:
> On 09/25/2012 01:35 PM, Scott Wood wrote:
> > 
> > Do you have an example of where you'd actually benefit from this?  I'd
> > think most things could either be done reasonably well with what's built
> > into DTC (see what we've done in arch/powerpc/boot/dts/fsl), or would
> > need math expression support in DTC (or has that been added?).
> 
> Yes, support for basic integer math in cell values has indeed been
> recently added to upstream dtc. I don't believe this has been ported
> into the in-kernel dtc yet though.
> 
> The primary motivation here is probably naming constants and associated
> readability. For example, instead of:
> 
> nvidia,phy-reset-gpio = <&gpio 169 0>; /* gpio PV1 */
> 
> You could write:
> 
> nvidia,phy-reset-gpio = <&gpio TEGRA_GPIO_PV1 0>;
> 
> No more opaque numbers!

This would be nice indeed.

Regards,

Tony

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

* Re: [RFC PATCH 0/3] ARM: use C pre-processor with dtc
       [not found] ` <1348599998-2729-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
                     ` (3 preceding siblings ...)
  2012-09-25 19:35   ` [RFC PATCH 0/3] ARM: use C pre-processor with dtc Scott Wood
@ 2012-09-27  5:40   ` Jean-Christophe PLAGNIOL-VILLARD
       [not found]     ` <20120927054038.GL17667-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
  4 siblings, 1 reply; 19+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-09-27  5:40 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Russell King, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	Rob Herring, Stephen Warren,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 13:06 Tue 25 Sep     , Stephen Warren wrote:
> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> 
> This series adds some build rules to run cpp on *.dts-cpp prior to
> invoking dtc, and converts Tegra to the new rule as an example. What do
> people think?
> 
> I assume that you've applied the dtc patches I sent yesterday. They
> aren't in this series. See:
> 
> https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-September/020182.html
> https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-September/020183.html
> https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-September/020181.html
> 
> Note: those patches are against upstream dtc. If you wish to test this
> series, apply the dtc patches to upstream dtc, build it, and copy the
> resultant dtc binary over the top of scripts/dtc/dtc.
> 
> Stephen Warren (3):
>   kbuild: introduce cmd_dtc_cpp
>   ARM: use cmd_dtc_cpp for compilation of *.dts-cpp to *.dtb
>   ARM: tegra: compile all DT files with cpp 
I do not like the extention

can we run gcc everytime?

or just do as done for lds

*.dts.S

Best Regards,
J.

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

* Re: [RFC PATCH 1/3] kbuild: introduce cmd_dtc_cpp
  2012-09-25 19:06   ` [RFC PATCH 1/3] kbuild: introduce cmd_dtc_cpp Stephen Warren
@ 2012-09-27  5:44     ` Jean-Christophe PLAGNIOL-VILLARD
       [not found]       ` <20120927054438.GM17667-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
  0 siblings, 1 reply; 19+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-09-27  5:44 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Jon Loeliger, Russell King, Arnd Bergmann, devicetree-discuss,
	Rob Herring, Grant Likely, Olof Johansson, Stephen Warren,
	linux-arm-kernel, David Gibson

On 13:06 Tue 25 Sep     , Stephen Warren wrote:
> 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.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
>  scripts/Makefile.lib |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 0be6f11..e3a149e 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -266,6 +266,9 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
>  quiet_cmd_dtc = DTC     $@
>  cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $<
>  
> +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) -
this should go to Makefile.build

and we should keep the same nomecalture as lds with lds.S

here dts.S

and is it possible to cmd with it

Best Regards,
J.

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

* Re: [RFC PATCH 2/3] ARM: use cmd_dtc_cpp for compilation of *.dts-cpp to *.dtb
       [not found]     ` <1348599998-2729-3-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2012-09-27  5:47       ` Jean-Christophe PLAGNIOL-VILLARD
       [not found]         ` <20120927054700.GN17667-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
  0 siblings, 1 reply; 19+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-09-27  5:47 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Russell King, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	Rob Herring, Stephen Warren,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 13:06 Tue 25 Sep     , Stephen Warren wrote:
> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> 
> This allows DT source files to use the C pre-processor. 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-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> ---
>  arch/arm/boot/Makefile              |    3 +++
>  arch/arm/boot/dts/skeleton.dtsi-cpp |   13 +++++++++++++
>  2 files changed, 16 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/boot/dts/skeleton.dtsi-cpp
> 
> diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
> index 3fdab01..c5d7fca 100644
> --- a/arch/arm/boot/Makefile
> +++ b/arch/arm/boot/Makefile
> @@ -65,6 +65,9 @@ targets += $(dtb-y)
>  $(obj)/%.dtb: $(src)/dts/%.dts FORCE
>  	$(call if_changed_dep,dtc)
>  
> +$(obj)/%.dtb: $(src)/dts/%.dts-cpp FORCE
> +	$(call if_changed_dep,dtc_cpp)
> +
move this to Makefile.build so we wan use it acroos arch

Best Regards,
J.

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

* Re: [RFC PATCH 0/3] ARM: use C pre-processor with dtc
       [not found]     ` <20120927054038.GL17667-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
@ 2012-09-27 15:38       ` Stephen Warren
       [not found]         ` <506472E4.5060107-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  0 siblings, 1 reply; 19+ messages in thread
From: Stephen Warren @ 2012-09-27 15:38 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD
  Cc: Russell King, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	Rob Herring, Stephen Warren,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 09/26/2012 11:40 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 13:06 Tue 25 Sep     , Stephen Warren wrote:
>> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>>
>> This series adds some build rules to run cpp on *.dts-cpp prior to
>> invoking dtc, and converts Tegra to the new rule as an example. What do
>> people think?
>>
>> I assume that you've applied the dtc patches I sent yesterday. They
>> aren't in this series. See:
>>
>> https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-September/020182.html
>> https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-September/020183.html
>> https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-September/020181.html
>>
>> Note: those patches are against upstream dtc. If you wish to test this
>> series, apply the dtc patches to upstream dtc, build it, and copy the
>> resultant dtc binary over the top of scripts/dtc/dtc.
>>
>> Stephen Warren (3):
>>   kbuild: introduce cmd_dtc_cpp
>>   ARM: use cmd_dtc_cpp for compilation of *.dts-cpp to *.dtb
>>   ARM: tegra: compile all DT files with cpp 
>
> I do not like the extention

It is a bit unwieldy. Perhaps *.dtsp, *.dtsip would be better.

> can we run gcc everytime?

Not without editing all the device tree files; any property (or node)
name the starts with a # must be escaped; changed from "#foo" to "\#foo"
to avoid cpp attempting to interpret it as a pre-processor directive.

> or just do as done for lds
> 
> *.dts.S

.S means assembly. (that's why I went with .dts-cpp rather than .dts.cpp).

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

* Re: [RFC PATCH 1/3] kbuild: introduce cmd_dtc_cpp
       [not found]       ` <20120927054438.GM17667-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
@ 2012-09-27 15:39         ` Stephen Warren
  2012-09-27 17:40           ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 19+ messages in thread
From: Stephen Warren @ 2012-09-27 15:39 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD
  Cc: Russell King, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	Rob Herring, Stephen Warren,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 09/26/2012 11:44 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 13:06 Tue 25 Sep     , Stephen Warren wrote:
>> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>>
>> 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.
>>
>> Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>> ---
>>  scripts/Makefile.lib |    3 +++
>>  1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
>> index 0be6f11..e3a149e 100644
>> --- a/scripts/Makefile.lib
>> +++ b/scripts/Makefile.lib
>> @@ -266,6 +266,9 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
>>  quiet_cmd_dtc = DTC     $@
>>  cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $<
>>  
>> +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) -
>
> this should go to Makefile.build

Hmm. Consistency with the existing cmd_dtc right above would dictate
otherwise.

> and we should keep the same nomecalture as lds with lds.S
> 
> here dts.S

I don't agree; see my previous response to the same assertion.

> and is it possible to cmd with it

I don't understand the question.

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

* Re: [RFC PATCH 2/3] ARM: use cmd_dtc_cpp for compilation of *.dts-cpp to *.dtb
       [not found]         ` <20120927054700.GN17667-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
@ 2012-09-27 15:40           ` Stephen Warren
  0 siblings, 0 replies; 19+ messages in thread
From: Stephen Warren @ 2012-09-27 15:40 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD
  Cc: Russell King, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	Rob Herring, Stephen Warren,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 09/26/2012 11:47 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 13:06 Tue 25 Sep     , Stephen Warren wrote:
>> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>>
>> This allows DT source files to use the C pre-processor. 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-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>> ---
>>  arch/arm/boot/Makefile              |    3 +++
>>  arch/arm/boot/dts/skeleton.dtsi-cpp |   13 +++++++++++++
>>  2 files changed, 16 insertions(+), 0 deletions(-)
>>  create mode 100644 arch/arm/boot/dts/skeleton.dtsi-cpp
>>
>> diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
>> index 3fdab01..c5d7fca 100644
>> --- a/arch/arm/boot/Makefile
>> +++ b/arch/arm/boot/Makefile
>> @@ -65,6 +65,9 @@ targets += $(dtb-y)
>>  $(obj)/%.dtb: $(src)/dts/%.dts FORCE
>>  	$(call if_changed_dep,dtc)
>>  
>> +$(obj)/%.dtb: $(src)/dts/%.dts-cpp FORCE
>> +	$(call if_changed_dep,dtc_cpp)
>> +
>
> move this to Makefile.build so we wan use it acroos arch

That would be an unrelated cleanup patch; the existing *.dts->*.dtb rule
is not there.

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

* Re: [RFC PATCH 0/3] ARM: use C pre-processor with dtc
       [not found]         ` <506472E4.5060107-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2012-09-27 17:27           ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 19+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-09-27 17:27 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Russell King, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	Rob Herring, Stephen Warren,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 09:38 Thu 27 Sep     , Stephen Warren wrote:
> On 09/26/2012 11:40 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 13:06 Tue 25 Sep     , Stephen Warren wrote:
> >> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> >>
> >> This series adds some build rules to run cpp on *.dts-cpp prior to
> >> invoking dtc, and converts Tegra to the new rule as an example. What do
> >> people think?
> >>
> >> I assume that you've applied the dtc patches I sent yesterday. They
> >> aren't in this series. See:
> >>
> >> https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-September/020182.html
> >> https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-September/020183.html
> >> https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-September/020181.html
> >>
> >> Note: those patches are against upstream dtc. If you wish to test this
> >> series, apply the dtc patches to upstream dtc, build it, and copy the
> >> resultant dtc binary over the top of scripts/dtc/dtc.
> >>
> >> Stephen Warren (3):
> >>   kbuild: introduce cmd_dtc_cpp
> >>   ARM: use cmd_dtc_cpp for compilation of *.dts-cpp to *.dtb
> >>   ARM: tegra: compile all DT files with cpp 
> >
> > I do not like the extention
> 
> It is a bit unwieldy. Perhaps *.dtsp, *.dtsip would be better.
> 
> > can we run gcc everytime?
> 
> Not without editing all the device tree files; any property (or node)
> name the starts with a # must be escaped; changed from "#foo" to "\#foo"
> to avoid cpp attempting to interpret it as a pre-processor directive.
> 
> > or just do as done for lds
> > 
> > *.dts.S
> 
> .S means assembly. (that's why I went with .dts-cpp rather than .dts.cpp).
on lds we do this way lds.S => lds

Best Regards,
J.

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

* Re: [RFC PATCH 1/3] kbuild: introduce cmd_dtc_cpp
  2012-09-27 15:39         ` Stephen Warren
@ 2012-09-27 17:40           ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 19+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-09-27 17:40 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Jon Loeliger, Russell King, Arnd Bergmann, devicetree-discuss,
	Rob Herring, Grant Likely, Olof Johansson, Stephen Warren,
	linux-arm-kernel, David Gibson

On 09:39 Thu 27 Sep     , Stephen Warren wrote:
> On 09/26/2012 11:44 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 13:06 Tue 25 Sep     , Stephen Warren wrote:
> >> 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.
> >>
> >> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> >> ---
> >>  scripts/Makefile.lib |    3 +++
> >>  1 files changed, 3 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> >> index 0be6f11..e3a149e 100644
> >> --- a/scripts/Makefile.lib
> >> +++ b/scripts/Makefile.lib
> >> @@ -266,6 +266,9 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
> >>  quiet_cmd_dtc = DTC     $@
> >>  cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $<
> >>  
> >> +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) -
> >
> > this should go to Makefile.build
> 
> Hmm. Consistency with the existing cmd_dtc right above would dictate
> otherwise.
no build command go to Makefile.build aside with makefile target

Best Regards,
J.

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

end of thread, other threads:[~2012-09-27 17:40 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-25 19:06 [RFC PATCH 0/3] ARM: use C pre-processor with dtc Stephen Warren
     [not found] ` <1348599998-2729-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-09-25 19:06   ` [RFC PATCH 1/3] kbuild: introduce cmd_dtc_cpp Stephen Warren
2012-09-27  5:44     ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]       ` <20120927054438.GM17667-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
2012-09-27 15:39         ` Stephen Warren
2012-09-27 17:40           ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-25 19:06   ` [RFC PATCH 2/3] ARM: use cmd_dtc_cpp for compilation of *.dts-cpp to *.dtb Stephen Warren
     [not found]     ` <1348599998-2729-3-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-09-27  5:47       ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]         ` <20120927054700.GN17667-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
2012-09-27 15:40           ` Stephen Warren
2012-09-25 19:06   ` [RFC PATCH 3/3] ARM: tegra: compile all DT files with cpp Stephen Warren
2012-09-25 19:35   ` [RFC PATCH 0/3] ARM: use C pre-processor with dtc Scott Wood
2012-09-25 19:51     ` Mark Brown
     [not found]       ` <20120925195127.GA19350-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2012-09-25 19:59         ` Scott Wood
2012-09-25 20:05           ` Stephen Warren
2012-09-25 20:05           ` Mark Brown
2012-09-25 19:51     ` Stephen Warren
     [not found]       ` <50620B5B.5020904-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-09-25 23:46         ` Tony Lindgren
2012-09-27  5:40   ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]     ` <20120927054038.GL17667-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
2012-09-27 15:38       ` Stephen Warren
     [not found]         ` <506472E4.5060107-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-09-27 17:27           ` Jean-Christophe PLAGNIOL-VILLARD

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).