[Skiboot] [PATCH 04/24] phb3/4: Move IO VPD preload out to a common place
Benjamin Herrenschmidt
benh at kernel.crashing.org
Fri Jun 23 02:22:05 AEST 2017
The code is duplicated between phb3 and phb4 for no reason
Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.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 b5f4f3d..1d2d07d 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 c226f6d..377c919 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 bc04c36..bf043b3 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 d3e170a..db0cf54 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 83e2c25..394ce93 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.9.4
More information about the Skiboot
mailing list