From b08d6146f834e3a3f44f52da26e86bbd56c68e18 Mon Sep 17 00:00:00 2001 From: Christian Geddes Date: Thu, 15 Nov 2018 11:53:46 -0600 Subject: [PATCH] Create error log and fail if Proc's EC is found to be 0x0 While looking up the SBE version we will look at the processor's EC level to determine how to lookup the version. If we find that the EC level is 0 then something went wrong. In HW the register describing the procs EC will always be fused to some non-zero so we shouldnt see this in HW , in simics if this happens it is likely because simics has not implemented this register yet. Change-Id: I24bc0caaf3d2c9a574943ca07069bd6fb99cf1a6 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/68804 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Matt Derksen Reviewed-by: William G. Hoffa Reviewed-by: Ilya Smirnov Reviewed-by: Daniel M. Crowell --- src/include/usr/sbe/sbereasoncodes.H | 3 ++- src/usr/sbe/sbe_update.C | 29 +++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/include/usr/sbe/sbereasoncodes.H b/src/include/usr/sbe/sbereasoncodes.H index 4dee3c6ea4e..4609373a5ee 100644 --- a/src/include/usr/sbe/sbereasoncodes.H +++ b/src/include/usr/sbe/sbereasoncodes.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2017 */ +/* Contributors Listed Below - COPYRIGHT 2013,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -106,6 +106,7 @@ enum sbeReasonCode SBE_MISMATCHED_HW_KEY_HASH = SBE_COMP_ID | 0x1A, SBE_UPDATE_DURING_MPIPL = SBE_COMP_ID | 0x1B, SBE_BOOT_SIDE_DIRTY_BAD_PATH = SBE_COMP_ID | 0x1C, + SBE_UNSUPPORTED_EC = SBE_COMP_ID | 0x1D, }; }; // end SBE diff --git a/src/usr/sbe/sbe_update.C b/src/usr/sbe/sbe_update.C index 7fdd7ae141d..87201508577 100644 --- a/src/usr/sbe/sbe_update.C +++ b/src/usr/sbe/sbe_update.C @@ -747,6 +747,33 @@ namespace SBE //Walk the TOC and find our current EC ec = i_target->getAttr(); + + // If ec == 0 then this indicates simics is not correctly + // writing EC to the FSI register we get the EC level from + if(ec == 0) + { + TRACFCOMP( g_trac_sbe, ERR_MRK"findSBEInPnor: invalid EC found, EC cannot be 0, check simics model" ); + + /*@ + * @errortype + * @moduleid SBE_FIND_IN_PNOR + * @reasoncode SBE_UNSUPPORTED_EC + * @userdata1 Target Huid + * @userdata2 unused + * @devdesc EC level says 0, which is invalid + * @custdesc Chip level is invalid + */ + err = new ErrlEntry(ERRL_SEV_UNRECOVERABLE, + SBE_FIND_IN_PNOR, + SBE_UNSUPPORTED_EC, + TARGETING::get_huid(i_target), + 0, + ERRORLOG::ErrlEntry::ADD_SW_CALLOUT); + err->collectTrace(SBE_COMP_NAME); + + break; + } + for(uint32_t i=0; i(ec) == sbeToc->entries[i].ec) @@ -767,7 +794,7 @@ namespace SBE } } } - + // IF we failed to find hdr_Ptr then no matching EC found if(NULL == hdr_Ptr) { //if we get here, it's an error