diff options
author | Mike Baiocchi <baiocchi@us.ibm.com> | 2014-02-28 17:58:10 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-03-03 12:46:50 -0600 |
commit | 768d2cd2a9f74c350e0d5eb98359246f03513814 (patch) | |
tree | 65af9638f12210d88128be099adc9c0a5d8e3c19 /src/usr/sbe/sbe_update.C | |
parent | f3c513e40abb822d78c0a83d7bf874d30eb733a1 (diff) | |
download | talos-hostboot-768d2cd2a9f74c350e0d5eb98359246f03513814.tar.gz talos-hostboot-768d2cd2a9f74c350e0d5eb98359246f03513814.zip |
Fix how SBE Update selects EXs for p8_xip_customize
This code will add in as many EXs as necessary for
p8_xip_customize() and will pass a mask with 0 cores into the
function if necessary.
Change-Id: Id355ff5440cfea7db3fb87964063e7c39305c346
CQ: SW246073
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/9246
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/sbe/sbe_update.C')
-rw-r--r-- | src/usr/sbe/sbe_update.C | 61 |
1 files changed, 54 insertions, 7 deletions
diff --git a/src/usr/sbe/sbe_update.C b/src/usr/sbe/sbe_update.C index 2fb63c0ea..d1952bc65 100644 --- a/src/usr/sbe/sbe_update.C +++ b/src/usr/sbe/sbe_update.C @@ -625,7 +625,7 @@ namespace SBE fapi::ReturnCode rc_fapi = fapi::FAPI_RC_SUCCESS; uint32_t coreMask = 0x0000FFFF; size_t maxCores = P8_MAX_EX_PER_PROC; - uint32_t coreCount = 0; + int coreCount = 0; uint32_t procIOMask = 0; uint32_t tmpImgSize = static_cast<uint32_t>(i_maxImgSize); bool procedure_success = false; @@ -652,7 +652,6 @@ namespace SBE // remove the number of cores passed into p8_xip_customize() until // an image can be created successfully. - // Maximize Core mask for this target err = selectBestCores(i_target, maxCores, @@ -672,7 +671,7 @@ namespace SBE coreCount = __builtin_popcount(coreMask); procIOMask = coreMask; - while( coreCount > 0 ) + while( coreCount >= 0 ) { FAPI_EXEC_HWP( rc_fapi, @@ -829,12 +828,20 @@ namespace SBE errlHndl_t err = NULL; uint32_t manGuardExs = 0x00000000; + uint32_t remainingExs = 0x00000000; uint32_t exCount = 0; uint32_t deconfigByEid = 0; o_exMask = 0x00000000; do{ + + // Special case: if i_maxExs == 0 don't loop through EXs + if (unlikely(i_maxExs == 0 )) + { + break; + } + // find all EX chiplets of the proc TARGETING::TargetHandleList l_exTargetList; TARGETING::getChildChiplets( l_exTargetList, @@ -851,7 +858,6 @@ namespace SBE // make a local copy of the EX target const TARGETING::Target* l_ex_target = *l_iterEX; - if( !(l_ex_target-> getAttr<TARGETING::ATTR_HWAS_STATE>().present) ) { @@ -894,6 +900,13 @@ namespace SBE { manGuardExs |= (0x00008000 >> chipUnit); } + // Add it to the 'remaining' list in case + // more are needed + else + { + remainingExs |= (0x00008000 >> chipUnit); + } + } } // end ex target loop @@ -902,13 +915,47 @@ namespace SBE //We've found enough, break out of function break; } + else + { + TRACUCOMP( g_trac_sbe,INFO_MRK"selectBestCores: non-functional " + "cores needed for bit mask: exCount=%d, i_maxExs=%d," + " o_exMask=0x%.8X, manGuardExs=0x%.8X, " + "remainingExs=0x%.8X", + exCount, i_maxExs, o_exMask, manGuardExs, + remainingExs ); + } - //Look for more 'good' exs. + // Add more 'good' exs. manGuardExs = trimBitMask(manGuardExs, i_maxExs-exCount); o_exMask |= manGuardExs; - TRACUCOMP( g_trac_sbe,INFO_MRK"selectBestCores: trimBitMask manGuardExs=0x%.8X", - manGuardExs); + exCount = __builtin_popcount(o_exMask); + TRACUCOMP( g_trac_sbe,INFO_MRK"selectBestCores: trimBitMask " + "manGuardExs=0x%.8X", manGuardExs); + + if(exCount >= i_maxExs) + { + //We've found enough, break out of function + break; + } + + // If we still need more, add 'remaining' exs + // Get Target Service + // System target check done earlier, so no assert check necessary + TargetService& tS = targetService(); + TARGETING::Target* sys = NULL; + (void) tS.getTopLevelTarget( sys ); + + uint32_t min_exs = sys->getAttr<ATTR_SBE_IMAGE_MINIMUM_VALID_EXS>(); + if ( exCount < min_exs ) + { + remainingExs = trimBitMask(remainingExs, + min_exs-exCount); + o_exMask |= remainingExs; + TRACUCOMP( g_trac_sbe,INFO_MRK"selectBestCores: trimBitMask " + "remainingExs=0x%.8X, min_exs=%d", + remainingExs, min_exs); + } }while(0); |