From 80295355e810c092007d9df7acf9ae9e9691f88a Mon Sep 17 00:00:00 2001 From: Dan Crowell Date: Mon, 22 Apr 2019 10:36:47 -0500 Subject: Support writable ATTR_FREQ_MCA_MHZ for Axone ATTR_FREQ_MCA_MHZ is being reused on Axone to drive the memory clocks out to the OMIs. Previously this value was locked to the NEST/PB frequency so the value was constant. Change-Id: I4ab7625c2e22efc83ad63a463ebbb208392209ff Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/76315 Reviewed-by: Nicholas E. Bofferding Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Tested-by: Jenkins OP HW Reviewed-by: Corey V. Swenson Reviewed-by: Christian R. Geddes Reviewed-by: Daniel M. Crowell --- src/include/usr/fapi2/attribute_service.H | 28 +++++++++++++++++++++++++- src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H | 1 + 2 files changed, 28 insertions(+), 1 deletion(-) (limited to 'src/include/usr/fapi2') diff --git a/src/include/usr/fapi2/attribute_service.H b/src/include/usr/fapi2/attribute_service.H index 6144524c5..2e20eec45 100644 --- a/src/include/usr/fapi2/attribute_service.H +++ b/src/include/usr/fapi2/attribute_service.H @@ -49,6 +49,7 @@ #include #include #include +#include //****************************************************************************** // Interface @@ -115,7 +116,7 @@ ReturnCode getTargetingAttr(const Target& i_pFapiTarget, uint32_t & o_pos); +/// +/// @brief This function is called by the FAPI_ATTR_SET macro when accessing +/// an attribute that should never be set. This is used to handle config- +/// dependent cases where the attribute may need to be writable in general +/// but not in some specific cases. +/// +/// @param[in] i_pTargTarget Pointer to TARGETING Target +/// @param[in] i_fapiAttrId FAPI attribute id +/// @return fapi2::ReturnCode. FAPI2_RC_SUCCESS if success, else error code. +/// +ReturnCode platErrorOnSet( TARGETING::Target * i_pTargTarget, + const fapi2::AttributeId i_fapiAttrId ); + /// /// @brief This function is called by the FAPI_ATTR_GET macro when getting /// ATTR_FUSED_CORE_MODE. It should not be called directly @@ -1666,11 +1680,23 @@ fapiToTargeting::ID, sizeof(VAL), &(VAL)) //---------------------------------------------------------------------------- // MACRO to route ATTR_FREQ_MCA_MHZ access to the correct HB function //---------------------------------------------------------------------------- + +// For Axone ATTR_FREQ_MCA_MHZ is a regular writable attribute +// For Nimbus/Cumulus ATTR_FREQ_MCA_MHZ is readonly and based on NEST +#ifndef CONFIG_AXONE + +#undef ATTR_FREQ_MCA_MHZ_GETMACRO #define ATTR_FREQ_MCA_MHZ_GETMACRO(ID, TARGET, VAL) \ AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\ ? fapi2::ReturnCode() : \ fapi2::platAttrSvc::\ platGetFreqMcaMhz(TARGET, VAL) +#undef ATTR_FREQ_MCA_MHZ_SETMACRO +#define ATTR_FREQ_MCA_MHZ_SETMACRO(ID, TARGET, VAL) \ + AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\ + ? fapi2::ReturnCode() : \ + fapi2::platAttrSvc::platErrorOnSet(TARGET, VAL) +#endif #endif // ATTRIBUTESERVICE_H_ diff --git a/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H b/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H index f0ae90b3a..3e1429b63 100644 --- a/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H +++ b/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H @@ -68,6 +68,7 @@ namespace fapi2 MOD_FAPI2_PLAT_GET_PROC_TEST = 0x19, MOD_FAPI2_MONITOR_FOR_FSP_MSGS = 0x1A, MOD_FAPI2_PLAT_GET_VPD_OCMB = 0x1B, + MOD_FAPI2_PLAT_ERROR_ON_SET = 0x1C, }; /** -- cgit v1.2.3