summaryrefslogtreecommitdiffstats
path: root/src/usr/util/runtime
diff options
context:
space:
mode:
authorMatt Derksen <mderkse1@us.ibm.com>2017-12-15 15:45:24 -0600
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2017-12-22 09:49:35 -0500
commitd2b876356f5441e7be94c434952c25826e929370 (patch)
tree50cbf1b464584d992850c5fca5dc5e1ea6f94e87 /src/usr/util/runtime
parent024dc9b9a20380fd7dbdec4f20aca23ceab751ed (diff)
downloadtalos-hostboot-d2b876356f5441e7be94c434952c25826e929370.tar.gz
talos-hostboot-d2b876356f5441e7be94c434952c25826e929370.zip
Lock i2c around vpd write message to FSP at runtime
Adding this lock mechanism to handle contention between the Host and OCC. Using the Host's lock as a proxy for any operations we want the FSP to do for us. HBRT will now call to lock the master i2c, then call down to the FSP to do the VPD write, then call to unlock the master. Change-Id: Ifa06b3bf12fe9914980d39d2663f032ddb950b94 RTC:184131 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/51041 Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/util/runtime')
-rw-r--r--src/usr/util/runtime/rt_fwreq_helper.C47
1 files changed, 43 insertions, 4 deletions
diff --git a/src/usr/util/runtime/rt_fwreq_helper.C b/src/usr/util/runtime/rt_fwreq_helper.C
index 16c9de777..e4cf371d3 100644
--- a/src/usr/util/runtime/rt_fwreq_helper.C
+++ b/src/usr/util/runtime/rt_fwreq_helper.C
@@ -172,6 +172,24 @@ errlHndl_t firmware_request_helper(uint64_t i_reqLen, void *i_req,
}
break; // END case hostInterfaces::HBRT_FW_MSG_HBRT_FSP_REQ:
+ case hostInterfaces::HBRT_FW_MSG_TYPE_I2C_LOCK:
+ {
+ TRACFCOMP(g_trac_runtime,
+ ERR_MRK"FSP is doing a reset/reload, "
+ "sending lock msg to FSP failed. "
+ "retry:%d/%d, rc:%d",
+ i,
+ HBRT_FW_REQUEST_RETRIES,
+ rc);
+
+ l_userData1 = TWO_UINT32_TO_UINT64( rc,
+ TWO_UINT8_TO_UINT16(
+ l_req_fw_msg->req_i2c_lock.i_i2cMaster,
+ l_req_fw_msg->req_i2c_lock.i_operation) );
+ l_userData2 = l_req_fw_msg->req_i2c_lock.i_chipId;
+ }
+ break; // END case hostInterfaces::HBRT_FW_MSG_TYPE_I2C_LOCK:
+
default:
break;
} // END switch (l_req_fw_msg->io_type)
@@ -185,9 +203,11 @@ errlHndl_t firmware_request_helper(uint64_t i_reqLen, void *i_req,
* @reasoncode RC_FW_REQUEST_RESET_RELOAD_ERR
* @userdata1[0:31] Hypervisor return code
* @userdata1[32:63] Firmware Request type (HCODE Update) ||
- sequence number (FSP MSG)
+ sequence number (FSP MSG) ||
+ i2cMaster & lock operation
* @userdata2[0:31] SCOM address (HCODE Update) ||
- MBOX message type (FSP MSG)
+ MBOX message type (FSP MSG) ||
+ chipID
* @userdata2[32:63] SCOM data (HCODE Update) ||
Message Type (FSP MSG)
* @devdesc The Firmware Request call failed
@@ -313,6 +333,23 @@ errlHndl_t firmware_request_helper(uint64_t i_reqLen, void *i_req,
}
break; // END case hostInterfaces::HBRT_FW_MSG_HBRT_FSP_REQ:
+ case hostInterfaces::HBRT_FW_MSG_TYPE_I2C_LOCK:
+ {
+ TRACFCOMP(g_trac_runtime, ERR_MRK"Failed sending FSP i2c "
+ "lock message rc 0x%X; i_chipId: 0x%llX, "
+ "i_i2cMaster: %d, i_operation: %d",
+ rc,
+ l_req_fw_msg->req_i2c_lock.i_chipId,
+ l_req_fw_msg->req_i2c_lock.i_i2cMaster,
+ l_req_fw_msg->req_i2c_lock.i_operation );
+
+ l_userData1 = TWO_UINT32_TO_UINT64( rc,
+ TWO_UINT8_TO_UINT16(
+ l_req_fw_msg->req_i2c_lock.i_i2cMaster,
+ l_req_fw_msg->req_i2c_lock.i_operation) );
+ l_userData2 = l_req_fw_msg->req_i2c_lock.i_chipId;
+ }
+ break; // END case hostInterfaces::HBRT_FW_MSG_TYPE_I2C_LOCK:
default:
break;
} // END switch (l_req_fw_msg->io_type)
@@ -326,9 +363,11 @@ errlHndl_t firmware_request_helper(uint64_t i_reqLen, void *i_req,
* @reasoncode RC_FW_REQUEST_ERR
* @userdata1[0:31] Hypervisor return code
* @userdata1[32:63] Firmware Request type (HCODE Update) ||
- sequence number (FSP MSG)
+ sequence number (FSP MSG) ||
+ i2cMaster & lock operation
* @userdata2[0:31] SCOM address (HCODE Update) ||
- MBOX message type (FSP MSG)
+ MBOX message type (FSP MSG) ||
+ chipId
* @userdata2[32:63] SCOM data (HCODE Update) ||
Message Type (FSP MSG)
* @devdesc The Firmware Request call failed
OpenPOWER on IntegriCloud