diff options
author | Soma BhanuTej <soma.bhanu@in.ibm.com> | 2016-09-15 12:12:44 -0400 |
---|---|---|
committer | Sachin Gupta <sgupta2m@in.ibm.com> | 2017-01-16 04:49:47 -0500 |
commit | e31e7d6991ab0f507ff0b13c3a2ec052d7c1f851 (patch) | |
tree | 5a4a591a3041377cb5bae4a740440857d52f1d25 /src/import/chips/p9/procedures/hwp/perv | |
parent | 540b899b4a01c87ca367a25433597ff79be0fb56 (diff) | |
download | talos-sbe-e31e7d6991ab0f507ff0b13c3a2ec052d7c1f851.tar.gz talos-sbe-e31e7d6991ab0f507ff0b13c3a2ec052d7c1f851.zip |
Stopclock procedure updates
-> Support for -skipPibNet region for Perv stopClocks
-> Support required for SBE Plat
Change-Id: Iec45cba0733cd727c8f6c4c83eacad5fa3f273c5
RTC:160787
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29778
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Joachim Fenkes <fenkes@de.ibm.com>
Reviewed-by: Sunil Kumar <skumar8j@in.ibm.com>
Reviewed-by: PARVATHI RACHAKONDA <prachako@in.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/34915
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/perv')
4 files changed, 110 insertions, 56 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 d37354df..5af89718 100644 --- a/src/import/chips/p9/procedures/hwp/perv/p9_stopclocks.C +++ b/src/import/chips/p9/procedures/hwp/perv/p9_stopclocks.C @@ -55,7 +55,8 @@ // i_stop_xbus_clks => True to stop XBUS chiplet clocks (should default TRUE) // i_stop_abus_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 (should default FALSE) +// 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_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) @@ -69,6 +70,7 @@ fapi2::ReturnCode p9_stopclocks(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP 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 p9hcd::P9_HCD_CLK_CTRL_CONSTANTS i_eq_clk_regions, const p9hcd::P9_HCD_EX_CTRL_CONSTANTS i_ex_select) @@ -98,38 +100,40 @@ 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_clks = %s\n\t i_stop_mc_clks = %s\n\t i_stop_xbus_clks = %s\n\t i_stop_obus_clks = %s\n\t i_stop_pcie_clks = %s\n\t i_stop_tp_clks = %s\n\t i_stop_vitl_clks = %s\n", + FAPI_DBG("p9_stopclocks : Input arguments received are \n\t i_stop_nest_clks = %s\n\t i_stop_mc_clks = %s\n\t i_stop_xbus_clks = %s\n\t i_stop_obus_clks = %s\n\t i_stop_pcie_clks = %s\n\t i_stop_tp_clks = %s\n\t i_stop_pib_clks = %s\n\t i_stop_vitl_clks = %s\n", btos(i_stop_nest_clks), btos(i_stop_mc_clks), btos(i_stop_xbus_clks), btos(i_stop_obus_clks), btos(i_stop_pcie_clks), - btos(i_stop_tp_clks), btos(i_stop_vitl_clks)); + btos(i_stop_tp_clks), btos(i_stop_pib_clks), btos(i_stop_vitl_clks)); FAPI_DBG("p9_stopclocks : Input CACHE arguments received are \n\t i_eq_clk_regions = %#018lx \n\t i_ex_select = %#018lx\n", (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__ + FAPI_TRY(fapi2::getScom(i_target_chip, PERV_PERV_CTRL0_SCOM, l_data64)); + perv_vitl_clks_off = l_data64.getBit<PERV_PERV_CTRL0_TP_VITL_CLKOFF_DC>(); +#else FAPI_TRY(fapi2::getCfamRegister(i_target_chip, PERV_PERV_CTRL0_FSI, l_cfam_data)); + perv_vitl_clks_off = l_cfam_data.getBit<PERV_PERV_CTRL0_TP_VITL_CLKOFF_DC>(); +#endif - if(l_cfam_data.getBit<PERV_PERV_CTRL0_TP_VITL_CLKOFF_DC>()) + if(perv_vitl_clks_off) { FAPI_INF("p9_stopclocks : Perv Vital clocks are off, so stopclocks cant go ahead"); - perv_vitl_clks_off = true; - } - else - { - perv_vitl_clks_off = false; } if(!(perv_vitl_clks_off)) { FAPI_DBG("p9_stopclocks : Check to see if the PIB/PCB network is being bypassed"); +#ifdef __PPE__ + FAPI_TRY(fapi2::getScom(i_target_chip, PERV_ROOT_CTRL0_SCOM, l_data64)); + pcb_is_bypassed = l_data64.getBit<PERV_ROOT_CTRL0_PIB2PCB_DC>(); +#else FAPI_TRY(fapi2::getCfamRegister(i_target_chip, PERV_ROOT_CTRL0_FSI, l_cfam_data)); + pcb_is_bypassed = l_cfam_data.getBit<PERV_ROOT_CTRL0_PIB2PCB_DC>(); +#endif - if(l_cfam_data.getBit<PERV_ROOT_CTRL0_PIB2PCB_DC>()) + if(pcb_is_bypassed) { FAPI_INF("p9_stopclocks : The PIB/PCB is being bypassed, so only the TP chiplet is accessible."); - pcb_is_bypassed = true; - } - else - { - pcb_is_bypassed = false; } @@ -240,15 +244,18 @@ fapi2::ReturnCode p9_stopclocks(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP } // TP chiplet stopclocks - if((i_stop_tp_clks && tp_cplt_scomable) && !(pcb_is_bypassed == false && pcb_clks_are_off == true)) + if(((i_stop_tp_clks || i_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)); + FAPI_TRY(p9_tp_stopclocks(i_target_chip, i_stop_tp_clks, i_stop_pib_clks)); } // Vital stopclocks if(i_stop_vitl_clks) { +#ifdef __PPE__ + FAPI_INF("p9_stopclocks : WARNING::VITAL clocks can't be stopped in SBE mode\n\t --> Skipping VITAL Stopclocks..! <--"); +#else FAPI_INF("p9_stopclocks : Stopping Pervasive VITAL clocks"); FAPI_DBG("Reading the current value of PERV_CTRL0 register"); @@ -270,6 +277,7 @@ fapi2::ReturnCode p9_stopclocks(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP FAPI_DBG("Writing the ROOT_CTRL0 register to raise FSI fence 4 and 5"); FAPI_TRY(fapi2::putCfamRegister(i_target_chip, PERV_ROOT_CTRL0_FSI, l_cfam_data)); +#endif } } 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 45efb63d..3338f667 100644 --- a/src/import/chips/p9/procedures/hwp/perv/p9_stopclocks.H +++ b/src/import/chips/p9/procedures/hwp/perv/p9_stopclocks.H @@ -51,6 +51,7 @@ typedef fapi2::ReturnCode (*p9_stopclocks_FP_t)(const fapi2::Target<fapi2::TARGE const bool, const bool, const bool, + const bool, const p9hcd::P9_HCD_CLK_CTRL_CONSTANTS, const p9hcd::P9_HCD_EX_CTRL_CONSTANTS ); @@ -65,7 +66,8 @@ extern "C" * @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 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_eq_clk_regions EQ chiplet clock regions of which clocks should be stopped * @param[in] i_ex_select EX chiplet selected for clocks stop @@ -79,6 +81,7 @@ extern "C" 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 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); diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_tp_stopclocks.C b/src/import/chips/p9/procedures/hwp/perv/p9_tp_stopclocks.C index 508beaed..8c5d2b03 100644 --- a/src/import/chips/p9/procedures/hwp/perv/p9_tp_stopclocks.C +++ b/src/import/chips/p9/procedures/hwp/perv/p9_tp_stopclocks.C @@ -45,45 +45,84 @@ #include <p9_sbe_common.H> #include <p9_common_stopclocks.H> - enum P9_TP_STOPCLOCKS_Private_Constants { CLOCK_CMD = 0x2, CLOCK_TYPES = 0x7, DONT_STARTMASTER = 0x0, DONT_STARTSLAVE = 0x0, + REGIONS_ONLY_PIB_NET = 0x300, + REGIONS_ALL_EXCEPT_PIB_NET_PLL = 0x4FE, REGIONS_ALL_EXCEPT_PLL = 0x7FE, STARTMASTER = 0x1, STARTSLAVE = 0x1 }; -fapi2::ReturnCode p9_tp_stopclocks(const - fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target_chip) +fapi2::ReturnCode p9_tp_stopclocks(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target_chip, + const bool i_stop_tp_clks, const bool i_stop_pib_clks) { fapi2::buffer<uint64_t> l_clock_regions; fapi2::buffer<uint32_t> l_data32; fapi2::buffer<uint32_t> l_data32_root_ctrl0; FAPI_INF("p9_tp_stopclocks: Entering ..."); - FAPI_DBG("p9_tp_stopclocks: Raise chiplet fence"); - //Setting PERV_CTRL0 register value - FAPI_TRY(fapi2::getCfamRegister(i_target_chip, PERV_PERV_CTRL0_FSI, l_data32)); - //CFAM.PERV_CTRL0.TP_FENCE_EN_DC = 1 - l_data32.setBit<PERV_PERV_CTRL0_SET_TP_FENCE_EN_DC>(); - FAPI_TRY(fapi2::putCfamRegister(i_target_chip, PERV_PERV_CTRL0_FSI, l_data32)); - - FAPI_DBG("p9_tp_stopclocks: Raise pib2pcb mux"); - //Setting ROOT_CTRL0 register value - FAPI_TRY(fapi2::getCfamRegister(i_target_chip, PERV_ROOT_CTRL0_FSI, - l_data32_root_ctrl0)); - //CFAM.ROOT_CTRL0.PIB2PCB_DC = 1 - l_data32_root_ctrl0.setBit<PERV_ROOT_CTRL0_SET_PIB2PCB_DC>(); - FAPI_TRY(fapi2::putCfamRegister(i_target_chip, PERV_ROOT_CTRL0_FSI, - l_data32_root_ctrl0)); - - FAPI_TRY(p9_perv_sbe_cmn_regions_setup_64( - i_target_chip.getChildren<fapi2::TARGET_TYPE_PERV>(fapi2::TARGET_FILTER_TP, - fapi2::TARGET_STATE_FUNCTIONAL)[0], REGIONS_ALL_EXCEPT_PLL, l_clock_regions)); + if(!(i_stop_tp_clks || i_stop_pib_clks)) //Atleast one must be TRUE + { + FAPI_INF("p9_tp_stopclocks: Input arguments \n\t i_stop_tp_clks = %s \n\t i_stop_pib_clks = %s", btos(i_stop_tp_clks), + btos(i_stop_pib_clks)); + FAPI_ERR("p9_tp_stopclocks: Calling stopclocks without selecting any regions\n\t --> Skipping TP Stopclocks..! <--"); + goto fapi_try_exit; + } + + if(i_stop_pib_clks) + { +#ifdef __PPE__ + FAPI_ERR("p9_tp_stopclocks: Calling TP stopclocks for PIB & NET regions in SBE mode is INVALID\n\t --> Skipping TP Stopclocks for PIB/NET regions..! <--"); + goto fapi_try_exit; +#endif + } + + if(i_stop_pib_clks) + { + FAPI_DBG("p9_tp_stopclocks: Raise chiplet fence"); + //Setting PERV_CTRL0 register value + FAPI_TRY(fapi2::getCfamRegister(i_target_chip, PERV_PERV_CTRL0_FSI, l_data32)); + //CFAM.PERV_CTRL0.TP_FENCE_EN_DC = 1 + l_data32.setBit<PERV_PERV_CTRL0_SET_TP_FENCE_EN_DC>(); + FAPI_TRY(fapi2::putCfamRegister(i_target_chip, PERV_PERV_CTRL0_FSI, l_data32)); + + FAPI_DBG("p9_tp_stopclocks: Raise pib2pcb mux"); + //Setting ROOT_CTRL0 register value + FAPI_TRY(fapi2::getCfamRegister(i_target_chip, PERV_ROOT_CTRL0_FSI, + l_data32_root_ctrl0)); + //CFAM.ROOT_CTRL0.PIB2PCB_DC = 1 + l_data32_root_ctrl0.setBit<PERV_ROOT_CTRL0_SET_PIB2PCB_DC>(); + FAPI_TRY(fapi2::putCfamRegister(i_target_chip, PERV_ROOT_CTRL0_FSI, + l_data32_root_ctrl0)); + } + + if(i_stop_tp_clks && i_stop_pib_clks) + { + FAPI_DBG("p9_tp_stopclocks: TP regions selected is REGIONS_ALL_EXCEPT_PLL"); + FAPI_TRY(p9_perv_sbe_cmn_regions_setup_64( + i_target_chip.getChildren<fapi2::TARGET_TYPE_PERV>(fapi2::TARGET_FILTER_TP, + fapi2::TARGET_STATE_FUNCTIONAL)[0], REGIONS_ALL_EXCEPT_PLL, l_clock_regions)); + } + else if(i_stop_tp_clks) + { + FAPI_DBG("p9_tp_stopclocks: TP regions selected is REGIONS_ALL_EXCEPT_PIB_NET_PLL"); + FAPI_TRY(p9_perv_sbe_cmn_regions_setup_64( + i_target_chip.getChildren<fapi2::TARGET_TYPE_PERV>(fapi2::TARGET_FILTER_TP, + fapi2::TARGET_STATE_FUNCTIONAL)[0], REGIONS_ALL_EXCEPT_PIB_NET_PLL, l_clock_regions)); + } + else if(i_stop_pib_clks) + { + FAPI_DBG("p9_tp_stopclocks: TP regions selected is REGIONS_ONLY_PIB_NET"); + FAPI_TRY(p9_perv_sbe_cmn_regions_setup_64( + i_target_chip.getChildren<fapi2::TARGET_TYPE_PERV>(fapi2::TARGET_FILTER_TP, + fapi2::TARGET_STATE_FUNCTIONAL)[0], REGIONS_ONLY_PIB_NET, l_clock_regions)); + } + FAPI_DBG("p9_tp_stopclocks: Regions value: %#018lX", l_clock_regions); FAPI_DBG("p9_tp_stopclocks: Call module clock start stop for Tp chiplet"); @@ -102,21 +141,25 @@ fapi2::ReturnCode p9_tp_stopclocks(const i_target_chip.getChildren<fapi2::TARGET_TYPE_PERV>(fapi2::TARGET_FILTER_TP, fapi2::TARGET_STATE_FUNCTIONAL)[0])); - FAPI_INF("p9_tp_stopclocks: Raise OOB Mux"); - //Setting ROOT_CTRL0 register value - //CFAM.ROOT_CTRL0.OOB_MUX = 1 - l_data32_root_ctrl0.setBit<PERV_ROOT_CTRL0_SET_OOB_MUX>(); - FAPI_TRY(fapi2::putCfamRegister(i_target_chip, PERV_ROOT_CTRL0_FSI, - l_data32_root_ctrl0)); - - FAPI_INF("p9_tp_stopclocks: Raise Global Endpoint reset"); - //Setting ROOT_CTRL0 register value - //CFAM.ROOT_CTRL0.GLOBAL_EP_RESET_DC = 1 - l_data32_root_ctrl0.setBit<PERV_ROOT_CTRL0_SET_GLOBAL_EP_RESET_DC>(); - FAPI_TRY(fapi2::putCfamRegister(i_target_chip, PERV_ROOT_CTRL0_FSI, - l_data32_root_ctrl0)); + if(i_stop_pib_clks) + { + FAPI_INF("p9_tp_stopclocks: Raise OOB Mux"); + //Setting ROOT_CTRL0 register value + //CFAM.ROOT_CTRL0.OOB_MUX = 1 + l_data32_root_ctrl0.setBit<PERV_ROOT_CTRL0_SET_OOB_MUX>(); + FAPI_TRY(fapi2::putCfamRegister(i_target_chip, PERV_ROOT_CTRL0_FSI, + l_data32_root_ctrl0)); + + FAPI_INF("p9_tp_stopclocks: Raise Global Endpoint reset"); + //Setting ROOT_CTRL0 register value + //CFAM.ROOT_CTRL0.GLOBAL_EP_RESET_DC = 1 + l_data32_root_ctrl0.setBit<PERV_ROOT_CTRL0_SET_GLOBAL_EP_RESET_DC>(); + FAPI_TRY(fapi2::putCfamRegister(i_target_chip, PERV_ROOT_CTRL0_FSI, + l_data32_root_ctrl0)); + } FAPI_INF("p9_tp_stopclocks: Exiting ..."); + fapi_try_exit: return fapi2::current_err; diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_tp_stopclocks.H b/src/import/chips/p9/procedures/hwp/perv/p9_tp_stopclocks.H index cd9a71e3..75ddd845 100644 --- a/src/import/chips/p9/procedures/hwp/perv/p9_tp_stopclocks.H +++ b/src/import/chips/p9/procedures/hwp/perv/p9_tp_stopclocks.H @@ -38,13 +38,13 @@ #ifndef _P9_TP_STOPCLOCKS_H_ #define _P9_TP_STOPCLOCKS_H_ - +#define btos(x) ((x)?"TRUE":"FALSE") #include <fapi2.H> typedef fapi2::ReturnCode (*p9_tp_stopclocks_FP_t)(const - fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>&); + fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>&, bool, bool); /// @brief Stop clocks for TP chiplet /// @@ -53,7 +53,7 @@ typedef fapi2::ReturnCode (*p9_tp_stopclocks_FP_t)(const extern "C" { fapi2::ReturnCode p9_tp_stopclocks(const - fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target_chip); + fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target_chip, const bool i_stop_tp_clks, const bool i_stop_pib_clks); } #endif |