diff mbox series

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

Message ID 20210807042100.399449-4-npiggin@gmail.com
State Superseded
Headers show
Series hwprobe patches | expand

Commit Message

Nicholas Piggin Aug. 7, 2021, 4:20 a.m. UTC
From: Stewart Smith <stewart@flamingspork.com>

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

Patch

diff --git a/core/init.c b/core/init.c
index 61934c9fe..5e2b18d85 100644
--- a/core/init.c
+++ b/core/init.c
@@ -1361,18 +1361,7 @@  void __noreturn __nomcount main_cpu_entry(const void *fdt)
 	/* NX init */
 	nx_init();
 
-	/* Probe PHB3 on P8 */
-	probe_phb3();
-
-	/* Probe PHB4 on P9 and PHB5 on P10 */
-	probe_phb4();
-
-	/* Probe NPUs */
-	probe_npu();
-	probe_npu2();
-	probe_npu3();
-
-	/* Probe all HWPROBE hardware we have code linked for*/
+	/* Probe all HWPROBE hardware we have code linked for */
 	probe_hardware();
 
 	/* Initialize PCI */
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 79083d4a1..ec07fe2bb 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -6398,3 +6398,5 @@  void probe_phb4(void)
 			phb4_create(np);
 	}
 }
+
+DEFINE_HWPROBE(phb4, probe_phb4);