[Skiboot] [PATCH 04/13] core: Move hservices_init to platform code

Jeremy Kerr jk at ozlabs.org
Fri Feb 27 20:11:06 AEDT 2015


We don't want to call hservices_init on machines that use the PRD, as
they expect to relocate the hbrt code later. This change moves the
hservices_init call out of the common path, and into the firenze
platform init.

Signed-off-by: Jeremy Kerr <jk at ozlabs.org>

---
 core/init.c                 |    4 ----
 platforms/ibm-fsp/firenze.c |   17 ++++++++++++++++-
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/core/init.c b/core/init.c
index c942319..ac61c37 100644
--- a/core/init.c
+++ b/core/init.c
@@ -42,7 +42,6 @@
 #include <fsi-master.h>
 #include <centaur.h>
 #include <libfdt/libfdt.h>
-#include <hostservices.h>
 #include <timer.h>
 
 #include <ipmi.h>
@@ -591,9 +590,6 @@ void __noreturn main_cpu_entry(const void *fdt, u32 master_cpu)
 	/* Reserve HOMER and OCC area */
 	homer_init();
 
-	/* Initialize host services. */
-	hservices_init();
-
 	/* Add the /opal node to the device-tree */
 	add_opal_node();
 
diff --git a/platforms/ibm-fsp/firenze.c b/platforms/ibm-fsp/firenze.c
index 258a6b3..30fe1c7 100644
--- a/platforms/ibm-fsp/firenze.c
+++ b/platforms/ibm-fsp/firenze.c
@@ -21,6 +21,7 @@
 #include <pci.h>
 #include <pci-cfg.h>
 #include <chip.h>
+#include <hostservices.h>
 
 #include "ibm-fsp.h"
 #include "lxvpd.h"
@@ -384,10 +385,24 @@ static uint32_t ibm_fsp_occ_timeout(void)
 	return 60;
 }
 
+static void firenze_init(void)
+{
+	/* We call hservices_init to relocate the hbrt image now, as the FSP
+	 * may request an OCC load any time after ibm_fsp_init.
+	 */
+	hservices_init();
+
+	ibm_fsp_init();
+
+	/* Preload hostservices lids */
+	hservices_lid_preload();
+
+}
+
 DECLARE_PLATFORM(firenze) = {
 	.name			= "Firenze",
 	.probe			= firenze_probe,
-	.init			= ibm_fsp_init,
+	.init			= firenze_init,
 	.cec_power_down		= ibm_fsp_cec_power_down,
 	.cec_reboot		= ibm_fsp_cec_reboot,
 	.pci_setup_phb		= firenze_setup_phb,


More information about the Skiboot mailing list