summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Schwartz <whs@us.ibm.com>2013-10-29 19:16:43 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-11-08 15:21:50 -0600
commitc811df7983a6dbb0d56b96badb58ed785ddd0b72 (patch)
treefc7c1dccec5b4a282be1df4e446e43b1f73fb066
parent06fdca58e18f8a6dae366a12e03b97c7b28d5742 (diff)
downloadtalos-hostboot-c811df7983a6dbb0d56b96badb58ed785ddd0b72.tar.gz
talos-hostboot-c811df7983a6dbb0d56b96badb58ed785ddd0b72.zip
Centaur VPD Attributes: Version, 2N_Mode_Enabled, and Address Mirroring
ATTR_VPD_VERSION - add attribute and hwp accessor to return Record VINI Keyword VZ ATTR_VPD_DRAM_2N_MODE_ENABLED - add attribute and new HWP accessor using MR hwp accessor to retrieve DRAM_2N_MODE. ATTR_VPD_DRAM_ADDRESS_MIRRORING - Change from DIMM to MBA target Change-Id: I05875c5e89966906a928d3c82925e33507962db9 RTC: 89859 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/6949 Tested-by: Jenkins Server Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com> Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r--src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.H59
-rw-r--r--src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.H13
-rw-r--r--src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.H9
-rw-r--r--src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdVersion.H59
-rw-r--r--src/include/usr/hwpf/hwpf_reasoncodes.H2
-rw-r--r--src/include/usr/hwpf/plat/fapiPlatAttributeService.H49
-rw-r--r--src/usr/hwpf/hwp/dimm_spd_attributes.xml17
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C11
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.C94
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C34
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/getMBvpdVersion.C102
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk4
-rw-r--r--src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml11
-rw-r--r--src/usr/hwpf/plat/fapiPlatAttributeService.C91
-rw-r--r--src/usr/hwpf/test/fapiwinkletest.H202
15 files changed, 651 insertions, 106 deletions
diff --git a/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.H b/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.H
new file mode 100644
index 000000000..112d34ca2
--- /dev/null
+++ b/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.H
@@ -0,0 +1,59 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 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: getMBvpdDram2NModeEnabled.H,v 1.1 2013/10/30 21:02:44 whs Exp $
+/**
+ * @file getMBvpdDram2NModeEnabled.H
+ *
+ * @brief MBVPD Accessor for providing the ATTR_VPD_DRAM_2N_MODE_ENABLED
+ * attribute
+ */
+
+#ifndef _HWP_GETMBVPDDRAM2NMODEENABLED_
+#define _HWP_GETMBVPDDRAM2NMODEENABLED_
+
+#include <fapi.H>
+
+// function pointer typedef definition for HWP call support
+typedef fapi::ReturnCode (*getMBvpdDram2NModeEnabled_FP_t)
+ (const fapi::Target &, uint8_t &);
+
+extern "C"
+{
+/**
+ * @brief Get the ATTR_DRAM_2N_MODE_ENABLED FAPI attribute
+ *
+ * Return whether Dram 2N Mode is enabled based on the MR keyword
+ * DRAM_2N_MODE value. The DRAM_2N_Mode values for both ports of the mba
+ * must be equal, otherwise an error is returned.
+ *
+ * @param[in] i_mbaTarget - Reference to mba Target
+ * @param[out] o_val - ATTR_VPD_DRAM_2N_MODE_ENABLED enumeration value
+ *
+ * @return fapi::ReturnCode FAPI_RC_SUCCESS if success, else error code
+ */
+fapi::ReturnCode getMBvpdDram2NModeEnabled(
+ const fapi::Target & i_mbaTarget,
+ uint8_t & o_val);
+}
+
+#endif
diff --git a/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.H b/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.H
index cb07272af..78d02f318 100644
--- a/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.H
+++ b/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.H
@@ -20,7 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: getMBvpdPhaseRotatorData.H,v 1.2 2013/04/29 16:48:15 whs Exp
+// $Id: getMBvpdPhaseRotatorData.H,v 1.8 2013/11/08 18:13:43 whs Exp $
/**
* @file getMBvpdPhaseRotatorData.H
@@ -49,8 +49,9 @@ namespace fapi
// special processing flags to be added on to the MBvpdPhaseRotatorData value
enum MBvpdPhaseRotatorSpecial
{
- PHASE_ROT_HIGH_NIBBLE = 0x0100, //bits 4:7 shifted right 4
- PHASE_ROT_LOW_NIBBLE = 0x0200, //bits 0:3
+ PHASE_ROT_HIGH_NIBBLE = 0x0100, //bits 0:3 of MSB 0 to LSB 7
+ // shifted right 4
+ PHASE_ROT_LOW_NIBBLE = 0x0200, //bits 4:7 of MSB 0 to LSB 7
PHASE_ROT_PORT00=0x0300, // return vpd port 0 value for 0 and 1
PHASE_ROT_PORT11=0x0400, // return vpd port 1 value for 0 and 1
};
@@ -115,12 +116,12 @@ const uint8_t PHASE_ROT_CHK60 = 0x40; // check version for offset to use
PHASE_ROT_M1_CNTL_CSN3 = 0x2d,
PHASE_ROT_M1_CNTL_ODT0 = 0x2e,
PHASE_ROT_M1_CNTL_ODT1 = 0x2f,
- // DRAM_2N_MODE reserved = 0x30,
+ PHASE_ROT_DRAM_2N_MODE = 0x30,
PHASE_ROT_TSYS_ADR = 0x31 | PHASE_ROT_CHK60 | PHASE_ROT_PORT00,
PHASE_ROT_TSYS_DP18 = 0x31 | PHASE_ROT_CHK60 | PHASE_ROT_PORT11,
// Use these offsets for vpd less than version 6.0
- PHASE_ROT_RLO_V53 = 0x31 | PHASE_ROT_HIGH_NIBBLE,
- PHASE_ROT_WLO_V53 = 0x31 | PHASE_ROT_LOW_NIBBLE,
+ PHASE_ROT_RLO_V53 = 0x31 | PHASE_ROT_LOW_NIBBLE,
+ PHASE_ROT_WLO_V53 = 0x31 | PHASE_ROT_HIGH_NIBBLE,
PHASE_ROT_GPO_V53= 0x32,
PHASE_ROT_TSYS_ADR_V53 = 0x33 | PHASE_ROT_PORT00,
PHASE_ROT_TSYS_DP18_V53 = 0x33 | PHASE_ROT_PORT11,
diff --git a/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.H b/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.H
index dbc6be40f..1838834cc 100644
--- a/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.H
+++ b/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.H
@@ -50,8 +50,9 @@ namespace fapi
// special processing flags to be added on to the MBvpdTermData value
enum MBvpdTermDataSpecial
{
- TERM_DATA_HIGH_NIBBLE = 0x0100, //bits 4:7 shifted right 4
- TERM_DATA_LOW_NIBBLE = 0x0200, //bits 0:3
+ TERM_DATA_HIGH_NIBBLE = 0x0100, //bits 0:3 of MSB 0 to LSB 7
+ // shifted right 4
+ TERM_DATA_LOW_NIBBLE = 0x0200, //bits 4:7 of MSB 0 to LSB 7
};
// mask to isolate special processing flags
const uint16_t TERM_DATA_SPECIAL_MASK = 0x0300;
@@ -95,8 +96,8 @@ const uint8_t TERM_DATA_CHK60 = 0x40; // check version for keyword to use
// as a uint32. The offset is incremented by only 2 to get the next vpd value.
TERM_DATA_CKE_PRI_MAP = 0x36, //uint32_t [2]
TERM_DATA_CKE_PWR_MAP = 0x38, //uint32_t [2]
- TERM_DATA_RLO = 0x3c|TERM_DATA_CHK60|TERM_DATA_HIGH_NIBBLE, //uint8_t[2]
- TERM_DATA_WLO = 0x3c|TERM_DATA_CHK60|TERM_DATA_LOW_NIBBLE, //uint8_t[2]
+ TERM_DATA_RLO = 0x3c|TERM_DATA_CHK60|TERM_DATA_LOW_NIBBLE, //uint8_t[2]
+ TERM_DATA_WLO = 0x3c|TERM_DATA_CHK60|TERM_DATA_HIGH_NIBBLE, //uint8_t[2]
TERM_DATA_GPO = 0x3d|TERM_DATA_CHK60, //uint8_t[2]
};
}
diff --git a/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdVersion.H b/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdVersion.H
new file mode 100644
index 000000000..29f6d39c2
--- /dev/null
+++ b/src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdVersion.H
@@ -0,0 +1,59 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/hwpf/hwp/mvpd_accessors/getMBvpdVersion.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 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: getMBvpdVersion.H,v 1.1 2013/10/30 21:04:08 whs Exp $
+/**
+ * @file getMBvpdVersion.H
+ *
+ * @brief MBVPD Accessor for providing the ATTR_VPD_VERSION attribute
+ */
+
+#ifndef _HWP_GETMBVPDVERSION_
+#define _HWP_GETMBVPDVERSION_
+
+#include <fapi.H>
+
+// function pointer typedef definition for HWP call support
+typedef fapi::ReturnCode (*getMBvpdVersion_FP_t)
+ (const fapi::Target &, uint32_t &);
+
+extern "C"
+{
+/**
+ * @brief Get the ATTR_VPD_VERSION FAPI attribute
+ *
+ * Return the VPD version from MBvpd record VINI keyword VZ.
+ *
+ * The ATTR_VPD_VERSION attribute is associated with a DIMM. The platfrom must
+ * get the associated MBA chip to be passed to this hwp accessor.
+ *
+ * @param[in] i_mbaTarget - Reference to mba Target
+ * @param[out] o_val - Filled in with vpd version
+ *
+ * @return fapi::ReturnCode FAPI_RC_SUCCESS if success, else error code
+ */
+fapi::ReturnCode getMBvpdVersion(
+ const fapi::Target & i_mbaTarget,
+ uint32_t & o_val);
+}
+
+#endif
diff --git a/src/include/usr/hwpf/hwpf_reasoncodes.H b/src/include/usr/hwpf/hwpf_reasoncodes.H
index 6b151a998..9babe4e05 100644
--- a/src/include/usr/hwpf/hwpf_reasoncodes.H
+++ b/src/include/usr/hwpf/hwpf_reasoncodes.H
@@ -60,7 +60,7 @@ namespace fapi
MOD_VDDR_PROC_MSG = 0x15,
MOD_VDDR_PROC_VDDR_MSG = 0x16,
MOD_VDDR_SEND_MSG = 0x17,
- MOD_PLAT_ATTR_SVC_GET_MIRR_DATA = 0x18,
+ MOD_PLAT_ATTR_SVC_GET_VPD_VERSION = 0x18,
MOD_PLAT_ATTR_SVC_GET_SPARE_DATA = 0x19,
MOD_PLAT_ATTR_SVC_GET_BADDQ_DATA = 0x1A,
MOD_PLAT_ATTR_SVC_SET_BADDQ_DATA = 0x1B,
diff --git a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H
index d25c13c4b..0c4c7d855 100644
--- a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H
+++ b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H
@@ -49,6 +49,8 @@
#include <hwpf/hwp/mvpd_accessors/getMBvpdTermData.H>
#include <hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.H>
#include <hwpf/hwp/mvpd_accessors/getMBvpdSpareDramData.H>
+#include <hwpf/hwp/mvpd_accessors/getMBvpdVersion.H>
+#include <hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.H>
#include <hwpf/hwp/spd_accessors/getSpdAttrAccessor.H>
#include <vpd/spdenums.H>
#include <dimmConsts.H>
@@ -470,13 +472,13 @@ fapi::ReturnCode fapiPlatGetPhaseRotatorData (
* 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
+ * @param[in] i_pTarget Target mba pointer
+ * @param[out] o_val Address Mirroring Data for mba
* @return ReturnCode. Zero on success, else platform specified error
*/
fapi::ReturnCode fapiPlatGetAddrMirrorData (
const fapi::Target * i_pTarget,
- uint8_t &o_val);
+ uint8_t (&o_val) [2][2] );
/**
* @brief This function is called by the FAPI_ATTR_GET macro when getting
@@ -527,6 +529,31 @@ fapi::ReturnCode fapiPlatDimmGetBadDqBitmap (
const fapi::Target * i_pTarget,
uint8_t (&o_data)[DIMM_DQ_MAX_DIMM_RANKS]
[DIMM_DQ_RANK_BITMAP_SIZE]);
+/**
+ * @brief This function is called by the FAPI_ATTR_GET macro when getting
+ * the vpd version
+ * It should not be called directly.
+ *
+ * @param[in] i_pTarget Target DIMM pointer
+ * @param[out] o_val vpd version
+ * @return ReturnCode. Zero on success, else platform specified error
+ */
+fapi::ReturnCode fapiPlatGetVpdVersion (
+ const fapi::Target * i_pTarget,
+ uint32_t & o_val );
+
+/**
+ * @brief This function is called by the FAPI_ATTR_GET macro when getting
+ * the Dram 2N Mode Enabled attribute
+ * It should not be called directly.
+ *
+ * @param[in] i_pTarget Target mba pointer
+ * @param[out] o_val Dram 2N Mode Enabled attr enumeration value
+ * @return ReturnCode. Zero on success, else platform specified error
+ */
+fapi::ReturnCode fapiPlatGetDram2NModeEnabled (
+ const fapi::Target * i_pTarget,
+ uint8_t & o_val );
/**
* @brief This function is called by the FAPI_ATTR_SET macro when setting
@@ -1597,4 +1624,20 @@ fapi::ReturnCode fapiPlatGetSpdAttrAccessor (
fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ? fapi::FAPI_RC_SUCCESS : \
fapi::platAttrSvc::fapiPlatGetZeroAttrData(&VAL, sizeof(VAL))
+//------------------------------------------------------------------------------
+// MACROS to support MBVPD Get vpd version attribute
+//------------------------------------------------------------------------------
+#define ATTR_VPD_VERSION_GETMACRO(ID, PTARGET, VAL)\
+ fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ?\
+ fapi::FAPI_RC_SUCCESS : fapi::platAttrSvc::fapiPlatGetVpdVersion\
+ (PTARGET, VAL)
+
+//------------------------------------------------------------------------------
+// MACROS to support MBVPD Get Dram 2N Mode Enabled
+//------------------------------------------------------------------------------
+#define ATTR_VPD_DRAM_2N_MODE_ENABLED_GETMACRO(ID, PTARGET, VAL)\
+ fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID, PTARGET, &VAL) ?\
+ fapi::FAPI_RC_SUCCESS : fapi::platAttrSvc::fapiPlatGetDram2NModeEnabled\
+ (PTARGET, VAL)
+
#endif // FAPIPLATATTRIBUTESERVICE_H_
diff --git a/src/usr/hwpf/hwp/dimm_spd_attributes.xml b/src/usr/hwpf/hwp/dimm_spd_attributes.xml
index 64f04a29f..77af0e71d 100644
--- a/src/usr/hwpf/hwp/dimm_spd_attributes.xml
+++ b/src/usr/hwpf/hwp/dimm_spd_attributes.xml
@@ -1211,7 +1211,6 @@ Querying them from DDR3 DIMMs will result in an error
<platInit/>
</attribute>
-<!-- Not yet supported by firmware
<attribute>
<id>ATTR_VPD_VERSION</id>
<targetType>TARGET_TYPE_DIMM</targetType>
@@ -1220,9 +1219,7 @@ Querying them from DDR3 DIMMs will result in an error
</description>
<valueType>uint32</valueType>
<platInit/>
- <writeable/>
</attribute>
--->
<!--
*******************************************************************************
@@ -1397,7 +1394,7 @@ file
<attribute>
<id>ATTR_VPD_DRAM_ADDRESS_MIRRORING</id>
- <targetType>TARGET_TYPE_DIMM</targetType>
+ <targetType>TARGET_TYPE_MBA_CHIPLET</targetType>
<description>
The C-DIMM ranks that have address mirroring.
This data is in the Record:VSPD, Keyword:AM field in C-DIMM VPD.
@@ -1412,6 +1409,7 @@ file
RANK3_MIRRORED = 0x01
</enum>
<platInit/>
+ <array> 2 2 </array>
</attribute>
<!-- Not yet supported by firmware
@@ -2308,4 +2306,15 @@ This Attribute is to be interpreted as an Integer</description>
<array> 2</array>
</attribute>
+<attribute>
+ <id>ATTR_VPD_DRAM_2N_MODE_ENABLED</id>
+ <targetType>TARGET_TYPE_MBA_CHIPLET</targetType>
+ <description>Describes if this MBA is in 2N address mode. The DIMM attributes associated with this MBA describes if this mode is needed for SI. Come from the VPD and consumed in the mba_def.initfile.</description>
+ <valueType>uint8</valueType>
+ <enum>FALSE = 0, TRUE = 1</enum>
+ <odmVisable/>
+ <odmChangeable/>
+</attribute>
+
+
</attributes>
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C
index 0c46c0bca..6d4d3b2cd 100644
--- a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C
+++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdAddrMirrorData.C
@@ -50,8 +50,7 @@ fapi::ReturnCode getMBvpdAddrMirrorData(
const uint8_t NUM_PORTS = 2; //Each MBA has 2 ports
struct port_attributes
{
- uint8_t dimm0 : 4 ;
- uint8_t dimm1 : 4 ;
+ uint8_t iv_dimm ; // bits 0:3 DIMM 0 bits 4:7 DIMM 1
};
struct mba_attributes
{
@@ -125,10 +124,10 @@ fapi::ReturnCode getMBvpdAddrMirrorData(
// 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;
+ uint8_t l_dimm = l_pMaBuffer->
+ mb_mba[l_mbaPos].mba_port[l_port].iv_dimm;
+ o_val[l_port][0]= ((l_dimm & 0xF0)>>4);
+ o_val[l_port][1]= l_dimm & 0x0F;
}
} while (0);
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.C
new file mode 100644
index 000000000..b5140e2e0
--- /dev/null
+++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.C
@@ -0,0 +1,94 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.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: getMBvpdDram2NModeEnabled.C,v 1.2 2013/10/31 18:06:17 whs Exp $
+/**
+ * @file getMBvpdDram2NModeEnabled.C
+ *
+ * @brief get the Dram 2N Mode value from MBvpd keyword MR
+ * and return whether 2N mode is enabled
+ *
+ */
+
+#include <stdint.h>
+
+// fapi support
+#include <fapi.H>
+#include <fapiUtil.H>
+#include <getMBvpdDram2NModeEnabled.H>
+#include <getMBvpdPhaseRotatorData.H>
+
+extern "C"
+{
+using namespace fapi;
+
+fapi::ReturnCode getMBvpdDram2NModeEnabled(
+ const fapi::Target &i_mbaTarget,
+ uint8_t & o_val)
+{
+ fapi::ReturnCode l_fapirc;
+ uint8_t l_dram2NMode [2] = {0,0};
+
+ FAPI_DBG("getMBvpdDram2NModeEnabled: entry ");
+
+ do {
+ // Retrieve the Dram 2N Mode from the MR keyword
+ FAPI_EXEC_HWP(l_fapirc,
+ getMBvpdPhaseRotatorData,
+ i_mbaTarget,
+ fapi::PHASE_ROT_DRAM_2N_MODE,
+ l_dram2NMode);
+ if (l_fapirc)
+ {
+ FAPI_ERR("getMBvpdDram2NModeEnabled: Read of VZ keyword failed");
+ break; // break out with fapirc
+ }
+ // ensure values match
+ if (l_dram2NMode[0] != l_dram2NMode[1]) {
+ FAPI_ERR("getMBvpdDram2NModeEnabled:"
+ " ports should have same value 0x%02x != 0x%02x",
+ l_dram2NMode[0],l_dram2NMode[1]);
+ const uint32_t & PORT0 = l_dram2NMode[0];
+ const uint32_t & PORT1 = l_dram2NMode[1];
+ FAPI_SET_HWP_ERROR(l_fapirc,RC_MBVPD_DRAM_2N_MODE_NOT_EQUAL);
+ break; // break out with fapirc
+ }
+ // return value
+ const uint8_t DRAM_2N_MODE = 0x02;
+ if (DRAM_2N_MODE == l_dram2NMode[0] )
+ {
+ o_val=fapi::ENUM_ATTR_VPD_DRAM_2N_MODE_ENABLED_TRUE;
+ }
+ else
+ {
+ o_val=fapi::ENUM_ATTR_VPD_DRAM_2N_MODE_ENABLED_FALSE;
+ }
+
+ } while (0);
+
+ FAPI_DBG("getMBvpdDram2NModeEnabled: exit rc=0x%08x)",
+ static_cast<uint32_t>(l_fapirc));
+
+ return l_fapirc;
+}
+
+} // extern "C"
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C
index da1c3b5bd..365986955 100644
--- a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C
+++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C
@@ -20,7 +20,7 @@
/* Origin: 30 */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: getMBvpdTermData.C,v 1.4 2013/10/21 18:55:40 whs Exp $
+// $Id: getMBvpdTermData.C,v 1.6 2013/10/31 18:03:28 whs Exp $
/**
* @file getMBvpdTermData.C
*
@@ -35,6 +35,7 @@
#include <fapiUtil.H>
#include <getMBvpdTermData.H>
#include <getMBvpdPhaseRotatorData.H>
+#include <getMBvpdVersion.H>
// Used to ensure attribute enums are equal at compile time
class Error_ConstantsDoNotMatch;
@@ -256,36 +257,23 @@ fapi::ReturnCode getMBvpdTermData(
// Check if the old vpd layout is different for this attr
if (TERM_DATA_CHK60 & i_attr) // need to check vpd version for this attr
{
- uint16_t l_vpdVersion = 0;
- uint32_t l_bufSize = sizeof(l_vpdVersion);
- const uint16_t VPD_VERSION_V60=0x3130; // Version 6.0 is ascii "10"
+ uint32_t l_vpdVersion = 0;
+ const uint32_t VPD_VERSION_V60=0x3130; // Version 6.0 is ascii "10"
+
+ // get vpd version
+ FAPI_EXEC_HWP(l_fapirc,
+ getMBvpdVersion,
+ i_mbaTarget,
+ l_vpdVersion);
- // get vpd version from record VINI keyword VZ
- l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VINI,
- fapi::MBVPD_KEYWORD_VZ,
- l_mbTarget,
- reinterpret_cast<uint8_t *>(&l_vpdVersion),
- l_bufSize);
if (l_fapirc)
{
- FAPI_ERR("getMBvpdTermData: Read of VZ keyword failed");
+ FAPI_ERR("getMBvpdTermData: getMBvpdVersion failed");
break; // break out with fapirc
}
FAPI_DBG("getMBvpdTermData: vpd version=0x%08x",
l_vpdVersion);
- // Check that sufficient size was returned.
- if (l_bufSize < sizeof(l_vpdVersion) )
- {
- FAPI_ERR("getMBvpdTermData:"
- " less keyword data returned than expected %d < %d",
- l_bufSize, sizeof(l_vpdVersion));
- const uint32_t & KEYWORD = sizeof(l_vpdVersion);
- const uint32_t & RETURNED_SIZE = l_bufSize;
- FAPI_SET_HWP_ERROR(l_fapirc,RC_MBVPD_INSUFFICIENT_VPD_RETURNED);
- break; // break out with fapirc
- }
-
// Check if work around needed
if (l_vpdVersion < VPD_VERSION_V60)
{
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdVersion.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdVersion.C
new file mode 100644
index 000000000..55f17291a
--- /dev/null
+++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdVersion.C
@@ -0,0 +1,102 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/hwpf/hwp/mvpd_accessors/getMBvpdVersion.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: getMBvpdVersion.C,v 1.1 2013/10/30 21:07:58 whs Exp $
+/**
+ * @file getMBvpdVersion.C
+ *
+ * @brief get the vpd version from MBvpd record VINI keyword VZ
+ *
+ */
+
+#include <stdint.h>
+
+// fapi support
+#include <fapi.H>
+#include <fapiUtil.H>
+#include <getMBvpdVersion.H>
+
+extern "C"
+{
+using namespace fapi;
+
+fapi::ReturnCode getMBvpdVersion(
+ const fapi::Target &i_mbaTarget,
+ uint32_t & o_val)
+{
+ fapi::ReturnCode l_fapirc;
+ fapi::Target l_mbTarget;
+ uint16_t l_vpdVersion = 0;
+ uint32_t l_bufSize = sizeof(l_vpdVersion);
+
+ FAPI_DBG("getMBvpdVersion: entry ");
+
+ do {
+ // find the Centaur memory buffer from the passed MBA
+ l_fapirc = fapiGetParentChip (i_mbaTarget,l_mbTarget);
+ if (l_fapirc)
+ {
+ FAPI_ERR("getMBvpdVersion: Finding the parent mb failed ");
+ break; // break out with fapirc
+ }
+ FAPI_DBG("getMBvpdVersion: parent path=%s ",
+ l_mbTarget.toEcmdString() );
+
+ // get vpd version from record VINI keyword VZ
+ l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VINI,
+ fapi::MBVPD_KEYWORD_VZ,
+ l_mbTarget,
+ reinterpret_cast<uint8_t *>(&l_vpdVersion),
+ l_bufSize);
+ if (l_fapirc)
+ {
+ FAPI_ERR("getMBvpdVersion: Read of VZ keyword failed");
+ break; // break out with fapirc
+ }
+
+ // Check that sufficient size was returned.
+ if (l_bufSize < sizeof(l_vpdVersion) )
+ {
+ FAPI_ERR("getMBvpdVersion:"
+ " less keyword data returned than expected %d < %d",
+ l_bufSize, sizeof(l_vpdVersion));
+ const uint32_t & KEYWORD = sizeof(l_vpdVersion);
+ const uint32_t & RETURNED_SIZE = l_bufSize;
+ FAPI_SET_HWP_ERROR(l_fapirc,RC_MBVPD_INSUFFICIENT_VPD_RETURNED);
+ break; // break out with fapirc
+ }
+ // return value
+ o_val = static_cast<uint32_t>(FAPI_BE16TOH(l_vpdVersion));
+
+ FAPI_DBG("getMBvpdVersion: vpd version=0x%08x",
+ o_val);
+
+
+ } while (0);
+
+ FAPI_DBG("getMBvpdVersion: 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 592431034..d90544f73 100644
--- a/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk
+++ b/src/usr/hwpf/hwp/mvpd_accessors/mvpd.mk
@@ -34,5 +34,7 @@ OBJS += getMvpdRing.o \
getMBvpdAddrMirrorData.o \
getMBvpdTermData.o \
getMBvpdSlopeInterceptData.o \
- getMBvpdSpareDramData.o
+ getMBvpdSpareDramData.o \
+ getMBvpdVersion.o \
+ getMBvpdDram2NModeEnabled.o
diff --git a/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml b/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml
index c9d8f7b71..69cebc849 100644
--- a/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml
+++ b/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml
@@ -20,7 +20,7 @@
<!-- Origin: 30 -->
<!-- -->
<!-- IBM_PROLOG_END_TAG -->
-<!-- $Id: mvpd_errors.xml,v 1.9 2013/10/22 14:02:13 whs Exp $ -->
+<!-- $Id: mvpd_errors.xml,v 1.11 2013/10/30 21:14:03 whs Exp $ -->
<hwpErrors>
<!-- ********************************************************************* -->
<hwpError>
@@ -132,4 +132,13 @@
<ffdc>ATTR_ID</ffdc>
<ffdc>VPD_VALUE</ffdc>
</hwpError>
+ <!-- ********************************************************************* -->
+ <hwpError>
+ <rc>RC_MBVPD_DRAM_2N_MODE_NOT_EQUAL</rc>
+ <description>
+ The 2 ports of DRAM 2N MODE should be equal.
+ </description>
+ <ffdc>PORT0</ffdc>
+ <ffdc>PORT1</ffdc>
+ </hwpError>
</hwpErrors>
diff --git a/src/usr/hwpf/plat/fapiPlatAttributeService.C b/src/usr/hwpf/plat/fapiPlatAttributeService.C
index a4c68d653..5a893c4da 100644
--- a/src/usr/hwpf/plat/fapiPlatAttributeService.C
+++ b/src/usr/hwpf/plat/fapiPlatAttributeService.C
@@ -47,6 +47,8 @@
#include <hwpf/hwp/mvpd_accessors/getMBvpdTermData.H>
#include <hwpf/hwp/mvpd_accessors/getMBvpdSlopeInterceptData.H>
#include <hwpf/hwp/mvpd_accessors/getMBvpdSpareDramData.H>
+#include <hwpf/hwp/mvpd_accessors/getMBvpdVersion.H>
+#include <hwpf/hwp/mvpd_accessors/getMBvpdDram2NModeEnabled.H>
#include <fapiPllRingAttr.H>
#include <getPllRingAttr.H>
@@ -1193,49 +1195,77 @@ fapi::ReturnCode fapiPlatGetPhaseRotatorData (
}
fapi::ReturnCode fapiPlatGetAddrMirrorData (
+ const fapi::Target * i_pTarget,
+ uint8_t (& o_val) [2][2] )
+{
+ // Get the data using the HWP accessor
+ fapi::ReturnCode l_rc;
+ FAPI_EXEC_HWP(l_rc, getMBvpdAddrMirrorData, *i_pTarget, o_val);
+ return l_rc;
+}
+
+fapi::ReturnCode fapiPlatGetTermData (
+ const fapi::Target * i_pTarget,
+ const fapi::MBvpdTermData i_attr,
+ void * o_pVal,
+ const uint32_t i_valSize)
+{
+ // Call a VPD Accessor HWP to get the data
+ fapi::ReturnCode l_rc;
+ FAPI_EXEC_HWP(l_rc, getMBvpdTermData,
+ *i_pTarget, i_attr, o_pVal, i_valSize);
+ return l_rc;
+}
+
+fapi::ReturnCode fapiPlatGetSlopeInterceptData (
+ const fapi::Target * i_pTarget,
+ const fapi::MBvpdSlopeIntercept i_attr,
+ uint32_t & o_Val)
+{
+ // Call a VPD Accessor HWP to get the data
+ fapi::ReturnCode l_rc;
+ FAPI_EXEC_HWP(l_rc, getMBvpdSlopeInterceptData,
+ *i_pTarget, i_attr, o_Val);
+ return l_rc;
+}
+
+fapi::ReturnCode fapiPlatGetVpdVersion (
const fapi::Target * i_pFapiTarget,
- uint8_t &o_val )
+ uint32_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");
+ FAPI_ERR("fapiPlatGetVpdVersion: 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 ",
+ FAPI_ERR("fapiPlatGetVpdVersion: expect 1 mba %d ",
l_mbaList.size());
/*@
* @errortype
- * @moduleid fapi::MOD_PLAT_ATTR_SVC_GET_MIRR_DATA
+ * @moduleid fapi::MOD_PLAT_ATTR_SVC_GET_VPD_VERSION
* @reasoncode fapi::RC_NO_SINGLE_MBA
* @userdata1 Number of MBAs
- * @devdesc fapiPlatGetAddrMirrorData could not find the
+ * @devdesc fapiPlatGetVpdVersion 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_MIRR_DATA,
+ fapi::MOD_PLAT_ATTR_SVC_GET_VPD_VERSION,
fapi::RC_NO_SINGLE_MBA,
l_mbaList.size());
@@ -1249,47 +1279,28 @@ fapi::ReturnCode fapiPlatGetAddrMirrorData (
static_cast<void *>(l_mbaList[0]));
// Get the data using the HWP accessor
- FAPI_EXEC_HWP(l_rc, getMBvpdAddrMirrorData, l_fapiTarget, l_val);
+ FAPI_EXEC_HWP(l_rc, getMBvpdVersion, l_fapiTarget, o_val);
if (l_rc)
{
- FAPI_ERR("fapiPlatGetAddrMirrorData:"
- " Error from getMBvpdAddrMirrorData");
+ FAPI_ERR("fapiPlatGetVpdVersion:"
+ " Error from getMBvpdVersion");
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 fapiPlatGetTermData (
- const fapi::Target * i_pTarget,
- const fapi::MBvpdTermData i_attr,
- void * o_pVal,
- const uint32_t i_valSize)
-{
- // Call a VPD Accessor HWP to get the data
- fapi::ReturnCode l_rc;
- FAPI_EXEC_HWP(l_rc, getMBvpdTermData,
- *i_pTarget, i_attr, o_pVal, i_valSize);
- return l_rc;
-}
-
-fapi::ReturnCode fapiPlatGetSlopeInterceptData (
- const fapi::Target * i_pTarget,
- const fapi::MBvpdSlopeIntercept i_attr,
- uint32_t & o_Val)
+fapi::ReturnCode fapiPlatGetDram2NModeEnabled (
+ const fapi::Target * i_pFapiTarget,
+ uint8_t &o_val )
{
- // Call a VPD Accessor HWP to get the data
+ // Get the data using the HWP accessor
fapi::ReturnCode l_rc;
- FAPI_EXEC_HWP(l_rc, getMBvpdSlopeInterceptData,
- *i_pTarget, i_attr, o_Val);
+ FAPI_EXEC_HWP(l_rc, getMBvpdDram2NModeEnabled, * i_pFapiTarget, o_val);
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/test/fapiwinkletest.H b/src/usr/hwpf/test/fapiwinkletest.H
index aadce24e2..118dccef6 100644
--- a/src/usr/hwpf/test/fapiwinkletest.H
+++ b/src/usr/hwpf/test/fapiwinkletest.H
@@ -48,6 +48,8 @@
#include <mvpd_accessors/getMBvpdAddrMirrorData.H>
#include <mvpd_accessors/getMBvpdTermData.H>
#include <mvpd_accessors/getMBvpdSlopeInterceptData.H>
+#include <mvpd_accessors/getMBvpdVersion.H>
+#include <mvpd_accessors/getMBvpdDram2NModeEnabled.H>
#include <errl/errlmanager.H>
#include <errl/errlentry.H>
@@ -407,21 +409,21 @@ public:
}
/**
- * @brief call getMBvpdAddrMirrorData to fetch memory buffer AM attributes
+ * @brief call getMBvpdVersion to fetch vpd version
*
*/
- void testGetAddrMirrorData()
+ void testGetVersion()
{
fapi::ReturnCode l_fapirc( fapi::FAPI_RC_SUCCESS );
- getMBvpdAddrMirrorData_FP_t (l_getMBvpdAddrMirrorData)
- = &getMBvpdAddrMirrorData;
+ getMBvpdVersion_FP_t (l_getMBvpdVersion)
+ = &getMBvpdVersion;
- TS_TRACE( "testGetAddrMirrorData entry" );
+ TS_TRACE( "testGetVersion entry" );
TARGETING::TargetHandleList l_memBufList;
getAllChips(l_memBufList, TYPE_MEMBUF);
- TS_TRACE( "testGetAddrMirrorData l_memBufList.size()=%d",
+ TS_TRACE( "testGetVersion l_memBufList.size()=%d",
l_memBufList.size() );
// loop thru memory buffers
#if UNITTESTfwt
@@ -435,7 +437,7 @@ public:
getChildAffinityTargets(l_mbaList,l_memBufList[l_mbNum],
CLASS_UNIT,TYPE_MBA,false);
- TS_TRACE( "testGetAddrMirrorData l_mbaBufList.size()=%d",
+ TS_TRACE( "testGetVersion l_mbaBufList.size()=%d",
l_mbaList.size());
// loop thru all the mbas (should be 2)
@@ -450,7 +452,7 @@ public:
getChildAffinityTargets(l_dimmList,l_mbaList[l_mbaNum],
CLASS_LOGICAL_CARD,TYPE_DIMM,false);
- TS_TRACE( "testGetAddrMirrorData l_dimmList.size()=%d",
+ TS_TRACE( "testGetVersion l_dimmList.size()=%d",
l_dimmList.size());
// cast OUR type of target to a FAPI type of target.
@@ -458,20 +460,18 @@ public:
(const_cast<TARGETING::Target*>(l_mbaList[l_mbaNum])));
// verify HWP accessor
- uint8_t l_val[2][2] = {{0xFF,0xFF},{0xFF,0xFF}};
+ uint32_t l_val = 0xffffffff;
- l_fapirc = (*l_getMBvpdAddrMirrorData)(l_fapi_mba_target,l_val);
+ l_fapirc = (*l_getMBvpdVersion)(l_fapi_mba_target,l_val);
if (l_fapirc)
{
- TS_FAIL( "fapiGetAddrMirrorData: HWP accessor fail rc=0x%x",
+ TS_FAIL( "fapiGetVersion: 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]);
+ TS_TRACE( "testGetVersion accessor 0x%08x",l_val);
}
// loop thru all the DIMMs (should be 4)
@@ -483,7 +483,7 @@ public:
#endif
for (; l_dimmNum < l_dimmList.size(); l_dimmNum++ )
{
- uint8_t l_val = 0xFF;
+// uint32_t l_val = 0xFFFFFFFF;
// dump physical path to target
EntityPath l_path;
@@ -496,18 +496,186 @@ public:
(const_cast<TARGETING::Target*>(l_dimmList[l_dimmNum])));
// verify getting all attributes
- l_fapirc = FAPI_ATTR_GET(ATTR_VPD_DRAM_ADDRESS_MIRRORING,
+ l_fapirc = FAPI_ATTR_GET(ATTR_VPD_VERSION,
&l_fapi_dimm_target,
l_val);
- TS_TRACE( "testGetAddrMirrorData attribute %d 0x%02x",
+ TS_TRACE( "testGetVersion attribute %d 0x%08x",
l_dimmNum,l_val);
}
if (l_fapirc)
{
+ TS_FAIL( "fapiGetVersion: FAPI_ATTR_GET fail rc=0x%x",
+ static_cast<uint32_t>(l_fapirc) );
+ fapiLogError(l_fapirc);
+ }
+ }
+ }
+
+ TS_TRACE( "testGetVersion exit" );
+
+ }
+
+ /**
+ * @brief call getMBvpdDram2NModeEnabled to retrieve 2N mode
+ *
+ */
+ void testGetDram2NModeEnabled()
+ {
+ fapi::ReturnCode l_fapirc( fapi::FAPI_RC_SUCCESS );
+ getMBvpdDram2NModeEnabled_FP_t (l_getMBvpdDram2NModeEnabled)
+ = &getMBvpdDram2NModeEnabled;
+
+ TS_TRACE( "testGetDram2NModeEnabled entry" );
+
+ TARGETING::TargetHandleList l_memBufList;
+ getAllChips(l_memBufList, TYPE_MEMBUF);
+
+ TS_TRACE( "testGetDram2NModeEnabled 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( "testGetDram2NModeEnabled 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++ )
+ {
+ // 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 = 0xFF;
+
+ l_fapirc = (*l_getMBvpdDram2NModeEnabled)
+ (l_fapi_mba_target,l_val);
+ if (l_fapirc)
+ {
+ TS_FAIL("fapiGetDram2NModeEnabled:HWP accessor fail rc=0x%x",
+ static_cast<uint32_t>(l_fapirc) );
+ fapiLogError(l_fapirc);
+ }
+ else
+ {
+ TS_TRACE("testGetDram2NModeEnabled accessor 0x%02x",
+ l_val);
+ }
+ // verify attribute
+ l_fapirc = FAPI_ATTR_GET(ATTR_VPD_DRAM_2N_MODE_ENABLED,
+ &l_fapi_mba_target,
+ l_val);
+ if (l_fapirc)
+ {
+ TS_FAIL("fapiGetDram2NModeEnabled:"
+ " FAPI_ATTR_GET fail rc=0x%x",
+ static_cast<uint32_t>(l_fapirc) );
+ fapiLogError(l_fapirc);
+ }
+ else
+ {
+ TS_TRACE( "testGetDram2NModeEnabled attribute 0x%02x",
+ l_val);
+ }
+ }
+ }
+
+ TS_TRACE( "testGetDram2NModeEnabled exit" );
+
+ }
+
+
+ /**
+ * @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++ )
+ {
+ // 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]);
+ }
+
+ // verify attribute
+ l_fapirc = FAPI_ATTR_GET(ATTR_VPD_DRAM_ADDRESS_MIRRORING,
+ &l_fapi_mba_target,
+ l_val);
+ if (l_fapirc)
+ {
TS_FAIL( "fapiGetAddrMirrorData: FAPI_ATTR_GET fail rc=0x%x",
static_cast<uint32_t>(l_fapirc) );
fapiLogError(l_fapirc);
}
+ else
+ {
+ TS_TRACE( "testGetAddrMirrorData attribute "
+ "(0x%02x,0x%02x),(0x%02x,0x%02x)",
+ l_val[0][0], l_val[0][1], l_val[1][0], l_val[1][1]);
+ }
}
}
OpenPOWER on IntegriCloud