summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDean Sanner <dsanner@us.ibm.com>2017-12-20 14:29:14 -0600
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2018-01-10 10:54:24 -0500
commit6407898fc569eb63527c6960dbb0ed9e1ebb0212 (patch)
tree397668e5c9a60ee20b624123392fe83569bda71e /src
parent4592e5a256c41eece80e55907535a76d07b36572 (diff)
downloadblackbird-hostboot-6407898fc569eb63527c6960dbb0ed9e1ebb0212.tar.gz
blackbird-hostboot-6407898fc569eb63527c6960dbb0ed9e1ebb0212.zip
Connect CDIMM power/slope ATTR with VPD accessor function
Change-Id: I7bd048fb17d8041ae97054f6aa30e9dd94c6eaf5 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/51212 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: Martin Gloff <mgloff@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.H95
-rw-r--r--src/usr/fapi2/attribute_service.C67
2 files changed, 160 insertions, 2 deletions
diff --git a/src/include/usr/fapi2/attribute_service.H b/src/include/usr/fapi2/attribute_service.H
index dfdd23803..eb1a1e9ed 100644
--- a/src/include/usr/fapi2/attribute_service.H
+++ b/src/include/usr/fapi2/attribute_service.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -438,6 +438,18 @@ ReturnCode getPllBucket(const Target<TARGET_TYPE_ALL>& i_fapiTarget,
uint8_t &o_bucket_val,
const uint8_t i_index);
+/// @brief This function is called by the FAPI_ATTR_GET macro when getting
+// the CEN_CDIMM_VPD_* attributes. It should not be called directly.
+//
+// @param[in] i_fapiTarget The target for the attribute operation.
+// @param[in] i_attr Which ATTR extracting from VPD
+// @param[out] o_val The retrieved attribute value.
+// @return ReturnCode Zero on success, else platform specified error.
+ReturnCode platGetMBvpdSlopeInterceptData(
+ const Target<TARGET_TYPE_ALL>& i_fapiTarget,
+ const uint32_t i_attr,
+ uint32_t& o_val);
+
// -----------------------------------------------------------------------------
// End TODO: End to be supported functions
// -----------------------------------------------------------------------------
@@ -1455,5 +1467,86 @@ fapiToTargeting::ID, sizeof(VAL), &(VAL))
fapi2::platAttrSvc::\
platGetMBvpdAttr<fapi2::ATTR_CEN_VPD_MT_DATA_CONTROL_BYTE_Type>(ID, TARGET, VAL)
+//----------------------------------------------------------------------------
+// MACRO to route ATTR_CEN_CDIMM_VPD_MASTER_POWER_INTERCEPT access to the correct
+// HB function
+//----------------------------------------------------------------------------
+#define ATTR_CEN_CDIMM_VPD_MASTER_POWER_INTERCEPT_GETMACRO(ID, TARGET, VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::\
+ platGetMBvpdSlopeInterceptData(TARGET, ID, VAL)
+
+//----------------------------------------------------------------------------
+// MACRO to route ATTR_CEN_CDIMM_VPD_MASTER_POWER_SLOPE access to the correct
+// HB function
+//----------------------------------------------------------------------------
+#define ATTR_CEN_CDIMM_VPD_MASTER_POWER_SLOPE_GETMACRO(ID, TARGET, VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::\
+ platGetMBvpdSlopeInterceptData(TARGET, ID, VAL)
+
+//----------------------------------------------------------------------------
+// MACRO to route ATTR_CEN_CDIMM_VPD_MASTER_TOTAL_POWER_INTERCEPT access to
+// the correct HB function
+//----------------------------------------------------------------------------
+#define ATTR_CEN_CDIMM_VPD_MASTER_TOTAL_POWER_INTERCEPT_GETMACRO(ID, TARGET, VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::\
+ platGetMBvpdSlopeInterceptData(TARGET, ID, VAL)
+
+//----------------------------------------------------------------------------
+// MACRO to route ATTR_CEN_CDIMM_VPD_MASTER_TOTAL_POWER_SLOPE access to
+// the correct HB function
+//----------------------------------------------------------------------------
+#define ATTR_CEN_CDIMM_VPD_MASTER_TOTAL_POWER_SLOPE_GETMACRO(ID, TARGET, VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::\
+ platGetMBvpdSlopeInterceptData(TARGET, ID, VAL)
+
+//----------------------------------------------------------------------------
+// MACRO to route ATTR_CEN_CDIMM_VPD_SUPPLIER_POWER_INTERCEPT access to the correct
+// HB function
+//----------------------------------------------------------------------------
+#define ATTR_CEN_CDIMM_VPD_SUPPLIER_POWER_INTERCEPT_GETMACRO(ID, TARGET, VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::\
+ platGetMBvpdSlopeInterceptData(TARGET, ID, VAL)
+
+//----------------------------------------------------------------------------
+// MACRO to route ATTR_CEN_CDIMM_VPD_SUPPLIER_POWER_SLOPE access to the correct
+// HB function
+//----------------------------------------------------------------------------
+#define ATTR_CEN_CDIMM_VPD_SUPPLIER_POWER_SLOPE_GETMACRO(ID, TARGET, VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::\
+ platGetMBvpdSlopeInterceptData(TARGET, ID, VAL)
+
+//----------------------------------------------------------------------------
+// MACRO to route ATTR_CEN_CDIMM_VPD_SUPPLIER_TOTAL_POWER_INTERCEPT access to
+// the correct HB function
+//----------------------------------------------------------------------------
+#define ATTR_CEN_CDIMM_VPD_SUPPLIER_TOTAL_POWER_INTERCEPT_GETMACRO(ID, TARGET, VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::\
+ platGetMBvpdSlopeInterceptData(TARGET, ID, VAL)
+
+//----------------------------------------------------------------------------
+// MACRO to route ATTR_CEN_CDIMM_VPD_SUPPLIER_TOTAL_POWER_SLOPE access to
+// the correct HB function
+//----------------------------------------------------------------------------
+#define ATTR_CEN_CDIMM_VPD_SUPPLIER_TOTAL_POWER_SLOPE_GETMACRO(ID, TARGET, VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::\
+ platGetMBvpdSlopeInterceptData(TARGET, ID, VAL)
+
+
#endif // ATTRIBUTESERVICE_H_
diff --git a/src/usr/fapi2/attribute_service.C b/src/usr/fapi2/attribute_service.C
index 4a2cb2500..1a1a62b31 100644
--- a/src/usr/fapi2/attribute_service.C
+++ b/src/usr/fapi2/attribute_service.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -73,6 +73,7 @@
#include<vpd_accessors/getMBvpdDram2NModeEnabled.H>
#include<vpd_accessors/getMBvpdMemoryDataVersion.H>
#include<vpd_accessors/getMBvpdSPDXRecordVersion.H>
+#include<vpd_accessors/getMBvpdSlopeInterceptData.H>
#include<vpd_accessors/getMBvpdSensorMap.H>
#include<vpd_accessors/getMBvpdSpareDramData.H>
#include<vpd_accessors/getMBvpdVersion.H>
@@ -1822,6 +1823,70 @@ ReturnCode getPllBucket(const Target<TARGET_TYPE_ALL>& i_fapiTarget,
return l_rc;
}
+//-----------------------------------------------------------------------------
+ReturnCode platGetMBvpdSlopeInterceptData(
+ const Target<TARGET_TYPE_ALL>& i_fapiTarget,
+ const uint32_t i_attr,
+ uint32_t& o_val)
+{
+ 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("platGetMBvpdSPDXRecordVersion: "
+ "Error from getTargetingTarget");
+ rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl));
+ }
+ else
+ {
+ MBvpdSlopeIntercept l_val;
+
+ switch (i_attr)
+ {
+ case ATTR_CEN_CDIMM_VPD_MASTER_POWER_INTERCEPT:
+ l_val = MASTER_POWER_INTERCEPT;
+ break;
+ case ATTR_CEN_CDIMM_VPD_MASTER_POWER_SLOPE:
+ l_val = MASTER_POWER_SLOPE;
+ break;
+ case ATTR_CEN_CDIMM_VPD_MASTER_TOTAL_POWER_INTERCEPT:
+ l_val = MASTER_TOTAL_POWER_INTERCEPT;
+ break;
+ case ATTR_CEN_CDIMM_VPD_MASTER_TOTAL_POWER_SLOPE:
+ l_val = MASTER_TOTAL_POWER_INTERCEPT;
+ break;
+ case ATTR_CEN_CDIMM_VPD_SUPPLIER_POWER_INTERCEPT:
+ l_val = SUPPLIER_POWER_INTERCEPT;
+ break;
+ case ATTR_CEN_CDIMM_VPD_SUPPLIER_POWER_SLOPE:
+ l_val = SUPPLIER_POWER_SLOPE;
+ break;
+ case ATTR_CEN_CDIMM_VPD_SUPPLIER_TOTAL_POWER_INTERCEPT:
+ l_val = SUPPLIER_TOTAL_POWER_INTERCEPT;
+ break;
+ case ATTR_CEN_CDIMM_VPD_SUPPLIER_TOTAL_POWER_SLOPE:
+ l_val = SUPPLIER_TOTAL_POWER_SLOPE;
+ break;
+ default:
+ l_val = MASTER_POWER_INTERCEPT;
+ }
+
+ fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP> l_fapiTarget(l_pTarget);
+ rc = getMBvpdSlopeInterceptData(l_fapiTarget, l_val, o_val);
+ }
+
+ return rc;
+}
+
+
} // End platAttrSvc namespace
} // End fapi2 namespace
OpenPOWER on IntegriCloud