From edb19ebde0ee25026228c2964a96b0779a9d1e57 Mon Sep 17 00:00:00 2001 From: "Richard J. Knight" Date: Tue, 1 Mar 2016 11:57:51 -0600 Subject: Need fapi2 interface for special wakeup -Add API to support special wakeup. Change-Id: I0b5a75339a43fe55a5d119891d2e5e767be4060d Depends-on:I35d2fdc689da349ccf8d61afa1639ed1b9438749 RTC:148345 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21535 Tested-by: Jenkins Server Tested-by: PPE CI Tested-by: Hostboot CI Reviewed-by: Brian R. Silver Reviewed-by: Matt K. Light Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21536 Reviewed-by: Sachin Gupta --- import/hwpf/fapi2/include/utils.H | 57 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) (limited to 'import/hwpf') diff --git a/import/hwpf/fapi2/include/utils.H b/import/hwpf/fapi2/include/utils.H index 95a4e5f1..10a7c333 100644 --- a/import/hwpf/fapi2/include/utils.H +++ b/import/hwpf/fapi2/include/utils.H @@ -26,10 +26,65 @@ #include #include -#include +#include +#include + namespace fapi2 { + +/// +/// @brief Enable/Disable special wakeup on processor chip core(s) +/// +/// Special Wakeup Enable must be done when a HWP is doing an operation that +/// requires core(s) to be awake (e.g. modifying the Hcode image). For +/// each Special Wakeup Enable call, there must be a subsequent Special Wakeup +/// Disable call. +/// +/// This does not apply to SCOM operations, platforms must handle Special Wakeup +/// for SCOM operations internally. +/// +/// If Special Wakeup is enabled, a core will not go to sleep (if already +/// sleeping, it is woken up). If Special Wakeup is disabled, if there are no +/// other active Enables, the core is allowed to sleep. +/// +/// @note Implemented by platform code calling the cpu special wakeup HWP. +/// This is a FAPI2 function because each platform may do different things +/// Hostboot: Does nothing (cores cannot sleep while Hostboot running) +/// FSP: Uses an algorithm to decide when to disable special wakeup +/// Cronus: Does Special Wakeup enable/disable as requested +/// +/// @param[in] i_target +/// TARGET_TYPE_PROC_CHIP: Enables/Disables Special Wakeup on all +/// cores (EX,EQ chiplets) of the specified chip target. +/// TARGET_TYPE_CORE: Enables/Disables Special Wakeup on the +/// specified core target (EX,EQ chiplets) +/// TARGET_TYPE_EX: Enables/Disables Special Wakeup on the +/// specified EX target. +/// TARGET_TYPE_EQ: Enables/Disables Special Wakeup on the +/// specified EQ target. +/// +/// @param[in] i_enable true = enable. false = disable. +/// +/// @return ReturnCode. FAPI2_RC_SUCCESS on success, else platform specified error. +/// +/// +template +inline ReturnCode specialWakeup(const Target& i_target, + const bool i_enable) +{ + // enforce the allowed target types + static_assert( ((T == fapi2::TARGET_TYPE_PROC_CHIP) || + (T == fapi2::TARGET_TYPE_CORE) || + (T == fapi2::TARGET_TYPE_EX) || + (T == fapi2::TARGET_TYPE_EQ)), + "Invalid target type for this function"); + + ReturnCode l_rc = platSpecialWakeup( i_target, i_enable ); + + return l_rc; +} + /// /// @brief Log an error. /// -- cgit v1.2.1