summaryrefslogtreecommitdiffstats
path: root/import/hwpf
diff options
context:
space:
mode:
authorRichard J. Knight <rjknight@us.ibm.com>2016-03-01 11:57:51 -0600
committerSachin Gupta <sgupta2m@in.ibm.com>2016-04-14 11:25:22 -0400
commitedb19ebde0ee25026228c2964a96b0779a9d1e57 (patch)
treebbd7e5136423bc684f2e114b25a3f0dddf90f1ad /import/hwpf
parenta58241ba46e0ebb25b4ccf2e9cb9087938bccb2c (diff)
downloadtalos-sbe-edb19ebde0ee25026228c2964a96b0779a9d1e57.tar.gz
talos-sbe-edb19ebde0ee25026228c2964a96b0779a9d1e57.zip
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 <bsilver@us.ibm.com> Reviewed-by: Matt K. Light <mklight@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21536 Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'import/hwpf')
-rw-r--r--import/hwpf/fapi2/include/utils.H57
1 files changed, 56 insertions, 1 deletions
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 <stdint.h>
#include <return_code.H>
-#include <error_info_defs.H>
+#include <target_types.H>
+#include <plat_utils.H>
+
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<TargetType T>
+inline ReturnCode specialWakeup(const Target<T>& 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.
///
OpenPOWER on IntegriCloud