diff options
author | Prem Shanker Jha <premjha2@in.ibm.com> | 2014-06-09 11:12:12 +0530 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-07-14 13:30:32 -0500 |
commit | c17babbc668e55f3b11574161fe867da680a5917 (patch) | |
tree | d8cc2f1f642bee048ea602930b9d84f43862cbb9 /src/usr/diag | |
parent | d980e34032968c9b34b9343ea167c1d3cbe15d17 (diff) | |
download | talos-hostboot-c17babbc668e55f3b11574161fe867da680a5917.tar.gz talos-hostboot-c17babbc668e55f3b11574161fe867da680a5917.zip |
PRD: Accessing raw card type using fapi attribute.
Change-Id: Id2d2f0568abe0630d8cdbbadc306bc239dc52fb5
CQ:SW262043
Backport: release-fips811
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/11604
Tested-by: Jenkins Server
Reviewed-by: Christopher T. Phan <cphan@us.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Reviewed-by: Bilicon Patil <bilpatil@in.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Reviewed-by: Zane Shelley <zshelle@us.ibm.com>
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/12158
Diffstat (limited to 'src/usr/diag')
5 files changed, 96 insertions, 97 deletions
diff --git a/src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.C b/src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.C index 1c7a7d0f0..dc2f2b15e 100755 --- a/src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.C +++ b/src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2014 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -48,6 +50,7 @@ #include <io_clear_firs.H> #include <erepairAccessorHwpFuncs.H> #include <io_fir_isolation.H> +#include <fapiAttributeIds.H> using namespace TARGETING; @@ -55,7 +58,7 @@ using namespace TARGETING; namespace PRDF { - +using namespace CEN_SYMBOL; namespace PlatServices { @@ -702,13 +705,78 @@ int32_t getDimmSpareConfig( TargetHandle_t i_mba, CenRank i_rank, //------------------------------------------------------------------------------ -/* TODO - Get the memory buffer raw card type (i.e. R/C A). This is needed for - the DRAM site locations for buffered DIMMs. Should be able to get this - from an attribute but doesn't look like this is available yet. -getMembufRawCardType() +int32_t getMemBufRawCardType( TargetHandle_t i_mba, + WiringType & o_cardType ) { + #define PRDF_FUNC "[PlatServices::getMemBufRawCardType] " + + o_cardType = WIRING_INVALID; + uint8_t l_cardType = WIRING_INVALID; + int32_t o_rc = FAIL; + + do + { + if( TYPE_MBA != getTargetType( i_mba ) ) + { + PRDF_ERR( PRDF_FUNC" Invalid target 0x%08x",getHuid( i_mba ) ); + break; + } + + TargetHandleList l_dimmList = getConnected( i_mba, TYPE_DIMM ); + + if( 0 == l_dimmList.size() ) + { + PRDF_ERR( PRDF_FUNC " No DIMM connected with mba 0x%08x", + getHuid( i_mba ) ); + break; + } + + errlHndl_t errl = NULL; + fapi::Target fapiDimm = getFapiTarget( l_dimmList[0] ); + + PRD_FAPI_TO_ERRL( errl, + fapi::platAttrSvc::fapiPlatGetSpdModspecComRefRawCard, + &fapiDimm, + l_cardType ); + + if( NULL != errl ) + { + PRDF_ERR( PRDF_FUNC" fapiPlatGetSpdModspecComRefRawCard failed for" + "DIMM 0x%08X", getHuid( l_dimmList[0] ) ); + PRDF_COMMIT_ERRL( errl, ERRL_ACTION_REPORT ); + break; + } + + switch( l_cardType ) + { + case ENUM_ATTR_SPD_MODSPEC_COM_REF_RAW_CARD_A : + o_cardType = CEN_TYPE_A; + break; + + case ENUM_ATTR_SPD_MODSPEC_COM_REF_RAW_CARD_B : + o_cardType = CEN_TYPE_B; + break; + + case ENUM_ATTR_SPD_MODSPEC_COM_REF_RAW_CARD_D: + o_cardType = CEN_TYPE_D; + break; + + default: + o_cardType = WIRING_INVALID; + break; + } + + }while(0); + + if( WIRING_INVALID != o_cardType ) + { + o_rc = SUCCESS; + } + + return o_rc; + #undef PRDF_FUNC } -*/ + //------------------------------------------------------------------------------ diff --git a/src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.H b/src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.H index 6fdd35e39..13353385a 100755 --- a/src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.H +++ b/src/usr/diag/prdf/common/framework/service/prdfPlatServices_common.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2014 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -39,6 +41,7 @@ #include <prdfTargetServices.H> // must include all common targeting code #include <prdfCenConst.H> #include <prdfTimer.H> +#include <prdfParserEnums.H> #include <dimmConsts.H> // for DIMM_DQ_RANK_BITMAP_SIZE #include <fapiPlatHwpInvoker.H> // for fapi::fapiRcToErrl() @@ -335,13 +338,13 @@ int32_t getDimmSpareConfig( TARGETING::TargetHandle_t i_mba, CenRank i_rank, uint8_t i_ps, uint8_t & o_spareConfig ); /** - * @brief Returns the memory buffer raw card type (i.e. R/C A). - * @param i_memTarget A memory buffer, MBA, or DIMM. - * @return + * @brief Returns the memory buffer raw card type. + * @param i_mbaTarget an MBA target. + * @param o_wiringType Card Type/ Wiring type of DIMM + * @return SUCCESS for a valid card type, FAIL otherwise. */ -/* TODO - See .C -getMembufRawCardType( TARGETING::TargetHandle_t i_memTarget ); -*/ +int32_t getMemBufRawCardType( TARGETING::TargetHandle_t i_mbaTarget, + CEN_SYMBOL::WiringType & o_wiringType ); /** * @brief Returns the type of the card the DIMM is plugged into. diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.C index 9e6fdae37..e9a6eeb5b 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2014 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -466,75 +468,6 @@ int32_t chnlCsCleanup( ExtensibleChip *i_mbChip, //------------------------------------------------------------------------------ -int32_t getRawCardType( TargetHandle_t i_mba, WiringType & o_type ) -{ - #define PRDF_FUNC "[MemUtils::getRawCardType] " - int32_t o_rc = FAIL; - o_type = WIRING_INVALID; - uint32_t mbaPos = getTargetPosition( i_mba ); - const char * reg_str = ( 0 == mbaPos )? "MBA0_MBAXCR" :"MBA1_MBAXCR"; - - do - { - if( TYPE_MBA != getTargetType( i_mba ) ) - { - PRDF_ERR( PRDF_FUNC"Invalid Target type 0x%08x ", - getTargetType( i_mba ) ); - break; - } - - SCAN_COMM_REGISTER_CLASS * addTransReg = NULL; - TargetHandle_t memBufTgt = getParentChip( i_mba ); - ExtensibleChip * memBuf = - ( ExtensibleChip * ) systemPtr->GetChip( memBufTgt ); - - addTransReg = memBuf->getRegister( reg_str ); - - if( SUCCESS != addTransReg->Read() ) - { - PRDF_ERR( PRDF_FUNC" Read failed: for %s , HUID: 0x%08x ", - reg_str, getHuid( i_mba ) ); - break; - } - - // card is of type RCA/RCB/RCD. Need to investigate card subtype. - - if( 1 == addTransReg->GetBitFieldJustified( 0, 4 ) ) - { - uint32_t l_cardSubType = - addTransReg->GetBitFieldJustified( 4, 2 ); - switch( l_cardSubType ) - { - case 0x00: // card type RCA - o_type = CEN_TYPE_A; break; - case 0x01: // card type RCB - o_type = CEN_TYPE_B; break; - case 0x03: // card type RCD - o_type = CEN_TYPE_D; break; - default: - PRDF_ERR( PRDF_FUNC" Invalid card sub type 0x%08x ", - l_cardSubType ); - break; - } - } - - if( WIRING_INVALID == o_type ) - { - PRDF_ERR( PRDF_FUNC "Invalid card type HUID: 0x%08x, card type " - "%d", getHuid( i_mba ), - (uint8_t ) addTransReg->GetBitFieldJustified( 0, 4 ) ); - break; - } - - o_rc = SUCCESS; // only if we found valid card type and sub type - - }while(0); - - return o_rc; - - #undef PRDF_FUNC -} - } // end namespace MemUtils } // end namespace PRDF diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.H b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.H index 2b62aafa4..c5bfb15db 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.H +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMemUtils.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2014 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -167,15 +169,6 @@ int32_t getDramSize( ExtensibleChip * i_mbaChip, uint8_t & o_size ); int32_t chnlCsCleanup( ExtensibleChip *i_mbChip, STEP_CODE_DATA_STRUCT & i_sc ); -/** - * @brief determines the type of Centaur based raw card associated with MBA. - * @param i_mba mba target - * @param o_type raw card type. - * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. - * @note Function is not intended for IS DIMM. - */ -int32_t getRawCardType( TARGETING::TargetHandle_t i_mba, - CEN_SYMBOL::WiringType & o_type ); } // end namespace MemUtils } // end namespace PRDF diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.C index c75228e19..4f4974d50 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenSymbol.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2014 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -216,11 +218,11 @@ int32_t CenSymbol::getWiringType( TargetHandle_t i_mba, const CenRank & i_rank, if( isCenDimm ) { //It is a centaur DIMM. Let us find out card type - o_rc = MemUtils::getRawCardType( i_mba, o_type ); + o_rc = getMemBufRawCardType( i_mba, o_type ); if( SUCCESS != o_rc ) { - PRDF_ERR( PRDF_FUNC"getRawCardType returned error" ); + PRDF_ERR( PRDF_FUNC"getMemBufRawCardType returned error" ); o_type = WIRING_INVALID; break; } |