From 810394f870786da606ef3179315e6cbdaa35627b Mon Sep 17 00:00:00 2001 From: Nick Bofferding Date: Wed, 13 Mar 2019 15:22:30 -0500 Subject: UCD flash update invoker Implements the main algorithm for finding applicable UCDs to perform flash update on and walking the UCD flash image table of contents to find the image associated with a UCD. Also adds a check to skip the update if simics is running. RTC: 201991 Change-Id: Ib35abec2f0a2ed22ae8d41a2acecd146f699bc43 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/73484 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Ilya Smirnov Reviewed-by: Matthew Raybuck Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Daniel M. Crowell --- src/include/usr/isteps/istep_reasoncodes.H | 2 ++ src/include/usr/isteps/ucd/updateUcdFlash.H | 24 ++++++++++++++++++++++++ src/include/usr/ucd/ucd_reasoncodes.H | 8 +++++++- src/include/usr/util/utillidmgr.H | 1 + 4 files changed, 34 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/usr/isteps/istep_reasoncodes.H b/src/include/usr/isteps/istep_reasoncodes.H index 09b12abdc..7aa3abc5e 100644 --- a/src/include/usr/isteps/istep_reasoncodes.H +++ b/src/include/usr/isteps/istep_reasoncodes.H @@ -66,6 +66,7 @@ namespace ISTEP MOD_APPLY_HCODE_GEN_CPU_REGS = 0x23, MOD_GET_LANEMASK_FROM_HX_KEYWORD = 0x24, MOD_MSS_SCRUB = 0x25, + MOD_CALL_UPDATE_UCD_FLASH = 0x26, }; /** @@ -138,6 +139,7 @@ namespace ISTEP RC_INVALID_HX_KEYWORD_DATA = ISTEP_COMP_ID | 0x4C, RC_PNOR_IPMI_NOT_ENABLED = ISTEP_COMP_ID | 0x4D, RC_SLAVE_CORE_WAKEUP_ERROR = ISTEP_COMP_ID | 0x4E, + RC_UCD_IMG_NOT_IN_CONTAINER = ISTEP_COMP_ID | 0x4F, }; }; diff --git a/src/include/usr/isteps/ucd/updateUcdFlash.H b/src/include/usr/isteps/ucd/updateUcdFlash.H index a1487e78d..2cc7e8e84 100644 --- a/src/include/usr/isteps/ucd/updateUcdFlash.H +++ b/src/include/usr/isteps/ucd/updateUcdFlash.H @@ -27,6 +27,7 @@ #define __UPDATE_UCD_FLASH_H #include +#include #include namespace POWER_SEQUENCER @@ -38,6 +39,29 @@ namespace TI // Texas Instruments namespace UCD // UCD series { +/** + * @brief Applies UCD data flash image updates (if needed) to the requested + * UCDs + * + * @param[in] i_powerSequencers Fixed vector of PowerSequencer targets to + * update flash image on + * @param[in] i_image Reference to UtilMem buffer holding the UCD flash image + * contents (including header, TOC entries, and flash images). Note: the + * implementation will not alter the buffer content, and will seek back + * to the beginning before handing control back. + * + * @return errlHndl_t Error log handle + * @retval nullptr Successfully took action against all requested UCDs. It's + * possible an individual UCD update failed, in which case the error is + * committed. + * @retval !nullptr Failed to take action against one or more requested UCDs. + * Typically this is due to a firmware problem. Handle points to valid + * error log + */ +errlHndl_t updateAllUcdFlashImages( + const TARGETING::TargetHandleList& i_powerSequencers, + UtilMem& i_image); + /** * @brief Updates a UCD target's flash image * diff --git a/src/include/usr/ucd/ucd_reasoncodes.H b/src/include/usr/ucd/ucd_reasoncodes.H index bfa18397f..4e7cc9841 100644 --- a/src/include/usr/ucd/ucd_reasoncodes.H +++ b/src/include/usr/ucd/ucd_reasoncodes.H @@ -32,13 +32,19 @@ namespace UCD_RC enum UcdModuleId { - MOD_UCD_INIT = 0x01, + MOD_UCD_INIT = 0x01, + MOD_UPDATE_ALL_UCD_FLASH_IMAGES = 0x02, }; enum UcdReasonCode { RC_DEVICE_READ_UNEXPECTED_SIZE_DEVICE_ID = UCD_COMP_ID | 0x01, RC_DEVICE_READ_UNEXPECTED_SIZE_MFR_REVISION = UCD_COMP_ID | 0x02, + UCD_INVALID_EYECATCHER = UCD_COMP_ID | 0x03, + UCD_INVALID_MAJOR_VER = UCD_COMP_ID | 0x04, + UCD_TOC_ENTRY_TOO_SMALL = UCD_COMP_ID | 0x05, + UCD_UNSUPPORTED_DEVICE_ID = UCD_COMP_ID | 0x06, + UCD_EOF = UCD_COMP_ID | 0x07, }; }; // namespace UCD diff --git a/src/include/usr/util/utillidmgr.H b/src/include/usr/util/utillidmgr.H index 64e77cfd3..e78eba133 100644 --- a/src/include/usr/util/utillidmgr.H +++ b/src/include/usr/util/utillidmgr.H @@ -63,6 +63,7 @@ enum LidId TARGETING_BINARY_LIDID = 0x81e00630, NVDIMM_16GB_LIDID = 0x81e00640, NVDIMM_32GB_LIDID = 0x81e00641, + UCD_LIDID = 0x81e00650, INVALID_LIDID = 0xFFFFFFFF }; -- cgit v1.2.1