diff options
author | Corey Swenson <cswenson@us.ibm.com> | 2018-02-05 17:09:52 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-03-27 13:19:16 -0400 |
commit | 579e63b60e50df4cbef126c306e1aa742d2c9f09 (patch) | |
tree | f467a15b40c193cbecf6afeeb247562fcf5533db /src | |
parent | 8a783ea89563b0e452caab5c5900add8cc99e358 (diff) | |
download | talos-hostboot-579e63b60e50df4cbef126c306e1aa742d2c9f09.tar.gz talos-hostboot-579e63b60e50df4cbef126c306e1aa742d2c9f09.zip |
Add support for ATTR_FREQ_MCA_MHZ
When accessing the attribute, return value for ATTR_FREQ_PB_MHZ.
Change-Id: I41a2f39582d76b3ea949d8998300b64c7622a671
RTC:179826
CMVC-Prereq: 1049714
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53408
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: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/usr/fapi2/attribute_service.H | 33 | ||||
-rw-r--r-- | src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H | 2 | ||||
-rw-r--r-- | src/usr/fapi2/attribute_service.C | 67 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/simics_CUMULUS.system.xml | 4 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/simics_CUMULUS_CDIMM.system.xml | 4 |
5 files changed, 102 insertions, 8 deletions
diff --git a/src/include/usr/fapi2/attribute_service.H b/src/include/usr/fapi2/attribute_service.H index d331d9637..e02053024 100644 --- a/src/include/usr/fapi2/attribute_service.H +++ b/src/include/usr/fapi2/attribute_service.H @@ -461,6 +461,22 @@ ReturnCode platGetMBvpdSlopeInterceptData( const uint32_t i_attr, uint32_t& o_val); +/// @brief This function is called by the FAPI_ATTR_GET macro when getting +// ATTR_FREQ_MCA_MHZ +// @param[in] i_fapiTarget FAPI2 Target pointer +// @param[out] o_val PB frequency from ATTR_FREQ_PB_MHZ +// @return ReturnCode Zero on success, else platform specified error. +ReturnCode platGetFreqMcaMhz(const Target<TARGET_TYPE_ALL>& i_fapiTarget, + uint32_t& o_val); + +/// @brief This function is called by the FAPI_ATTR_SET macro when getting +// ATTR_FREQ_MCA_MHZ +// @param[in] i_fapiTarget FAPI2 Target pointer +// @param[in] i_val New frequency +// @return ReturnCode Zero on success, else platform specified error. +ReturnCode platSetFreqMcaMhz(const Target<TARGET_TYPE_ALL>& i_fapiTarget, + uint32_t i_val); + // ----------------------------------------------------------------------------- // End TODO: End to be supported functions // ----------------------------------------------------------------------------- @@ -1567,6 +1583,23 @@ fapiToTargeting::ID, sizeof(VAL), &(VAL)) fapi2::platAttrSvc::\ platGetMBvpdSlopeInterceptData(TARGET, ID, VAL) +//---------------------------------------------------------------------------- +// MACRO to route ATTR_FREQ_MCA_MHZ access to the correct HB function +//---------------------------------------------------------------------------- +#define ATTR_FREQ_MCA_MHZ_GETMACRO(ID, TARGET, VAL) \ + AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\ + ? fapi2::ReturnCode() : \ + fapi2::platAttrSvc::\ + platGetFreqMcaMhz(TARGET, VAL) + +//---------------------------------------------------------------------------- +// MACRO to route ATTR_FREQ_MCA_MHZ access to the correct HB function +//---------------------------------------------------------------------------- +#define ATTR_FREQ_MCA_MHZ_SETMACRO(ID, TARGET, VAL) \ + AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\ + ? fapi2::ReturnCode() : \ + fapi2::platAttrSvc::\ + platSetFreqMcaMhz(TARGET, VAL) #endif // ATTRIBUTESERVICE_H_ diff --git a/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H b/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H index 0a4ebe089..f516425ad 100644 --- a/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H +++ b/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H @@ -64,6 +64,7 @@ namespace fapi2 MOD_FAPI2_GET_MB_VPD_ATTR = 0x15, MOD_FAPI2_GET_PLL_BUCKET = 0x16, MOD_FAPI2_GET_RING = 0x17, + MOD_FAPI2_SET_ATTR_FREQ_MCA_MHZ = 0x18, }; /** @@ -141,6 +142,7 @@ namespace fapi2 RC_FAILED_TO_DECOMPRESS_RING = FAPI2_COMP_ID | 0x3C, RC_INCORRECT_HW_IMAGE_TYPE = FAPI2_COMP_ID | 0x3D, RC_DD_SUPPORT_CHECK_FAILED = FAPI2_COMP_ID | 0x3E, + RC_SET_ATTR_NOT_VALID = FAPI2_COMP_ID | 0x3F, // HWP generated errors RC_HWP_GENERATED_ERROR = HWPF_COMP_ID | 0x0f, diff --git a/src/usr/fapi2/attribute_service.C b/src/usr/fapi2/attribute_service.C index fa3de0bf7..08ed1b877 100644 --- a/src/usr/fapi2/attribute_service.C +++ b/src/usr/fapi2/attribute_service.C @@ -2204,6 +2204,73 @@ ReturnCode platGetMBvpdSlopeInterceptData( return rc; } +//****************************************************************************** +// fapi::platAttrSvc::platGetFreqMcaMhz function +//****************************************************************************** +ReturnCode platGetFreqMcaMhz(const Target<TARGET_TYPE_ALL>& i_fapiTarget, + uint32_t & o_val) +{ + // The POR config for Cumulus is to run the MC/DMI clocks directly + // off of the NEST PLL in 'sync' mode. To support 'sync' mode FW + // can pin ATTR_FREQ_MCA_MHZ == ATTR_FREQ_PB_MHZ. + + fapi2::ReturnCode l_rc; + errlHndl_t l_errl = nullptr; + + TARGETING::Target * l_chipTarget = nullptr; + l_errl = getTargetingTarget(i_fapiTarget, l_chipTarget); + if(l_errl) + { + FAPI_ERR("platGetFreqMcaMhz: Error from getTargetingTarget"); + l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl)); + } + else + { + o_val = l_chipTarget->getAttr<TARGETING::ATTR_FREQ_PB_MHZ>(); + } + return l_rc; +} + +//****************************************************************************** +// fapi::platAttrSvc::platSetFreqMcaMhz function +//****************************************************************************** +ReturnCode platSetFreqMcaMhz(const Target<TARGET_TYPE_ALL>& i_fapiTarget, + uint32_t i_val) +{ + fapi2::ReturnCode l_rc; + + TARGETING::Target * l_pTarget = NULL; + errlHndl_t l_errl = getTargetingTarget(i_fapiTarget, l_pTarget); + if (l_errl) + { + FAPI_ERR("platSetFreqMcaMhz: Error from getTargetingTarget"); + l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl)); + } + else + { + /*@ + * @errortype + * @moduleid fapi2::MOD_FAPI2_SET_ATTR_FREQ_MCA_MHZ + * @reasoncode fapi2::RC_SET_ATTR_NOT_VALID + * @userdata1 HUID + * @userdata2 Requested attr value + * @devdesc platSetFreqMcaMhz should never be called + */ + l_errl = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_UNRECOVERABLE, + fapi2::MOD_FAPI2_SET_ATTR_FREQ_MCA_MHZ, + fapi2::RC_SET_ATTR_NOT_VALID, + TARGETING::get_huid(l_pTarget), + i_val, + true); + + FAPI_ERR("platSetFreqMcaMhz: Function should never be called"); + l_rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl)); + } + + return l_rc; +} + } // End platAttrSvc namespace diff --git a/src/usr/targeting/common/xmltohb/simics_CUMULUS.system.xml b/src/usr/targeting/common/xmltohb/simics_CUMULUS.system.xml index b99bc8c52..68a5f6a3c 100644 --- a/src/usr/targeting/common/xmltohb/simics_CUMULUS.system.xml +++ b/src/usr/targeting/common/xmltohb/simics_CUMULUS.system.xml @@ -154,10 +154,6 @@ <default>1</default> </attribute> <attribute> - <id>FREQ_MCA_MHZ</id> - <default>2000</default> - </attribute> - <attribute> <id>FAPI_NAME</id> <default>k0</default> </attribute> diff --git a/src/usr/targeting/common/xmltohb/simics_CUMULUS_CDIMM.system.xml b/src/usr/targeting/common/xmltohb/simics_CUMULUS_CDIMM.system.xml index 04ea89cfc..acd0d6d62 100644 --- a/src/usr/targeting/common/xmltohb/simics_CUMULUS_CDIMM.system.xml +++ b/src/usr/targeting/common/xmltohb/simics_CUMULUS_CDIMM.system.xml @@ -154,10 +154,6 @@ <default>1</default> </attribute> <attribute> - <id>FREQ_MCA_MHZ</id> - <default>2000</default> - </attribute> - <attribute> <id>FAPI_NAME</id> <default>k0</default> </attribute> |