summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSwathi Madhuri Bhattiprolu <bhmadhur@in.ibm.com>2018-06-13 10:26:07 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-06-15 21:22:44 -0400
commite3163f375ff88fba19e66f591d780a5c33cfbc20 (patch)
tree5aecee20fe5ec17ec4f9b6625ee7245bae5cab54
parent7cc8294252577238eb99bad42c3bc7dd92f4794d (diff)
downloadtalos-hostboot-e3163f375ff88fba19e66f591d780a5c33cfbc20.tar.gz
talos-hostboot-e3163f375ff88fba19e66f591d780a5c33cfbc20.zip
Implement the VPD backend for these attributes
- ATTR_CEN_VPD_CDIMM_SENSOR_MAP_PRIMARY - ATTR_CEN_VPD_CDIMM_SENSOR_MAP_SECONDARY Change-Id: Idb20b53f1fe9d5a8fbdbef608fb3ab3faa64330b CQ:SW422858 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60473 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Reviewed-by: Roland Veloz <rveloz@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r--src/include/usr/fapi2/attribute_service.H41
-rw-r--r--src/usr/fapi2/attribute_service.C62
-rwxr-xr-xsrc/usr/fapi2/fapi2.mk1
3 files changed, 104 insertions, 0 deletions
diff --git a/src/include/usr/fapi2/attribute_service.H b/src/include/usr/fapi2/attribute_service.H
index 88988195e..cb54534c3 100644
--- a/src/include/usr/fapi2/attribute_service.H
+++ b/src/include/usr/fapi2/attribute_service.H
@@ -351,6 +351,29 @@ ReturnCode platGetDQSAttrISDIMM(
);
/// @brief This function is called by the FAPI_ATTR_GET macro when getting
+// the CEN_VPD_CDIMM_SENSOR_MAP_PRIMARY attribute. It should not be called directly.
+//
+// @param[in] i_fapiTarget The target for the attribute operation.
+// @param[out] o_SensorMapType The retrieved attribute value.
+// @return ReturnCode Zero on success, else platform specified error.
+ReturnCode platGetMBvpdSensorMapPrimary(
+ const Target<TARGET_TYPE_ALL>& i_fapiTarget,
+ ATTR_CEN_VPD_CDIMM_SENSOR_MAP_PRIMARY_Type& o_SensorMapType
+ );
+
+/// @brief This function is called by the FAPI_ATTR_GET macro when getting
+// the CEN_VPD_CDIMM_SENSOR_MAP_SECONDARY attribute. It should not be called directly.
+//
+// @param[in] i_fapiTarget The target for the attribute operation.
+// @param[out] o_SensorMapType The retrieved attribute value.
+// @return ReturnCode Zero on success, else platform specified error.
+ReturnCode platGetMBvpdSensorMapSecondary(
+ const Target<TARGET_TYPE_ALL>& i_fapiTarget,
+ ATTR_CEN_VPD_CDIMM_SENSOR_MAP_SECONDARY_Type& o_SensorMapType
+ );
+
+
+/// @brief This function is called by the FAPI_ATTR_GET macro when getting
// the CEN_VPD_DRAM_ADDRESS_MIRRORING attribute. It should not be called directly.
//
// @param[in] i_fapiTarget The target for the attribute operation.
@@ -675,6 +698,24 @@ fapiToTargeting::ID, sizeof(VAL), &(VAL))
fapi2::platAttrSvc::platGetDQSAttrISDIMM(TARGET, VAL)
//-----------------------------------------------------------------------------
+// MACRO to route ATTR_CEN_VPD_CDIMM_SENSOR_MAP_PRIMARY_GETMACRO access to the
+// correct HB function
+//-----------------------------------------------------------------------------
+#define ATTR_CEN_VPD_CDIMM_SENSOR_MAP_PRIMARY_GETMACRO(ID, TARGET, VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::platGetMBvpdSensorMapPrimary(TARGET, VAL)
+
+//-----------------------------------------------------------------------------
+// MACRO to route ATTR_CEN_VPD_CDIMM_SENSOR_MAP_SECONDARY_GETMACRO access to the
+// correct HB function
+//-----------------------------------------------------------------------------
+#define ATTR_CEN_VPD_CDIMM_SENSOR_MAP_SECONDARY_GETMACRO(ID, TARGET, VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::platGetMBvpdSensorMapSecondary(TARGET, VAL)
+
+//-----------------------------------------------------------------------------
// MACRO to route ATTR_CEN_VPD_DRAM_ADDRESS_MIRRORING access to the correct
// HB function
//-----------------------------------------------------------------------------
diff --git a/src/usr/fapi2/attribute_service.C b/src/usr/fapi2/attribute_service.C
index bc67647ad..264e8d2ea 100644
--- a/src/usr/fapi2/attribute_service.C
+++ b/src/usr/fapi2/attribute_service.C
@@ -1934,6 +1934,68 @@ ReturnCode platGetDQSAttrISDIMM(
}
//-----------------------------------------------------------------------------
+ReturnCode platGetMBvpdSensorMapPrimary(
+ const Target<TARGET_TYPE_ALL>& i_fapiTarget,
+ ATTR_CEN_VPD_CDIMM_SENSOR_MAP_PRIMARY_Type& o_SensorMapType
+ )
+{
+ ReturnCode rc;
+
+ // Don't need to check the type here, the FAPI_ATTR_GET macro clause
+ // "fapi2::Target<ID##_TargetType>(TARGET)" does it for us. However,
+ // to enable a streamlined dump of the attributes, all plat code must use
+ // the generic TARGET_TYPE_ALL -- so convert back to the correct type
+ // manually
+ TARGETING::Target * l_pTarget = NULL;
+ errlHndl_t l_errl = getTargetingTarget(i_fapiTarget, l_pTarget);
+
+ if (l_errl)
+ {
+ FAPI_ERR("platGetMBvpdSensorMapPrimary: "
+ "Error from getTargetingTarget");
+ rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl));
+ }
+ else
+ {
+ fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP> l_fapiTarget(l_pTarget);
+ rc = getMBvpdSensorMap(l_fapiTarget, fapi2::SENSOR_MAP_PRIMARY, o_SensorMapType);
+ }
+
+ return rc;
+}
+
+//-----------------------------------------------------------------------------
+ReturnCode platGetMBvpdSensorMapSecondary(
+ const Target<TARGET_TYPE_ALL>& i_fapiTarget,
+ ATTR_CEN_VPD_CDIMM_SENSOR_MAP_SECONDARY_Type& o_SensorMapType
+ )
+{
+ ReturnCode rc;
+
+ // Don't need to check the type here, the FAPI_ATTR_GET macro clause
+ // "fapi2::Target<ID##_TargetType>(TARGET)" does it for us. However,
+ // to enable a streamlined dump of the attributes, all plat code must use
+ // the generic TARGET_TYPE_ALL -- so convert back to the correct type
+ // manually
+ TARGETING::Target * l_pTarget = NULL;
+ errlHndl_t l_errl = getTargetingTarget(i_fapiTarget, l_pTarget);
+
+ if (l_errl)
+ {
+ FAPI_ERR("platGetMBvpdSensorMapSecondary: "
+ "Error from getTargetingTarget");
+ rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl));
+ }
+ else
+ {
+ fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP> l_fapiTarget(l_pTarget);
+ rc = getMBvpdSensorMap(l_fapiTarget, fapi2::SENSOR_MAP_SECONDARY, o_SensorMapType);
+ }
+
+ return rc;
+}
+
+//-----------------------------------------------------------------------------
ReturnCode platGetMBvpdDramAddressMirroring(
const Target<TARGET_TYPE_ALL>& i_fapiTarget,
ATTR_CEN_VPD_DRAM_ADDRESS_MIRRORING_Type& o_dramAddressMirroring
diff --git a/src/usr/fapi2/fapi2.mk b/src/usr/fapi2/fapi2.mk
index 9417f9603..283b37b72 100755
--- a/src/usr/fapi2/fapi2.mk
+++ b/src/usr/fapi2/fapi2.mk
@@ -174,6 +174,7 @@ include ${CENTAUR_VPD_PATH}/getDecompressedISDIMMAttrs.mk
include ${CENTAUR_VPD_PATH}/getISDIMMTOC4DAttrs.mk
include ${CENTAUR_VPD_PATH}/getDQAttrISDIMM.mk
include ${CENTAUR_VPD_PATH}/getDQSAttrISDIMM.mk
+include ${CENTAUR_VPD_PATH}/getMBvpdSensorMap.mk
include ${CENTAUR_VPD_PATH}/getMBvpdAddrMirrorData.mk
include ${CENTAUR_VPD_PATH}/getMBvpdAttr.mk
include ${CENTAUR_VPD_PATH}/getMBvpdDram2NModeEnabled.mk
OpenPOWER on IntegriCloud