summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp/nest/p9_l2_flush.H
diff options
context:
space:
mode:
authorThi Tran <thi@us.ibm.com>2017-09-18 14:19:02 -0500
committerSachin Gupta <sgupta2m@in.ibm.com>2017-10-11 00:28:09 -0400
commit77b63192f398181a009630bcdbec28c5918b7c5c (patch)
tree2adbbed01d6e1ca878e16147aab6ac49cefc231e /src/import/chips/p9/procedures/hwp/nest/p9_l2_flush.H
parentec9a99e9c39564fc9a69589d2bed3f339b0e86b1 (diff)
downloadtalos-sbe-77b63192f398181a009630bcdbec28c5918b7c5c.tar.gz
talos-sbe-77b63192f398181a009630bcdbec28c5918b7c5c.zip
Share common code between p9_l2_flush and p9_l2err_linedelete
Change-Id: I547078b1e0fc7adec767402faf5e64e4b4390bc9 RTC: 178071 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/46359 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com> Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Joseph J. McGill <jmcgill@us.ibm.com> Reviewed-by: Benjamin Gass <bgass@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/46385 Reviewed-by: Hostboot Team <hostboot@us.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/nest/p9_l2_flush.H')
-rwxr-xr-xsrc/import/chips/p9/procedures/hwp/nest/p9_l2_flush.H49
1 files changed, 43 insertions, 6 deletions
diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_l2_flush.H b/src/import/chips/p9/procedures/hwp/nest/p9_l2_flush.H
index a54ad639..af02fccd 100755
--- a/src/import/chips/p9/procedures/hwp/nest/p9_l2_flush.H
+++ b/src/import/chips/p9/procedures/hwp/nest/p9_l2_flush.H
@@ -94,21 +94,58 @@ extern "C"
{
///
+/// @brief Utility function to check for a purge operation to be completed.
+/// This function polls the EX_PRD_PURGE_CMD_REG_BUSY bit of
+/// EX_PRD_PURGE_CMD_REG.
+/// - If this bit is clear before the input loop threshold is
+/// reached, it returns FAPi2_RC_SUCCESS.
+/// - Otherwise, it returns an error code.
+///
+/// @param[in] i_target => EX chiplet target
+/// @param[in] i_busyCount => Max busy count waiting for PURGE to complete.
+/// @param[out] o_prdPurgeCmdReg => EX_PRD_PURGE_CMD_REG value.
+///
+/// @return FAPI2_RC_SUCCESS if engine status returns as idle (with no errors)
+/// before maximum number of polls has been reached
+/// else, return error.
+ fapi2::ReturnCode purgeCompleteCheck(
+ const fapi2::Target<fapi2::TARGET_TYPE_EX>& i_target,
+ const uint64_t i_busyCount,
+ fapi2::buffer<uint64_t>& o_prdPurgeCmdReg);
+
+///-----------------------------------------------------------------------------
+/// @brief Utility subroutine to setup and trigger a PRD PURGE based
+/// on input purge data specification.
+///
+/// @param[in] i_target EX target
+/// @param[in] i_purgeData Structure having values for MEM, CGC, BANK
+/// passed by the user
+/// @param[in] i_prdPurgeCmdReg EX_PRD_PURGE_CMD_REG value.
+///
+/// @return FAPI2_RC_SUCCESS if purge operation was started,
+/// else error code.
+///-----------------------------------------------------------------------------
+ fapi2::ReturnCode setupAndTriggerPrdPurge(
+ const fapi2::Target<fapi2::TARGET_TYPE_EX>& i_target,
+ const p9core::purgeData_t& i_purgeData,
+ fapi2::buffer<uint64_t>& i_prdPurgeCmdReg);
+
+///
/// @brief Flush entire content of L2 cache via purge engine
/// @param[in] i_target EX target
/// @param[in] i_purgeData Specifies a particular purge type
/// @return: FAPI2_RC_SUCCESS if purge operation completes successfully,
-/// RC_P9_L2_FLUSH_PURGE_REQ_OUTSTANDING
+/// P9_L2_FLUSH_PURGE_REQ_OUTSTANDING
/// if called when existing L2 purge is in progress,
-/// RC_P9_L2_FLUSH_CMD_TIMEOUT
+/// RC_P9_PURGE_COMPLETE_TIMEOUT
/// if purge operation does not complete in expected time,
-/// RC_P9_L2_FLUSH_CMD_ERROR
+/// RC_P9_PURGE_CMD_REG_ERR
/// if purge operation reports error,
/// else FAPI getscom/putscom return code for failing operation
///
- fapi2::ReturnCode p9_l2_flush(const fapi2::Target < fapi2::TARGET_TYPE_EX >
- & i_target,
- const p9core::purgeData_t& i_purgeData);
+ fapi2::ReturnCode p9_l2_flush(
+ const fapi2::Target < fapi2::TARGET_TYPE_EX >& i_target,
+ const p9core::purgeData_t& i_purgeData);
} // end of extern C
OpenPOWER on IntegriCloud