summaryrefslogtreecommitdiffstats
path: root/src/include/usr/fapi2
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/usr/fapi2')
-rw-r--r--src/include/usr/fapi2/attribute_service.H83
-rw-r--r--src/include/usr/fapi2/dimmBadDqBitmapFuncs.H14
-rw-r--r--src/include/usr/fapi2/fapiPlatTrace.H3
-rw-r--r--src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H12
-rw-r--r--src/include/usr/fapi2/rowRepairsFuncs.H14
-rw-r--r--src/include/usr/fapi2/target.H10
6 files changed, 117 insertions, 19 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_
diff --git a/src/include/usr/fapi2/dimmBadDqBitmapFuncs.H b/src/include/usr/fapi2/dimmBadDqBitmapFuncs.H
index 5d51b7153..a51f5c92e 100644
--- a/src/include/usr/fapi2/dimmBadDqBitmapFuncs.H
+++ b/src/include/usr/fapi2/dimmBadDqBitmapFuncs.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2017 */
+/* Contributors Listed Below - COPYRIGHT 2017,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -41,7 +41,7 @@ extern "C"
* dimmBadDqBitmapAccessHwp to get the DQ bitmap and returns the data
* for the specified rank.
*
- * @param[in] i_fapiTrgt Reference to MCA/MBA/MEM_PORT Target
+ * @param[in] i_fapiTrgt Reference to MCA/MBA/MEM_PORT/OCMB_CHIP Target
* @param[in] i_dimm MCA/MBA port DIMM number
* @param[in] i_rank DIMM rank number
* @param[out] o_data Reference to data where Bad DQ bitmap is copied to
@@ -50,8 +50,8 @@ extern "C"
* @return ReturnCode
*/
fapi2::ReturnCode p9DimmGetBadDqBitmap( const fapi2::Target
- <fapi2::TARGET_TYPE_MCA|fapi2::TARGET_TYPE_MBA|fapi2::TARGET_TYPE_MEM_PORT>
- & i_fapiTrgt,
+ <fapi2::TARGET_TYPE_MCA|fapi2::TARGET_TYPE_MBA|
+ fapi2::TARGET_TYPE_MEM_PORT|fapi2::TARGET_TYPE_OCMB_CHIP> & i_fapiTrgt,
const uint8_t i_dimm,
const uint8_t i_rank,
uint8_t (&o_data)[mss::BAD_DQ_BYTE_COUNT],
@@ -67,7 +67,7 @@ fapi2::ReturnCode p9DimmGetBadDqBitmap( const fapi2::Target
* dimmBadDqBitmapAccessHwp to get the DQ bitmap, fills in the data for the
* specified rank and calls dimmBadDqBitmapAccessHwp to set the DQ bitmap
*
- * @param[in] i_fapiTrgt Reference to MCA/MBA/MEM_PORT Target
+ * @param[in] i_fapiTrgt Reference to MCA/MBA/MEM_PORT/OCMB_CHIP Target
* @param[in] i_dimm MCA/MBA port DIMM number
* @param[in] i_rank DIMM rank number
* @param[in] i_data Reference to data where Bad DQ bitmap is copied from
@@ -76,8 +76,8 @@ fapi2::ReturnCode p9DimmGetBadDqBitmap( const fapi2::Target
* @return ReturnCode
*/
fapi2::ReturnCode p9DimmSetBadDqBitmap( const fapi2::Target
- <fapi2::TARGET_TYPE_MCA|fapi2::TARGET_TYPE_MBA|fapi2::TARGET_TYPE_MEM_PORT>
- & i_fapiTrgt,
+ <fapi2::TARGET_TYPE_MCA|fapi2::TARGET_TYPE_MBA|
+ fapi2::TARGET_TYPE_MEM_PORT|fapi2::TARGET_TYPE_OCMB_CHIP> & i_fapiTrgt,
const uint8_t i_dimm,
const uint8_t i_rank,
const uint8_t (&i_data)[mss::BAD_DQ_BYTE_COUNT],
diff --git a/src/include/usr/fapi2/fapiPlatTrace.H b/src/include/usr/fapi2/fapiPlatTrace.H
index d780832ca..94f6a20b2 100644
--- a/src/include/usr/fapi2/fapiPlatTrace.H
+++ b/src/include/usr/fapi2/fapiPlatTrace.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2016 */
+/* Contributors Listed Below - COPYRIGHT 2011,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -40,7 +40,6 @@
#include <stdio.h>
#include <trace/interface.H>
-#include <config.h>
//******************************************************************************
// Trace buffer names
diff --git a/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H b/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H
index f0ae90b3a..793474322 100644
--- a/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H
+++ b/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H
@@ -68,6 +68,13 @@ 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,
+ MOD_FAPI2_PLAT_GET_MC_PLL_BUCKET = 0x1D,
+ MOD_FAPI2_PLAT_GET_FREQ_MCA_MHZ = 0x1E,
+ MOD_GET_OMI_FREQ_AND_VCO = 0x1F,
+ MOD_FAPI2_SPD_ACCESS = 0x20,
+ MOD_FAPI2_EXPLR_IB_I2C_READ = 0x21,
+ MOD_FAPI2_EXPLR_IB_I2C_WRITE = 0x22,
};
/**
@@ -128,6 +135,8 @@ namespace fapi2
RC_SET_ATTR_NOT_VALID = FAPI2_COMP_ID | 0x3F,
RC_FAILED_TO_GET_RING_LIST = FAPI2_COMP_ID | 0x40,
RC_ATTR_OVERRIDE_DISALLOWED = FAPI2_COMP_ID | 0x41,
+ RC_UNKNOWN_OCMB_CHIP_TYPE = FAPI2_COMP_ID | 0x42,
+ RC_INVALID_BUFFER_SIZE = FAPI2_COMP_ID | 0x43,
// HWP generated errors
RC_HWP_GENERATED_ERROR = HWPF_COMP_ID | 0x0f,
@@ -137,6 +146,9 @@ namespace fapi2
// PLL_BUCKET generated errors
RC_NO_MATCHING_FREQ = HWPF_COMP_ID | 0x31,
RC_FREQ_LIST_NOT_FOUND = HWPF_COMP_ID | 0x32,
+ RC_PROC_FREQ_MISMATCH = HWPF_COMP_ID | 0x33,
+
+ RC_INVALID_SPD_DRAM_GEN = FAPI2_COMP_ID | 0x34,
};
/**
diff --git a/src/include/usr/fapi2/rowRepairsFuncs.H b/src/include/usr/fapi2/rowRepairsFuncs.H
index 373ec3319..78e00b126 100644
--- a/src/include/usr/fapi2/rowRepairsFuncs.H
+++ b/src/include/usr/fapi2/rowRepairsFuncs.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2018 */
+/* Contributors Listed Below - COPYRIGHT 2018,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -39,7 +39,7 @@ extern "C"
* Row Repair Data getter procedure to get the DQ bitmap and returns the data
* for the specified rank.
*
- * @param[in] i_fapiTrgt Reference to MCA/MBA/MEM_PORT Target
+ * @param[in] i_fapiTrgt Reference to MCA/MBA/MEM_PORT/OCMB_CHIP Target
* @param[in] i_dimm MCA/MBA port DIMM number
* @param[in] i_rank DIMM rank number
* @param[out] o_data Reference to data where Row Repair Data is copied to
@@ -48,8 +48,8 @@ extern "C"
* @return ReturnCode
*/
fapi2::ReturnCode getRowRepair( const fapi2::Target
- <fapi2::TARGET_TYPE_MCA|fapi2::TARGET_TYPE_MBA|fapi2::TARGET_TYPE_MEM_PORT>
- & i_fapiTrgt,
+ <fapi2::TARGET_TYPE_MCA|fapi2::TARGET_TYPE_MBA|
+ fapi2::TARGET_TYPE_MEM_PORT|fapi2::TARGET_TYPE_OCMB_CHIP> & i_fapiTrgt,
const uint8_t i_dimm,
const uint8_t i_rank,
uint8_t (&o_data)[mss::ROW_REPAIR_BYTE_COUNT],
@@ -62,7 +62,7 @@ fapi2::ReturnCode getRowRepair( const fapi2::Target
* Row Repair Data setter procedure to set the data
* for the specified rank.
*
- * @param[in] i_fapiTrgt Reference to MCA/MBA/MEM_PORT Target
+ * @param[in] i_fapiTrgt Reference to MCA/MBA/MEM_PORT/OCMB_CHIP Target
* @param[in] i_dimm MCA/MBA port DIMM number
* @param[in] i_rank DIMM rank number
* @param[out] i_data Reference to data where Row Repair Data is
@@ -71,8 +71,8 @@ fapi2::ReturnCode getRowRepair( const fapi2::Target
* @return ReturnCode
*/
fapi2::ReturnCode setRowRepair( const fapi2::Target
- <fapi2::TARGET_TYPE_MCA|fapi2::TARGET_TYPE_MBA|fapi2::TARGET_TYPE_MEM_PORT>
- & i_fapiTrgt,
+ <fapi2::TARGET_TYPE_MCA|fapi2::TARGET_TYPE_MBA|
+ fapi2::TARGET_TYPE_MEM_PORT|fapi2::TARGET_TYPE_OCMB_CHIP> & i_fapiTrgt,
const uint8_t i_dimm,
const uint8_t i_rank,
uint8_t (&i_data)[mss::ROW_REPAIR_BYTE_COUNT],
diff --git a/src/include/usr/fapi2/target.H b/src/include/usr/fapi2/target.H
index 7b286db87..31e909a68 100644
--- a/src/include/usr/fapi2/target.H
+++ b/src/include/usr/fapi2/target.H
@@ -267,6 +267,9 @@ inline TARGETING::TYPE convertFapi2TypeToTargeting(fapi2::TargetType i_T)
case fapi2::TARGET_TYPE_MEM_PORT:
o_targetingType = TARGETING::TYPE_MEM_PORT;
break;
+ case fapi2::TARGET_TYPE_PMIC:
+ o_targetingType = TARGETING::TYPE_PMIC;
+ break;
default:
FAPI_ERR("convertFapi2TypeToTargeting:: Chiplet type not supported 0x%.8X!", i_T);
assert(false);
@@ -382,6 +385,9 @@ inline fapi2::TargetType convertTargetingTypeToFapi2(TARGETING::TYPE i_T)
case TARGETING::TYPE_MEM_PORT:
o_targetingType = fapi2::TARGET_TYPE_MEM_PORT;
break;
+ case TARGETING::TYPE_PMIC:
+ o_targetingType = fapi2::TARGET_TYPE_PMIC;
+ break;
default:
o_targetingType = fapi2::TARGET_TYPE_NONE;
break;
@@ -920,9 +926,11 @@ inline std::vector<Target<K_CHILD, M, V> >
// valid children for OCMB
// OCMB -> MEM_PORT
// OCMB -> DIMM
+ // OCMB -> PMIC
static_assert(!((T_SELF == fapi2::TARGET_TYPE_OCMB_CHIP) &&
(K_CHILD != fapi2::TARGET_TYPE_MEM_PORT) &&
- (K_CHILD != fapi2::TARGET_TYPE_DIMM)),
+ (K_CHILD != fapi2::TARGET_TYPE_DIMM) &&
+ (K_CHILD != fapi2::TARGET_TYPE_PMIC)),
"improper child of fapi2::TARGET_TYPE_OCMB_CHIP");
// valid children for MEM_PORT
OpenPOWER on IntegriCloud