[Skiboot] [PATCH] fast-reboot: Disable on FSP IPL side change

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Fri Jun 15 20:35:31 AEST 2018


If FSP changes next IPL side, then disable fast reboot.

sample output:
  [  620.196442259,5] FSP: Got sysparam update, param ID 0xf0000007
  [  620.196444501,5] CUPD: FW IPL side changed. Disable fast reboot
  [  620.196445389,5] CUPD: Next IPL side : perm


Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 hw/fsp/fsp-codeupdate.c | 26 ++++++++++++++++++++++++++
 include/fsp-sysparam.h  |  1 +
 2 files changed, 27 insertions(+)

diff --git a/hw/fsp/fsp-codeupdate.c b/hw/fsp/fsp-codeupdate.c
index f17703a72..e38b18711 100644
--- a/hw/fsp/fsp-codeupdate.c
+++ b/hw/fsp/fsp-codeupdate.c
@@ -206,6 +206,29 @@ static void get_platform_hmc_managed(void)
 	}
 }
 
+static bool fw_ipl_side_update_notify(struct fsp_msg *msg)
+{
+	u32 param_id = msg->data.words[0];
+	int dlen = msg->data.words[1] & 0xffff;
+	uint32_t state = msg->data.words[2];
+
+	if (param_id != SYS_PARAM_FW_IPL_SIDE)
+		return false;
+
+	if (dlen != 4) {
+		prlog(PR_DEBUG,
+		      "CUPD: Invalid sysparams notify len : 0x%x\n", dlen);
+		return false;
+	}
+
+	prlog(PR_NOTICE, "CUPD: FW IPL side changed. Disable fast reboot\n");
+	prlog(PR_NOTICE, "CUPD: Next IPL side : %s\n",
+	      state == FW_IPL_SIDE_TEMP ? "temp" : "perm");
+
+	disable_fast_reboot("FSP IPL Side Change");
+	return true;
+}
+
 static int64_t code_update_check_state(void)
 {
 	switch(flash_state) {
@@ -1275,6 +1298,9 @@ void fsp_code_update_init(void)
 	/* Register for Class AA (FSP R/R) */
 	fsp_register_client(&fsp_cupd_client_rr, FSP_MCLASS_RR_EVENT);
 
+	/* Register for firmware IPL side update notification */
+	sysparam_add_update_notifier(fw_ipl_side_update_notify);
+
 	/* Flash hook */
 	fsp_flash_term_hook = NULL;
 
diff --git a/include/fsp-sysparam.h b/include/fsp-sysparam.h
index cccd979ad..127577665 100644
--- a/include/fsp-sysparam.h
+++ b/include/fsp-sysparam.h
@@ -22,6 +22,7 @@
  */
 #define SYS_PARAM_SURV			0xf0000001
 #define SYS_PARAM_HMC_MANAGED		0xf0000003
+#define SYS_PARAM_FW_IPL_SIDE		0xf0000007
 #define SYS_PARAM_FLASH_POLICY		0xf0000012
 #define SYS_PARAM_NEED_HMC		0xf0000016
 #define SYS_PARAM_REAL_SAI		0xf0000019
-- 
2.14.3



More information about the Skiboot mailing list