summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp/pm/p9_cpu_special_wakeup.H
diff options
context:
space:
mode:
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/pm/p9_cpu_special_wakeup.H')
-rw-r--r--src/import/chips/p9/procedures/hwp/pm/p9_cpu_special_wakeup.H165
1 files changed, 136 insertions, 29 deletions
diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_cpu_special_wakeup.H b/src/import/chips/p9/procedures/hwp/pm/p9_cpu_special_wakeup.H
index 90b038e72..28bc65732 100644
--- a/src/import/chips/p9/procedures/hwp/pm/p9_cpu_special_wakeup.H
+++ b/src/import/chips/p9/procedures/hwp/pm/p9_cpu_special_wakeup.H
@@ -29,7 +29,7 @@
// *HWP HW Owner : Greg Still <stillgs@us.ibm.com>
// *HWP FW Owner : Prem S Jha <premjha2@in.ibm.com>
// *HWP Team : PM
-// *HWP Level : 1
+// *HWP Level : 2
// *HWP Consumed by : OCC:FSP:HOST
#ifndef __P9_CPU_SPECIAL_WAKEUP_H_
@@ -48,19 +48,16 @@
namespace p9specialWakeup
{
-typedef fapi2::Target < fapi2::TARGET_TYPE_CORE |
-fapi2::TARGET_TYPE_EX |
-fapi2::TARGET_TYPE_EQ > FAPI2_WAKEUP_CHIPLET;
-
/**
* @brief enumerates all platforms which request special wakeup.
*/
enum PROC_SPCWKUP_ENTITY
{
- HOST,
- FSP,
- OCC,
- PHYP = HOST,
+ OTR = 0,
+ FSP = 1,
+ OCC = 2,
+ HYP = 3,
+ HOST = HYP,
SPW_ALL
};
@@ -69,37 +66,147 @@ enum PROC_SPCWKUP_ENTITY
*/
enum PROC_SPCWKUP_OPS
{
- SPCWKUP_DISABLE,
- SPCWKUP_ENABLE,
- SPCWKUP_INIT,
- SPCWKUP_FORCE_DEASSERT
+ SPCWKUP_ENABLE = 0,
+ SPCWKUP_DISABLE = 1
+};
+
+/**
+ * @brief enumerates types of special wakeup.
+ */
+enum PROC_SPCWKUP_TYPE
+{
+ SPW_CORE = 0,
+ SPW_EQ = 1,
+ SPW_EX = 2
+};
+// Used by checking infrastructure checking code
+static const uint32_t END_OP = SPCWKUP_DISABLE;
+
+/**
+ * Id of the string associated with special wakeup.
+ */
+enum SpecialWakeUpMsg
+{
+ SPWK_MSG_ASSERT = 0,
+ SPWK_MSG_DEASSERT = 1,
+ SPWK_MSG_CLEAN_UP_DEASSERT = 2,
};
} //p9specialWakeup ends
-// function pointer typedef definition for HWP call support
typedef fapi2::ReturnCode (*p9_cpu_special_wakeup_FP_t)
-( const p9specialWakeup::FAPI2_WAKEUP_CHIPLET& i_chipletTarget,
- const p9specialWakeup::PROC_SPCWKUP_OPS i_operation,
- const p9specialWakeup::PROC_SPCWKUP_ENTITY i_entity );
+( const fapi2::Target < fapi2::TARGET_TYPE_CORE >&,
+ const p9specialWakeup::PROC_SPCWKUP_OPS,
+ const p9specialWakeup::PROC_SPCWKUP_ENTITY);
+
+// function pointer typedef definition for HWP call support
+typedef fapi2::ReturnCode (*p9_cpu_special_wakeup_core_FP_t)
+( const fapi2::Target < fapi2::TARGET_TYPE_CORE >&,
+ const p9specialWakeup::PROC_SPCWKUP_OPS,
+ const p9specialWakeup::PROC_SPCWKUP_ENTITY);
+
+// function pointer typedef definition for HWP call support
+typedef fapi2::ReturnCode (*p9_cpu_special_wakeup_eq_FP_t)
+( const fapi2::Target < fapi2::TARGET_TYPE_EQ >&,
+ const p9specialWakeup::PROC_SPCWKUP_OPS,
+ const p9specialWakeup::PROC_SPCWKUP_ENTITY);
+
+// function pointer typedef definition for HWP call support
+typedef fapi2::ReturnCode (*p9_cpu_special_wakeup_ex_FP_t)
+( const fapi2::Target < fapi2::TARGET_TYPE_EX >&,
+ const p9specialWakeup::PROC_SPCWKUP_OPS,
+ const p9specialWakeup::PROC_SPCWKUP_ENTITY);
+
+
extern "C"
{
-/// @brief Sets core, ex or eq chiplet into special wakeup state.
+
+/// @brief Asserts/Deasserts core, ex or eq chiplets into special wakeup state.
+/// @verbatim
+/// - General function
+/// Based on "entity" parameter (OCC, FSP, HYP, OTHER), write the
+/// appropriate Special Wakeup bit (different address)
+///
+/// Poll for SPECIAL WAKEUP DONE
+///
+/// Note: the caller has to decide what needs to be target based on the
+/// fused operational mode and the address that is needed to be accessed.
+/// This procedure does NOT know the address(es) to be accessed.
+///
+/// - General flow
+/// if TARGET_TYPE_CORE, same as normal core mode
+/// if TARGET_TYPE_EQ, same a normal core mode
+/// if TARGET_TYPE_EX, sets special wakeup to both cores in the EX
+/// The act of waking up an EX will wakeup the shared portion of the EQ
+/// (including the CMEs and all L3) as well as the L2 domain associated
+/// with the functional core in the targeted EX. The two cores will be
+/// restored (including SCOM and SPR restoration.
+///
+/// - Polling Timeouts
+/// Timeouts need to account for the following:
+/// 1) All the chiplets are not in a Deep Idle state and will awaken in
+/// < 1us
+///
+/// 2) All the chiplets in a STOP 4 or less can be awakened in < 1ms
+///
+/// 3) Multiple chiplets in STOP 11/15 will cause a serialization of
+/// at least two exits so awakening of < 5ms
+///
+/// Procedure Prereq:
+/// - Caller must follow these rules:
+/// - if system checkstop is present, set ATTR_PM_SPWUP_IGNORE_XSTOP_FLAG
+/// to not produce errors if special wake-up done times out
+/// - On a successful assertion of special wake-up, deassert afterwards!
+/// - On an unsuccessful assertion of special wake-up, do NOT deassert
+/// afterwards!
+/// @endverbatim
+///
/// @param[in] i_chipletTarget fapi2 target associated with core, ex and eq.
/// @param[in] i_operation special wakeup operations to be used.
-/// @param[in] i_entity entity requesting special wakeup.
+/// SPCWKUP_ENABLE - asserts the special wake-up bit associated
+/// with i_entity, increment entity specific counter
+/// (attribute), and poll for valid special wakeup completion.
+/// SPCWKUP_DISABLE - decrement entity specific counter (attribute)
+/// associated with i_entity and deasserts the special wake-up
+/// bit only if the count is zero.
+/// SPCWKUP_INIT - write all entity counters(attributes) to zero.
+/// SPCWKUP_FORCE_DEASSERT - deassert the i_entity bit without
+/// checking or updating the counter attributes.
+/// @param[in] i_entity entity to perform special wake-up upon. Effectively
+/// chooses the special wake-up to use.
/// @return FAPI2_RC_SUCCESS on success, errorcode otherwise.
-/// @note needs support of following attribute:
-/// ATTR_PM_SPWUP_FSP
-/// ATTR_PM_SPWUP_OCC
-/// ATTR_PM_SPWUP_HOST
-/// ATTR_PM_SPWUP_OTR
-/// ATTR_PM_SPWUP_IGNORE_XSTOP_FLAG
- fapi2::ReturnCode
- p9_cpu_special_wakeup( const p9specialWakeup::FAPI2_WAKEUP_CHIPLET& i_chipletTarget,
- const p9specialWakeup::PROC_SPCWKUP_OPS i_operation,
- const p9specialWakeup::PROC_SPCWKUP_ENTITY i_entity );
+///
+/// @note needs support of following attributes:
+/// ATTR_PM_SPWUP_CORE[NUM_ENTITIES] (CORE target) - counter attributes
+/// for Cores
+/// ATTR_PM_SPWUP_EQ[NUM_ENTITIES] (EQ target) - counter attributes for
+/// EQs
+/// ATTR_PM_SPWUP_IGNORE_XSTOP_FLAG (PROC target) - bypass Done timeout
+/// Done checking to return SUCCESS if a checkstop condition is
+/// present. Must be set by the caller to suppress timeout errors
+/// from being reported.
+///
+ fapi2::ReturnCode p9_cpu_special_wakeup(
+ const fapi2::Target <fapi2::TARGET_TYPE_CORE>& i_target,
+ const p9specialWakeup::PROC_SPCWKUP_OPS i_operation,
+ const p9specialWakeup::PROC_SPCWKUP_ENTITY i_entity );
+
+ fapi2::ReturnCode p9_cpu_special_wakeup_core(
+ const fapi2::Target <fapi2::TARGET_TYPE_CORE>& i_target,
+ const p9specialWakeup::PROC_SPCWKUP_OPS i_operation,
+ const p9specialWakeup::PROC_SPCWKUP_ENTITY i_entity );
+
+ fapi2::ReturnCode p9_cpu_special_wakeup_eq(
+ const fapi2::Target <fapi2::TARGET_TYPE_EQ>& i_target,
+ const p9specialWakeup::PROC_SPCWKUP_OPS i_operation,
+ const p9specialWakeup::PROC_SPCWKUP_ENTITY i_entity );
+
+ fapi2::ReturnCode p9_cpu_special_wakeup_ex(
+ const fapi2::Target <fapi2::TARGET_TYPE_EX>& i_target,
+ const p9specialWakeup::PROC_SPCWKUP_OPS i_operation,
+ const p9specialWakeup::PROC_SPCWKUP_ENTITY i_entity );
+
}// extern "C" ends
#endif //__P9_CPU_SPECIAL_WAKEUP_H_
OpenPOWER on IntegriCloud