summaryrefslogtreecommitdiffstats
path: root/src/include/usr/fapi2/attribute_service.H
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/usr/fapi2/attribute_service.H')
-rw-r--r--src/include/usr/fapi2/attribute_service.H83
1 files changed, 81 insertions, 2 deletions
diff --git a/src/include/usr/fapi2/attribute_service.H b/src/include/usr/fapi2/attribute_service.H
index 6144524c5..58d958f73 100644
--- a/src/include/usr/fapi2/attribute_service.H
+++ b/src/include/usr/fapi2/attribute_service.H
@@ -115,7 +115,7 @@ ReturnCode getTargetingAttr(const Target<TARGET_TYPE_ALL,
/// @param[in] o_pAttr Pointer to attribute where value is copied to
/// @return boolean describing if it was successful
///
-bool setTargetingAttrHelper(TARGETING::Target * l_pTargTarget,
+bool setTargetingAttrHelper(TARGETING::Target * i_pTargTarget,
const TARGETING::ATTRIBUTE_ID i_targAttrId,
const uint32_t i_attrSize,
void * o_pAttr);
@@ -191,6 +191,19 @@ ReturnCode platGetTargetPos(const Target<TARGET_TYPE_ALL>& i_pFapiTarget,
///
+/// @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
///
@@ -500,13 +513,23 @@ ReturnCode getPllBucket(const Target<TARGET_TYPE_ALL>& i_fapiTarget,
//
// @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.
+// @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);
+/// @brief This function is called by the FAPI_ATTR_GET functions that lookup
+/// values in the MEM_PLL_FREQ_BUCKETS tree. The key's used to lookup values in that
+/// tree are the ATTR_FREQ_OMI_MHZ and ATTR_OMI_PLL_VCO attributes. These are on the
+/// processor target but it is expected that all of the values match.
+/// @param[out] o_omiFreq OMI Frequency of the system
+/// @param[out] o_omiVco OMI VCO of the system
+/// @return ReturnCode Zero on success, else platform specified error.
+errlHndl_t getOmiFreqAndVco(TARGETING::ATTR_FREQ_OMI_MHZ_type & o_omiFreq,
+ TARGETING::ATTR_OMI_PLL_VCO_type & o_omiVco);
+
/// @brief This function is called by the FAPI_ATTR_GET macro when getting
// ATTR_FREQ_MCA_MHZ
// @param[in] i_fapiTarget FAPI2 Target pointer
@@ -523,6 +546,22 @@ ReturnCode platGetFreqMcaMhz(const Target<TARGET_TYPE_ALL>& i_fapiTarget,
ReturnCode platSetFreqMcaMhz(const Target<TARGET_TYPE_ALL>& i_fapiTarget,
uint32_t i_val);
+/// @brief This function is called by the FAPI_ATTR_GET macro when getting
+// ATTR_MC_PLL_BUCKET
+// @param[in] i_fapiTarget FAPI2 Target pointer
+// @param[in] o_val PLL bucket associated with a given OMI freq
+// @return ReturnCode Zero on success, else platform specified error.
+ReturnCode platGetMcPllBucket(const Target<TARGET_TYPE_ALL>& i_fapiTarget,
+ uint8_t& o_val);
+
+/// @brief This function is called by the FAPI_ATTR_SET macro when getting
+// ATTR_OCMB_COUNTER
+// @param[in] i_fapiTarget FAPI2 Target pointer
+// @param[out] o_val The retrieved attribute value
+// @return ReturnCode Zero on success, else platform specified error.
+ReturnCode platIncrementOcmbCounter(const Target<TARGET_TYPE_ALL>& i_fapiTarget,
+ uint32_t& o_val);
+
// -----------------------------------------------------------------------------
// End TODO: End to be supported functions
// -----------------------------------------------------------------------------
@@ -1666,11 +1705,51 @@ fapiToTargeting::ID, sizeof(VAL), &(VAL))
//----------------------------------------------------------------------------
// MACRO to route ATTR_FREQ_MCA_MHZ access to the correct HB function
//----------------------------------------------------------------------------
+
+#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)
+#ifdef CONFIG_AXONE
+//----------------------------------------------------------------------------
+// MACRO to route ATTR_MC_PLL_BUCKET access to the correct HB function
+//----------------------------------------------------------------------------
+
+#undef ATTR_MC_PLL_BUCKET_GETMACRO
+#define ATTR_MC_PLL_BUCKET_GETMACRO(ID, TARGET, VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::\
+ platGetMcPllBucket(TARGET, VAL)
+#undef ATTR_MC_PLL_BUCKET_SETMACRO
+#define ATTR_MC_PLL_BUCKET_SETMACRO(ID, TARGET, VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::platErrorOnSet(TARGET, VAL)
+
+#endif //CONFIG_AXONE
+
+//----------------------------------------------------------------------------
+// MACRO to route ATTR_OCMB_COUNTER access to the correct HB function
+//----------------------------------------------------------------------------
+#undef ATTR_OCMB_COUNTER_GETMACRO
+#define ATTR_OCMB_COUNTER_GETMACRO(ID, TARGET, VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::\
+ platIncrementOcmbCounter(TARGET, VAL)
+#undef ATTR_OCMB_COUNTER_SETMACRO
+#define ATTR_OCMB_COUNTER_SETMACRO(ID, TARGET, VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::platErrorOnSet(TARGET, VAL)
#endif // ATTRIBUTESERVICE_H_
OpenPOWER on IntegriCloud