diff options
author | Mike Jones <mjjones@us.ibm.com> | 2013-05-17 13:46:41 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-06-06 10:21:40 -0500 |
commit | 66474f4f93fd10ad3b35ed89cecc3d6b11e99eed (patch) | |
tree | d4eead386bbfce426e554bd35a105410689d5b9a /src | |
parent | 3d8ff73f2435dda59135776a751d692779b045bb (diff) | |
download | talos-hostboot-66474f4f93fd10ad3b35ed89cecc3d6b11e99eed.tar.gz talos-hostboot-66474f4f93fd10ad3b35ed89cecc3d6b11e99eed.zip |
Retrieve attributes from VSPD AM Centaur VPD fields
Create a HWP accessor to retrieve Address Mirroring Data attributes from cvpd
record VSPD keyword AM.
Change-Id: I1b994814407d0747021c869515d8e08a6d02f7e5
RTC: 50574
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4781
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Tested-by: Jenkins Server
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/usr/hwpf/fapi/fapiMBvpdAccess.H | 1 | ||||
-rw-r--r-- | src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.H | 108 | ||||
-rw-r--r-- | src/include/usr/hwpf/hwpf_reasoncodes.H | 2 | ||||
-rw-r--r-- | src/include/usr/hwpf/plat/fapiPlatAttributeService.H | 22 | ||||
-rw-r--r-- | src/include/usr/vpd/cvpdenums.H | 1 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/dimm_spd_attributes.xml | 19 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C | 143 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk | 3 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml | 11 | ||||
-rw-r--r-- | src/usr/hwpf/plat/fapiPlatAttributeService.C | 74 | ||||
-rw-r--r-- | src/usr/hwpf/plat/fapiPlatMBvpdAccess.C | 1 | ||||
-rw-r--r-- | src/usr/hwpf/test/fapiwinkletest.H | 114 | ||||
-rw-r--r-- | src/usr/vpd/cvpd.H | 1 | ||||
-rw-r--r-- | src/usr/vpd/makefile | 2 | ||||
-rwxr-xr-x | src/usr/vpd/test/cvpdtest.H | 1 |
15 files changed, 499 insertions, 4 deletions
diff --git a/src/include/usr/hwpf/fapi/fapiMBvpdAccess.H b/src/include/usr/hwpf/fapi/fapiMBvpdAccess.H index 5fa79f5fa..e90ce67cd 100644 --- a/src/include/usr/hwpf/fapi/fapiMBvpdAccess.H +++ b/src/include/usr/hwpf/fapi/fapiMBvpdAccess.H @@ -67,6 +67,7 @@ namespace fapi MBVPD_KEYWORD_LM = 0x06, MBVPD_KEYWORD_MW = 0x07, MBVPD_KEYWORD_MV = 0x08, + MBVPD_KEYWORD_AM = 0x09, }; } diff --git a/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.H b/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.H new file mode 100644 index 000000000..75d217587 --- /dev/null +++ b/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.H @@ -0,0 +1,108 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirror.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ +// $Id$ + +/** + * @file getMBvpdAddrMirror.H + * + * @brief Prototype for getMBvpdAddrMirror() - + * get Address Mirroring Data from MBvpd + */ + +#ifndef _HWP_MBVPDADDRMIRRORDATA_ +#define _HWP_MBVPDADDRMIRRORDATA_ + +#include <fapi.H> + +// function pointer typedef definition for HWP call support +typedef fapi::ReturnCode (*getMBvpdAddrMirrorData_FP_t) + (const fapi::Target &, uint8_t (&) [2][2]); + +extern "C" +{ +/** + * @brief get Address Mirroring Data from cvpd record VSPD keyword AM + * + * The Address Mirroring Data attributes are retrieved from cvpd record VSPD + * keyword AM. + * There are two mba per memory buffer: position 0 and position 1. + * There are two ports for each mba and 2 DIMMs per port. + * + * cpvd record VSPD keyword AM - 4 bytes + * ----------------------------------- + * | mba position 0 | + * | ----------------------------- | + * | | port 0 (Port A) | | + * | | ------------------------ | | + * | | | DIMM 0 : 4 bits | | | + * | | ------------------------ | | + * | | | DIMM 1 : 4 bits | | | + * | | ------------------------ | | + * | |---------------------------| | + * | | port 1 (Port B) | | + * | | ------------------------ | | + * | | | DIMM 0 : 4 bits | | | + * | | ------------------------ | | + * | | | DIMM 1 : 4 bits | | | + * | | ------------------------ | | + * | ----------------------------- | + * |---------------------------------| + * | mba postion 1 | + * | ----------------------------- | + * | | port 0 (Port C) | | + * | | ------------------------ | | + * | | | DIMM 0 : 4 bits | | | + * | | ------------------------ | | + * | | | DIMM 1 : 4 bits | | | + * | | ------------------------ | | + * | |---------------------------| | + * | | port 1 (Port D) | | + * | | ------------------------ | | + * | | | DIMM 0 : 4 bits | | | + * | | ------------------------ | | + * | | | DIMM 1 : 4 bits | | | + * | | ------------------------ | | + * | ----------------------------- | + * ----------------------------------- + * + * Bit definition + * + * RANK0_MIRRORED = 0x08, + * RANK1_MIRRORED = 0x04, + * RANK2_MIRRORED = 0x02, + * RANK3_MIRRORED = 0x01, + * + * @param[in] i_mbaTarget - mba target + * @param[out] o_val - 2 x 2 array of bytes ([num ports] [num dimms]) + * Address Mirroring 4 bits per dimm returned + * in the lower nibble of the byte for the mba + * + * @return fapi::ReturnCode - FAPI_RC_SUCCESS if success, + * relevant error code for failure. + */ +fapi::ReturnCode getMBvpdAddrMirrorData( const fapi::Target &i_mbaTarget, + uint8_t (&o_val) [2][2]); + +} + +#endif diff --git a/src/include/usr/hwpf/hwpf_reasoncodes.H b/src/include/usr/hwpf/hwpf_reasoncodes.H index 818157f43..c16296fe6 100644 --- a/src/include/usr/hwpf/hwpf_reasoncodes.H +++ b/src/include/usr/hwpf/hwpf_reasoncodes.H @@ -103,6 +103,8 @@ namespace fapi RC_VDDR_ERROR_MSG = HWPF_COMP_ID | 0x26, RC_VDDR_POWR_ERR = HWPF_COMP_ID | 0x27, RC_INCORRECT_MSG_TYPE = HWPF_COMP_ID | 0x28, + + RC_NO_SINGLE_MBA = HWPF_COMP_ID | 0x29, }; /** diff --git a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H index 97c60b0de..0d423acdf 100644 --- a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H +++ b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H @@ -54,6 +54,7 @@ #include <hwpf/fapi/fapiTarget.H> #include <hwpf/plat/fapiPlatAttrOverrideSync.H> #include <hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.H> +#include <hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.H> #include <vpd/spdenums.H> #include <dimmConsts.H> #include <util/singleton.H> @@ -452,6 +453,19 @@ fapi::ReturnCode fapiPlatGetPhaseRotatorData ( const fapi::Target * i_pTarget, const fapi::MBvpdPhaseRotatorData i_attr, uint8_t (&o_val) [2] ); +/** + * @brief This function is called by the FAPI_ATTR_GET macro when getting + * the Address Mirroring Data attributes + * It should not be called directly. + * + * @param[in] i_pTarget Target DIMM pointer + * @param[out] o_val Address Mirroring Data for DIMM + * @return ReturnCode. Zero on success, else platform specified error + */ +fapi::ReturnCode fapiPlatGetAddrMirrorData ( + const fapi::Target * i_pTarget, + uint8_t &o_val); + } // namespace platAttrSvc @@ -1064,4 +1078,12 @@ fapi::ReturnCode fapiPlatGetPhaseRotatorData ( #define ATTR_EFF_CEN_PHASE_ROT_M1_CNTL_ODT1_SETMACRO(ID, PTARGET, VAL)\ fapi::FAPI_RC_SUCCESS #endif +//------------------------------------------------------------------------------ +// MACROS to support MBVPD Address Mirror attributes +//------------------------------------------------------------------------------ +#define ATTR_VPD_DRAM_ADDRESS_MIRRORING_GETMACRO(ID, PTARGET, VAL)\ + fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ?\ + fapi::FAPI_RC_SUCCESS : fapi::platAttrSvc::fapiPlatGetAddrMirrorData\ + (PTARGET, VAL) + #endif // FAPIPLATATTRIBUTESERVICE_H_ diff --git a/src/include/usr/vpd/cvpdenums.H b/src/include/usr/vpd/cvpdenums.H index 3a2516f7b..4a8f2821b 100644 --- a/src/include/usr/vpd/cvpdenums.H +++ b/src/include/usr/vpd/cvpdenums.H @@ -59,6 +59,7 @@ namespace CVPD LM = 0x06, MW = 0x07, MV = 0x08, + AM = 0x09, // Last Keyword CVPD_LAST_KEYWORD, CVPD_TEST_KEYWORD, // Test purposes ONLY! diff --git a/src/usr/hwpf/hwp/dimm_spd_attributes.xml b/src/usr/hwpf/hwp/dimm_spd_attributes.xml index de5a47bd0..3624f53a3 100644 --- a/src/usr/hwpf/hwp/dimm_spd_attributes.xml +++ b/src/usr/hwpf/hwp/dimm_spd_attributes.xml @@ -618,4 +618,23 @@ <writeable/> </attribute> +<attribute> + <id>ATTR_VPD_DRAM_ADDRESS_MIRRORING</id> + <targetType>TARGET_TYPE_DIMM</targetType> + <description> + The C-DIMM ranks that have address mirroring. + This data is in the Record:VSPD, Keyword:AM field in C-DIMM VPD. + This attribute is only valid for C-DIMMs, an error should be returned if queried from IS-DIMMs. + Note: Muliple ranks can be mirrored. + </description> + <valueType>uint8</valueType> + <enum> + RANK0_MIRRORED = 0x08, + RANK1_MIRRORED = 0x04, + RANK2_MIRRORED = 0x02, + RANK3_MIRRORED = 0x01 + </enum> + <platInit/> +</attribute> + </attributes> diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C new file mode 100644 index 000000000..22389959d --- /dev/null +++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C @@ -0,0 +1,143 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ +// $Id$ +/** + * @file getMBvpdAddrMirrorData.C + * + * @brief get Address Mirroring Data from MBvpd AM keyword + * + */ + +#include <stdint.h> + +// fapi support +#include <fapi.H> +#include <fapiUtil.H> +#include <getMBvpdAddrMirrorData.H> + +extern "C" +{ +using namespace fapi; + +fapi::ReturnCode getMBvpdAddrMirrorData( + const fapi::Target &i_mbaTarget, + uint8_t (& o_val)[2][2]) +{ + //AM keyword layout + //The following constants are for readibility. They need to stay in sync + // with the vpd layout. + const uint8_t NUM_MBAS = 2; //There are 2 MBAs per Centaur memory buffer + const uint8_t NUM_PORTS = 2; //Each MBA has 2 ports + struct port_attributes + { + uint8_t dimm0 : 4 ; + uint8_t dimm1 : 4 ; + }; + struct mba_attributes + { + port_attributes mba_port[NUM_PORTS]; + }; + struct ma_keyword + { + mba_attributes mb_mba[NUM_MBAS]; + }; + const uint32_t AM_KEYWORD_SIZE = sizeof(ma_keyword); // keyword size + + fapi::ReturnCode l_fapirc; + fapi::Target l_mbTarget; + uint8_t l_mbaPos = NUM_MBAS; //initialize to out of range value (+1) + ma_keyword * l_pMaBuffer = NULL; // MBvpd MT keyword buffer + uint32_t l_MaBufsize = sizeof(ma_keyword); + + FAPI_DBG("getMBvpdAddrMirrorData: entry "); + + do { + + // find the position of the passed mba on the centuar + l_fapirc = FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS,&i_mbaTarget,l_mbaPos); + if (l_fapirc) + { + FAPI_ERR(" getMBvpdAddrMirrorData: Get MBA position failed "); + break; // break out with fapirc + } + FAPI_DBG("getMBvpdAddrMirrorData: mba %s position=%d", + i_mbaTarget.toEcmdString(), + l_mbaPos); + + // find the Centaur memmory buffer from the passed MBA + l_fapirc = fapiGetParentChip (i_mbaTarget,l_mbTarget); + if (l_fapirc) + { + FAPI_ERR("getMBvpdAddrMirrorData: Finding the parent mb failed "); + break; // break out with fapirc + } + FAPI_DBG("getMBvpdAddrMirrorData: parent mb path=%s ", + l_mbTarget.toEcmdString() ); + + // Read the AM keyword field + l_pMaBuffer = new ma_keyword; + + l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VSPD, + fapi::MBVPD_KEYWORD_AM, + l_mbTarget, + reinterpret_cast<uint8_t *>(l_pMaBuffer), + l_MaBufsize); + if (l_fapirc) + { + FAPI_ERR("getMBvpdAddrMirrorData: Read of AM keyword failed"); + break; // break out with fapirc + } + + // Check that sufficient AM was returned. + if (l_MaBufsize < AM_KEYWORD_SIZE ) + { + FAPI_ERR("getMBvpdAddrMirrorData:" + " less AM keyword returned than expected %d < %d", + l_MaBufsize, AM_KEYWORD_SIZE); + const uint32_t & KEYWORD = fapi::MBVPD_KEYWORD_AM; + const uint32_t & RETURNED_SIZE = l_MaBufsize; + FAPI_SET_HWP_ERROR(l_fapirc, RC_MBVPD_INSUFFICIENT_VPD_RETURNED ); + break; // break out with fapirc + } + + // Return the 4 bits of address mirroring data for each + // of the 4 DIMMs for the requested mba from the AM keyword buffer + for (uint8_t l_port=0; l_port<NUM_PORTS; l_port++) + { + o_val[l_port][0]= l_pMaBuffer-> + mb_mba[l_mbaPos].mba_port[l_port].dimm0; + o_val[l_port][1]= l_pMaBuffer-> + mb_mba[l_mbaPos].mba_port[l_port].dimm1; + } + + } while (0); + + delete l_pMaBuffer; + l_pMaBuffer = NULL; + + FAPI_DBG("getMBvpdAddrMirrorData: exit rc=0x%08x", + static_cast<uint32_t>(l_fapirc)); + return l_fapirc; +} + +} // extern "C" diff --git a/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk b/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk index f12fdc1dc..8cf8f417a 100644 --- a/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk +++ b/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk @@ -29,5 +29,6 @@ OBJS += getMvpdRing.o \ setMvpdRing.o \ mvpdRingFuncs.o \ getMvpdExL2SingleMemberEnable.o \ - getMBvpdPhaseRotatorData.o + getMBvpdPhaseRotatorData.o \ + getMBvpdAddrMirrorData.o diff --git a/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml b/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml index 88b48c270..1254658aa 100644 --- a/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml +++ b/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml @@ -86,7 +86,16 @@ <hwpError> <rc>RC_MBVPD_INSUFFICIENT_MR_KEYWORD</rc> <description> - MR keyword record returned is smaller than expected. + VPD read is smaller than expected. </description> </hwpError> + <!-- ********************************************************************* --> + <hwpError> + <rc>RC_MBVPD_INSUFFICIENT_VPD_RETURNED</rc> + <description> + VPD keyword record returned is smaller than expected. + </description> + <ffdc>KEYWORD</ffdc> + <ffdc>RETURNED_SIZE</ffdc> + </hwpError> </hwpErrors> diff --git a/src/usr/hwpf/plat/fapiPlatAttributeService.C b/src/usr/hwpf/plat/fapiPlatAttributeService.C index f98043756..13392988d 100644 --- a/src/usr/hwpf/plat/fapiPlatAttributeService.C +++ b/src/usr/hwpf/plat/fapiPlatAttributeService.C @@ -34,6 +34,7 @@ #include <hwpf/fapi/fapiTarget.H> #include <hwpf/fapi/fapiHwpExecutor.H> #include <targeting/common/targetservice.H> +#include <targeting/common/predicates/predicatectm.H> #include <targeting/common/utilFilter.H> #include <errl/errlentry.H> #include <hwpf/plat/fapiPlatAttributeService.H> @@ -42,6 +43,7 @@ #include <devicefw/driverif.H> #include <hwpf/hwp/mvpd_accessors/getMvpdExL2SingleMemberEnable.H> #include <hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.H> +#include <hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.H> // The following file checks at compile time that all HWPF attributes are // handled by Hostboot. This is done to ensure that the HTML file listing @@ -1217,6 +1219,78 @@ fapi::ReturnCode fapiPlatGetPhaseRotatorData ( return l_rc; } +fapi::ReturnCode fapiPlatGetAddrMirrorData ( + const fapi::Target * i_pFapiTarget, + uint8_t &o_val ) +{ + fapi::ReturnCode l_rc; + TARGETING::Target * l_pTarget = NULL; + TARGETING::TargetHandleList l_mbaList; + uint8_t l_val[2][2] = {{0xFF,0xFF},{0xFF,0xFF}}; + + do { + // Get the Targeting Target + l_rc = getTargetingTarget(i_pFapiTarget, l_pTarget); + if (l_rc) + { + FAPI_ERR("fapiPlatGetAddrMirrorData:Error from getTargetingTarget"); + break; + } + + // Find the port and DIMM position + TARGETING::ATTR_MBA_PORT_type l_portPos = + l_pTarget->getAttr<TARGETING::ATTR_MBA_PORT>(); + TARGETING::ATTR_MBA_DIMM_type l_dimmPos = + l_pTarget->getAttr<TARGETING::ATTR_MBA_DIMM>(); + + // Find MBA target from DIMM target + getParentAffinityTargets (l_mbaList, l_pTarget, TARGETING::CLASS_UNIT, + TARGETING::TYPE_MBA, false); + + if (l_mbaList.size () != 1 ) + { + FAPI_ERR("fapiPlatGetAddrMirrorData: expect 1 mba %d ", + l_mbaList.size()); + + /*@ + * @errortype + * @moduleid fapi::MOD_PLAT_ATTR_SVC_GET_TARG_ATTR + * @reasoncode fapi::RC_NO_SINGLE_MBA + * @userdata1 Number of MBAs + * @devdesc fapiPlatGetAddrMirrorData could not find the + * expected 1 mba from the passed dimm target + */ + errlHndl_t l_pError = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_UNRECOVERABLE, + fapi::MOD_PLAT_ATTR_SVC_GET_TARG_ATTR, + fapi::RC_NO_SINGLE_MBA, + l_mbaList.size()); + + // Attach the error log to the fapi::ReturnCode + l_rc.setPlatError(reinterpret_cast<void *> (l_pError)); + break; + } + + // Get the Fapi Target + fapi::Target l_fapiTarget(TARGET_TYPE_MBA_CHIPLET, + static_cast<void *>(l_mbaList[0])); + + // Get the data using the HWP accessor + FAPI_EXEC_HWP(l_rc, getMBvpdAddrMirrorData, l_fapiTarget, l_val); + if (l_rc) + { + FAPI_ERR("fapiPlatGetAddrMirrorData:" + " Error from getMBvpdAddrMirrorData"); + break; + } + + // return the address mirroring data for the passed DIMM + o_val = l_val[l_portPos][l_dimmPos]; + + } while (0); + return l_rc; +} + fapi::ReturnCode fapiPlatGetEnableAttr ( fapi::AttributeId i_id, const fapi::Target * i_pFapiTarget, uint8_t & o_enable ) { diff --git a/src/usr/hwpf/plat/fapiPlatMBvpdAccess.C b/src/usr/hwpf/plat/fapiPlatMBvpdAccess.C index 5ddf458de..c5efb2d96 100644 --- a/src/usr/hwpf/plat/fapiPlatMBvpdAccess.C +++ b/src/usr/hwpf/plat/fapiPlatMBvpdAccess.C @@ -117,6 +117,7 @@ fapi::ReturnCode MBvpdKeywordXlate(const fapi::MBvpdKeyword i_fapiKeyword, CVPD::LM, CVPD::MW, CVPD::MV, + CVPD::AM, }; const uint8_t NUM_MBVPD_KEYWORDS = sizeof(mbvpdFapiKeywordToHbKeyword)/sizeof(mbvpdFapiKeywordToHbKeyword[0]); diff --git a/src/usr/hwpf/test/fapiwinkletest.H b/src/usr/hwpf/test/fapiwinkletest.H index 6a164f402..d0ec9b9ac 100644 --- a/src/usr/hwpf/test/fapiwinkletest.H +++ b/src/usr/hwpf/test/fapiwinkletest.H @@ -47,6 +47,7 @@ #include <getMvpdRing.H> #include <setMvpdRing.H> #include <mvpd_accessors/getMBvpdPhaseRotatorData.H> +#include <mvpd_accessors/getMBvpdAddrMirrorData.H> #include <errl/errlmanager.H> #include <errl/errlentry.H> @@ -188,6 +189,7 @@ public: { MBVPD_RECORD_VSPD, MBVPD_KEYWORD_LM}, { MBVPD_RECORD_VSPD, MBVPD_KEYWORD_MW}, { MBVPD_RECORD_VSPD, MBVPD_KEYWORD_MV}, + { MBVPD_RECORD_VSPD, MBVPD_KEYWORD_AM}, }; TS_TRACE( "testGetMBvpd entry" ); @@ -258,7 +260,7 @@ public: free( l_pRecord ); return; } -#if UNITTESTmft +#if UNITTESTfwt TRACFCOMP(g_trac_test,"testMBvpd:Record=%d,Keyword=%d", l_mbvpdRecords[i].record, l_mbvpdRecords[i].keyword); @@ -290,6 +292,116 @@ public: } /** + * @brief call getMBvpdAddrMirrorData to fetch memory buffer AM attributes + * + */ + void testGetAddrMirrorData() + { + fapi::ReturnCode l_fapirc( fapi::FAPI_RC_SUCCESS ); + getMBvpdAddrMirrorData_FP_t (l_getMBvpdAddrMirrorData) + = &getMBvpdAddrMirrorData; + + TS_TRACE( "testGetAddrMirrorData entry" ); + + TARGETING::TargetHandleList l_memBufList; + getAllChips(l_memBufList, TYPE_MEMBUF); + + TS_TRACE( "testGetAddrMirrorData l_memBufList.size()=%d", + l_memBufList.size() ); + // loop thru memory buffers +#if UNITTESTfwt + uint8_t l_mbNum = 0; // check them all in unit test +#else + uint8_t l_mbNum = (l_memBufList.size() > 0) ? l_memBufList.size()-1 : 0; +#endif + for (; l_mbNum < l_memBufList.size(); l_mbNum++ ) + { + TARGETING::TargetHandleList l_mbaList; + getChildAffinityTargets(l_mbaList,l_memBufList[l_mbNum], + CLASS_UNIT,TYPE_MBA,false); + + TS_TRACE( "testGetAddrMirrorData l_mbaBufList.size()=%d", + l_mbaList.size()); + + // loop thru all the mbas (should be 2) +#if UNITTESTfwt + uint8_t l_mbaNum = 0; // check them all in unit test +#else + uint8_t l_mbaNum = (l_mbaList.size() > 0) ? l_mbaList.size()-1:0 ; +#endif + for (; l_mbaNum < l_mbaList.size(); l_mbaNum++ ) + { + TARGETING::TargetHandleList l_dimmList; + + getChildAffinityTargets(l_dimmList,l_mbaList[l_mbaNum], + CLASS_LOGICAL_CARD,TYPE_DIMM,false); + TS_TRACE( "testGetAddrMirrorData l_dimmList.size()=%d", + l_dimmList.size()); + + // cast OUR type of target to a FAPI type of target. + fapi::Target l_fapi_mba_target( TARGET_TYPE_MBA_CHIPLET, + (const_cast<TARGETING::Target*>(l_mbaList[l_mbaNum]))); + + // verify HWP accessor + uint8_t l_val[2][2] = {{0xFF,0xFF},{0xFF,0xFF}}; + + l_fapirc = (*l_getMBvpdAddrMirrorData)(l_fapi_mba_target,l_val); + if (l_fapirc) + { + TS_FAIL( "fapiGetAddrMirrorData: HWP accessor fail rc=0x%x", + static_cast<uint32_t>(l_fapirc) ); + fapiLogError(l_fapirc); + } + else + { + TS_TRACE( "testGetAddrMirrorData accessor " + "(0x%02x,0x%02x),(0x%02x,0x%02x)", + l_val[0][0], l_val[0][1], l_val[1][0], l_val[1][1]); + } + + // loop thru all the DIMMs (should be 4) +#if UNITTESTfwt + uint8_t l_dimmNum = 0; // check them all in unit test +#else + uint8_t l_dimmNum = + (l_dimmList.size() > 0) ? l_dimmList.size()-1:0 ; +#endif + for (; l_dimmNum < l_dimmList.size(); l_dimmNum++ ) + { + uint8_t l_val = 0xFF; + + // dump physical path to target + EntityPath l_path; + l_path = l_dimmList[l_dimmNum]->getAttr<ATTR_PHYS_PATH>(); + l_path.dump(); + + // cast OUR type of target to a FAPI type of target. + fapi::Target l_fapi_dimm_target( + TARGET_TYPE_DIMM, + (const_cast<TARGETING::Target*>(l_dimmList[l_dimmNum]))); + + // verify getting all attributes + l_fapirc = FAPI_ATTR_GET(ATTR_VPD_DRAM_ADDRESS_MIRRORING, + &l_fapi_dimm_target, + l_val); + TS_TRACE( "testGetAddrMirrorData attribute %d 0x%02x", + l_dimmNum,l_val); + } + if (l_fapirc) + { + TS_FAIL( "fapiGetAddrMirrorData: FAPI_ATTR_GET fail rc=0x%x", + static_cast<uint32_t>(l_fapirc) ); + fapiLogError(l_fapirc); + } + } + } + + TS_TRACE( "testGetAddrMirrorData exit" ); + + } + + + /** * @brief call fapiGetMBvpdField to fetch memory buffer vpd records. * */ diff --git a/src/usr/vpd/cvpd.H b/src/usr/vpd/cvpd.H index 5445df475..d2c9bd15c 100644 --- a/src/usr/vpd/cvpd.H +++ b/src/usr/vpd/cvpd.H @@ -92,6 +92,7 @@ namespace CVPD { LM, "LM" }, { MW, "MW" }, { MV, "MV" }, + { AM, "AM" }, // ------------------------------------------------------------------- // DO NOT USE!! This is for test purposes ONLY! { CVPD_TEST_KEYWORD, "XX" }, diff --git a/src/usr/vpd/makefile b/src/usr/vpd/makefile index 78bb8453b..b09d57a75 100644 --- a/src/usr/vpd/makefile +++ b/src/usr/vpd/makefile @@ -29,6 +29,6 @@ SUBDIRS = test.d BINARY_FILES = $(IMGDIR)/dimmspd.dat:9a6e6b6a7f6d3fc77a12d38537279d402124d699 BINARY_FILES += $(IMGDIR)/procmvpd.dat:9473e24c02c40a577700ae0292676c4b82698c13 -BINARY_FILES += $(IMGDIR)/cvpd.dat:2e60fd37c773399e2a30633459aa5852c99b4e18 +BINARY_FILES += $(IMGDIR)/cvpd.dat:e64471326f58d3b6375e4d05f9d0938932fdb1ec include ${ROOTPATH}/config.mk diff --git a/src/usr/vpd/test/cvpdtest.H b/src/usr/vpd/test/cvpdtest.H index 3429a6117..0f8865169 100755 --- a/src/usr/vpd/test/cvpdtest.H +++ b/src/usr/vpd/test/cvpdtest.H @@ -72,6 +72,7 @@ cvpdTestData cvpdData[] = { CVPD::VSPD, CVPD::LM }, { CVPD::VSPD, CVPD::MW }, { CVPD::VSPD, CVPD::MV }, + { CVPD::VSPD, CVPD::AM }, }; |