diff options
author | Dean Sanner <dsanner@us.ibm.com> | 2017-12-20 14:29:14 -0600 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2018-01-10 10:54:24 -0500 |
commit | 6407898fc569eb63527c6960dbb0ed9e1ebb0212 (patch) | |
tree | 397668e5c9a60ee20b624123392fe83569bda71e /src/usr/fapi2 | |
parent | 4592e5a256c41eece80e55907535a76d07b36572 (diff) | |
download | talos-hostboot-6407898fc569eb63527c6960dbb0ed9e1ebb0212.tar.gz talos-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/usr/fapi2')
-rw-r--r-- | src/usr/fapi2/attribute_service.C | 67 |
1 files changed, 66 insertions, 1 deletions
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 |