[Pdbg] [PATCH 22/23] dts: Split P9 device trees into system and backend trees

Amitay Isaacs amitay at ozlabs.org
Thu Sep 19 12:33:32 AEST 2019


Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
 Makefile.am      |  2 +-
 p9-cronus.dts.m4 | 50 ++++++++++++++++--------------------------------
 p9-fsi.dtsi.m4   |  7 ++++---
 p9-host.dts.m4   |  4 ++--
 p9-kernel.dts.m4 | 13 ++++++++-----
 p9-pib.dts.m4    |  5 +++++
 p9.dts.m4        | 27 ++++++++++++++++++++++++++
 7 files changed, 64 insertions(+), 44 deletions(-)
 create mode 100644 p9.dts.m4

diff --git a/Makefile.am b/Makefile.am
index 95e69b7..6f46abb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -68,7 +68,7 @@ endif
 DT = fake.dts p8-cronus.dts p9-cronus.dts \
      p8-fsi.dts p8-i2c.dts p8-kernel.dts \
      p9w-fsi.dts p9r-fsi.dts p9z-fsi.dts p9-kernel.dts \
-     p8-host.dts p9-host.dts p8.dts
+     p8-host.dts p9-host.dts p8.dts p9.dts
 
 DT_sources = $(DT:.dts=.dtb.S)
 DT_headers = $(DT:.dts=.dt.h)
diff --git a/p9-cronus.dts.m4 b/p9-cronus.dts.m4
index c560442..179f581 100644
--- a/p9-cronus.dts.m4
+++ b/p9-cronus.dts.m4
@@ -1,43 +1,27 @@
 /dts-v1/;
 
 / {
-	#address-cells = <0x1>;
-	#size-cells = <0x0>;
-
-	fsi0: kernelfsi at 0 {
-		#address-cells = <0x2>;
-		#size-cells = <0x1>;
+       fsi0 {
 		compatible = "ibm,cronus-fsi";
-		reg = <0x0 0x0 0x0>;
-
 		index = <0x0>;
-		status = "mustexist";
+		device-tree-path = "/proc0/fsi";
+	};
 
-		pib at 1000 {
-			#address-cells = <0x2>;
-			#size-cells = <0x1>;
-			reg = <0x0 0x1000 0x7>;
-			index = <0x0>;
-			compatible = "ibm,cronus-pib";
-			include(p9-pib.dts.m4)dnl
-		};
+	pib0 {
+		compatible = "ibm,cronus-pib";
+		index = <0x0>;
+		device-tree-path = "/proc0/pib";
+	};
 
-		hmfsi at 100000 {
-			#address-cells = <0x2>;
-			#size-cells = <0x1>;
-			compatible = "ibm,cronus-fsi";
-			reg = <0x0 0x100000 0x8000>;
-			port = <0x1>;
-			index = <0x1>;
+	fsi1 {
+		compatible = "ibm,cronus-fsi";
+		index = <0x1>;
+		device-tree-path = "/proc1/fsi";
+	};
 
-			pib at 1000 {
-				#address-cells = <0x2>;
-				#size-cells = <0x1>;
-				 reg = <0x0 0x1000 0x7>;
-				 index = <0x1>;
-				 compatible = "ibm,cronus-pib";
-				 include(p9-pib.dts.m4)dnl
-			};
-		};
+	pib1 {
+		compatible = "ibm,cronus-pib";
+		index = <0x1>;
+		device-tree-path = "/proc1/pib";
 	};
 };
diff --git a/p9-fsi.dtsi.m4 b/p9-fsi.dtsi.m4
index afa7d39..a43284b 100644
--- a/p9-fsi.dtsi.m4
+++ b/p9-fsi.dtsi.m4
@@ -8,9 +8,9 @@
 		#size-cells = <0x1>;
 		compatible = "ibm,bmcfsi";
 		reg = <0x0 0x0 0x0>;
-
 		index = <0x0>;
 		status = "mustexist";
+		device-tree-path = "/proc0/fsi";
 
 		pib at 1000 {
 			 #address-cells = <0x2>;
@@ -18,7 +18,7 @@
 			 reg = <0x0 0x1000 0x7>;
 			 index = <0x0>;
 			 compatible = "ibm,fsi-pib", "ibm,power9-fsi-pib";
-			 include(p9-pib.dts.m4)dnl
+			 device-tree-path = "/proc0/pib";
 		};
 
 		hmfsi at 100000 {
@@ -28,6 +28,7 @@
 			reg = <0x0 0x100000 0x8000>;
 			port = <0x1>;
 			index = <0x1>;
+			device-tree-path = "/proc1/fsi";
 
 			pib at 1000 {
 				#address-cells = <0x2>;
@@ -35,7 +36,7 @@
 				reg = <0x0 0x1000 0x7>;
 				index = <0x1>;
 				compatible = "ibm,fsi-pib", "ibm,power9-fsi-pib";
-				include(p9-pib.dts.m4)dnl
+				device-tree-path = "/proc1/pib";
 			};
 		};
 
diff --git a/p9-host.dts.m4 b/p9-host.dts.m4
index 52973ff..a48c8d3 100644
--- a/p9-host.dts.m4
+++ b/p9-host.dts.m4
@@ -11,7 +11,7 @@
 	      compatible = "ibm,host-pib";
 	      reg = <0x0>;
 	      index = <0x0>;
-	      include(p9-pib.dts.m4)dnl
+	      device-tree-path = "/proc0/pib";
 	};
 
 	pib at 8 {
@@ -20,6 +20,6 @@
 	      compatible = "ibm,host-pib";
 	      reg = <0x8>;
 	      index = <0x8>;
-	      include(p9-pib.dts.m4)dnl
+	      device-tree-path = "/proc1/pib";
 	};
 };
diff --git a/p9-kernel.dts.m4 b/p9-kernel.dts.m4
index aa4bcac..b013983 100644
--- a/p9-kernel.dts.m4
+++ b/p9-kernel.dts.m4
@@ -9,9 +9,9 @@
 		#size-cells = <0x1>;
 		compatible = "ibm,kernel-fsi";
 		reg = <0x0 0x0 0x0>;
-
 		index = <0x0>;
 		status = "mustexist";
+		device-tree-path = "/proc0/fsi";
 
 		pib at 1000 {
 			#address-cells = <0x2>;
@@ -20,7 +20,7 @@
 			index = <0x0>;
 			compatible = "ibm,kernel-pib";
 			device-path = "/dev/scom1";
-			include(p9-pib.dts.m4)dnl
+			device-tree-path = "/proc0/pib";
 		};
 
 		sbefifo at 2400 { /* Bogus address */
@@ -29,8 +29,9 @@
 			compatible = "ibm,kernel-sbefifo";
 			device-path = "/dev/sbefifo1";
 
-			sbefifo-mem at 0 {
+			sbefifo-mem {
 				      compatible = "ibm,sbefifo-mem";
+				      device-tree-path = "/mem0";
 			};
 		};
 
@@ -41,6 +42,7 @@
 			reg = <0x0 0x100000 0x8000>;
 			port = <0x1>;
 			index = <0x1>;
+			device-tree-path = "/proc1/fsi";
 
 			pib at 1000 {
 				#address-cells = <0x2>;
@@ -49,7 +51,7 @@
 				 index = <0x1>;
 				 compatible = "ibm,kernel-pib";
 				 device-path = "/dev/scom2";
-				 include(p9-pib.dts.m4)dnl
+				 device-tree-path = "/proc1/pib";
 			};
 
 			sbefifo at 2400 { /* Bogus address */
@@ -58,8 +60,9 @@
 				compatible = "ibm,kernel-sbefifo";
 				device-path = "/dev/sbefifo2";
 
-				sbefifo-mem at 0 {
+				sbefifo-mem {
 				      compatible = "ibm,sbefifo-mem";
+				      device-tree-path = "/mem1";
 				};
 			};
 		};
diff --git a/p9-pib.dts.m4 b/p9-pib.dts.m4
index 3a99157..03d9630 100644
--- a/p9-pib.dts.m4
+++ b/p9-pib.dts.m4
@@ -35,6 +35,11 @@ index = <HEX(eval($1, 16))>;
 reg = <0x0 HEX(CHIPLET_BASE($1)) 0xfffff>;
 }')dnl
 
+adu at 90000 {
+	compatible = "ibm-power9-adu";
+	reg = <0x0 0x90000 0x50>;
+	device-tree-path = "CONCAT(/mem,PROC_ID)";
+};
 
 htm at 5012880 {
 	compatible = "ibm,power9-nhtm";
diff --git a/p9.dts.m4 b/p9.dts.m4
new file mode 100644
index 0000000..dd46ace
--- /dev/null
+++ b/p9.dts.m4
@@ -0,0 +1,27 @@
+define(`PROC',`
+define(`PROC_ID',`$1')dnl
+	proc$1 {
+		index = <$1>;
+
+		fsi {
+			index = <$1>;
+		};
+
+		pib {
+			#address-cells = <0x2>;
+			#size-cells = <0x1>;
+			index = <$1>;
+			include(p9-pib.dts.m4)dnl
+		};
+	};
+	mem$1 {
+		index = <$1>;
+	}'
+)dnl
+
+/dts-v1/;
+
+/ {
+	PROC(0);
+	PROC(1);
+};
-- 
2.21.0



More information about the Pdbg mailing list