[Skiboot] [PATCH v4 2/9] hwprobe: convert PHB, NPU, PAU subsystems to hwprobe
Nicholas Piggin
npiggin at gmail.com
Fri Dec 17 13:36:40 AEDT 2021
From: Stewart Smith <stewart at flamingspork.com>
Reviewed-by: Dan Horák <dan at danny.cz>
[npiggin: split out from initial hwprobe pach]
Signed-off-by: Stewart Smith <stewart at flamingspork.com>
---
core/init.c | 15 +--------------
hw/npu.c | 4 +++-
hw/npu2-common.c | 4 +++-
hw/pau.c | 3 ++-
hw/phb3.c | 4 ++--
hw/phb4.c | 4 +++-
include/skiboot.h | 5 -----
7 files changed, 14 insertions(+), 25 deletions(-)
diff --git a/core/init.c b/core/init.c
index 5c2bd7fdc..c3e0c494d 100644
--- a/core/init.c
+++ b/core/init.c
@@ -1361,20 +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 PAUs */
- probe_pau();
-
- /* 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..35e6372d2 100644
--- a/hw/npu.c
+++ b/hw/npu.c
@@ -1679,7 +1679,7 @@ static void npu_create_phb(struct dt_node *dn)
npu_hw_init(p);
}
-void probe_npu(void)
+static void probe_npu(void)
{
struct dt_node *np;
@@ -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 b3f500f4b..02f102fe5 100644
--- a/hw/npu2-common.c
+++ b/hw/npu2-common.c
@@ -619,7 +619,7 @@ static void setup_devices(struct npu2 *npu)
npu2_opencapi_init_npu(npu);
}
-void probe_npu2(void)
+static void probe_npu2(void)
{
struct proc_chip *chip = next_chip(NULL);
struct npu2 *npu;
@@ -658,3 +658,5 @@ void probe_npu2(void)
setup_devices(npu);
}
}
+
+DEFINE_HWPROBE_DEPS(npu2, probe_npu2, "phb4");
diff --git a/hw/pau.c b/hw/pau.c
index a34d6dab1..1a3fbfaf7 100644
--- a/hw/pau.c
+++ b/hw/pau.c
@@ -2074,7 +2074,7 @@ static void pau_init(struct pau *pau)
pau_opencapi_init(pau);
}
-void probe_pau(void)
+static void probe_pau(void)
{
struct dt_node *dn;
struct pau *pau;
@@ -2093,3 +2093,4 @@ void probe_pau(void)
pau_init(pau);
}
}
+DEFINE_HWPROBE_DEPS(pau, probe_pau, "phb4");
diff --git a/hw/phb3.c b/hw/phb3.c
index 09255a0a6..f46a43c9d 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -4993,7 +4993,7 @@ static void phb3_probe_pbcq(struct dt_node *pbcq)
}
-void probe_phb3(void)
+static void probe_phb3(void)
{
struct dt_node *np;
@@ -5006,4 +5006,4 @@ void probe_phb3(void)
phb3_create(np);
}
-
+DEFINE_HWPROBE(phb3, probe_phb3);
diff --git a/hw/phb4.c b/hw/phb4.c
index 4daad148a..f329e1309 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -6368,7 +6368,7 @@ static void phb4_probe_pbcq(struct dt_node *pbcq)
}
}
-void probe_phb4(void)
+static void probe_phb4(void)
{
struct dt_node *np;
const char *s;
@@ -6404,3 +6404,5 @@ void probe_phb4(void)
phb4_create(np);
}
}
+
+DEFINE_HWPROBE(phb4, probe_phb4);
diff --git a/include/skiboot.h b/include/skiboot.h
index d1553c4ef..e2a1b5fc6 100644
--- a/include/skiboot.h
+++ b/include/skiboot.h
@@ -210,13 +210,8 @@ extern void copy_sreset_vector_fast_reboot(void);
extern void patch_traps(bool enable);
/* Various probe routines, to replace with an initcall system */
-extern void probe_phb3(void);
-extern void probe_phb4(void);
extern int preload_capp_ucode(void);
extern void preload_io_vpd(void);
-extern void probe_npu(void);
-extern void probe_npu2(void);
-extern void probe_pau(void);
extern void uart_init(void);
extern void mbox_init(void);
extern void early_uart_init(void);
--
2.23.0
More information about the Skiboot
mailing list