diff mbox series

[v4,29/30] dts: Split P9 device trees into system and backend trees

Message ID 20191003041909.23187-30-amitay@ozlabs.org
State Accepted
Headers show
Series Add system device tree to libpdbg | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (8a10a05c89db666bf98734139334166da7c370a4)
snowpatch_ozlabs/build-multiarch fail Test build-multiarch on branch master

Commit Message

Amitay Isaacs Oct. 3, 2019, 4:19 a.m. UTC
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
Reviewed-by: Alistair Popple <alistair@popple.id.au>
---
 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 mbox series

Patch

diff --git a/Makefile.am b/Makefile.am
index 5829fb3..e4905b7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -72,7 +72,7 @@  endif
 DT = fake.dts fake2.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..2221a68 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@0 {
-		#address-cells = <0x2>;
-		#size-cells = <0x1>;
+       fsi0 {
 		compatible = "ibm,cronus-fsi";
-		reg = <0x0 0x0 0x0>;
-
 		index = <0x0>;
-		status = "mustexist";
+		system-path = "/proc0/fsi";
+	};
 
-		pib@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>;
+		system-path = "/proc0/pib";
+	};
 
-		hmfsi@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>;
+		system-path = "/proc1/fsi";
+	};
 
-			pib@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>;
+		system-path = "/proc1/pib";
 	};
 };
diff --git a/p9-fsi.dtsi.m4 b/p9-fsi.dtsi.m4
index afa7d39..3bbe43d 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";
+		system-path = "/proc0/fsi";
 
 		pib@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
+			 system-path = "/proc0/pib";
 		};
 
 		hmfsi@100000 {
@@ -28,6 +28,7 @@ 
 			reg = <0x0 0x100000 0x8000>;
 			port = <0x1>;
 			index = <0x1>;
+			system-path = "/proc1/fsi";
 
 			pib@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
+				system-path = "/proc1/pib";
 			};
 		};
 
diff --git a/p9-host.dts.m4 b/p9-host.dts.m4
index 52973ff..3b4c2b2 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
+	      system-path = "/proc0/pib";
 	};
 
 	pib@8 {
@@ -20,6 +20,6 @@ 
 	      compatible = "ibm,host-pib";
 	      reg = <0x8>;
 	      index = <0x8>;
-	      include(p9-pib.dts.m4)dnl
+	      system-path = "/proc1/pib";
 	};
 };
diff --git a/p9-kernel.dts.m4 b/p9-kernel.dts.m4
index aa4bcac..8c2c35b 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";
+		system-path = "/proc0/fsi";
 
 		pib@1000 {
 			#address-cells = <0x2>;
@@ -20,7 +20,7 @@ 
 			index = <0x0>;
 			compatible = "ibm,kernel-pib";
 			device-path = "/dev/scom1";
-			include(p9-pib.dts.m4)dnl
+			system-path = "/proc0/pib";
 		};
 
 		sbefifo@2400 { /* Bogus address */
@@ -29,8 +29,9 @@ 
 			compatible = "ibm,kernel-sbefifo";
 			device-path = "/dev/sbefifo1";
 
-			sbefifo-mem@0 {
+			sbefifo-mem {
 				      compatible = "ibm,sbefifo-mem";
+				      system-path = "/mem0";
 			};
 		};
 
@@ -41,6 +42,7 @@ 
 			reg = <0x0 0x100000 0x8000>;
 			port = <0x1>;
 			index = <0x1>;
+			system-path = "/proc1/fsi";
 
 			pib@1000 {
 				#address-cells = <0x2>;
@@ -49,7 +51,7 @@ 
 				 index = <0x1>;
 				 compatible = "ibm,kernel-pib";
 				 device-path = "/dev/scom2";
-				 include(p9-pib.dts.m4)dnl
+				 system-path = "/proc1/pib";
 			};
 
 			sbefifo@2400 { /* Bogus address */
@@ -58,8 +60,9 @@ 
 				compatible = "ibm,kernel-sbefifo";
 				device-path = "/dev/sbefifo2";
 
-				sbefifo-mem@0 {
+				sbefifo-mem {
 				      compatible = "ibm,sbefifo-mem";
+				      system-path = "/mem1";
 				};
 			};
 		};
diff --git a/p9-pib.dts.m4 b/p9-pib.dts.m4
index 3a99157..8c9dfaf 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@90000 {
+	compatible = "ibm-power9-adu";
+	reg = <0x0 0x90000 0x50>;
+	system-path = "CONCAT(/mem,PROC_ID)";
+};
 
 htm@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);
+};