Skip to content

Commit

Permalink
SMF: Fixes to enable SMF on correct DD levels of Nimbus, Cumulus and …
Browse files Browse the repository at this point in the history
…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 <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: RANGANATHPRASAD G. BRAHMASAMUDRA <prasadbgr@in.ibm.com>
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69513
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
  • Loading branch information
premsjha authored and crgeddes committed Jan 15, 2019
1 parent e7a324f commit f5dd1c1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 25 deletions.
28 changes: 16 additions & 12 deletions src/import/chips/p9/procedures/hwp/pm/p9_hcode_image_build.C
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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");
Expand Down Expand Up @@ -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" );
Expand All @@ -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 )
{
Expand Down
18 changes: 9 additions & 9 deletions src/import/chips/p9/procedures/hwp/pm/p9_scan_ring_util.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -777,7 +777,7 @@ P9FuncModel::P9FuncModel( ):
iv_funcQuads(0),
iv_ddLevel(0),
iv_chipName(0),
iv_urmorBug(0)
iv_smfEn(0)
{ }
//-------------------------------------------------------------------------

Expand All @@ -789,7 +789,8 @@ P9FuncModel::P9FuncModel( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP >& i_

auto l_core_functional_vector =
i_procTgt.getChildren<fapi2::TARGET_TYPE_CORE>(fapi2::TARGET_STATE_FUNCTIONAL);
uint8_t l_corePos = 0;
uint8_t l_corePos = 0;
const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM> FAPI_SYSTEM;

for( auto it : l_core_functional_vector )
{
Expand All @@ -802,12 +803,12 @@ P9FuncModel::P9FuncModel( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP >& 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" );
}

//---------------------------------------------------------------------------
Expand Down Expand Up @@ -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;
}

//-------------------------------------------------------------------------

}
8 changes: 4 additions & 4 deletions src/import/chips/p9/procedures/hwp/pm/p9_scan_ring_util.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -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
Expand All @@ -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];
};

Expand Down

0 comments on commit f5dd1c1

Please sign in to comment.