[Skiboot] [PATCH 03/10] hwprobe: convert PHB, NPU subsystems to hwprobe

Nicholas Piggin npiggin at gmail.com
Sat Jun 26 12:38:17 AEST 2021


From: Stewart Smith <stewart at flamingspork.com>

[npiggin: split out from initial hwprobe pach]
Signed-off-by: Stewart Smith <stewart at flamingspork.com>
---
 core/init.c      | 11 -----------
 hw/npu.c         |  2 ++
 hw/npu2-common.c |  2 ++
 hw/npu3.c        |  2 ++
 hw/phb3.c        |  2 +-
 hw/phb4.c        |  2 ++
 6 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/core/init.c b/core/init.c
index ed3229172..3d190e4ff 100644
--- a/core/init.c
+++ b/core/init.c
@@ -1322,17 +1322,6 @@ void __noreturn __nomcount main_cpu_entry(const void *fdt)
 	/* NX init */
 	nx_init();
 
-	/* Probe PHB3 on P8 */
-	probe_phb3();
-
-	/* Probe PHB4 on P9 */
-	probe_phb4();
-
-	/* Probe NPUs */
-	probe_npu();
-	probe_npu2();
-	probe_npu3();
-
 	/* Probe all HWPROBE hardware we have code linked for*/
 	probe_hardware();
 
diff --git a/hw/npu.c b/hw/npu.c
index dba7ee50f..2b5364c33 100644
--- a/hw/npu.c
+++ b/hw/npu.c
@@ -1691,3 +1691,5 @@ void probe_npu(void)
 	dt_for_each_compatible(dt_root, np, "ibm,power8-npu-pciex")
 		npu_create_phb(np);
 }
+
+DEFINE_HWPROBE_DEPS(npu, probe_npu, "phb3");
diff --git a/hw/npu2-common.c b/hw/npu2-common.c
index 3bc9bcee6..87ebf8232 100644
--- a/hw/npu2-common.c
+++ b/hw/npu2-common.c
@@ -679,3 +679,5 @@ void probe_npu2(void)
 		setup_devices(npu);
 	}
 }
+
+DEFINE_HWPROBE_DEPS(npu2, probe_npu2, "phb4");
diff --git a/hw/npu3.c b/hw/npu3.c
index 03461373e..92af96b23 100644
--- a/hw/npu3.c
+++ b/hw/npu3.c
@@ -547,3 +547,5 @@ void probe_npu3(void)
 		npu3_init(npu);
 	}
 }
+
+DEFINE_HWPROBE_DEPS(npu3, probe_npu3, "phb4");
diff --git a/hw/phb3.c b/hw/phb3.c
index 8af6b6164..320023e57 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -5049,4 +5049,4 @@ void probe_phb3(void)
 		phb3_create(np);
 }
 
-
+DEFINE_HWPROBE(phb3, probe_phb3);
diff --git a/hw/phb4.c b/hw/phb4.c
index 31f9fa250..7c7ba994e 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -6087,3 +6087,5 @@ void probe_phb4(void)
 	dt_for_each_compatible(dt_root, np, "ibm,power9-pciex")
 		phb4_create(np);
 }
+
+DEFINE_HWPROBE(phb4, probe_phb4);
-- 
2.23.0



More information about the Skiboot mailing list