[Crosstoolchain-logs] [device-tree-compiler] 181/198: Alter grammar to allow multiple /dts-v1/ tags

Hector Oron zumbi at moszumanska.debian.org
Thu Dec 8 17:07:07 UTC 2016


This is an automated email from the git hooks/post-receive script.

zumbi pushed a commit to branch upstream/1.4.x
in repository device-tree-compiler.

commit c4cb12e193e314226991deb468c1b397296dea53
Author: David Gibson <david at gibson.dropbear.id.au>
Date:   Mon Jun 2 15:23:40 2014 +1000

    Alter grammar to allow multiple /dts-v1/ tags
    
    This patch allows dtc to accept multiple /dts-v1/ tags (provided they're
    all at the beginning of the input), rather than giving a syntax error.
    
    This makes it more convenient to include one .dts file from another without
    having to be careful that the /dts-v1/ tag is in exactly one of them.
    
    We a couple of existing testcases to take advantage of this, which
    simplifies them slightly.
    
    Signed-off-by: David Gibson <david at gibson.dropbear.id.au>
---
 dtc-parser.y                | 11 ++++++++---
 tests/test_tree1.dts        | 44 +++++++++++++++++++++++++++++++++++++++++++-
 tests/test_tree1_body.dtsi  | 43 -------------------------------------------
 tests/test_tree1_delete.dts |  2 +-
 4 files changed, 52 insertions(+), 48 deletions(-)

diff --git a/dtc-parser.y b/dtc-parser.y
index 000873f..14aaf2e 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -101,13 +101,18 @@ extern bool treesource_error;
 %%
 
 sourcefile:
-	  DT_V1 ';' memreserves devicetree
+	  v1tag memreserves devicetree
 		{
-			the_boot_info = build_boot_info($3, $4,
-							guess_boot_cpuid($4));
+			the_boot_info = build_boot_info($2, $3,
+							guess_boot_cpuid($3));
 		}
 	;
 
+v1tag:
+	  DT_V1 ';'
+	| DT_V1 ';' v1tag
+	;
+
 memreserves:
 	  /* empty */
 		{
diff --git a/tests/test_tree1.dts b/tests/test_tree1.dts
index c7b170c..67ecfd0 100644
--- a/tests/test_tree1.dts
+++ b/tests/test_tree1.dts
@@ -1,3 +1,45 @@
 /dts-v1/;
 
-/include/ "test_tree1_body.dtsi"
+/memreserve/ 0xdeadbeef00000000 0x100000;
+/memreserve/ 123456789 010000;
+
+/ {
+	compatible = "test_tree1";
+	prop-int = <0xdeadbeef>;
+	prop-int64 = /bits/ 64 <0xdeadbeef01abcdef>;
+	prop-str = "hello world";
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	subnode at 1 {
+		compatible = "subnode1";
+		reg = <1>;
+		prop-int = [deadbeef];
+
+		subsubnode {
+			compatible = "subsubnode1", "subsubnode";
+			prop-int = <0xdeadbeef>;
+		};
+
+		ss1 {
+		};
+	};
+
+	subnode at 2 {
+		reg = <2>;
+		linux,phandle = <0x2000>;
+		prop-int = <123456789>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ssn0: subsubnode at 0 {
+			reg = <0>;
+			phandle = <0x2001>;
+			compatible = "subsubnode2", "subsubnode";
+			prop-int = <0726746425>;
+		};
+
+		ss2 {
+		};
+	};
+};
diff --git a/tests/test_tree1_body.dtsi b/tests/test_tree1_body.dtsi
deleted file mode 100644
index 24a5e1e..0000000
--- a/tests/test_tree1_body.dtsi
+++ /dev/null
@@ -1,43 +0,0 @@
-/memreserve/ 0xdeadbeef00000000 0x100000;
-/memreserve/ 123456789 010000;
-
-/ {
-	compatible = "test_tree1";
-	prop-int = <0xdeadbeef>;
-	prop-int64 = /bits/ 64 <0xdeadbeef01abcdef>;
-	prop-str = "hello world";
-	#address-cells = <1>;
-	#size-cells = <0>;
-
-	subnode at 1 {
-		compatible = "subnode1";
-		reg = <1>;
-		prop-int = [deadbeef];
-
-		subsubnode {
-			compatible = "subsubnode1", "subsubnode";
-			prop-int = <0xdeadbeef>;
-		};
-
-		ss1 {
-		};
-	};
-
-	subnode at 2 {
-		reg = <2>;
-		linux,phandle = <0x2000>;
-		prop-int = <123456789>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		ssn0: subsubnode at 0 {
-			reg = <0>;
-			phandle = <0x2001>;
-			compatible = "subsubnode2", "subsubnode";
-			prop-int = <0726746425>;
-		};
-
-		ss2 {
-		};
-	};
-};
diff --git a/tests/test_tree1_delete.dts b/tests/test_tree1_delete.dts
index a2f1bfd..b95ef1e 100644
--- a/tests/test_tree1_delete.dts
+++ b/tests/test_tree1_delete.dts
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ "test_tree1_body.dtsi"
+/include/ "test_tree1.dts"
 
 / {
 	nonexistant-property = <0xdeadbeef>;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/crosstoolchain/device-tree-compiler.git



More information about the Crosstoolchain-logs mailing list