summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPrachi Gupta <pragupta@us.ibm.com>2018-03-20 16:01:35 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2018-03-21 16:24:52 -0400
commit3f639460a8f1b85cdc22539675b8e2e6bae4981e (patch)
tree5628b8b382b827f562b3383b701ee8f18548b2e6 /src
parent7ce93122ca1e7a9eeebd88225b7e0c65c0e2a4df (diff)
downloadtalos-hostboot-3f639460a8f1b85cdc22539675b8e2e6bae4981e.tar.gz
talos-hostboot-3f639460a8f1b85cdc22539675b8e2e6bae4981e.zip
ATTR_CEN_VPD_DRAM_ADDRESS_MIRRORING: add function backed to this attribute
Change-Id: I95814e68937e82e9ba7ab1ce7a9dc2baca804532 CQ: SW415651 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56109 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Elizabeth K. Liner <eliner@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@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: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/fapi2/attribute_service.H20
-rw-r--r--src/usr/fapi2/attribute_service.C32
2 files changed, 52 insertions, 0 deletions
diff --git a/src/include/usr/fapi2/attribute_service.H b/src/include/usr/fapi2/attribute_service.H
index eb1a1e9ed..d331d9637 100644
--- a/src/include/usr/fapi2/attribute_service.H
+++ b/src/include/usr/fapi2/attribute_service.H
@@ -329,6 +329,17 @@ ReturnCode platGetDQSAttrISDIMM(
);
/// @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.
+// @param[out] o_dramAddressMirroring The retrieved attribute value.
+// @return ReturnCode Zero on success, else platform specified error.
+ReturnCode platGetMBvpdDramAddressMirroring(
+ const Target<TARGET_TYPE_ALL>& i_fapiTarget,
+ ATTR_CEN_VPD_DRAM_ADDRESS_MIRRORING_Type& o_dramAddressMirroring
+ );
+
+/// @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_fapiTarget The target for the attribute operation.
@@ -610,6 +621,15 @@ fapiToTargeting::ID, sizeof(VAL), &(VAL))
fapi2::platAttrSvc::platGetDQSAttrISDIMM(TARGET, VAL)
//-----------------------------------------------------------------------------
+// MACRO to route ATTR_CEN_VPD_DRAM_ADDRESS_MIRRORING access to the correct
+// HB function
+//-----------------------------------------------------------------------------
+#define ATTR_CEN_VPD_DRAM_ADDRESS_MIRRORING_GETMACRO(ID, TARGET, VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::platGetMBvpdDramAddressMirroring(TARGET, VAL)
+
+//-----------------------------------------------------------------------------
// MACRO to route ATTR_CEN_VPD_DRAM_2N_MODE_ENABLED access to the correct
// HB function
//-----------------------------------------------------------------------------
diff --git a/src/usr/fapi2/attribute_service.C b/src/usr/fapi2/attribute_service.C
index dfcaff74a..fa3de0bf7 100644
--- a/src/usr/fapi2/attribute_service.C
+++ b/src/usr/fapi2/attribute_service.C
@@ -71,6 +71,7 @@
#include<vpd_accessors/getDQAttrISDIMM.H>
#include<vpd_accessors/getDQSAttrISDIMM.H>
#include<vpd_accessors/getISDIMMTOC4DAttrs.H>
+#include<vpd_accessors/getMBvpdAddrMirrorData.H>
#include<vpd_accessors/getMBvpdDram2NModeEnabled.H>
#include<vpd_accessors/getMBvpdMemoryDataVersion.H>
#include<vpd_accessors/getMBvpdSPDXRecordVersion.H>
@@ -1692,6 +1693,37 @@ ReturnCode platGetDQSAttrISDIMM(
}
//-----------------------------------------------------------------------------
+ReturnCode platGetMBvpdDramAddressMirroring(
+ const Target<TARGET_TYPE_ALL>& i_fapiTarget,
+ ATTR_CEN_VPD_DRAM_ADDRESS_MIRRORING_Type& o_dramAddressMirroring
+ )
+{
+ 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("platGetMBvpdDramAddressMirroring: "
+ "Error from getTargetingTarget");
+ rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl));
+ }
+ else
+ {
+ fapi2::Target<fapi2::TARGET_TYPE_MBA> l_fapiTarget(l_pTarget);
+ rc = getMBvpdAddrMirrorData(l_fapiTarget, o_dramAddressMirroring);
+ }
+
+ return rc;
+}
+
+//-----------------------------------------------------------------------------
ReturnCode platGetMBvpdDram2NModeEnabled(
const Target<TARGET_TYPE_ALL>& i_fapiTarget,
ATTR_CEN_VPD_DRAM_2N_MODE_ENABLED_Type& o_dram2NModeEnabled
OpenPOWER on IntegriCloud