From f5dd1c1283bad3f20c6d791f9f0fc5658a360163 Mon Sep 17 00:00:00 2001 From: Prem Shanker Jha Date: Thu, 6 Dec 2018 04:31:22 -0600 Subject: [PATCH] SMF: Fixes to enable SMF on correct DD levels of Nimbus, Cumulus and Axone. - engages new layout if SMF keyword is found in self restore image. - engages old layout if SMF keyword is not found in self restore image. - updates CPMR header indicating, URMOR bug workaround, STOP API version and self restore version. Key_Cronus_Test=PM_REGRESS Change-Id: I293cc2a1d15736e85c6565896ecfa4b00a8feb24 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69512 Tested-by: FSP CI Jenkins Tested-by: Jenkins Server Tested-by: Hostboot CI Reviewed-by: RANGANATHPRASAD G. BRAHMASAMUDRA Reviewed-by: Gregory S. Still Reviewed-by: Jennifer A. Stofer Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69513 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Christian R. Geddes --- .../procedures/hwp/pm/p9_hcode_image_build.C | 28 +++++++++++-------- .../p9/procedures/hwp/pm/p9_scan_ring_util.C | 18 ++++++------ .../p9/procedures/hwp/pm/p9_scan_ring_util.H | 8 +++--- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_hcode_image_build.C b/src/import/chips/p9/procedures/hwp/pm/p9_hcode_image_build.C index d113b87352c..c408c1dd8a2 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_hcode_image_build.C +++ b/src/import/chips/p9/procedures/hwp/pm/p9_hcode_image_build.C @@ -1410,9 +1410,9 @@ void updateCpmrCmeRegion( Homerlayout_t* i_pChipHomer ) * @brief updates various CPMR fields which are associated with self restore code. * @param[in] i_pChipHomer points to start of P9 HOMER. * @param[in] i_fuseState core fuse status - * @param[in] i_urmorFix true if URMOR correction is needed else false. + * @param[in] i_smfEnabled true if SMF is enabled else false. */ -void updateCpmrHeaderSR( Homerlayout_t* i_pChipHomer, uint8_t i_fusedState, uint8_t i_urmorFix, uint32_t i_smfSign ) +void updateCpmrHeaderSR( Homerlayout_t* i_pChipHomer, uint8_t i_fusedState, uint8_t i_smfEnabled, uint32_t i_smfSign ) { FAPI_INF(">> updateCpmrHeaderSR"); cpmrHeader_t* pCpmrHdr = @@ -1423,17 +1423,22 @@ void updateCpmrHeaderSR( Homerlayout_t* i_pChipHomer, uint8_t i_fusedState, uint pCpmrHdr->fusedModeStatus = i_fusedState ? uint32_t(FUSED_CORE_MODE) : uint32_t(NONFUSED_CORE_MODE); - if( i_urmorFix ) + if( i_smfEnabled ) { - if( SMF_SELF_SIGNATURE == i_smfSign ) - { - pCpmrHdr->selfRestoreVer = 0x01; - pCpmrHdr->stopApiVer = 0x01; - } - pCpmrHdr->urmorFix = 0x01; } + if( SMF_SELF_SIGNATURE == i_smfSign ) + { + pCpmrHdr->selfRestoreVer = 0x01; + pCpmrHdr->stopApiVer = 0x01; + } + else + { + pCpmrHdr->selfRestoreVer = 0x00; + pCpmrHdr->stopApiVer = 0x00; + } + pCmeHdr->g_cme_mode_flags = SWIZZLE_4_BYTE(i_fusedState ? 1 : 0); FAPI_INF("CPMR SR"); @@ -1819,7 +1824,7 @@ fapi2::ReturnCode buildCoreRestoreImage( void* const i_pImageIn, //Padding SPR restore area with ATTN Opcode FAPI_INF("Padding CPMR Core Restore portion with Attn opcodes"); - if( i_procFuncModel.hasUrmorBug() && ( SMF_SELF_SIGNATURE == l_pSmfSignature ) ) // Nimbus >= DD22 and Cumulus >= DD13 + if( SMF_SELF_SIGNATURE == l_pSmfSignature ) // Nimbus >= DD22 and Cumulus >= DD13 { FAPI_TRY( initSelfRestoreRegion( i_pChipHomer ), "Failed To Initialize The Self-Restore Region" ); @@ -1832,10 +1837,9 @@ fapi2::ReturnCode buildCoreRestoreImage( void* const i_pImageIn, FAPI_TRY( initSmfDisabledSelfRestore( i_pChipHomer ), "Failed To Initialize Self-Restore Region In Non SMF Mode" ); } - } - updateCpmrHeaderSR( i_pChipHomer, i_fusedState, i_procFuncModel.hasUrmorBug(), l_pSmfSignature ); + updateCpmrHeaderSR( i_pChipHomer, i_fusedState, i_procFuncModel.isSmfEnabled(), l_pSmfSignature ); if( i_imgType.coreScomBuild ) { diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_scan_ring_util.C b/src/import/chips/p9/procedures/hwp/pm/p9_scan_ring_util.C index 62b1b9d3d90..ba0387bc3bb 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_scan_ring_util.C +++ b/src/import/chips/p9/procedures/hwp/pm/p9_scan_ring_util.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2018 */ +/* Contributors Listed Below - COPYRIGHT 2016,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -777,7 +777,7 @@ P9FuncModel::P9FuncModel( ): iv_funcQuads(0), iv_ddLevel(0), iv_chipName(0), - iv_urmorBug(0) + iv_smfEn(0) { } //------------------------------------------------------------------------- @@ -789,7 +789,8 @@ P9FuncModel::P9FuncModel( const fapi2::Target& i_ auto l_core_functional_vector = i_procTgt.getChildren(fapi2::TARGET_STATE_FUNCTIONAL); - uint8_t l_corePos = 0; + uint8_t l_corePos = 0; + const fapi2::Target FAPI_SYSTEM; for( auto it : l_core_functional_vector ) { @@ -802,12 +803,12 @@ P9FuncModel::P9FuncModel( const fapi2::Target& i_ FAPI_ATTR_GET_PRIVILEGED(fapi2::ATTR_EC, i_procTgt, iv_ddLevel); FAPI_ATTR_GET_PRIVILEGED(fapi2::ATTR_NAME, i_procTgt, iv_chipName); - FAPI_ATTR_GET(fapi2::ATTR_CHIP_EC_FEATURE_HW403111, i_procTgt, iv_urmorBug); + FAPI_ATTR_GET(fapi2::ATTR_SMF_ENABLED, FAPI_SYSTEM, iv_smfEn ); FAPI_DBG("functional core : 0x%08x Ex : 0x%08x quad 0x%08x" - "EC : 0x%02x ChipName : 0x%02x URMOR Bug 0x%02x", + "EC : 0x%02x ChipName : 0x%02x SMF Enable : %s", iv_funcCores, iv_funcExes, iv_funcQuads, iv_ddLevel, - iv_chipName, iv_urmorBug ); + iv_chipName, iv_smfEn ? "Yes" : "No" ); } //--------------------------------------------------------------------------- @@ -851,11 +852,10 @@ uint8_t P9FuncModel::getChipName() const } //------------------------------------------------------------------------- -bool P9FuncModel::hasUrmorBug() const +bool P9FuncModel::isSmfEnabled() const { - return iv_urmorBug ? true : false; + return iv_smfEn ? true : false; } - //------------------------------------------------------------------------- } diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_scan_ring_util.H b/src/import/chips/p9/procedures/hwp/pm/p9_scan_ring_util.H index 21f252f2fb7..f52832ff3d6 100644 --- a/src/import/chips/p9/procedures/hwp/pm/p9_scan_ring_util.H +++ b/src/import/chips/p9/procedures/hwp/pm/p9_scan_ring_util.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2018 */ +/* Contributors Listed Below - COPYRIGHT 2016,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -321,9 +321,9 @@ class P9FuncModel uint8_t getChipName() const; /** - * returns true if URMOR has a hw bug else false. + * reutrns true if SMF is enabled else false. */ - bool hasUrmorBug() const; + bool isSmfEnabled() const; /** * @brief constructor @@ -338,7 +338,7 @@ class P9FuncModel uint8_t iv_funcQuads; uint8_t iv_ddLevel; uint8_t iv_chipName; - uint8_t iv_urmorBug; + uint8_t iv_smfEn; uint8_t iv_reserve[2]; };