summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp/pm/p9_query_stop_state.C
diff options
context:
space:
mode:
authorPeng Fei GOU <shgoupf@cn.ibm.com>2017-05-12 22:44:25 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-06-11 14:38:58 -0400
commit075b200958f391fab88a229d77f2566c8aa2e8e1 (patch)
treee684d0e74f8aadc60ce1e411bf143f88afb4d0ff /src/import/chips/p9/procedures/hwp/pm/p9_query_stop_state.C
parent46f5876f0858b26b9d041e3abea740d6273a1797 (diff)
downloadtalos-hostboot-075b200958f391fab88a229d77f2566c8aa2e8e1.tar.gz
talos-hostboot-075b200958f391fab88a229d77f2566c8aa2e8e1.zip
fircheck -- Leverage p9_query_stop_state for core PPM status
1) Leverage the Attributes dumped by p9_query_stop_state. 2) Make fir_hierarchy an independent object file. 3) Only use -O0 on fir_hierarchy object. 4) Split p9_query_stop_state to a subroutine which only uses stop_attrs_t as the output, so that fircheck can call it directly wihtout accessing attributes. Change-Id: I0ff59d0add7d97c6b114ff4e2b2e959d6560c9d4 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40478 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Kevin F. Reick <reick@us.ibm.com> Reviewed-by: Joseph J. McGill <jmcgill@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40679 Reviewed-by: Hostboot Team <hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/pm/p9_query_stop_state.C')
-rwxr-xr-xsrc/import/chips/p9/procedures/hwp/pm/p9_query_stop_state.C102
1 files changed, 50 insertions, 52 deletions
diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_query_stop_state.C b/src/import/chips/p9/procedures/hwp/pm/p9_query_stop_state.C
index 041f01fa0..e22829e34 100755
--- a/src/import/chips/p9/procedures/hwp/pm/p9_query_stop_state.C
+++ b/src/import/chips/p9/procedures/hwp/pm/p9_query_stop_state.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -77,21 +77,6 @@
typedef struct
{
- uint8_t l2_hasclocks;
- uint8_t l3_hasclocks;
- uint8_t c0_exec_hasclocks; // these could be put in an array, but is broken out since attributes are separate
- uint8_t c1_exec_hasclocks;
- uint8_t c0_pc_hasclocks;
- uint8_t c1_pc_hasclocks;
-
- uint8_t l2_haspower;
- uint8_t l3_haspower;
- uint8_t c0_haspower;
- uint8_t c1_haspower;
-} stop_attrs_t;
-
-typedef struct
-{
uint8_t l2_hasclocks;
uint8_t l3_hasclocks;
@@ -156,20 +141,18 @@ void compare_ss_hw(const char* msg, const uint8_t hw_state, uint8_t& stop_state)
}
fapi2::ReturnCode
-p9_query_stop_state(
- const fapi2::Target<fapi2::TARGET_TYPE_EX>& i_ex_target)
+query_stop_state(
+ const fapi2::Target<fapi2::TARGET_TYPE_EX>& i_ex_target,
+ stop_attrs_t& o_stop_attrs)
{
-
-
fapi2::buffer<uint64_t> l_qsshsrc, l_csshsrc[2], l_qpfetsense, l_cpfetsense[2];
fapi2::buffer<uint64_t> l_data64;
uint8_t l_chpltNumber = 0;
uint32_t l_quadStopLevel = 0;
uint32_t l_exPos = 0;
uint32_t l_coreStopLevel[2] = {0, 0};
- uint8_t l_data8;
+ uint8_t l_data8 = 0;
- stop_attrs_t l_stop_attrs = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; // Initialize all fields to 1
hw_state_t l_clk_pfet = {0, 0, {0, 0}, {0, 0}, 0, 0, {0, 0}}; // Initialize all fields to 0
@@ -234,12 +217,12 @@ p9_query_stop_state(
// VSU, ISU are clocked off
if (l_coreStopLevel[0] >= 1)
{
- l_stop_attrs.c0_exec_hasclocks = 0;
+ o_stop_attrs.c0_exec_hasclocks = 0;
}
if (l_coreStopLevel[1] >= 1)
{
- l_stop_attrs.c1_exec_hasclocks = 0;
+ o_stop_attrs.c1_exec_hasclocks = 0;
}
// STOP2 - Fast Sleep
@@ -248,12 +231,12 @@ p9_query_stop_state(
// PC, Core EPS are clocked off
if (l_coreStopLevel[0] >= 2)
{
- l_stop_attrs.c0_pc_hasclocks = 0;
+ o_stop_attrs.c0_pc_hasclocks = 0;
}
if (l_coreStopLevel[1] >= 2)
{
- l_stop_attrs.c1_pc_hasclocks = 0;
+ o_stop_attrs.c1_pc_hasclocks = 0;
}
// STOP4 - Deep Sleep (special exception for stop 9 - lab use only)
@@ -262,12 +245,12 @@ p9_query_stop_state(
// PC, Core EPS are powered off
if (l_coreStopLevel[0] >= 4 && l_coreStopLevel[0] != 9)
{
- l_stop_attrs.c0_haspower = 0;
+ o_stop_attrs.c0_haspower = 0;
}
if (l_coreStopLevel[1] >= 4 && l_coreStopLevel[1] != 9)
{
- l_stop_attrs.c1_haspower = 0;
+ o_stop_attrs.c1_haspower = 0;
}
@@ -281,22 +264,22 @@ p9_query_stop_state(
{
// The FAPI_ASSERT above ensures both cores are >= the quad stop state
- l_stop_attrs.l2_hasclocks = 0;
+ o_stop_attrs.l2_hasclocks = 0;
}
// STOP9 - Fast Winkle (lab use only)
// Both cores and cache are clocked off
if (l_quadStopLevel >= 9)
{
- l_stop_attrs.l3_hasclocks = 0;
+ o_stop_attrs.l3_hasclocks = 0;
}
// STOP11 - Deep Winkle
// Both cores and cache are powered off
if (l_quadStopLevel >= 11)
{
- l_stop_attrs.l2_haspower = 0;
- l_stop_attrs.l3_haspower = 0;
+ o_stop_attrs.l2_haspower = 0;
+ o_stop_attrs.l3_haspower = 0;
}
//----------------------------------------------------------------------------------
@@ -375,39 +358,54 @@ p9_query_stop_state(
}
FAPI_DBG("Comparing Stop State vs Actual HW settings");
- FAPI_DBG("C0_EXEC_HASCLOCKS ATTR(%d) HW(%d)", l_stop_attrs.c0_exec_hasclocks, l_clk_pfet.c_exec_hasclocks[0]);
- FAPI_DBG("C1_EXEC_HASCLOCKS ATTR(%d) HW(%d)", l_stop_attrs.c1_exec_hasclocks, l_clk_pfet.c_exec_hasclocks[1]);
+ FAPI_DBG("C0_EXEC_HASCLOCKS ATTR(%d) HW(%d)", o_stop_attrs.c0_exec_hasclocks, l_clk_pfet.c_exec_hasclocks[0]);
+ FAPI_DBG("C1_EXEC_HASCLOCKS ATTR(%d) HW(%d)", o_stop_attrs.c1_exec_hasclocks, l_clk_pfet.c_exec_hasclocks[1]);
- FAPI_DBG("C0_PC_HASCLOCKS ATTR(%d) HW(%d)", l_stop_attrs.c0_pc_hasclocks, l_clk_pfet.c_pc_hasclocks[0]);
- FAPI_DBG("C1_PC_HASCLOCKS ATTR(%d) HW(%d)", l_stop_attrs.c1_pc_hasclocks, l_clk_pfet.c_pc_hasclocks[1]);
+ FAPI_DBG("C0_PC_HASCLOCKS ATTR(%d) HW(%d)", o_stop_attrs.c0_pc_hasclocks, l_clk_pfet.c_pc_hasclocks[0]);
+ FAPI_DBG("C1_PC_HASCLOCKS ATTR(%d) HW(%d)", o_stop_attrs.c1_pc_hasclocks, l_clk_pfet.c_pc_hasclocks[1]);
- FAPI_DBG("L2_HASCLOCKS ATTR(%d) HW(%d)", l_stop_attrs.l2_hasclocks, l_clk_pfet.l2_hasclocks);
- FAPI_DBG("L3_HASCLOCKS ATTR(%d) HW(%d)", l_stop_attrs.l3_hasclocks, l_clk_pfet.l3_hasclocks);
+ FAPI_DBG("L2_HASCLOCKS ATTR(%d) HW(%d)", o_stop_attrs.l2_hasclocks, l_clk_pfet.l2_hasclocks);
+ FAPI_DBG("L3_HASCLOCKS ATTR(%d) HW(%d)", o_stop_attrs.l3_hasclocks, l_clk_pfet.l3_hasclocks);
- FAPI_DBG("C0_HASPOWER ATTR(%d) HW(%d)", l_stop_attrs.c0_haspower, l_clk_pfet.c0_haspower());
- FAPI_DBG("C1_HASPOWER ATTR(%d) HW(%d)", l_stop_attrs.c1_haspower, l_clk_pfet.c1_haspower());
+ FAPI_DBG("C0_HASPOWER ATTR(%d) HW(%d)", o_stop_attrs.c0_haspower, l_clk_pfet.c0_haspower());
+ FAPI_DBG("C1_HASPOWER ATTR(%d) HW(%d)", o_stop_attrs.c1_haspower, l_clk_pfet.c1_haspower());
- FAPI_DBG("L2_HASPOWER ATTR(%d) HW(%d)", l_stop_attrs.l2_haspower, l_clk_pfet.l2_haspower());
- FAPI_DBG("L3_HASPOWER ATTR(%d) HW(%d)", l_stop_attrs.l3_haspower, l_clk_pfet.l3_haspower());
+ FAPI_DBG("L2_HASPOWER ATTR(%d) HW(%d)", o_stop_attrs.l2_haspower, l_clk_pfet.l2_haspower());
+ FAPI_DBG("L3_HASPOWER ATTR(%d) HW(%d)", o_stop_attrs.l3_haspower, l_clk_pfet.l3_haspower());
//----------------------------------------------------------------------------------
// Compare Hardware status vs stop state status. If there is a mismatch, the HW value overrides the stop state
//----------------------------------------------------------------------------------
- compare_ss_hw("C0_exec_HASCLOCKS", l_clk_pfet.c_exec_hasclocks[0], l_stop_attrs.c0_exec_hasclocks);
- compare_ss_hw("C1_exec_HASCLOCKS", l_clk_pfet.c_exec_hasclocks[1], l_stop_attrs.c1_exec_hasclocks);
- compare_ss_hw("C0_pc_HASCLOCKS", l_clk_pfet.c_pc_hasclocks[0], l_stop_attrs.c0_pc_hasclocks);
- compare_ss_hw("C1_pc_HASCLOCKS", l_clk_pfet.c_pc_hasclocks[1], l_stop_attrs.c1_pc_hasclocks);
- compare_ss_hw("L2_HASCLOCKS", l_clk_pfet.l2_hasclocks, l_stop_attrs.l2_hasclocks);
- compare_ss_hw("L3_HASCLOCKS", l_clk_pfet.l3_hasclocks, l_stop_attrs.l3_hasclocks);
+ compare_ss_hw("C0_exec_HASCLOCKS", l_clk_pfet.c_exec_hasclocks[0], o_stop_attrs.c0_exec_hasclocks);
+ compare_ss_hw("C1_exec_HASCLOCKS", l_clk_pfet.c_exec_hasclocks[1], o_stop_attrs.c1_exec_hasclocks);
+ compare_ss_hw("C0_pc_HASCLOCKS", l_clk_pfet.c_pc_hasclocks[0], o_stop_attrs.c0_pc_hasclocks);
+ compare_ss_hw("C1_pc_HASCLOCKS", l_clk_pfet.c_pc_hasclocks[1], o_stop_attrs.c1_pc_hasclocks);
+ compare_ss_hw("L2_HASCLOCKS", l_clk_pfet.l2_hasclocks, o_stop_attrs.l2_hasclocks);
+ compare_ss_hw("L3_HASCLOCKS", l_clk_pfet.l3_hasclocks, o_stop_attrs.l3_hasclocks);
+
+ compare_ss_hw("C0_HASPOWER", l_clk_pfet.c0_haspower(), o_stop_attrs.c0_haspower);
+ compare_ss_hw("C1_HASPOWER", l_clk_pfet.c1_haspower(), o_stop_attrs.c1_haspower);
+ compare_ss_hw("L2_HASPOWER", l_clk_pfet.l2_haspower(), o_stop_attrs.l2_haspower);
+ compare_ss_hw("L3_HASPOWER", l_clk_pfet.l3_haspower(), o_stop_attrs.l3_haspower);
+
- compare_ss_hw("C0_HASPOWER", l_clk_pfet.c0_haspower(), l_stop_attrs.c0_haspower);
- compare_ss_hw("C1_HASPOWER", l_clk_pfet.c1_haspower(), l_stop_attrs.c1_haspower);
- compare_ss_hw("L2_HASPOWER", l_clk_pfet.l2_haspower(), l_stop_attrs.l2_haspower);
- compare_ss_hw("L3_HASPOWER", l_clk_pfet.l3_haspower(), l_stop_attrs.l3_haspower);
+fapi_try_exit:
+ FAPI_INF("< p9_query_stop_state...");
+ return fapi2::current_err;
+}
+
+fapi2::ReturnCode
+p9_query_stop_state(
+ const fapi2::Target<fapi2::TARGET_TYPE_EX>& i_ex_target)
+{
+
+
+ stop_attrs_t l_stop_attrs = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; // Initialize all fields to 1
+ FAPI_TRY(query_stop_state(i_ex_target, l_stop_attrs));
//----------------------------------------------------------------------------------
// Set the Attributes
OpenPOWER on IntegriCloud