summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp/perv
diff options
context:
space:
mode:
authorspashabk-in <shakeebbk@in.ibm.com>2016-12-19 03:25:48 -0600
committerSachin Gupta <sgupta2m@in.ibm.com>2017-01-16 07:39:12 -0500
commit6b72e2618482554e40ce0bb8c379ff94dadbcc91 (patch)
treebc10822c5cc0d8229f16baf484b6c2402bb305ee /src/import/chips/p9/procedures/hwp/perv
parent197375d2fe4c13b0f1bc4f7389c6f53330e9c3be (diff)
downloadtalos-sbe-6b72e2618482554e40ce0bb8c379ff94dadbcc91.tar.gz
talos-sbe-6b72e2618482554e40ce0bb8c379ff94dadbcc91.zip
Modify signature of p9_stopclocks
Since PPE doesn't comprehensively support more than 8 args, modifying the signature of p9_stopcocks Change-Id: I2838207a575184daa2c6c5cc4924257186f7d596 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/34037 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: RAJA DAS <rajadas2@in.ibm.com> Reviewed-by: SRINIVAS V. POLISETTY <srinivan@in.ibm.com> Dev-Ready: Sangram Alapati <sangram@us.ibm.com> Reviewed-by: Joseph J. McGill <jmcgill@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/34920 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/perv')
-rw-r--r--src/import/chips/p9/procedures/hwp/perv/p9_stopclocks.C83
-rw-r--r--src/import/chips/p9/procedures/hwp/perv/p9_stopclocks.H86
2 files changed, 99 insertions, 70 deletions
diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_stopclocks.C b/src/import/chips/p9/procedures/hwp/perv/p9_stopclocks.C
index 6d454b63..a4aff4f9 100644
--- a/src/import/chips/p9/procedures/hwp/perv/p9_stopclocks.C
+++ b/src/import/chips/p9/procedures/hwp/perv/p9_stopclocks.C
@@ -54,32 +54,24 @@
//------------------------------------------------------------------------------
// Function definition: p9_stopclocks
// parameters: i_target => chip target
-// i_stop_nest_clks => True to stop NEST chiplet clocks (should default TRUE)
-// i_stop_mc_clks => True to stop MC chiplet clocks (should default TRUE)
-// i_stop_xbus_clks => True to stop XBUS chiplet clocks (should default TRUE)
-// i_stop_obus_clks => True to stop OBUS chiplet clocks (should default TRUE)
-// i_stop_pcie_clks => True to stop PCIE chiplet clocks (should default TRUE)
-// i_stop_tp_clks => True to stop PERVASIVE (TP) chiplet clocks all except PIB/NET (should default FALSE)
-// i_stop_pib_clks => True to stop PERVASIVE (TP) chiplet PIB/NET clocks (should default FALSE)
-// i_stop_vitl_clks => True to stop PERVASIVE VITL clocks (should default FALSE)
-// i_stop_cache_clks => True to stop CACHE chiplet clocks (should default TRUE)
-// i_stop_core_clks => True to stop CORE chiplet clocks (should default TRUE)
+// i_flags => flags as per the following definition
+// i_flags.stop_nest_clks => True to stop NEST chiplet clocks (should default TRUE)
+// i_flags.stop_mc_clks => True to stop MC chiplet clocks (should default TRUE)
+// i_flags.stop_xbus_clks => True to stop XBUS chiplet clocks (should default TRUE)
+// i_flags.stop_obus_clks => True to stop OBUS chiplet clocks (should default TRUE)
+// i_flags.stop_pcie_clks => True to stop PCIE chiplet clocks (should default TRUE)
+// i_flags.stop_tp_clks => True to stop PERVASIVE (TP) chiplet clocks all except PIB/NET (should default FALSE)
+// i_flags.stop_pib_clks => True to stop PERVASIVE (TP) chiplet PIB/NET clocks (should default FALSE)
+// i_flags.stop_vitl_clks => True to stop PERVASIVE VITL clocks (should default FALSE)
+// i_flags.stop_cache_clks => True to stop CACHE chiplet clocks (should default TRUE)
+// i_flags.stop_core_clks => True to stop CORE chiplet clocks (should default TRUE)
// i_eq_clk_regions => EQ chiplet clock regions of which clocks should be stopped (default ALL_BUT_PLL_REFR)
// i_ex_select => EX chiplet selected for clocks stop (default BOTH_EX)
// returns: FAPI_RC_SUCCESS if operation was successful, else error
//------------------------------------------------------------------------------
fapi2::ReturnCode p9_stopclocks(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target_chip,
- const bool i_stop_nest_clks,
- const bool i_stop_mc_clks,
- const bool i_stop_xbus_clks,
- const bool i_stop_obus_clks,
- const bool i_stop_pcie_clks,
- const bool i_stop_tp_clks,
- const bool i_stop_pib_clks,
- const bool i_stop_vitl_clks,
- const bool i_stop_cache_clks,
- const bool i_stop_core_clks,
+ const p9_stopclocks_flags& i_flags,
const p9hcd::P9_HCD_CLK_CTRL_CONSTANTS i_eq_clk_regions,
const p9hcd::P9_HCD_EX_CTRL_CONSTANTS i_ex_select)
{
@@ -116,11 +108,20 @@ fapi2::ReturnCode p9_stopclocks(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP
FAPI_INF("p9_stopclocks : Entering ...");
- FAPI_DBG("p9_stopclocks : Input arguments received are \n\t i_stop_nest = %d\n\t i_stop_mc = %d\n\t i_stop_xbus = %d\n\t i_stop_obus = %d\n\t i_stop_pcie = %d\n\t i_stop_tp = %d\n\t i_stop_pib = %d\n\t i_stop_vitl = %d\n",
- i_stop_nest_clks, i_stop_mc_clks, i_stop_xbus_clks, i_stop_obus_clks, i_stop_pcie_clks,
- i_stop_tp_clks, i_stop_pib_clks, i_stop_vitl_clks);
- FAPI_DBG("p9_stopclocks : Input QUAD arguments received are \n\t i_stop_cache = %d\n\t i_stop_core = %d\n\t i_eq_clk_regions = %#018lx \n\t i_ex_select = %#018lx\n",
- i_stop_cache_clks, i_stop_core_clks, (uint64_t)i_eq_clk_regions, (uint64_t)i_ex_select);
+ FAPI_DBG("p9_stopclocks : Input arguments received are \n\t"
+ "i_stop_nest = %d\n\t i_stop_mc = %d\n\t i_stop_xbus = %d\n\t"
+ "i_stop_obus = %d\n", i_flags.stop_nest_clks, i_flags.stop_mc_clks,
+ i_flags.stop_xbus_clks, i_flags.stop_obus_clks);
+ FAPI_DBG("i_stop_pcie = %d\n\t i_stop_tp = %d\n\t i_stop_pib = %d\n\t "
+ "i_stop_vitl = %d\n",
+ i_flags.stop_pcie_clks,
+ i_flags.stop_tp_clks, i_flags.stop_pib_clks,
+ i_flags.stop_vitl_clks);
+ FAPI_DBG("p9_stopclocks : Input QUAD arguments received are \n\t"
+ "i_stop_cache = %d\n\t i_stop_core = %d\n\t "
+ "i_eq_clk_regions = %#018lx \n\t i_ex_select = %#018lx\n",
+ i_flags.stop_cache_clks, i_flags.stop_core_clks,
+ (uint64_t)i_eq_clk_regions, (uint64_t)i_ex_select);
FAPI_DBG("p9_stopclocks : Check to see if the Perv Vital clocks are OFF");
#ifdef __PPE__
@@ -149,8 +150,9 @@ fapi2::ReturnCode p9_stopclocks(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP
if(pcb_is_bypassed)
{
- if(i_stop_nest_clks || i_stop_mc_clks || i_stop_xbus_clks || i_stop_obus_clks || i_stop_pcie_clks || i_stop_cache_clks
- || i_stop_core_clks)
+ if(i_flags.stop_nest_clks || i_flags.stop_mc_clks || i_flags.stop_xbus_clks || i_flags.stop_obus_clks
+ || i_flags.stop_pcie_clks || i_flags.stop_cache_clks
+ || i_flags.stop_core_clks)
{
FAPI_ERR("p9_stopclocks : The PIB/PCB is being bypassed, so only the TP chiplet is accessible.");
}
@@ -299,7 +301,7 @@ fapi2::ReturnCode p9_stopclocks(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP
obus_cplt_scomable, pcie_cplt_scomable);
// Core stopclocks
- if(i_stop_core_clks)
+ if(i_flags.stop_core_clks)
{
for (const auto& l_target_core : i_target_chip.getChildren<fapi2::TARGET_TYPE_CORE>(fapi2::TARGET_STATE_FUNCTIONAL))
{
@@ -309,7 +311,7 @@ fapi2::ReturnCode p9_stopclocks(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP
}
// L2 & Cache stopclocks
- if(i_stop_cache_clks)
+ if(i_flags.stop_cache_clks)
{
for (const auto& l_target_eq : i_target_chip.getChildren<fapi2::TARGET_TYPE_EQ>(fapi2::TARGET_STATE_FUNCTIONAL))
{
@@ -320,11 +322,11 @@ fapi2::ReturnCode p9_stopclocks(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP
// Chiplet stopclocks
FAPI_INF("p9_stopclocks : Call p9_cplt_stopclocks function");
- FAPI_TRY(p9_cplt_stopclocks(i_target_chip, (i_stop_xbus_clks && xbus_cplt_scomable), (i_stop_obus_clks
- && obus_cplt_scomable), (i_stop_pcie_clks && pcie_cplt_scomable), (i_stop_mc_clks && mc_cplt_scomable)));
+ FAPI_TRY(p9_cplt_stopclocks(i_target_chip, (i_flags.stop_xbus_clks && xbus_cplt_scomable), (i_flags.stop_obus_clks
+ && obus_cplt_scomable), (i_flags.stop_pcie_clks && pcie_cplt_scomable), (i_flags.stop_mc_clks && mc_cplt_scomable)));
//Nest stopclocks
- if((i_stop_nest_clks && nest_cplt_scomable))
+ if((i_flags.stop_nest_clks && nest_cplt_scomable))
{
FAPI_INF("p9_stopclocks : Call p9_nest_stopclocks function");
FAPI_TRY(p9_nest_stopclocks(i_target_chip));
@@ -332,29 +334,30 @@ fapi2::ReturnCode p9_stopclocks(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP
}
// TP chiplet stopclocks
- if(((i_stop_tp_clks && i_stop_pib_clks) && tp_cplt_scomable) && !(pcb_is_bypassed == false && pcb_clks_are_off == true))
+ if(((i_flags.stop_tp_clks && i_flags.stop_pib_clks) && tp_cplt_scomable) && !(pcb_is_bypassed == false
+ && pcb_clks_are_off == true))
{
FAPI_INF("p9_stopclocks : Call p9_tp_stopclocks function");
- FAPI_TRY(p9_tp_stopclocks(i_target_chip, i_stop_tp_clks, i_stop_pib_clks));
+ FAPI_TRY(p9_tp_stopclocks(i_target_chip, i_flags.stop_tp_clks, i_flags.stop_pib_clks));
}
- else if((i_stop_tp_clks && tp_cplt_scomable) && !(pcb_is_bypassed == false && pcb_clks_are_off == true))
+ else if((i_flags.stop_tp_clks && tp_cplt_scomable) && !(pcb_is_bypassed == false && pcb_clks_are_off == true))
{
FAPI_INF("p9_stopclocks : Call p9_tp_stopclocks function to stop only TP clocks");
- FAPI_TRY(p9_tp_stopclocks(i_target_chip, i_stop_tp_clks, 0));
+ FAPI_TRY(p9_tp_stopclocks(i_target_chip, i_flags.stop_tp_clks, 0));
}
- else if(i_stop_pib_clks && !tp_vitl_clk_off && !tp_ep_rst && tp_mesh_clk_en)
+ else if(i_flags.stop_pib_clks && !tp_vitl_clk_off && !tp_ep_rst && tp_mesh_clk_en)
{
FAPI_INF("p9_stopclocks : Call p9_tp_stopclocks function to stop only PIB clocks");
- FAPI_TRY(p9_tp_stopclocks(i_target_chip, 0, i_stop_pib_clks));
+ FAPI_TRY(p9_tp_stopclocks(i_target_chip, 0, i_flags.stop_pib_clks));
}
- else if(i_stop_tp_clks || i_stop_pib_clks)
+ else if(i_flags.stop_tp_clks || i_flags.stop_pib_clks)
{
FAPI_ERR("p9_stopclocks : Invalid condition to stop TP chiplet clocks\n\t TP_CPLT_SCOMABLE= %d, PCB_IS_BYPASSED=%d, PCB_CLKS_ARE_OFF=%d TP_MESH_CLK_EN=%d",
tp_cplt_scomable, pcb_is_bypassed, pcb_clks_are_off, tp_mesh_clk_en);
}
// Vital stopclocks
- if(i_stop_vitl_clks)
+ if(i_flags.stop_vitl_clks)
{
#ifdef __PPE__
FAPI_ERR("p9_stopclocks : WARNING::VITAL clocks can't be stopped in SBE mode\n\t --> Skipping VITAL Stopclocks..! <--");
diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_stopclocks.H b/src/import/chips/p9/procedures/hwp/perv/p9_stopclocks.H
index 2e6ee45b..a5dacb06 100644
--- a/src/import/chips/p9/procedures/hwp/perv/p9_stopclocks.H
+++ b/src/import/chips/p9/procedures/hwp/perv/p9_stopclocks.H
@@ -43,17 +43,51 @@
#include <fapi2.H>
#include <p9_hcd_common.H>
+// Structure to select flags for stop clocks
+struct p9_stopclocks_flags
+{
+ uint32_t stop_nest_clks : 1; //True if NEST chiplet clocks should be stopped, else false
+ uint32_t stop_mc_clks : 1; //True if MC chiplet clocks should be stopped, else false
+ uint32_t stop_xbus_clks : 1; //True if XBUS chiplet clocks should be stopped, else false
+ uint32_t stop_obus_clks : 1; //True if OBUS chiplet clocks should be stopped, else false
+ uint32_t stop_pcie_clks : 1; //True if PCIE chiplet clocks should be stopped, else false
+ uint32_t stop_tp_clks : 1; //True if PERV (TP) chiplet clocks all except PIB/NET should be stopped, else false
+ uint32_t stop_pib_clks : 1; //True if PERV (TP) chiplet PIB/NET clocks should be stopped, else false
+ uint32_t stop_vitl_clks : 1; //True if PERV VITL clocks should be stopped, else false
+ uint32_t stop_cache_clks : 1; //True if CACHE chiplet clocks should be stopped, else false
+ uint32_t stop_core_clks : 1; //True if CORE chiplet clocks should be stopped, else false
+ // Default constructor - fill default values
+ p9_stopclocks_flags()
+ {
+ stop_nest_clks = true;
+ stop_mc_clks = true;
+ stop_xbus_clks = true;
+ stop_obus_clks = true;
+ stop_pcie_clks = true;
+ stop_tp_clks = false;
+ stop_pib_clks = false;
+ stop_vitl_clks = false;
+ stop_cache_clks = true;
+ stop_core_clks = true;
+ }
+ // Set all the flags to false
+ void clearAll()
+ {
+ stop_nest_clks = false;
+ stop_mc_clks = false;
+ stop_xbus_clks = false;
+ stop_obus_clks = false;
+ stop_pcie_clks = false;
+ stop_tp_clks = false;
+ stop_pib_clks = false;
+ stop_vitl_clks = false;
+ stop_cache_clks = false;
+ stop_core_clks = false;
+ }
+};
+
typedef fapi2::ReturnCode (*p9_stopclocks_FP_t)(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>&,
- const bool,
- const bool,
- const bool,
- const bool,
- const bool,
- const bool,
- const bool,
- const bool,
- const bool,
- const bool,
+ const p9_stopclocks_flags& i_flags,
const p9hcd::P9_HCD_CLK_CTRL_CONSTANTS,
const p9hcd::P9_HCD_EX_CTRL_CONSTANTS );
@@ -63,32 +97,24 @@ extern "C"
* @brief p9_stopclocks procedure: The purpose of this procedure is to stop the clocks of the P9 processor chip
*
* @param[in] i_target Reference to processor chip target
- * @param[in] i_stop_nest_clks True if NEST chiplet clocks should be stopped, else false
- * @param[in] i_stop_mc_clks True if MC chiplet clocks should be stopped, else false
- * @param[in] i_stop_xbus_clks True if XBUS chiplet clocks should be stopped, else false
- * @param[in] i_stop_obus_clks True if OBUS chiplet clocks should be stopped, else false
- * @param[in] i_stop_pcie_clks True if PCIE chiplet clocks should be stopped, else false
- * @param[in] i_stop_tp_clks True if PERV (TP) chiplet clocks all except PIB/NET should be stopped, else false
- * @param[in] i_stop_pib_clks True if PERV (TP) chiplet PIB/NET clocks should be stopped, else false
- * @param[in] i_stop_vitl_clks True if PERV VITL clocks should be stopped, else false
- * @param[in] i_stop_cache_clks True if CACHE chiplet clocks should be stopped, else false
- * @param[in] i_stop_core_clks True if CORE chiplet clocks should be stopped, else false
+ * @param[in] i_flags Flags as per the following definition
+ * i_flags.stop_nest_clks True if NEST chiplet clocks should be stopped, else false
+ * i_flags.stop_mc_clks True if MC chiplet clocks should be stopped, else false
+ * i_flags.stop_xbus_clks True if XBUS chiplet clocks should be stopped, else false
+ * i_flags.stop_obus_clks True if OBUS chiplet clocks should be stopped, else false
+ * i_flags.stop_pcie_clks True if PCIE chiplet clocks should be stopped, else false
+ * i_flags.stop_tp_clks True if PERV (TP) chiplet clocks all except PIB/NET should be stopped, else false
+ * i_flags.stop_pib_clks True if PERV (TP) chiplet PIB/NET clocks should be stopped, else false
+ * i_flags.stop_vitl_clks True if PERV VITL clocks should be stopped, else false
+ * i_flags.stop_cache_clks True if CACHE chiplet clocks should be stopped, else false
+ * i_flags.stop_core_clks True if CORE chiplet clocks should be stopped, else false
* @param[in] i_eq_clk_regions EQ chiplet clock regions of which clocks should be stopped
* @param[in] i_ex_select EX chiplet selected for clocks stop
*
* @return ReturnCode
*/
fapi2::ReturnCode p9_stopclocks(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target_chip,
- const bool i_stop_nest_clks = true,
- const bool i_stop_mc_clks = true,
- const bool i_stop_xbus_clks = true,
- const bool i_stop_obus_clks = true,
- const bool i_stop_pcie_clks = true,
- const bool i_stop_tp_clks = false,
- const bool i_stop_pib_clks = false,
- const bool i_stop_vitl_clks = false,
- const bool i_stop_cache_clks = true,
- const bool i_stop_core_clks = true,
+ const p9_stopclocks_flags& i_flags = p9_stopclocks_flags(),
const p9hcd::P9_HCD_CLK_CTRL_CONSTANTS i_eq_clk_regions = p9hcd::CLK_REGION_ALL_BUT_PLL_REFR,
const p9hcd::P9_HCD_EX_CTRL_CONSTANTS i_ex_select = p9hcd::BOTH_EX);
}
OpenPOWER on IntegriCloud