summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Still <stillgs@us.ibm.com>2016-01-10 22:51:44 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-02-26 17:20:15 -0600
commit9d3ca70e96ea63585a22bc2051ea8b86a48293a8 (patch)
treed39cf2e3a23be473fd8b6e3c5a1bce0f781a85e9
parent8f3e967849a84c6909d59912a9eb6ac3a255d58f (diff)
downloadtalos-hostboot-9d3ca70e96ea63585a22bc2051ea8b86a48293a8.tar.gz
talos-hostboot-9d3ca70e96ea63585a22bc2051ea8b86a48293a8.zip
p9_sbe_check_master_stop15 Level 2
- Tested on AWAN using wrapper flow injection - Fixed Suet issues with multiple core chiplets - Added SSH Source initialization - Added p9_pm_stop_history include - Rebased; added missing powermgmnt.act closing bracket - Rebased to pick up powermgnt SUET updates Change-Id: I0aefbc19cce5a66a5be38437eaf0641a36ab228b RTC: 144287 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/23926 Tested-by: Jenkins Server Reviewed-by: RAJA DAS <rajadas2@in.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/24707 Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r--src/import/chips/p9/procedures/hwp/perv/p9_sbe_check_master_stop15.C66
-rw-r--r--src/import/chips/p9/procedures/hwp/perv/p9_sbe_check_master_stop15.H3
-rw-r--r--src/import/chips/p9/procedures/hwp/perv/p9_sbe_check_master_stop15.mk1
3 files changed, 68 insertions, 2 deletions
diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_sbe_check_master_stop15.C b/src/import/chips/p9/procedures/hwp/perv/p9_sbe_check_master_stop15.C
index 7b7e160a0..436d7fa03 100644
--- a/src/import/chips/p9/procedures/hwp/perv/p9_sbe_check_master_stop15.C
+++ b/src/import/chips/p9/procedures/hwp/perv/p9_sbe_check_master_stop15.C
@@ -23,7 +23,7 @@
// *HWP HWP Owner : Greg Still <stillgsg@us.ibm.com>
// *HWP FW Owner : Bilicon Patil <bilpatil@in.ibm.com>
// *HWP Team : PM
-// *HWP Level : 1
+// *HWP Level : 2
// *HWP Consumed by : SBE
///
/// High-level procedure flow:
@@ -46,6 +46,8 @@
// Includes
// -----------------------------------------------------------------------------
#include <p9_sbe_check_master_stop15.H>
+#include <p9_pm_stop_history.H>
+#include <p9_quad_scom_addresses.H>
// -----------------------------------------------------------------------------
// Function definitions
@@ -57,6 +59,68 @@ fapi2::ReturnCode p9_sbe_check_master_stop15(
{
FAPI_IMP("> p9_sbe_check_master_stop15");
+ fapi2::buffer<uint64_t> l_data64;
+ uint32_t l_stop_gated = 0;
+ uint32_t l_stop_transition = p9ssh::SSH_UNDEFINED;
+ uint32_t l_stop_requested_level = 0; // Running Level
+ uint32_t l_stop_actual_level = 0; // Running Level
+
+ // Read the "Other" STOP History Register
+ FAPI_TRY(fapi2::getScom(i_target, C_PPM_SSHOTR, l_data64));
+
+ // Extract the field values
+ l_data64.extractToRight<p9ssh::STOP_GATED_START,
+ p9ssh::STOP_GATED_LEN>(l_stop_gated);
+
+ l_data64.extractToRight<p9ssh::STOP_TRANSITION_START,
+ p9ssh::STOP_TRANSITION_LEN>(l_stop_transition);
+
+ // Testing showed the above operation was sign extending into
+ // the l_stop_transition variable.
+ l_stop_transition &= 0x3;
+
+ l_data64.extractToRight<p9ssh::STOP_REQUESTED_LEVEL_START,
+ p9ssh::STOP_REQUESTED_LEVEL_LEN>(l_stop_requested_level);
+
+ l_data64.extractToRight<p9ssh::STOP_ACTUAL_LEVEL_START,
+ p9ssh::STOP_ACTUAL_LEVEL_LEN>(l_stop_actual_level);
+
+#ifndef __PPE__
+ FAPI_DBG("GATED = %d; TRANSITION = %d (0x%X); REQUESTED_LEVEL = %d; ACTUAL_LEVEL = %d",
+ l_stop_gated,
+ l_stop_transition, l_stop_transition,
+ l_stop_requested_level,
+ l_stop_actual_level);
+#endif
+
+ // Check for valide reguest level
+ FAPI_ASSERT((l_stop_requested_level == 11 || l_stop_requested_level == 15),
+ fapi2::CHECK_MASTER_STOP15_INVALID_REQUEST_LEVEL()
+ .set_REQUESTED_LEVEL(l_stop_requested_level),
+ "Invalid requested STOP Level");
+
+ // Check for valid pending condition
+ FAPI_ASSERT(!(l_stop_transition == p9ssh::SSH_CORE_COMPLETE ||
+ l_stop_transition == p9ssh::SSH_ENTERING ),
+ fapi2::CHECK_MASTER_STOP15_PENDING(),
+ "STOP 15 is still pending");
+
+ // Assert completion and the core gated condition. If not, something is off.
+ FAPI_ASSERT((l_stop_transition == p9ssh::SSH_COMPLETE &&
+ l_stop_gated == p9ssh::SSH_GATED ),
+ fapi2::CHECK_MASTER_STOP15_INVALID_STATE()
+ .set_STOP_HISTORY(l_data64),
+ "STOP 15 error");
+
+ // Check for valid actual level
+ FAPI_ASSERT((l_stop_actual_level == 11 || l_stop_actual_level == 15),
+ fapi2::CHECK_MASTER_STOP15_INVALID_ACTUAL_LEVEL()
+ .set_ACTUAL_LEVEL(l_stop_actual_level),
+ "Invalid actual STOP Level");
+
+ FAPI_INF("SUCCESS!! Valid STOP entry state has been achieved.")
+
+fapi_try_exit:
FAPI_INF("< p9_sbe_check_master_stop15");
return fapi2::current_err;
diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_sbe_check_master_stop15.H b/src/import/chips/p9/procedures/hwp/perv/p9_sbe_check_master_stop15.H
index c7a8c1e3b..93c5379fe 100644
--- a/src/import/chips/p9/procedures/hwp/perv/p9_sbe_check_master_stop15.H
+++ b/src/import/chips/p9/procedures/hwp/perv/p9_sbe_check_master_stop15.H
@@ -23,7 +23,7 @@
// *HWP HWP Owner : Greg Still <stillgsg@us.ibm.com>
// *HWP FW Owner : Bilicon Patil <bilpatil@in.ibm.com>
// *HWP Team : PM
-// *HWP Level : 1
+// *HWP Level : 2
// *HWP Consumed by : SBE
//------------------------------------------------------------------------------
@@ -36,6 +36,7 @@
typedef fapi2::ReturnCode (*p9_sbe_check_master_stop15_FP_t)(const
fapi2::Target<fapi2::TARGET_TYPE_CORE>&);
+
/// @brief Check if the targeted core (master) is fully in STOP15
///
/// @param[in] i_target Reference to TARGET_TYPE_CORE target
diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_sbe_check_master_stop15.mk b/src/import/chips/p9/procedures/hwp/perv/p9_sbe_check_master_stop15.mk
index 210a98dc9..ac626b310 100644
--- a/src/import/chips/p9/procedures/hwp/perv/p9_sbe_check_master_stop15.mk
+++ b/src/import/chips/p9/procedures/hwp/perv/p9_sbe_check_master_stop15.mk
@@ -17,4 +17,5 @@
#
# IBM_PROLOG_END_TAG
PROCEDURE=p9_sbe_check_master_stop15
+$(call ADD_MODULE_SRCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/procedures/hwp/lib)
$(call BUILD_PROCEDURE)
OpenPOWER on IntegriCloud