summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwhs <whs@us.ibm.com>2016-04-04 10:19:37 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-06-30 23:52:31 -0400
commitc9219373d4320bf513046e69903ce33243e84be6 (patch)
tree93494842bf5a673b00910edc756f19d3e1e1a026
parentf07603a9f2eab60e8e524ff487787086b9a5304e (diff)
downloadtalos-hostboot-c9219373d4320bf513046e69903ce33243e84be6.tar.gz
talos-hostboot-c9219373d4320bf513046e69903ce33243e84be6.zip
Changes related to packaging of memory vpd on Nimbus - part 2
Add the "upper" half of the NIMBUS direct memory support. Add ATTR_MEMVPD_FREQS_MHZ and ATTR_MEMVPD_POS attributes. Implement plat_vpd_access to call p9_getmem_vpd_keyword which decodes which vpd keyword to read for MR and MT. Update dvpd DD with record and keyword list. Update dvpd.dat simics vpd file to include MR and MT that map to J0 and X0. Change-Id: Ife00aa4266a7c16dcff2f0f72837f4d547988b82 RTC: 144519 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/23245 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r--src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H6
-rw-r--r--src/include/usr/fapi2/plat_vpd_access.H55
-rw-r--r--src/include/usr/fapi2/vpd_access.H52
-rw-r--r--src/include/usr/vpd/dvpdenums.H180
-rwxr-xr-xsrc/usr/fapi2/fapi2.mk12
-rw-r--r--src/usr/fapi2/plat_vpd_access.C274
-rw-r--r--src/usr/fapi2/test/fapi2GetVpdTest.H59
-rw-r--r--src/usr/fapi2/test/fapi2Test.mk2
-rw-r--r--src/usr/fapi2/test/getVpdTest.C612
-rw-r--r--src/usr/fapi2/test/getVpdTest.H79
-rwxr-xr-xsrc/usr/targeting/common/genHwsvMrwXml.pl23
-rw-r--r--src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml217
-rwxr-xr-xsrc/usr/targeting/common/xmltohb/target_types.xml6
-rw-r--r--src/usr/vpd/dvpd.H178
-rw-r--r--src/usr/vpd/makefile2
-rwxr-xr-xsrc/usr/vpd/test/dvpdtest.H53
16 files changed, 1544 insertions, 266 deletions
diff --git a/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H b/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H
index 9c76cc0e6..a6ffce5ba 100644
--- a/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H
+++ b/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H
@@ -54,6 +54,7 @@ namespace fapi2
MOD_FAPI2_PLAT_GET_CHILDREN_FILTER_TEST = 0x0B,
MOD_FAPI2_GET_TARGETING_ATTR = 0x0C,
MOD_FAPI2_SET_TARGETING_ATTR = 0x0D,
+ MOD_FAPI2_PLAT_GET_VPD = 0x0E,
};
/**
@@ -106,7 +107,10 @@ namespace fapi2
RC_INCORRECT_OTHER_END = FAPI2_COMP_ID | 0x24,
RC_FOUND_TOO_MANY_PEERS = FAPI2_COMP_ID | 0x25,
RC_FOUND_NO_PEERS = FAPI2_COMP_ID | 0x26,
- RC_INVALID_ATTRIBUTE = FAPI2_COMP_ID | 0x27,
+ RC_BUFFER_TOO_SMALL = FAPI2_COMP_ID | 0x27,
+ RC_INVALID_TYPE = FAPI2_COMP_ID | 0x28,
+ RC_RETURNED_VPD_TOO_SMALL = FAPI2_COMP_ID | 0x29,
+ RC_INVALID_ATTRIBUTE = FAPI2_COMP_ID | 0x2A,
// HWP generated errors
RC_HWP_GENERATED_ERROR = HWPF_COMP_ID | 0x0f,
diff --git a/src/include/usr/fapi2/plat_vpd_access.H b/src/include/usr/fapi2/plat_vpd_access.H
new file mode 100644
index 000000000..715ddc875
--- /dev/null
+++ b/src/include/usr/fapi2/plat_vpd_access.H
@@ -0,0 +1,55 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/fapi2/plat_vpd_access.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2016 */
+/* [+] 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. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+/// @file plat_vpd_access.H
+///
+/// @brief Platform vpd-access definitions
+///
+
+#ifndef _FAPI2_PLAT_VPDACCESS_H_
+#define _FAPI2_PLAT_VPDACCESS_H_
+
+#include <fapi2_vpd_access.H>
+
+namespace fapi2
+{
+
+/// @brief Return a blob of memory VPD data associated with the input target
+///
+/// Platform specific getVPD implmentation for MCS target type
+///
+/// @param[in] i_target, a valid fapi2 MCS target
+/// @param[in] io_vpd_info, fapi2::VPDInfo class that specifies which piece
+/// of data to return. Types MR and MT supported.
+/// @param[out] o_blob, the blob of raw data from the vpd
+/// @return FAPI2_RC_SUCCESS if there's no problem
+/// @note passing nullptr for o_blob will return the size of the keyword
+
+fapi2::ReturnCode platGetVPD(
+ const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target,
+ VPDInfo<fapi2::TARGET_TYPE_MCS>& io_vpd_info,
+ uint8_t* o_blob);
+
+};
+#endif // _FAPI2_PLAT_VPDACCESS_H_
diff --git a/src/include/usr/fapi2/vpd_access.H b/src/include/usr/fapi2/vpd_access.H
new file mode 100644
index 000000000..3586f6148
--- /dev/null
+++ b/src/include/usr/fapi2/vpd_access.H
@@ -0,0 +1,52 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/fapi2/vpd_access.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2016 */
+/* [+] 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. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+/// @file vpd_access.H
+///
+/// @brief VPD access functions that need to be specialized for
+/// platform implementation.
+///
+
+#ifndef __VPDACCESS_H_
+#define __VPDACCESS_H_
+
+#include <target.H>
+#include <return_code.H>
+#include <plat_vpd_access.H>
+
+namespace fapi2
+{
+
+// platform specialization for MCS target
+template<> fapi2::ReturnCode getVPD(
+ const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target,
+ VPDInfo<fapi2::TARGET_TYPE_MCS>& io_vpd_info,
+ uint8_t* o_blob)
+{
+ return platGetVPD( i_target, io_vpd_info, o_blob );
+}
+
+};
+
+#endif // __VPDACCESS_H_
diff --git a/src/include/usr/vpd/dvpdenums.H b/src/include/usr/vpd/dvpdenums.H
index 5f7e99832..ee39e9905 100644
--- a/src/include/usr/vpd/dvpdenums.H
+++ b/src/include/usr/vpd/dvpdenums.H
@@ -30,8 +30,6 @@
namespace DVPD
{
-//TODO RTC 144519 Replace with list of direct memory records and keywords
-// from memory team.
/**
* @brief Enumeration for the DVPD Records that contain
* the keyword enumerations below.
@@ -39,14 +37,13 @@ namespace DVPD
enum dvpdRecord
{
DVPD_FIRST_RECORD = 0x00,
- VEIR = DVPD_FIRST_RECORD,
- VER0 = 0x01,
- MER0 = 0x02,
- VSPD = 0x03,
- VINI = 0x04,
- OPFR = 0x05,
- VNDR = 0x06,
- SPDX = 0x07,
+ VINI = DVPD_FIRST_RECORD,
+ MEMD = 0x01,
+ LXR0 = 0x02,
+ VCEN = 0x03,
+ VMSC = 0x04,
+ VRTN = 0x05,
+ VSRC = 0x06,
// Last Record
DVPD_LAST_RECORD,
DVPD_TEST_RECORD, // Test purposes ONLY!
@@ -62,69 +59,106 @@ namespace DVPD
enum dvpdKeyword
{
DVPD_FIRST_KEYWORD = 0x00,
- pdI = DVPD_FIRST_KEYWORD,
- PF = 0x01,
- MT = 0x02,
- MR = 0x03,
- pdA = 0x04,
- EL = 0x05,
- LM = 0x06,
- MW = 0x07,
- MV = 0x08,
- AM = 0x09,
- VZ = 0x0a,
- pdD = 0x0b,
- MX = 0x0c,
- DW = 0x0d,
- PN = 0x0e,
- SN = 0x0f,
- DR = 0x10,
- CE = 0x11,
- FN = 0x12,
- CC = 0x13,
- HE = 0x14,
- CT = 0x15,
- HW = 0x16,
- VD = 0x17,
- VN = 0x18,
- VP = 0x19,
- VS = 0x1a,
- M0 = 0x1b,
- M1 = 0x1c,
- M2 = 0x1d,
- M3 = 0x1e,
- M4 = 0x1f,
- M5 = 0x20,
- M6 = 0x21,
- M7 = 0x22,
- M8 = 0x23,
- T1 = 0x24,
- T2 = 0x25,
- T4 = 0x26,
- T5 = 0x27,
- T6 = 0x28,
- T8 = 0x29,
- Q0 = 0x2a,
- Q1 = 0x2b,
- Q2 = 0x2c,
- Q3 = 0x2d,
- Q4 = 0x2e,
- Q5 = 0x2f,
- Q6 = 0x30,
- Q7 = 0x31,
- Q8 = 0x32,
- K0 = 0x33,
- K1 = 0x34,
- K2 = 0x35,
- K3 = 0x36,
- K4 = 0x37,
- K5 = 0x38,
- K6 = 0x39,
- K7 = 0x3a,
- K8 = 0x3b,
- MM = 0x3c,
- SS = 0x3d,
- ET = 0x3e,
+ B3 = DVPD_FIRST_KEYWORD,
+ B4 = 0x01,
+ B7 = 0x02,
+ CC = 0x03,
+ CE = 0x04,
+ CT = 0x05,
+ DR = 0x06,
+ FC = 0x07,
+ FN = 0x08,
+ HE = 0x09,
+ HW = 0x0a,
+ I2 = 0x0b,
+ IN = 0x0c,
+ J0 = 0x0d,
+ J1 = 0x0e,
+ J2 = 0x0f,
+ J3 = 0x10,
+ J4 = 0x11,
+ J5 = 0x12,
+ J6 = 0x13,
+ J7 = 0x14,
+ J8 = 0x15,
+ J9 = 0x16,
+ JA = 0x17,
+ JB = 0x18,
+ JC = 0x19,
+ JD = 0x1a,
+ JE = 0x1b,
+ JF = 0x1c,
+ JG = 0x1d,
+ JH = 0x1e,
+ JI = 0x1f,
+ JJ = 0x20,
+ JK = 0x21,
+ JL = 0x22,
+ JM = 0x23,
+ JN = 0x24,
+ JO = 0x25,
+ JP = 0x26,
+ JQ = 0x27,
+ JR = 0x28,
+ JS = 0x29,
+ JT = 0x2a,
+ JU = 0x2b,
+ JV = 0x2c,
+ JW = 0x2d,
+ JX = 0x2e,
+ JY = 0x2f,
+ JZ = 0x30,
+ LX = 0x31,
+ MR = 0x32,
+ MT = 0x33,
+ PF = 0x34,
+ PN = 0x35,
+ PR = 0x36,
+ RB = 0x37,
+ RG = 0x38,
+ RT = 0x39,
+ SE = 0x3a,
+ SN = 0x3b,
+ SO = 0x3c,
+ TM = 0x3d,
+ VM = 0x3e,
+ VZ = 0x3f,
+ X0 = 0x40,
+ X1 = 0x41,
+ X2 = 0x42,
+ X3 = 0x43,
+ X4 = 0x44,
+ X5 = 0x45,
+ X6 = 0x46,
+ X7 = 0x47,
+ X8 = 0x48,
+ X9 = 0x49,
+ XA = 0x4a,
+ XB = 0x4b,
+ XC = 0x4c,
+ XD = 0x4d,
+ XE = 0x4e,
+ XF = 0x4f,
+ XG = 0x50,
+ XH = 0x51,
+ XI = 0x52,
+ XJ = 0x53,
+ XK = 0x54,
+ XL = 0x55,
+ XM = 0x56,
+ XN = 0x57,
+ XO = 0x58,
+ XP = 0x59,
+ XQ = 0x5a,
+ XR = 0x5b,
+ XS = 0x5c,
+ XT = 0x5d,
+ XU = 0x5e,
+ XV = 0x5f,
+ XW = 0x60,
+ XX = 0x61,
+ XY = 0x62,
+ XZ = 0x63,
// Last Keyword
DVPD_LAST_KEYWORD,
diff --git a/src/usr/fapi2/fapi2.mk b/src/usr/fapi2/fapi2.mk
index 1bedbd2e5..89f00e9c7 100755
--- a/src/usr/fapi2/fapi2.mk
+++ b/src/usr/fapi2/fapi2.mk
@@ -29,11 +29,15 @@
#
GENPATH?=$(ROOTPATH)/obj/genfiles
+HWP_PATH += ${ROOTPATH}/src/import/chips/p9/procedures
+
EXTRAINCDIR += ${ROOTPATH}/src/import/hwpf/fapi2/include/
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/
EXTRAINCDIR += $(ROOTPATH)/src/import/chips/p9/procedures/hwp/pm/
+EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/accessors/
include ${ROOTPATH}/src/build/mkrules/verbose.rules.mk
define __CLEAN_TARGET
@@ -50,6 +54,13 @@ OBJS += target.o
OBJS += plat_hw_access.o
OBJS += plat_spd_access.o
OBJS += plat_mvpd_access.o
+OBJS += plat_vpd_access.o
+
+
+#Required include before all the procedure.mk are included
+include ${ROOTPATH}/procedure.rules.mk
+
+include ${HWP_PATH}/hwp/accessors/p9_get_mem_vpd_keyword.mk
#EKB Objects (mirrored in src/import)
OBJS += error_info.o
@@ -113,6 +124,7 @@ include ${ROOTPATH}/src/import/hwpf/fapi2/tools/createIfAttrService.mk
include $(ROOTPATH)/src/import/chips/p9/procedures/hwp/pm/p9_pm_get_poundv_bucket.mk
include $(ROOTPATH)/src/import/chips/p9/procedures/hwp/pm/p9_pm_get_poundv_bucket_attr.mk
+VPATH += ${HWP_PATH}/hwp/accessors
VPATH += ${ROOTPATH}/src/import/hwpf/fapi2/src/
VPATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/pm/
VPATH += ${GENPATH}
diff --git a/src/usr/fapi2/plat_vpd_access.C b/src/usr/fapi2/plat_vpd_access.C
new file mode 100644
index 000000000..91ea92506
--- /dev/null
+++ b/src/usr/fapi2/plat_vpd_access.C
@@ -0,0 +1,274 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/fapi2/plat_vpd_access.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2012,2016 */
+/* [+] 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. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+/**
+ * @file plat_vpd_access.C
+ *
+ * @brief Implements the GetVpd function
+ */
+
+#include <stdint.h>
+#include <fapi2.H>
+#include <vpd_access_defs.H>
+#include <vpd_access.H>
+#include <p9_get_mem_vpd_keyword.H>
+#include <attribute_service.H>
+#include <vpd/dvpdenums.H>
+
+//The following can be uncommented for unit testing
+//#undef FAPI_DBG
+//#define FAPI_DBG(args...) FAPI_INF(args)
+
+namespace fapi2
+{
+
+fapi2::ReturnCode platGetVPD(
+ const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target,
+ VPDInfo<fapi2::TARGET_TYPE_MCS>& io_vpd_info,
+ uint8_t* o_blob)
+{
+ fapi2::ReturnCode l_rc = fapi2::FAPI2_RC_SUCCESS;
+ errlHndl_t l_errl = nullptr;
+ keywordName_t l_keywordName = {0};
+ // Assume that all memory keywords (MR,MT,J0..JZ,X0...XZ) are all the
+ // same size of 255. This avoids going through the decode and asking
+ // the vpd DD the size of the keyword.
+ const size_t VPD_KEYWORD_SIZE = 255;
+
+ FAPI_DBG("platGetVPD: enter");
+
+ do
+ {
+ // null blob pointer requests blob size
+ if ( nullptr == o_blob) // just return size
+ {
+ io_vpd_info.iv_size = VPD_KEYWORD_SIZE;
+ FAPI_DBG("platGetVPD: return blob size of %d",
+ io_vpd_info.iv_size);
+ break; //return success
+ }
+
+ //Make sure passed blob buffer is big enough
+ if (VPD_KEYWORD_SIZE > io_vpd_info.iv_size)
+ {
+ FAPI_ERR("platGetVPD: blob size of %d too small, should be %d",
+ io_vpd_info.iv_size,
+ VPD_KEYWORD_SIZE);
+ /*@
+ * @errortype
+ * @moduleid fapi2::MOD_FAPI2_PLAT_GET_VPD
+ * @reasoncode fapi2::RC_BUFFER_TOO_SMALL
+ * @userdata1 Buffer size
+ * @userdata2 Expected size
+ * @devdesc Passed buffer too small
+ * @custdesc Firmware Error
+ */
+ l_errl = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ fapi2::MOD_FAPI2_PLAT_GET_VPD,
+ fapi2::RC_BUFFER_TOO_SMALL,
+ io_vpd_info.iv_size,
+ VPD_KEYWORD_SIZE,
+ true); //software callout
+ l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl));
+ break; //return with error
+ }
+
+ // Get targeting MCS target
+ TARGETING::Target * l_pMcsTarget = nullptr;
+ l_errl = fapi2::platAttrSvc::getTargetingTarget(i_target, l_pMcsTarget);
+ if (l_errl)
+ {
+ FAPI_ERR("platGetVPD: Error from getTargetingTarget");
+ l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl));
+ break; //return with error
+ }
+
+ //Validate type and check for override
+ uint64_t l_mapKeyword = 0;
+ uint64_t l_keywordEnum = 0; //set this now to be used later
+ if ( fapi2::MT == io_vpd_info.iv_vpd_type )
+ {
+ if (1 ==
+ l_pMcsTarget->getAttr<TARGETING::ATTR_VPD_OVERRIDE_MT_ENABLE>() )
+ {
+ uint8_t l_override[VPD_KEYWORD_SIZE]={0};
+ assert(l_pMcsTarget->tryGetAttr<TARGETING::ATTR_VPD_OVERRIDE_MT>
+ (l_override),
+ "platGetVPD: getAttr ATTR_VPD_OVERRIDE_MT failed");
+ FAPI_DBG("platGetVPD: return MT override attr");
+ memcpy(o_blob,l_override,VPD_KEYWORD_SIZE);
+ break; //return with overriden keyword
+ }
+
+ // not overriden, continue
+ l_mapKeyword = DVPD::MT;
+ l_keywordEnum = DVPD::X0;
+ }
+ else if ( fapi2::MR == io_vpd_info.iv_vpd_type )
+ {
+ if (1==
+ l_pMcsTarget->getAttr<TARGETING::ATTR_VPD_OVERRIDE_MR_ENABLE>() )
+ {
+ uint8_t l_override[VPD_KEYWORD_SIZE]={0};
+ assert(l_pMcsTarget->tryGetAttr<TARGETING::ATTR_VPD_OVERRIDE_MR>
+ (l_override),
+ "platGetVPD: getAttr ATTR_VPD_OVERRIDE_MR failed");
+ FAPI_DBG("platGetVPD: return MR override attr");
+ memcpy(o_blob,l_override,VPD_KEYWORD_SIZE);
+ break; //return with overriden keyword
+ }
+
+ // not overriden, continue
+ l_mapKeyword = DVPD::MR;
+ l_keywordEnum = DVPD::J0;
+ }
+ else
+ {
+ FAPI_ERR("platGetVPD: invalid type = %d",
+ io_vpd_info.iv_vpd_type);
+ /*@
+ * @errortype
+ * @moduleid fapi2::MOD_FAPI2_PLAT_GET_VPD
+ * @reasoncode fapi2::RC_INVALID_TYPE
+ * @userdata1 Vpd type
+ * @userdata2 HUID of MCS target
+ * @devdesc MR and MT types supported
+ * @custdesc Firmware Error
+ */
+ l_errl = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ fapi2::MOD_FAPI2_PLAT_GET_VPD,
+ fapi2::RC_BUFFER_TOO_SMALL,
+ io_vpd_info.iv_vpd_type,
+ TARGETING::get_huid(l_pMcsTarget),
+ true); //software callout
+ l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl));
+ break; //return with error
+ }
+
+ //Read mapping keyword
+ size_t l_buffSize = VPD_KEYWORD_SIZE;
+ uint8_t * l_pMapping = new uint8_t[VPD_KEYWORD_SIZE];
+ l_errl = deviceRead((TARGETING::Target *)l_pMcsTarget,
+ l_pMapping,
+ l_buffSize,
+ DEVICE_DVPD_ADDRESS(DVPD::MEMD,
+ l_mapKeyword));
+ if (l_errl)
+ {
+ delete l_pMapping;
+ FAPI_ERR("platGetVPD: ERROR reading mapping keyword");
+ l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl));
+ break; //return with error
+ }
+
+ // Find vpd keyword name based on VPDInfo
+ FAPI_EXEC_HWP(l_rc,
+ p9_get_mem_vpd_keyword,
+ i_target,
+ io_vpd_info,
+ l_pMapping,
+ VPD_KEYWORD_SIZE,
+ l_keywordName);
+ delete l_pMapping;
+ if (l_rc)
+ {
+ FAPI_ERR("platGetVPD: ERROR returned from p9_get_mem_vpd_keyword");
+ break; //return with error
+ }
+ FAPI_DBG("platGetVPD: keyword name = %s",
+ l_keywordName);
+
+ //Convert keyword name to keyword enumeration.
+ //ascii 0..9 runs from 0x30 to 0x39.
+ //The conversion assumes the input is valid (0..9,A..Z)
+ //and that the enumeration is in order and consecutive.
+ if ( '0' == (l_keywordName[1] & 0xf0)) //it is a digit (0..9)
+ {
+ l_keywordEnum += (l_keywordName[1] - '0');
+ }
+ else //it is a char (A..Z)
+ {
+ l_keywordEnum += (l_keywordName[1] - 'A') + 10;
+ }
+
+ //Read vpd blob
+ l_buffSize = io_vpd_info.iv_size;
+ l_errl = deviceRead((TARGETING::Target *)l_pMcsTarget,
+ o_blob,
+ l_buffSize,
+ DEVICE_DVPD_ADDRESS(DVPD::MEMD,
+ l_keywordEnum));
+ if (l_errl)
+ {
+ FAPI_ERR("platGetVPD: ERROR reading keyword");
+ l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl));
+ break; //return with error
+ }
+
+ //Confirm all expected data was returned
+ if (VPD_KEYWORD_SIZE > l_buffSize)
+ {
+ FAPI_ERR("platGetVPD: insufficient vpd returned"
+ " for keyword %d;"
+ " %d returned, %d expected",
+ l_keywordEnum,
+ l_buffSize,
+ VPD_KEYWORD_SIZE);
+ /*@
+ * @errortype
+ * @moduleid fapi2::MOD_FAPI2_PLAT_GET_VPD
+ * @reasoncode fapi2::RC_RETURNED_VPD_TOO_SMALL
+ * @userdata1[0:31] Returned vpd in bytes
+ * @userdata1[32:64] Expected number of vpd bytes
+ * @userdata2 Keyword
+ * @devdesc Less than expected number of bytes returned.
+ * @custdesc Firmware Error
+ */
+ l_errl = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ fapi2::MOD_FAPI2_PLAT_GET_VPD,
+ fapi2::RC_RETURNED_VPD_TOO_SMALL,
+ TWO_UINT32_TO_UINT64(
+ l_buffSize,
+ VPD_KEYWORD_SIZE),
+ l_keywordEnum);
+ l_errl->addHwCallout( l_pMcsTarget,
+ HWAS::SRCI_PRIORITY_LOW,
+ HWAS::NO_DECONFIG,
+ HWAS::GARD_NULL );
+
+ l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl));
+ break; //return with error
+ }
+ }
+ while (0);
+
+ FAPI_DBG("platGetVPD: exit");
+
+ return l_rc;
+}
+
+} // namespace
diff --git a/src/usr/fapi2/test/fapi2GetVpdTest.H b/src/usr/fapi2/test/fapi2GetVpdTest.H
new file mode 100644
index 000000000..cfd560b28
--- /dev/null
+++ b/src/usr/fapi2/test/fapi2GetVpdTest.H
@@ -0,0 +1,59 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/fapi2/test/fapi2GetVpdTest.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2016 */
+/* [+] 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. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+
+#ifndef __FAPI2GETVPDTEST_H
+#define __FAPI2GETVPDTEST_H
+
+/**
+ * @file getVpdTest.H
+ * @brief simple testcase for vpd function
+ */
+
+#include <stdint.h>
+
+#include <cxxtest/TestSuite.H>
+#include <getVpdTest.H>
+
+class GetVPDTest : public CxxTest::TestSuite
+{
+
+public:
+
+void testGetVPD(void)
+{
+ testGetVPD_MR();
+
+ testGetVPD_MT();
+
+ testDecode_MR();
+
+ testDecode_MT();
+
+ testGetVPD_Override();
+}
+
+}; // GetVPDTest class
+
+#endif
diff --git a/src/usr/fapi2/test/fapi2Test.mk b/src/usr/fapi2/test/fapi2Test.mk
index b7544564a..1c0fd049a 100644
--- a/src/usr/fapi2/test/fapi2Test.mk
+++ b/src/usr/fapi2/test/fapi2Test.mk
@@ -35,12 +35,14 @@ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/common/include/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/pm/
+EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/accessors/
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/targeting/common/
# Procedures
OBJS += p9_sample_procedure.o
OBJS += p9_hwtests.o
OBJS += fapi2TestUtils.o
+OBJS += getVpdTest.o
TESTS += ${ROOTPATH}/src/usr/fapi2/test/*Test.H
TESTS += ${ROOTPATH}/src/usr/fapi2/test/*TestCxx.H
diff --git a/src/usr/fapi2/test/getVpdTest.C b/src/usr/fapi2/test/getVpdTest.C
new file mode 100644
index 000000000..e582ab609
--- /dev/null
+++ b/src/usr/fapi2/test/getVpdTest.C
@@ -0,0 +1,612 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/fapi2/test/getVpdTest.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2016 */
+/* [+] 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. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+
+/**
+ * @file getVpdTest.C
+ * @brief getVpd for MCA memory test cases
+ */
+
+#include <stdint.h>
+#include <cxxtest/TestSuite.H>
+#include <target.H>
+#include <target_types.H>
+#include <vpd_access_defs.H>
+#include <return_code_defs.H>
+#include <return_code.H>
+#include <vpd_access.H>
+#include <getVpdTest.H>
+#include <p9_get_mem_vpd_keyword.H>
+#include <attribute_service.H>
+
+//The following commented out section can be restored for unit testing
+//#undef FAPI_DBG
+//#define FAPI_DBG(args...) FAPI_INF(args)
+
+using TARGETING::ATTR_VPD_OVERRIDE_MT;
+using TARGETING::ATTR_VPD_OVERRIDE_MT_ENABLE;
+using TARGETING::ATTR_VPD_OVERRIDE_MR;
+using TARGETING::ATTR_VPD_OVERRIDE_MR_ENABLE;
+
+const size_t VPD_KEYWORD_SIZE = 255;
+
+using namespace fapi2;
+
+// Find MCS of requested MEMVPD_POS
+bool getTarget (TARGETING::ATTR_MEMVPD_POS_type i_memVpdPos,
+ TARGETING::Target * &o_target,
+ fapi2::Target<fapi2::TARGET_TYPE_MCS> &o_fapiTarget)
+{
+ bool l_rc = false;
+
+
+ TARGETING::TargetHandleList l_mcsTargetList;
+ getAllChiplets(l_mcsTargetList, TARGETING::TYPE_MCS, false);
+ FAPI_DBG("testGetVPD mcs count = %d", l_mcsTargetList.size());
+
+ for (const auto l_mcsTarget: l_mcsTargetList)
+ {
+ TARGETING::ATTR_MEMVPD_POS_type l_memVpdPos =
+ l_mcsTarget->getAttr<TARGETING::ATTR_MEMVPD_POS>();
+ if (i_memVpdPos == l_memVpdPos)
+ {
+ o_target = l_mcsTarget;
+ fapi2::Target<fapi2::TARGET_TYPE_MCS>
+ l_fapiTarget(o_target);
+ o_fapiTarget = l_fapiTarget;
+ l_rc = true;
+ break; //found MCS
+ }
+ }
+
+ return l_rc;
+}
+
+//Common code for calling getVPD
+ReturnCode testGetVPD(
+ fapi2::Target<fapi2::TARGET_TYPE_MCS> i_fapiTarget,
+ fapi2::VPDInfo<fapi2::TARGET_TYPE_MCS> i_VPDInfo,
+ const fapi2::MemVpdData i_vpdType,
+ const char * i_check, //NULL for no check
+ int & numTests,
+ int & numFails)
+{
+ numTests = 0;
+ numFails = 0;
+ ReturnCode l_rc;
+
+ FAPI_DBG("testGetVPD common enter");
+
+ do
+ {
+ // call with null blob pointer to get blob size
+ uint8_t* blob = nullptr; //first call
+ numTests++;
+ l_rc = getVPD(i_fapiTarget, i_VPDInfo, blob );
+ if (l_rc)
+ {
+ TS_FAIL ("testGetVPD getVPD failed to get blob size");
+ numFails++;
+ break;
+ }
+
+ numTests++;
+ if ( i_VPDInfo.iv_vpd_type != i_vpdType )
+ {
+ TS_FAIL ("testGetVPD invalid initial type"
+ "value = %d expected = %d",
+ i_VPDInfo.iv_vpd_type,i_vpdType);
+ numFails++;
+ }
+ numTests++;
+ if ( blob != nullptr )
+ {
+ TS_FAIL ("testGetVPD blob pointer not NULL"
+ "value = %p expected = %d",
+ blob,0);
+ numFails++;
+ }
+ numTests++;
+ if ( i_VPDInfo.iv_size != VPD_KEYWORD_SIZE )
+ {
+ TS_FAIL ("testGetVPD invalid size"
+ "value = %d expected = %d",
+ i_VPDInfo.iv_size,VPD_KEYWORD_SIZE);
+ numFails++;
+ }
+ if (numFails) break;
+
+ // call to get blob
+ blob = new uint8_t[i_VPDInfo.iv_size];
+ numTests++;
+ l_rc = getVPD(i_fapiTarget, i_VPDInfo, blob);
+ if (l_rc)
+ {
+ TS_FAIL ("testGetVPD getVPD failed to return blob");
+ numFails++;
+ break;
+ }
+
+ numTests++;
+ if ( blob == nullptr )
+ {
+ TS_FAIL ("testGetVPD blob pointer NULL value = %p",
+ blob);
+ numFails++;
+ break; //don't use NULL pointer
+ }
+
+ // compare to expected test data
+ numTests++;
+ if ( i_check &&
+ (blob[0] != i_check[0]) &&
+ (blob[1] != i_check[1]) )
+ {
+ TS_FAIL ("testGetVPD:: invalid blob value"
+ "value = %x %x expected = %x %x",
+ blob[0],blob[1],i_check[0],i_check[1]);
+ numFails++;
+ }
+ delete blob;
+ blob = nullptr;
+
+ }
+ while(0);
+
+ FAPI_DBG("testGetVPD common exit");
+
+ return l_rc;
+}
+
+void testDecode_MR(void)
+{
+ int numTests = 0;
+ int numFails = 0;
+ ReturnCode l_rc;
+
+ FAPI_DBG("testDecode MR start");
+
+ do
+ {
+ // get a MCS fapi2 target for MEMVPD_POS 0
+ TARGETING::ATTR_MEMVPD_POS_type l_memVpdPos = 0;
+
+ fapi2::Target<fapi2::TARGET_TYPE_MCS> l_fapiTarget;
+ TARGETING::Target * l_target;
+ if(!getTarget(l_memVpdPos,l_target,l_fapiTarget))
+ {
+ TS_FAIL ("testDecode_MR:: could not find MCS MEMVPD_POS=%d",
+ l_memVpdPos);
+ numFails++;
+ break; //Target not found
+ }
+
+ // set up VPDInfo
+ fapi2::VPDInfo<fapi2::TARGET_TYPE_MCS> l_info(fapi2::MR);
+ l_info.iv_freq_mhz = 1866; // index = 0
+ l_info.iv_rank_count_dimm_0 = 1;
+ l_info.iv_rank_count_dimm_1 = 4;
+ fapi2::ReturnCode l_rc = fapi2::FAPI2_RC_SUCCESS;
+
+ // set up the mapping data
+ uint8_t l_pMapping[VPD_KEYWORD_SIZE] = {
+ // Header: version=1, num entries=5, reserved
+ 1,5,0,
+ // miss: mcs match, pair match, freq miss
+ 0xff,0xff,0xff,0xff,0x7f,'0',
+ // miss: mcs match, pair missing, freq match
+ 0xff,0xff,0xfe,0xff,0xff,'1',
+ // miss: mcs miss, pair match, freq match
+ 0x7f,0xff,0xff,0xff,0xff,'2',
+ // match:
+ 0x80,0x00,0x01,0x00,0x80,'3', // <-- should be this one
+ // match everything
+ 0xff,0xff,0xff,0xff,0xff,'4',
+ // zero out rest
+ 0};
+
+ // decode keyword
+ keywordName_t l_keywordName = {0};
+ numTests++;
+
+ FAPI_EXEC_HWP(l_rc,
+ p9_get_mem_vpd_keyword,
+ l_fapiTarget,
+ l_info,
+ l_pMapping,
+ VPD_KEYWORD_SIZE,
+ l_keywordName);
+ if(l_rc)
+ {
+ TS_FAIL ("testDecode_MR:: p9_get_mem_vpd_keyword failed");
+ numFails++;
+ break; // decode failed
+ }
+
+ // compare to expected test data
+ numTests++;
+ if ( (l_keywordName[0] != 'J' ) &&
+ (l_keywordName[1] != '3' ) )
+ {
+ TS_FAIL ("testDecode_MR:: unexpected keyword name returned"
+ "value = %x %x expected = %x %x",
+ l_keywordName[0],l_keywordName[1],'J','3');
+ numFails++;
+ }
+
+ }
+ while(0);
+
+ FAPI_INF("testDecode MR Test Complete, %d/%d fails",
+ numFails, numTests);
+}
+
+void testDecode_MT(void)
+{
+ int numTests = 0;
+ int numFails = 0;
+ ReturnCode l_rc;
+
+ FAPI_DBG("testDecode MT start");
+
+ do
+ {
+ // get a MCS fapi2 target for MEMVPD_POS 7
+ TARGETING::ATTR_MEMVPD_POS_type l_memVpdPos = 7;
+
+ fapi2::Target<fapi2::TARGET_TYPE_MCS> l_fapiTarget;
+ TARGETING::Target * l_target;
+ if(!getTarget(l_memVpdPos,l_target,l_fapiTarget))
+ {
+ TS_FAIL ("testDecode_MT:: could not find MCS MEMVPD_POS=%d",
+ l_memVpdPos);
+ numFails++;
+ break; //Target not found
+ }
+
+ // set up VPDInfo
+ fapi2::VPDInfo<fapi2::TARGET_TYPE_MCS> l_info(fapi2::MT);
+ l_info.iv_freq_mhz = 2667; //index 3
+ l_info.iv_rank_count_dimm_0 = 4;
+ l_info.iv_rank_count_dimm_1 = 1;
+
+ // set up the mapping data
+ uint8_t l_pMapping[VPD_KEYWORD_SIZE] = {
+ // Header: version=1, num entries=4, reserved
+ 1,4,0,
+ // miss: mcs match, pair match, freq miss
+ 0xff,0xff,0xff,0xff,0xef,'0',
+ // miss: mcs match, pair missing, freq match
+ 0xff,0xff,0xff,0xfd,0xff,'1',
+ // miss: mcs miss, pair match, freq match
+ 0xfe,0xff,0xff,0xff,0xff,'2',
+ // match:
+ 0x01,0x00,0x00,0x04,0x10,'3', // <-- should be this one
+ // zero out rest
+ 0};
+
+ // decode keyword
+ keywordName_t l_keywordName = {0};
+ numTests++;
+ FAPI_EXEC_HWP(l_rc,
+ p9_get_mem_vpd_keyword,
+ l_fapiTarget,
+ l_info,
+ l_pMapping,
+ VPD_KEYWORD_SIZE,
+ l_keywordName);
+ if(l_rc)
+ {
+ TS_FAIL ("testDecode_MT:: p9_get_mem_vpd_keyword failed");
+ numFails++;
+ break; // decode failed
+ }
+
+ // compare to expected test data
+ numTests++;
+ if ( (l_keywordName[0] != 'X' ) &&
+ (l_keywordName[1] != '3' ) )
+ {
+ TS_FAIL ("testDecode_MT:: unexpected keyword name returned"
+ "value = %x %x expected = %x %x",
+ l_keywordName[0],l_keywordName[1],'X','3');
+ numFails++;
+ }
+
+ }
+ while(0);
+
+ FAPI_INF("testDecode MT Test Complete, %d/%d fails",
+ numFails, numTests);
+}
+
+void testGetVPD_MR(void)
+{
+ int numTests = 0;
+ int numFails = 0;
+ ReturnCode l_rc;
+
+ FAPI_DBG("testGetVPD MR start");
+
+ do
+ {
+ // get a MCS fapi2 target for MEMVPD_POS 0
+ TARGETING::ATTR_MEMVPD_POS_type l_memVpdPos = 0;
+
+ fapi2::Target<fapi2::TARGET_TYPE_MCS> l_fapiTarget;
+ TARGETING::Target * l_target;
+ if(!getTarget(l_memVpdPos,l_target,l_fapiTarget))
+ {
+ TS_FAIL ("testGetVPD_MR:: could not find MCS MEMVPD_POS=%d",
+ l_memVpdPos);
+ numFails++;
+ break; //Target not found
+ }
+
+ // set up VPDInfo
+ // simics test data will return keyword J0
+ fapi2::VPDInfo<fapi2::TARGET_TYPE_MCS> l_info(fapi2::MR);
+ l_info.iv_freq_mhz = 1866;
+ l_info.iv_rank_count_dimm_0 = 1;
+ l_info.iv_rank_count_dimm_1 = 4;
+
+ l_rc = testGetVPD(l_fapiTarget,
+ l_info,
+ fapi2::MR,
+ nullptr, //don't test data, just ability to access
+ numTests,
+ numFails);
+ if(l_rc)
+ {
+ TS_FAIL ("testGetVPD MR:: testGetVPD decode failed");
+ break; // decode failed (don't double count num tests and fails)
+ }
+
+ }
+ while(0);
+
+ FAPI_INF("testGetVPD MR Test Complete, %d/%d fails",
+ numFails, numTests);
+}
+
+void testGetVPD_MT(void)
+{
+ int numTests = 0;
+ int numFails = 0;
+ ReturnCode l_rc;
+
+ FAPI_DBG("testGetVPD MT start");
+
+ do
+ {
+ // get a MCS fapi2 target for MEMVPD_POS 7
+ TARGETING::ATTR_MEMVPD_POS_type l_memVpdPos = 7;
+
+ fapi2::Target<fapi2::TARGET_TYPE_MCS> l_fapiTarget;
+ TARGETING::Target * l_target;
+ if(!getTarget(l_memVpdPos,l_target,l_fapiTarget))
+ {
+ TS_FAIL ("testGetVPD_MT:: could not find MCS MEMVPD_POS=%d",
+ l_memVpdPos);
+ numFails++;
+ break; //Target not found
+ }
+
+ // set up VPDInfo
+ // simics test data will return keyword X0
+ fapi2::VPDInfo<fapi2::TARGET_TYPE_MCS> l_info(fapi2::MT);
+ l_info.iv_freq_mhz = 2667;
+ l_info.iv_rank_count_dimm_0 = 4;
+ l_info.iv_rank_count_dimm_1 = 1;
+
+ l_rc = testGetVPD(l_fapiTarget,
+ l_info,
+ fapi2::MT,
+ nullptr, //don't test data, just ability to access
+ numTests,
+ numFails);
+ if(l_rc)
+ {
+ TS_FAIL ("testGetVPD MT:: testGetVPD decode failed");
+ break; // decode failed (don't double count num tests and fails)
+ }
+
+ }
+ while(0);
+
+ FAPI_INF("testGetVPD MT Test Complete, %d/%d fails",
+ numFails, numTests);
+}
+
+void testGetVPD_Override(void)
+{
+ int numMRTests = 0;
+ int numMRFails = 0;
+ int numMTTests = 0;
+ int numMTFails = 0;
+ ReturnCode l_rc;
+
+ FAPI_DBG("testGetVPD Override start");
+
+ do
+ {
+ // get a MCS fapi2 target for MEMVPD_POS 4
+ numMTTests++;
+ TARGETING::ATTR_MEMVPD_POS_type l_memVpdPos = 4;
+ fapi2::Target<fapi2::TARGET_TYPE_MCS> l_fapiTarget;
+ TARGETING::Target * l_target;
+ if(!getTarget(l_memVpdPos,l_target,l_fapiTarget))
+ {
+ TS_FAIL ("testGetVPD_Overrides:: could not find MCS MEMVPD_POS=%d",
+ l_memVpdPos);
+ numMTFails++;
+ break; //Target not found
+ }
+
+ //Skip test if already overriden
+ TARGETING::ATTR_VPD_OVERRIDE_MT_ENABLE_type l_mtType =
+ l_target->getAttr<TARGETING::ATTR_VPD_OVERRIDE_MT_ENABLE>();
+ if (0 == l_mtType)
+ {
+ //Set the overriden data.
+ //Use the plat attr svc helper function to set the override
+ //attributes because the override attributes are not writable.
+ //The helper avoids the error checks.
+ uint8_t l_overrideMT[VPD_KEYWORD_SIZE] = {'O','T',0};
+ bool l_setWorked = fapi2::platAttrSvc::setTargetingAttrHelper(
+ l_target,
+ TARGETING::ATTR_VPD_OVERRIDE_MT,
+ sizeof(l_overrideMT),
+ &l_overrideMT);
+ if (!l_setWorked)
+ {
+ TS_FAIL ("testGetVPD_Overrides:: "
+ "could not set ATTR_VPD_OVERRIDE_MT");
+ numMTFails++;
+ break; //stop on error
+ }
+
+ //Set override enable
+ numMTTests++;
+ l_mtType = 1;
+ l_setWorked = fapi2::platAttrSvc::setTargetingAttrHelper(
+ l_target,
+ TARGETING::ATTR_VPD_OVERRIDE_MT_ENABLE,
+ sizeof(l_mtType),
+ &l_mtType);
+ if (!l_setWorked)
+ {
+ TS_FAIL ("testGetVPD_Overrides:: "
+ "could not set ATTR_VPD_OVERRIDE_MT_ENABLE");
+ numMTFails++;
+ break; //stop on error
+ }
+
+ // set up VPDInfo, only type should matter
+ fapi2::VPDInfo<fapi2::TARGET_TYPE_MCS> l_info(fapi2::MT);
+
+ l_rc = testGetVPD(l_fapiTarget,
+ l_info,
+ fapi2::MT,
+ "OT",
+ numMTTests,
+ numMTFails);
+ if(l_rc)
+ {
+ TS_FAIL ("testGetVPD_Overrides:: testGetVPD failed");
+ break; // failed (don't double count num tests and fails)
+ }
+
+ // restore to not being overriden
+ numMTTests++;
+ l_mtType = 0;
+ l_setWorked = fapi2::platAttrSvc::setTargetingAttrHelper(
+ l_target,
+ TARGETING::ATTR_VPD_OVERRIDE_MT_ENABLE,
+ sizeof(l_mtType),
+ &l_mtType);
+ if (!l_setWorked)
+ {
+ TS_FAIL ("testGetVPD_Overrides:: "
+ "could not set ATTR_VPD_OVERRIDE_MT_ENABLE");
+ numMTFails++;
+ break; //stop on error
+ }
+ }
+
+ //Set override enable and data for MR
+ //Skip test if already overriden
+ TARGETING::ATTR_VPD_OVERRIDE_MR_ENABLE_type l_mrType =
+ l_target->getAttr<TARGETING::ATTR_VPD_OVERRIDE_MR_ENABLE>();
+ if (0 == l_mrType)
+ {
+ //Set the overriden data.
+ uint8_t l_overrideMR[VPD_KEYWORD_SIZE] = {'O','R',0};
+ bool l_setWorked = fapi2::platAttrSvc::setTargetingAttrHelper(
+ l_target,
+ TARGETING::ATTR_VPD_OVERRIDE_MR,
+ sizeof(l_overrideMR),
+ &l_overrideMR);
+ if (!l_setWorked)
+ {
+ TS_FAIL ("testGetVPD_Overrides:: "
+ "could not set ATTR_VPD_OVERRIDE_MR");
+ numMRFails++;
+ break; //stop on error
+ }
+
+ //Set override enable
+ numMRTests++;
+ l_mrType = 1;
+ l_setWorked = fapi2::platAttrSvc::setTargetingAttrHelper(
+ l_target,
+ TARGETING::ATTR_VPD_OVERRIDE_MR_ENABLE,
+ sizeof(l_mrType),
+ &l_mrType);
+ if (!l_setWorked)
+ {
+ TS_FAIL ("testGetVPD_Overrides:: "
+ "could not set ATTR_VPD_OVERRIDE_MR_ENABLE");
+ numMRFails++;
+ break; //stop on error
+ }
+
+ // set up VPDInfo, only type should matter
+ fapi2::VPDInfo<fapi2::TARGET_TYPE_MCS> l_info(fapi2::MR);
+
+ l_rc = testGetVPD(l_fapiTarget,
+ l_info,
+ fapi2::MR,
+ "OR",
+ numMRTests,
+ numMRFails);
+ if(l_rc)
+ {
+ TS_FAIL ("testGetVPD_Overrides:: testGetVPD failed");
+ break; // failed (don't double count num tests and fails)
+ }
+
+ // restore to not being overriden
+ numMRTests++;
+ l_mrType = 0;
+ l_setWorked = fapi2::platAttrSvc::setTargetingAttrHelper(
+ l_target,
+ TARGETING::ATTR_VPD_OVERRIDE_MR_ENABLE,
+ sizeof(l_mrType),
+ &l_mrType);
+ if (!l_setWorked)
+ {
+ TS_FAIL ("testGetVPD_Overrides:: "
+ "could not set ATTR_VPD_OVERRIDE_MR_ENABLE");
+ numMRFails++;
+ break; //stop on error
+ }
+ }
+ }
+ while(0);
+
+ FAPI_INF("testGetVPD Override Test Complete, %d/%d fails",
+ numMRFails+numMTFails, numMRTests+numMTTests);
+}
+
diff --git a/src/usr/fapi2/test/getVpdTest.H b/src/usr/fapi2/test/getVpdTest.H
new file mode 100644
index 000000000..b7b67e672
--- /dev/null
+++ b/src/usr/fapi2/test/getVpdTest.H
@@ -0,0 +1,79 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/fapi2/test/getVpdTest.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2016 */
+/* [+] 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. */
+/* You may obtain a copy of the License at */
+/* */
+/* http://www.apache.org/licenses/LICENSE-2.0 */
+/* */
+/* Unless required by applicable law or agreed to in writing, software */
+/* distributed under the License is distributed on an "AS IS" BASIS, */
+/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
+/* implied. See the License for the specific language governing */
+/* permissions and limitations under the License. */
+/* */
+/* IBM_PROLOG_END_TAG */
+
+#ifndef __GETVPDTEST_H
+#define __GETVPDTEST_H
+
+/**
+ * @file getVpdTest.H
+ * @brief getVpd for MCS memory test cases
+ */
+
+#include <stdint.h>
+
+/**
+ * @brief MCS getVpd MR tests
+ *
+ * Test the getVPD MR interface. Based on a VPDInfo configuration,
+ * verify the expected direct memory vpd is returned.
+ * There is a dependency to update standalone simics direct memory (dvpd.dat)
+ * for the configuration to map to a keyword, but there is no data dependency.
+ * expected data.
+ */
+void testGetVPD_MR(void);
+
+/**
+ * @brief MCS getVpd MT tests
+ *
+ * Test the getVPD MT interface. Based on a VPDInfo configuration,
+ * verify the expected direct memory vpd is returned.
+ * There is a dependency to update standalone simics direct memory (dvpd.dat)
+ * for the configuration to map to a keyword, but there is no data dependency.
+ */
+void testGetVPD_MT(void);
+
+/**
+ * @brief p9_get_mem_vpd_keyword MR decode tests
+ *
+ * Test the p9_get_mem_vpd_keyword decode MR interface. Based on a VPDInfo
+ * configuration, verify the expected keyword is returned.
+ */
+void testDecode_MR(void);
+
+/**
+ * @brief p9_get_mem_vpd_keyword MT decode tests
+ *
+ * Test the p9_get_mem_vpd_keyword decode MT interface. Based on a VPDInfo
+ * configuration, verify the expected keyword is returned.
+ */
+void testDecode_MT(void);
+/**
+ * @brief MCS getVpd override test
+ *
+ * Verify that overriding the direct memory vpd works.
+ */
+void testGetVPD_Override(void);
+
+#endif
diff --git a/src/usr/targeting/common/genHwsvMrwXml.pl b/src/usr/targeting/common/genHwsvMrwXml.pl
index 1e42b5040..8d06024fb 100755
--- a/src/usr/targeting/common/genHwsvMrwXml.pl
+++ b/src/usr/targeting/common/genHwsvMrwXml.pl
@@ -2491,6 +2491,17 @@ sub generate_sys
<default>$plat</default>
</attribute>\n";
+ #TODO CQ:SW352246 Replace hardcoded defaults with MRW values
+ print " <attribute>
+ <id>MEMVPD_FREQS_MHZ</id>
+ <default>
+ 1866,
+ 2133,
+ 2400,
+ 2667,
+ </default>
+ </attribute>\n";
+
print " <!-- System Attributes from MRW -->\n";
addSysAttrs();
@@ -3038,6 +3049,18 @@ sub calcAndAddFapiPos
<id>FAPI_POS</id>
<default>$fapiPos</default>
</attribute>";
+
+ #mcs MEMVPD_POS is the same as FAPI_POS on single node systems.
+ if($type eq "mcs")
+ {
+ # Uncomment to emit debug trace to STDERR
+ # print STDERR "MEMVPD_POS=$fapiPos\n";
+ print "
+ <attribute>
+ <id>MEMVPD_POS</id>
+ <default>$fapiPos</default>
+ </attribute>";
+ }
}
else
{
diff --git a/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml b/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml
index 91b6af19f..0f5de72ce 100644
--- a/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml
+++ b/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml
@@ -122,6 +122,15 @@
<id>PROC_EPS_TABLE_TYPE</id>
<default>EPS_TYPE_LE</default>
</attribute>
+ <attribute>
+ <id>MEMVPD_FREQS_MHZ</id>
+ <default>
+ 1866,
+ 2133,
+ 2400,
+ 2667,
+ </default>
+ </attribute>
</targetInstance>
<!-- System node 0 -->
@@ -1748,6 +1757,10 @@
<default>0</default>
</attribute>
<attribute>
+ <id>MEMVPD_POS</id>
+ <default>0</default>
+ </attribute>
+ <attribute>
<id>ORDINAL_ID</id>
<default>0</default>
</attribute>
@@ -1788,6 +1801,10 @@
<default>1</default>
</attribute>
<attribute>
+ <id>MEMVPD_POS</id>
+ <default>1</default>
+ </attribute>
+ <attribute>
<id>ORDINAL_ID</id>
<default>1</default>
</attribute>
@@ -1828,6 +1845,10 @@
<default>2</default>
</attribute>
<attribute>
+ <id>MEMVPD_POS</id>
+ <default>2</default>
+ </attribute>
+ <attribute>
<id>ORDINAL_ID</id>
<default>2</default>
</attribute>
@@ -1868,6 +1889,10 @@
<default>3</default>
</attribute>
<attribute>
+ <id>MEMVPD_POS</id>
+ <default>3</default>
+ </attribute>
+ <attribute>
<id>ORDINAL_ID</id>
<default>3</default>
</attribute>
@@ -1888,10 +1913,10 @@
<attribute><id>VPD_REC_NUM</id><default>0</default></attribute>
</targetInstance>
-<!-- Nimbus n0p0mcs0 MCA units -->
+<!-- Power9 n0p0mcs0 MCA units -->
<targetInstance>
<id>sys0node0proc0mcbist0mcs0mca0</id>
- <type>unit-mca-nimbus</type>
+ <type>unit-mca-power9</type>
<attribute><id>HUID</id><default>0x00240100</default></attribute>
<attribute>
<id>FAPI_NAME</id><default>pu.mca:k0:n0:s0:p00:c0</default>
@@ -1924,7 +1949,7 @@
<targetInstance>
<id>sys0node0proc0mcbist0mcs0mca1</id>
- <type>unit-mca-nimbus</type>
+ <type>unit-mca-power9</type>
<attribute><id>HUID</id><default>0x00240101</default></attribute>
<attribute>
<id>FAPI_NAME</id><default>pu.mca:k0:n0:s0:p00:c1</default>
@@ -1955,10 +1980,10 @@
</attribute>
</targetInstance>
-<!-- Nimbus n0p0mcs1 MCA units -->
+<!-- Power9 n0p0mcs1 MCA units -->
<targetInstance>
<id>sys0node0proc0mcbist0mcs1mca0</id>
- <type>unit-mca-nimbus</type>
+ <type>unit-mca-power9</type>
<attribute><id>HUID</id><default>0x00240102</default></attribute>
<attribute>
<id>FAPI_NAME</id><default>pu.mca:k0:n0:s0:p00:c2</default>
@@ -1991,7 +2016,7 @@
<targetInstance>
<id>sys0node0proc0mcbist0mcs1mca1</id>
- <type>unit-mca-nimbus</type>
+ <type>unit-mca-power9</type>
<attribute><id>HUID</id><default>0x00240103</default></attribute>
<attribute>
<id>FAPI_NAME</id><default>pu.mca:k0:n0:s0:p00:c3</default>
@@ -2022,10 +2047,10 @@
</attribute>
</targetInstance>
-<!-- Nimbus n0p0mcs2 MCA units -->
+<!-- Power9 n0p0mcs2 MCA units -->
<targetInstance>
<id>sys0node0proc0mcbist1mcs0mca0</id>
- <type>unit-mca-nimbus</type>
+ <type>unit-mca-power9</type>
<attribute><id>HUID</id><default>0x00240104</default></attribute>
<attribute>
<id>FAPI_NAME</id><default>pu.mca:k0:n0:s0:p00:c4</default>
@@ -2058,7 +2083,7 @@
<targetInstance>
<id>sys0node0proc0mcbist1mcs0mca1</id>
- <type>unit-mca-nimbus</type>
+ <type>unit-mca-power9</type>
<attribute><id>HUID</id><default>0x00240105</default></attribute>
<attribute>
<id>FAPI_NAME</id><default>pu.mca:k0:n0:s0:p00:c5</default>
@@ -2089,10 +2114,10 @@
</attribute>
</targetInstance>
-<!-- Nimbus n0p0mcs3 MCA units -->
+<!-- Power9 n0p0mcs3 MCA units -->
<targetInstance>
<id>sys0node0proc0mcbist1mcs1mca0</id>
- <type>unit-mca-nimbus</type>
+ <type>unit-mca-power9</type>
<attribute><id>HUID</id><default>0x00240106</default></attribute>
<attribute>
<id>FAPI_NAME</id><default>pu.mca:k0:n0:s0:p00:c6</default>
@@ -2125,7 +2150,7 @@
<targetInstance>
<id>sys0node0proc0mcbist1mcs1mca1</id>
- <type>unit-mca-nimbus</type>
+ <type>unit-mca-power9</type>
<attribute><id>HUID</id><default>0x00240107</default></attribute>
<attribute>
<id>FAPI_NAME</id><default>pu.mca:k0:n0:s0:p00:c7</default>
@@ -6271,15 +6296,15 @@
</targetInstance>
<targetInstance>
- <id>sys0node0proc1mcbist0mcs0</id>
- <type>unit-mcs-nimbus</type>
- <attribute><id>HUID</id><default>0x000B0004</default></attribute>
+ <id>sys0node0proc1mcbist0</id>
+ <type>unit-mcbist-power9</type>
+ <attribute><id>HUID</id><default>0x00250002</default></attribute>
<attribute>
- <id>FAPI_NAME</id><default>pu.mcs:k0:n0:s0:p01:c0</default>
+ <id>FAPI_NAME</id><default>pu.mcbist:k0:n0:s0:p01:c0</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
- <default>physical:sys-0/node-0/proc-1/mcs-0</default>
+ <default>physical:sys-0/node-0/proc-1/mcbist-0</default>
</attribute>
<attribute>
<id>MRU_ID</id>
@@ -6287,15 +6312,15 @@
</attribute>
<attribute>
<id>AFFINITY_PATH</id>
- <default>affinity:sys-0/node-0/proc-1/mcs-0</default>
+ <default>affinity:sys-0/node-0/proc-1/mcbist-0</default>
</attribute>
<attribute>
<id>ORDINAL_ID</id>
- <default>4</default>
+ <default>2</default>
</attribute>
<attribute>
<id>FAPI_POS</id>
- <default>4</default>
+ <default>2</default>
</attribute>
<attribute>
<id>PARENT_PERVASIVE</id>
@@ -6305,27 +6330,18 @@
<id>CHIP_UNIT</id>
<default>0</default>
</attribute>
- <attribute><id>IBSCOM_MCS_BASE_ADDR</id>
- <!-- baseAddr = 0x0003E00000000000, 128GB per MCS -->
- <default>0x0003E10000000000</default>
- </attribute>
- <attribute>
- <id>EI_BUS_TX_MSBSWAP</id>
- <default>0</default>
- </attribute>
- <attribute><id>VPD_REC_NUM</id><default>0</default></attribute>
</targetInstance>
<targetInstance>
- <id>sys0node0proc1mcbist0mcs1</id>
- <type>unit-mcs-nimbus</type>
- <attribute><id>HUID</id><default>0x000B0005</default></attribute>
+ <id>sys0node0proc1mcbist1</id>
+ <type>unit-mcbist-power9</type>
+ <attribute><id>HUID</id><default>0x00250003</default></attribute>
<attribute>
- <id>FAPI_NAME</id><default>pu.mcs:k0:n0:s0:p01:c1</default>
+ <id>FAPI_NAME</id><default>pu.mcbist:k0:n0:s0:p01:c1</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
- <default>physical:sys-0/node-0/proc-1/mcs-1</default>
+ <default>physical:sys-0/node-0/proc-1/mcbist-1</default>
</attribute>
<attribute>
<id>MRU_ID</id>
@@ -6333,45 +6349,36 @@
</attribute>
<attribute>
<id>AFFINITY_PATH</id>
- <default>affinity:sys-0/node-0/proc-1/mcs-1</default>
+ <default>affinity:sys-0/node-0/proc-1/mcbist-1</default>
</attribute>
<attribute>
<id>ORDINAL_ID</id>
- <default>5</default>
+ <default>3</default>
</attribute>
<attribute>
<id>FAPI_POS</id>
- <default>5</default>
+ <default>3</default>
</attribute>
<attribute>
<id>PARENT_PERVASIVE</id>
- <default>physical:sys-0/node-0/proc-1/perv-7</default>
+ <default>physical:sys-0/node-0/proc-1/perv-8</default>
</attribute>
<attribute>
<id>CHIP_UNIT</id>
<default>1</default>
</attribute>
- <attribute><id>IBSCOM_MCS_BASE_ADDR</id>
- <!-- baseAddr = 0x0003E00000000000, 128GB per MCS -->
- <default>0x0003E12000000000</default>
- </attribute>
- <attribute>
- <id>EI_BUS_TX_MSBSWAP</id>
- <default>0</default>
- </attribute>
- <attribute><id>VPD_REC_NUM</id><default>0</default></attribute>
</targetInstance>
<targetInstance>
- <id>sys0node0proc1mcbist1mcs0</id>
- <type>unit-mcs-nimbus</type>
- <attribute><id>HUID</id><default>0x000B0006</default></attribute>
+ <id>sys0node0proc1mcbist0mcs0</id>
+ <type>unit-mcs-power9</type>
+ <attribute><id>HUID</id><default>0x000B0004</default></attribute>
<attribute>
- <id>FAPI_NAME</id><default>pu.mcs:k0:n0:s0:p01:c2</default>
+ <id>FAPI_NAME</id><default>pu.mcs:k0:n0:s0:p01:c0</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
- <default>physical:sys-0/node-0/proc-1/mcs-2</default>
+ <default>physical:sys-0/node-0/proc-1/mcs-0</default>
</attribute>
<attribute>
<id>MRU_ID</id>
@@ -6379,27 +6386,31 @@
</attribute>
<attribute>
<id>AFFINITY_PATH</id>
- <default>affinity:sys-0/node-0/proc-1/mcs-2</default>
+ <default>affinity:sys-0/node-0/proc-1/mcs-0</default>
</attribute>
<attribute>
<id>ORDINAL_ID</id>
- <default>6</default>
+ <default>4</default>
</attribute>
<attribute>
<id>FAPI_POS</id>
- <default>6</default>
+ <default>4</default>
+ </attribute>
+ <attribute>
+ <id>MEMVPD_POS</id>
+ <default>4</default>
</attribute>
<attribute>
<id>PARENT_PERVASIVE</id>
- <default>physical:sys-0/node-0/proc-1/perv-8</default>
+ <default>physical:sys-0/node-0/proc-1/perv-7</default>
</attribute>
<attribute>
<id>CHIP_UNIT</id>
- <default>2</default>
+ <default>0</default>
</attribute>
<attribute><id>IBSCOM_MCS_BASE_ADDR</id>
<!-- baseAddr = 0x0003E00000000000, 128GB per MCS -->
- <default>0x0003E14000000000</default>
+ <default>0x0003E10000000000</default>
</attribute>
<attribute>
<id>EI_BUS_TX_MSBSWAP</id>
@@ -6409,15 +6420,15 @@
</targetInstance>
<targetInstance>
- <id>sys0node0proc1mcbist1mcs1</id>
- <type>unit-mcs-nimbus</type>
- <attribute><id>HUID</id><default>0x000B0007</default></attribute>
+ <id>sys0node0proc1mcbist0mcs1</id>
+ <type>unit-mcs-power9</type>
+ <attribute><id>HUID</id><default>0x000B0005</default></attribute>
<attribute>
- <id>FAPI_NAME</id><default>pu.mcs:k0:n0:s0:p01:c3</default>
+ <id>FAPI_NAME</id><default>pu.mcs:k0:n0:s0:p01:c1</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
- <default>physical:sys-0/node-0/proc-1/mcs-3</default>
+ <default>physical:sys-0/node-0/proc-1/mcs-1</default>
</attribute>
<attribute>
<id>MRU_ID</id>
@@ -6425,27 +6436,31 @@
</attribute>
<attribute>
<id>AFFINITY_PATH</id>
- <default>affinity:sys-0/node-0/proc-1/mcs-3</default>
+ <default>affinity:sys-0/node-0/proc-1/mcs-1</default>
</attribute>
<attribute>
<id>ORDINAL_ID</id>
- <default>7</default>
+ <default>5</default>
</attribute>
<attribute>
<id>FAPI_POS</id>
- <default>7</default>
+ <default>5</default>
+ </attribute>
+ <attribute>
+ <id>MEMVPD_POS</id>
+ <default>5</default>
</attribute>
<attribute>
<id>PARENT_PERVASIVE</id>
- <default>physical:sys-0/node-0/proc-1/perv-8</default>
+ <default>physical:sys-0/node-0/proc-1/perv-7</default>
</attribute>
<attribute>
<id>CHIP_UNIT</id>
- <default>3</default>
+ <default>1</default>
</attribute>
<attribute><id>IBSCOM_MCS_BASE_ADDR</id>
<!-- baseAddr = 0x0003E00000000000, 128GB per MCS -->
- <default>0x0003E16000000000</default>
+ <default>0x0003E12000000000</default>
</attribute>
<attribute>
<id>EI_BUS_TX_MSBSWAP</id>
@@ -6455,15 +6470,15 @@
</targetInstance>
<targetInstance>
- <id>sys0node0proc1mcbist0</id>
- <type>unit-mcbist-power9</type>
- <attribute><id>HUID</id><default>0x00250002</default></attribute>
+ <id>sys0node0proc1mcbist1mcs0</id>
+ <type>unit-mcs-power9</type>
+ <attribute><id>HUID</id><default>0x000B0006</default></attribute>
<attribute>
- <id>FAPI_NAME</id><default>pu.mcbist:k0:n0:s0:p01:c0</default>
+ <id>FAPI_NAME</id><default>pu.mcs:k0:n0:s0:p01:c2</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
- <default>physical:sys-0/node-0/proc-1/mcbist-0</default>
+ <default>physical:sys-0/node-0/proc-1/mcs-2</default>
</attribute>
<attribute>
<id>MRU_ID</id>
@@ -6471,36 +6486,49 @@
</attribute>
<attribute>
<id>AFFINITY_PATH</id>
- <default>affinity:sys-0/node-0/proc-1/mcbist-0</default>
+ <default>affinity:sys-0/node-0/proc-1/mcs-2</default>
</attribute>
<attribute>
<id>ORDINAL_ID</id>
- <default>2</default>
+ <default>6</default>
</attribute>
<attribute>
<id>FAPI_POS</id>
- <default>2</default>
+ <default>6</default>
+ </attribute>
+ <attribute>
+ <id>MEMVPD_POS</id>
+ <default>6</default>
</attribute>
<attribute>
<id>PARENT_PERVASIVE</id>
- <default>physical:sys-0/node-0/proc-1/perv-7</default>
+ <default>physical:sys-0/node-0/proc-1/perv-8</default>
</attribute>
<attribute>
<id>CHIP_UNIT</id>
+ <default>2</default>
+ </attribute>
+ <attribute><id>IBSCOM_MCS_BASE_ADDR</id>
+ <!-- baseAddr = 0x0003E00000000000, 128GB per MCS -->
+ <default>0x0003E14000000000</default>
+ </attribute>
+ <attribute>
+ <id>EI_BUS_TX_MSBSWAP</id>
<default>0</default>
</attribute>
+ <attribute><id>VPD_REC_NUM</id><default>0</default></attribute>
</targetInstance>
<targetInstance>
- <id>sys0node0proc1mcbist1</id>
- <type>unit-mcbist-power9</type>
- <attribute><id>HUID</id><default>0x00250003</default></attribute>
+ <id>sys0node0proc1mcbist1mcs1</id>
+ <type>unit-mcs-power9</type>
+ <attribute><id>HUID</id><default>0x000B0007</default></attribute>
<attribute>
- <id>FAPI_NAME</id><default>pu.mcbist:k0:n0:s0:p01:c1</default>
+ <id>FAPI_NAME</id><default>pu.mcs:k0:n0:s0:p01:c3</default>
</attribute>
<attribute>
<id>PHYS_PATH</id>
- <default>physical:sys-0/node-0/proc-1/mcbist-1</default>
+ <default>physical:sys-0/node-0/proc-1/mcs-3</default>
</attribute>
<attribute>
<id>MRU_ID</id>
@@ -6508,15 +6536,19 @@
</attribute>
<attribute>
<id>AFFINITY_PATH</id>
- <default>affinity:sys-0/node-0/proc-1/mcbist-1</default>
+ <default>affinity:sys-0/node-0/proc-1/mcs-3</default>
</attribute>
<attribute>
<id>ORDINAL_ID</id>
- <default>3</default>
+ <default>7</default>
</attribute>
<attribute>
<id>FAPI_POS</id>
- <default>3</default>
+ <default>7</default>
+ </attribute>
+ <attribute>
+ <id>MEMVPD_POS</id>
+ <default>7</default>
</attribute>
<attribute>
<id>PARENT_PERVASIVE</id>
@@ -6524,8 +6556,17 @@
</attribute>
<attribute>
<id>CHIP_UNIT</id>
- <default>1</default>
+ <default>3</default>
+ </attribute>
+ <attribute><id>IBSCOM_MCS_BASE_ADDR</id>
+ <!-- baseAddr = 0x0003E00000000000, 128GB per MCS -->
+ <default>0x0003E16000000000</default>
</attribute>
+ <attribute>
+ <id>EI_BUS_TX_MSBSWAP</id>
+ <default>0</default>
+ </attribute>
+ <attribute><id>VPD_REC_NUM</id><default>0</default></attribute>
</targetInstance>
<targetInstance>
@@ -6640,7 +6681,7 @@
</targetInstance>
<targetInstance>
- <id>sys0node0proc1mcbist0mcs1mca0</id>
+ <id>sys0node0proc1mcbist0mcs1mca1</id>
<type>unit-mca-power9</type>
<attribute><id>HUID</id><default>0x0024000B</default></attribute>
<attribute>
diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml
index ada193c00..a24ea7710 100755
--- a/src/usr/targeting/common/xmltohb/target_types.xml
+++ b/src/usr/targeting/common/xmltohb/target_types.xml
@@ -580,6 +580,7 @@
</attribute>
<attribute><id>HB_HRMOR_NODAL_BASE</id></attribute>
<attribute><id>TPM_REQUIRED</id></attribute>
+ <attribute><id>MEMVPD_FREQS_MHZ</id></attribute>
<!-- Max/min config attributes -->
<attribute><id>MAX_PROC_CHIPS_PER_NODE</id></attribute>
<attribute><id>MAX_EXS_PER_PROC_CHIP</id></attribute>
@@ -1475,6 +1476,11 @@
<attribute><id>EFF_DRAM_TMAW</id></attribute>
<attribute><id>CDM_DOMAIN</id><default>MEM</default></attribute>
<attribute><id>VMEM_ID</id></attribute>
+ <attribute><id>MEMVPD_POS</id></attribute>
+ <attribute><id>VPD_OVERRIDE_MT</id></attribute>
+ <attribute><id>VPD_OVERRIDE_MT_ENABLE</id></attribute>
+ <attribute><id>VPD_OVERRIDE_MR</id></attribute>
+ <attribute><id>VPD_OVERRIDE_MR_ENABLE</id></attribute>
</targetType>
<targetType>
diff --git a/src/usr/vpd/dvpd.H b/src/usr/vpd/dvpd.H
index 8f0f3630b..bd3185956 100644
--- a/src/usr/vpd/dvpd.H
+++ b/src/usr/vpd/dvpd.H
@@ -69,14 +69,13 @@ namespace DVPD
// list, be sure that the keyword in each entry (value 0)
// are in ascending order.
// -------------------------------------------------------------------
- { VEIR, "VEIR" },
- { VER0, "VER0" }, //Not currently used, but keep support
- { MER0, "MER0" },
- { VSPD, "VSPD" },
{ VINI, "VINI" },
- { OPFR, "OPFR" },
- { VNDR, "VNDR" },
- { SPDX, "SPDX" },
+ { MEMD, "MEMD" },
+ { LXR0, "LXR0" },
+ { VCEN, "VCEN" },
+ { VMSC, "VMSC" },
+ { VRTN, "VRTN" },
+ { VSRC, "VSRC" },
// -------------------------------------------------------------------
// DO NOT USE!! This is for test purposes ONLY!
{ DVPD_TEST_RECORD, "TEST" },
@@ -95,73 +94,110 @@ namespace DVPD
// the list, be sure that the keyword in each entry (value 0)
// are in ascending order.
// -------------------------------------------------------------------
- { pdI, "#I" },
- { PF, "PF" },
- { MT, "MT" },
- { MR, "MR" },
- { pdA, "#A" },
- { EL, "EL" },
- { LM, "LM" },
- { MW, "MW" },
- { MV, "MV" },
- { AM, "AM" },
- { VZ, "VZ" },
- { pdD, "#D" },
- { MX, "MX" },
- { DW, "DW" },
- { PN, "PN" },
- { SN, "SN" },
- { DR, "DR" },
- { CE, "CE" },
- { FN, "FN" },
- { CC, "CC" },
- { HE, "HE" },
- { CT, "CT" },
- { HW, "HW" },
- { VD, "VD" },
- { VN, "VN" },
- { VP, "VP" },
- { VS, "VS" },
- { M0, "M0" },
- { M1, "M1" },
- { M2, "M2" },
- { M3, "M3" },
- { M4, "M4" },
- { M5, "M5" },
- { M6, "M6" },
- { M7, "M7" },
- { M8, "M8" },
- { T1, "T1" },
- { T2, "T2" },
- { T4, "T4" },
- { T5, "T5" },
- { T6, "T6" },
- { T8, "T8" },
- { Q0, "Q0" },
- { Q1, "Q1" },
- { Q2, "Q2" },
- { Q3, "Q3" },
- { Q4, "Q4" },
- { Q5, "Q5" },
- { Q6, "Q6" },
- { Q7, "Q7" },
- { Q8, "Q8" },
- { K0, "K0" },
- { K1, "K1" },
- { K2, "K2" },
- { K3, "K3" },
- { K4, "K4" },
- { K5, "K5" },
- { K6, "K6" },
- { K7, "K7" },
- { K8, "K8" },
- { MM, "MM" },
- { SS, "SS" },
- { ET, "ET" },
+ { B3, "B3" },
+ { B4, "B4" },
+ { B7, "B7" },
+ { CC, "CC" },
+ { CE, "CE" },
+ { CT, "CT" },
+ { DR, "DR" },
+ { FC, "FC" },
+ { FN, "FN" },
+ { HE, "HE" },
+ { HW, "HW" },
+ { I2, "I2" },
+ { IN, "IN" },
+ { J0, "J0" },
+ { J1, "J1" },
+ { J2, "J2" },
+ { J3, "J3" },
+ { J4, "J4" },
+ { J5, "J5" },
+ { J6, "J6" },
+ { J7, "J7" },
+ { J8, "J8" },
+ { J9, "J9" },
+ { JA, "JA" },
+ { JB, "JB" },
+ { JC, "JC" },
+ { JD, "JD" },
+ { JE, "JE" },
+ { JF, "JF" },
+ { JG, "JG" },
+ { JH, "JH" },
+ { JI, "JI" },
+ { JJ, "JJ" },
+ { JK, "JK" },
+ { JL, "JL" },
+ { JM, "JM" },
+ { JN, "JN" },
+ { JO, "JO" },
+ { JP, "JP" },
+ { JQ, "JQ" },
+ { JR, "JR" },
+ { JS, "JS" },
+ { JT, "JT" },
+ { JU, "JU" },
+ { JV, "JV" },
+ { JW, "JW" },
+ { JX, "JX" },
+ { JY, "JY" },
+ { JZ, "JZ" },
+ { LX, "LX" },
+ { MR, "MR" },
+ { MT, "MT" },
+ { PF, "PF" },
+ { PN, "PN" },
+ { PR, "PR" },
+ { RB, "RB" },
+ { RG, "RG" },
+ { RT, "RT" },
+ { SE, "SE" },
+ { SN, "SN" },
+ { SO, "SO" },
+ { TM, "TM" },
+ { VM, "VM" },
+ { VZ, "VZ" },
+ { X0, "X0" },
+ { X1, "X1" },
+ { X2, "X2" },
+ { X3, "X3" },
+ { X4, "X4" },
+ { X5, "X5" },
+ { X6, "X6" },
+ { X7, "X7" },
+ { X8, "X8" },
+ { X9, "X9" },
+ { XA, "XA" },
+ { XB, "XB" },
+ { XC, "XC" },
+ { XD, "XD" },
+ { XE, "XE" },
+ { XF, "XF" },
+ { XG, "XG" },
+ { XH, "XH" },
+ { XI, "XI" },
+ { XJ, "XJ" },
+ { XK, "XK" },
+ { XL, "XL" },
+ { XM, "XM" },
+ { XN, "XN" },
+ { XO, "XO" },
+ { XP, "XP" },
+ { XQ, "XQ" },
+ { XR, "XR" },
+ { XS, "XS" },
+ { XT, "XT" },
+ { XU, "XU" },
+ { XV, "XV" },
+ { XW, "XW" },
+ { XX, "XX" },
+ { XY, "XY" },
+ { XZ, "XZ" },
// -------------------------------------------------------------------
// DO NOT USE!! This is for test purposes ONLY!
- { DVPD_TEST_KEYWORD, "XX" },
+ { DVPD_TEST_KEYWORD, "ZZ" },
// -------------------------------------------------------------------
//Common ipvpd
diff --git a/src/usr/vpd/makefile b/src/usr/vpd/makefile
index 24d9e51c0..3a34df282 100644
--- a/src/usr/vpd/makefile
+++ b/src/usr/vpd/makefile
@@ -49,6 +49,6 @@ BINARY_FILES += $(IMGDIR)/vpo_sysmvpd.dat:b3b907c2e80b68ffe96e924b9cb0db6735fe45
BINARY_FILES += $(IMGDIR)/cvpd.dat:2e33352ca95279b992927336567adf960dca7d46
#Direct memory vpd
-BINARY_FILES += $(IMGDIR)/dvpd.dat:2e33352ca95279b992927336567adf960dca7d46
+BINARY_FILES += $(IMGDIR)/dvpd.dat:be4cd7ff59c75151920d17c636612d27caf991b6
include ${ROOTPATH}/config.mk
diff --git a/src/usr/vpd/test/dvpdtest.H b/src/usr/vpd/test/dvpdtest.H
index c192d326c..30daedafa 100755
--- a/src/usr/vpd/test/dvpdtest.H
+++ b/src/usr/vpd/test/dvpdtest.H
@@ -47,6 +47,9 @@ extern trace_desc_t* g_trac_vpd;
using namespace TARGETING;
+//Use this keyword for general testing where just some keyword is needed.
+constexpr uint64_t TSTKEYWD = DVPD::J4;
+
/**
* @brief Structure to define record/keyword pairs for DVPD tests.
*/
@@ -61,20 +64,8 @@ struct dvpdTestData
*/
dvpdTestData dvpdData[] =
{
- { DVPD::VEIR, DVPD::pdI },
- { DVPD::MER0, DVPD::pdI },
- { DVPD::VSPD, DVPD::pdI },
- { DVPD::VSPD, DVPD::MT },
- { DVPD::VSPD, DVPD::MR },
- { DVPD::VSPD, DVPD::pdA },
- { DVPD::VSPD, DVPD::EL },
- { DVPD::VSPD, DVPD::LM },
- { DVPD::VSPD, DVPD::MW },
- { DVPD::VSPD, DVPD::MV },
- { DVPD::VSPD, DVPD::AM },
- { DVPD::VINI, DVPD::VZ },
- { DVPD::VSPD, DVPD::MX },
-
+ { DVPD::MEMD, DVPD::MR },
+ { DVPD::MEMD, DVPD::MT },
};
TARGETING::Target* getFunctionalMcsTarget()
@@ -239,13 +230,13 @@ class DVPDTest: public CxxTest::TestSuite
err = deviceRead( theTarget,
testData,
theSize,
- DEVICE_DVPD_ADDRESS(DVPD::VEIR,DVPD::pdI) );
+ DEVICE_DVPD_ADDRESS(DVPD::MEMD,TSTKEYWD) );
if( err )
{
fails++;
TRACFCOMP( g_trac_vpd,
ERR_MRK"testDvpdWrite() - "
- "failure getting size of VEIR/#I, RC=%.4X",
+ "failure getting size of MEMD/J4, RC=%.4X",
err->reasonCode() );
TS_FAIL( "testDvpdWrite() - Failure calling deviceRead!" );
errlCommit( err,
@@ -259,13 +250,13 @@ class DVPDTest: public CxxTest::TestSuite
err = deviceRead( theTarget,
origData,
theSize,
- DEVICE_DVPD_ADDRESS(DVPD::VEIR,DVPD::pdI) );
+ DEVICE_DVPD_ADDRESS(DVPD::MEMD,TSTKEYWD) );
if( err )
{
fails++;
TRACFCOMP( g_trac_vpd,
ERR_MRK"testDvpdWrite() - "
- "failure reading VEIR/#I, RC=%.4X",
+ "failure reading MEMD/J4, RC=%.4X",
err->reasonCode() );
TS_FAIL( "testDvpdWrite() - Failure calling deviceRead!" );
errlCommit( err,
@@ -287,13 +278,13 @@ class DVPDTest: public CxxTest::TestSuite
err = deviceWrite( theTarget,
testData,
theSize,
- DEVICE_DVPD_ADDRESS(DVPD::VEIR,DVPD::pdI) );
+ DEVICE_DVPD_ADDRESS(DVPD::MEMD,TSTKEYWD) );
if( err )
{
fails++;
TRACFCOMP( g_trac_vpd,
ERR_MRK"testDvpdWrite() - "
- "failure writing VEIR/#I, RC=%.4X",
+ "failure writing MEMD/J4, RC=%.4X",
err->reasonCode() );
TS_FAIL( "testDvpdWrite() - Failure calling deviceWrite!" );
errlCommit( err,
@@ -307,13 +298,13 @@ class DVPDTest: public CxxTest::TestSuite
err = deviceRead( theTarget,
verifyData,
theSize,
- DEVICE_DVPD_ADDRESS(DVPD::VEIR,DVPD::pdI) );
+ DEVICE_DVPD_ADDRESS(DVPD::MEMD,TSTKEYWD) );
if( err )
{
fails++;
TRACFCOMP( g_trac_vpd,
ERR_MRK"testDvpdWrite() - "
- "failure reading VEIR/#I to verify, RC=%.4X",
+ "failure reading MEMD/J4 to verify, RC=%.4X",
err->reasonCode() );
TS_FAIL( "testDvpdWrite() - Failure calling deviceRead!" );
errlCommit( err,
@@ -339,13 +330,13 @@ class DVPDTest: public CxxTest::TestSuite
err = deviceWrite( theTarget,
origData,
theSize,
- DEVICE_DVPD_ADDRESS(DVPD::VEIR,DVPD::pdI) );
+ DEVICE_DVPD_ADDRESS(DVPD::MEMD,TSTKEYWD) );
if( err )
{
fails++;
TRACFCOMP( g_trac_vpd,
ERR_MRK"testDvpdWrite() - "
- "failure writing original data back into VEIR/#I, RC=%.4X",
+ "failure writing original data back into MEMD/J4, RC=%.4X",
err->reasonCode() );
TS_FAIL( "testDvpdWrite() - Failure calling deviceRead!" );
errlCommit( err,
@@ -416,7 +407,7 @@ class DVPDTest: public CxxTest::TestSuite
theData,
theSize,
DEVICE_DVPD_ADDRESS( DVPD::DVPD_LAST_RECORD,
- DVPD::pdI ) );
+ TSTKEYWD ) );
if( NULL == err )
{
@@ -474,7 +465,7 @@ class DVPDTest: public CxxTest::TestSuite
theData,
theSize,
DEVICE_DVPD_ADDRESS( DVPD::DVPD_TEST_RECORD,
- DVPD::pdI ) );
+ TSTKEYWD ) );
if( NULL == err )
{
@@ -493,7 +484,6 @@ class DVPDTest: public CxxTest::TestSuite
theData = NULL;
}
} while( 0 );
-
TRACFCOMP( g_trac_vpd,
"testDvpdMissingRecord - %d/%d fails",
fails, cmds );
@@ -568,7 +558,6 @@ class DVPDTest: public CxxTest::TestSuite
TRACFCOMP( g_trac_vpd,
ENTER_MRK"testDvpdInvalidKeyword()" );
-
do
{
TARGETING::Target * theTarget = getFunctionalMcsTarget();
@@ -585,7 +574,7 @@ class DVPDTest: public CxxTest::TestSuite
err = deviceRead(theTarget,
theData,
theSize,
- DEVICE_DVPD_ADDRESS(DVPD::VEIR,
+ DEVICE_DVPD_ADDRESS(DVPD::MEMD,
DVPD::DVPD_LAST_KEYWORD));
if( NULL == err )
@@ -621,7 +610,7 @@ class DVPDTest: public CxxTest::TestSuite
*/
void testDvpdInvalidBufferSize ( void )
{
- errlHndl_t err = NULL;
+ errlHndl_t err = NULL;
uint64_t cmds = 0x0;
uint64_t fails = 0x0;
@@ -644,8 +633,8 @@ class DVPDTest: public CxxTest::TestSuite
err = deviceRead( theTarget,
theData,
theSize,
- DEVICE_DVPD_ADDRESS( DVPD::VEIR,
- DVPD::pdI ) );
+ DEVICE_DVPD_ADDRESS( DVPD::MEMD,
+ TSTKEYWD ) );
if( NULL == err )
{
OpenPOWER on IntegriCloud