From d2b876356f5441e7be94c434952c25826e929370 Mon Sep 17 00:00:00 2001 From: Matt Derksen Date: Fri, 15 Dec 2017 15:45:24 -0600 Subject: 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 Tested-by: Jenkins Server Reviewed-by: Christian R. Geddes Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: William G. Hoffa --- src/include/runtime/interface.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/include/runtime') diff --git a/src/include/runtime/interface.h b/src/include/runtime/interface.h index 3a6ac6b93..b2c7312a4 100644 --- a/src/include/runtime/interface.h +++ b/src/include/runtime/interface.h @@ -74,6 +74,7 @@ enum MemoryError_t MEMORY_ERROR_PREDICTIVE = 2, }; + /** * I2C Master Description: chip, engine and port packed into * a single 64-bit argument @@ -504,7 +505,6 @@ typedef struct hostInterfaces /** * @brief Structure to be sent and received in the * firmware_request call - * */ enum { @@ -515,6 +515,7 @@ typedef struct hostInterfaces HBRT_FW_MSG_HBRT_FSP_REQ = 4, HBRT_FW_MSG_TYPE_ERROR_LOG = 5, HBRT_FW_MSG_HBRT_FSP_RESP = 6, + HBRT_FW_MSG_TYPE_I2C_LOCK = 7, }; struct hbrt_fw_msg // define struct hbrt_fw_msg @@ -558,6 +559,19 @@ typedef struct hostInterfaces // (uint8_t*)&l_req_fw_msg->error_log.i_data; } __attribute__ ((packed)) error_log; + + // This struct is sent from HBRT with + // io_type set to HBRT_FW_MSG_TYPE_I2C_LOCK + struct + { + uint64_t i_chipId; // processor chip ID plus ID type, + // always proc (0x0) + uint8_t i_i2cMaster; // i2c master + // B=0, C=1, D=2, E=3 + uint8_t i_operation; // type of operation to perform + // 1 = lock, 2 = unlock + } __attribute__ ((packed)) req_i2c_lock; + // This struct is sent from HBRT with // io_type set to HBRT_FW_MSG_HBRT_FSP_REQ or // HBRT_FW_MSG_HBRT_FSP_RESP -- cgit v1.2.1