[Skiboot] [PATCH v2 04/23] phb3/4: Move IO VPD preload out to a common place

Michael Neuling mikey at neuling.org
Sun Jun 25 05:17:09 AEST 2017


From: Benjamin Herrenschmidt <benh at kernel.crashing.org>

The code is duplicated between phb3 and phb4 for no reason

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
Signed-off-by: Michael Neuling <mikey at neuling.org>

# Conflicts:
#	core/init.c
#	hw/phb3.c
---
 core/init.c       |  2 +-
 core/vpd.c        | 11 +++++++++++
 hw/phb3.c         | 10 ----------
 hw/phb4.c         | 11 -----------
 include/skiboot.h |  3 +--
 5 files changed, 13 insertions(+), 24 deletions(-)

diff --git a/core/init.c b/core/init.c
index b5f4f3d9fd..1d2d07d8fd 100644
--- a/core/init.c
+++ b/core/init.c
@@ -992,7 +992,7 @@ void __noreturn __nomcount main_cpu_entry(const void *fdt)
 
 	pci_nvram_init();
 
-	phb3_preload_vpd();
+	preload_io_vpd();
 	preload_capp_ucode();
 	start_preload_kernel();
 
diff --git a/core/vpd.c b/core/vpd.c
index c226f6deb8..377c9192cc 100644
--- a/core/vpd.c
+++ b/core/vpd.c
@@ -272,3 +272,14 @@ void vpd_preload(struct dt_node *hub_node)
 
 	vpd_lid = vpd_lid_preload(lxr);
 }
+
+void preload_io_vpd(void)
+{
+	const struct dt_property *prop;
+
+	prop = dt_find_property(dt_root, "ibm,io-vpd");
+	if (!prop) {
+		/* LX VPD Lid not already loaded */
+		vpd_preload(dt_root);
+	}
+}
diff --git a/hw/phb3.c b/hw/phb3.c
index bc04c36fad..bf043b3f2f 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -4934,16 +4934,6 @@ static void phb3_probe_pbcq(struct dt_node *pbcq)
 	add_chip_dev_associativity(np);
 }
 
-void phb3_preload_vpd(void)
-{
-	const struct dt_property *prop;
-
-	prop = dt_find_property(dt_root, "ibm,io-vpd");
-	if (!prop) {
-		/* LX VPD Lid not already loaded */
-		vpd_preload(dt_root);
-	}
-}
 
 void probe_phb3(void)
 {
diff --git a/hw/phb4.c b/hw/phb4.c
index d3e170aa3a..db0cf544fd 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -4356,17 +4356,6 @@ static void phb4_probe_pbcq(struct dt_node *pbcq)
 	}
 }
 
-void phb4_preload_vpd(void)
-{
-	const struct dt_property *prop;
-
-	prop = dt_find_property(dt_root, "ibm,io-vpd");
-	if (!prop) {
-		/* LX VPD Lid not already loaded */
-		vpd_preload(dt_root);
-	}
-}
-
 void probe_phb4(void)
 {
 	struct dt_node *np;
diff --git a/include/skiboot.h b/include/skiboot.h
index 83e2c25a78..394ce93870 100644
--- a/include/skiboot.h
+++ b/include/skiboot.h
@@ -214,9 +214,8 @@ extern void setup_reset_vector(void);
 extern void probe_p7ioc(void);
 extern void probe_phb3(void);
 extern void probe_phb4(void);
-extern void phb3_preload_vpd(void);
 extern int preload_capp_ucode(void);
-extern void phb4_preload_vpd(void);
+extern void preload_io_vpd(void);
 extern void probe_npu(void);
 extern void probe_npu2(void);
 extern void uart_init(void);
-- 
2.11.0



More information about the Skiboot mailing list