From ace2c563f607cd1aabf3b0daa82bc9112135e35d Mon Sep 17 00:00:00 2001 From: Soma BhanuTej Date: Thu, 1 Feb 2018 03:30:20 -0500 Subject: Axone support to TP stopclocks Change-Id: I0960ec588156f3df3f863b6c5fa41bbed95e089e RTC: 183048 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53139 Tested-by: FSP CI Jenkins Tested-by: HWSV CI Tested-by: Jenkins Server Tested-by: PPE CI Dev-Ready: Soma Bhanutej Reviewed-by: Soma Bhanutej Reviewed-by: SRINIVAS V. POLISETTY Reviewed-by: Joseph J. McGill Reviewed-by: NAGENDRA K. GURRAM Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53152 Reviewed-by: Sachin Gupta --- .../p9/procedures/hwp/perv/p9_common_stopclocks.C | 14 ++- .../p9/procedures/hwp/perv/p9_common_stopclocks.H | 4 +- .../p9/procedures/hwp/perv/p9_tp_stopclocks.C | 132 ++++++++++++++------- .../xml/attribute_info/chip_ec_attributes.xml | 17 +++ .../xml/attribute_info/p9_sbe_attributes.xml | 4 + 5 files changed, 125 insertions(+), 46 deletions(-) (limited to 'src/import/chips/p9') diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_common_stopclocks.C b/src/import/chips/p9/procedures/hwp/perv/p9_common_stopclocks.C index 83e5dbd1..c506afea 100644 --- a/src/import/chips/p9/procedures/hwp/perv/p9_common_stopclocks.C +++ b/src/import/chips/p9/procedures/hwp/perv/p9_common_stopclocks.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -59,20 +59,28 @@ enum P9_common_stopclocks_Private_Constants /// --Clear abstclk muxsel & Set syncclk_muxsel /// /// @param[in] i_target_chiplet Reference to TARGET_TYPE_PERV target +/// @param[in] i_regions Input clock regions /// @return FAPI2_RC_SUCCESS if success, else error code. fapi2::ReturnCode p9_common_stopclocks_cplt_ctrl_action_function( - const fapi2::Target& i_target_chiplet) + const fapi2::Target& i_target_chiplet, fapi2::buffer i_regions) { // Local variable and constant definition fapi2::buffer l_cplt_ctrl_init; fapi2::buffer l_attr_pg; + fapi2::buffer l_regions; fapi2::buffer l_data64; + FAPI_INF("Entering p9_common_stopclocks_cplt_ctrl_action_function..."); FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PG, i_target_chiplet, l_attr_pg)); l_attr_pg.invert(); - l_attr_pg.extractToRight<4, 11>(l_cplt_ctrl_init); + FAPI_DBG("Masking with regions bits enabled : %#018lX ", i_regions); + i_regions.extractToRight<53, 11>(l_regions); + l_regions = (l_attr_pg >> 1) & l_regions; + FAPI_DBG("Effective l_regions : %#06lX", l_regions); + + l_regions.extractToRight<5, 11>(l_cplt_ctrl_init); FAPI_DBG("Raise partial good fences"); //Setting CPLT_CTRL1 register value diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_common_stopclocks.H b/src/import/chips/p9/procedures/hwp/perv/p9_common_stopclocks.H index 548fd9a1..b7dfeeb3 100644 --- a/src/import/chips/p9/procedures/hwp/perv/p9_common_stopclocks.H +++ b/src/import/chips/p9/procedures/hwp/perv/p9_common_stopclocks.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -43,7 +43,7 @@ #include fapi2::ReturnCode p9_common_stopclocks_cplt_ctrl_action_function( - const fapi2::Target& i_target_chiplet); + const fapi2::Target& i_target_chiplet, fapi2::buffer i_regions = 0xFFFFFFFFFFFFFFFF); fapi2::ReturnCode p9_common_stopclocks_raise_fence( const fapi2::Target& i_target_chiplet); 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 add2685d..06c108a6 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 @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -52,42 +52,53 @@ enum P9_TP_STOPCLOCKS_Private_Constants DONT_STARTMASTER = 0x0, DONT_STARTSLAVE = 0x0, REGIONS_ONLY_PIB_NET = 0x300, + REGIONS_ONLY_PIB_NET_SBE = 0x320, REGIONS_ALL_EXCEPT_PIB_NET = 0x4FF, + REGIONS_ALL_EXCEPT_PIB_NET_SBE = 0x4DF, REGIONS_ALL_INCLUDING_PLL = 0x7FF, STARTMASTER = 0x1, STARTSLAVE = 0x1 }; fapi2::ReturnCode p9_tp_stopclocks(const fapi2::Target& i_target_chip, - const bool i_stop_tp_clks, const bool i_stop_pib_clks) + const bool i_stop_tp_clks, + const bool i_stop_pib_clks //Axone: PIB, NET & SBE clocks; Nimbus & Cumulus: PIB & NET clocks + ) { fapi2::buffer l_clock_regions; fapi2::buffer l_data32; fapi2::buffer l_data32_root_ctrl0; + fapi2::buffer l_is_axone; FAPI_INF("p9_tp_stopclocks: Entering ..."); + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_CHIP_EC_FEATURE_P9A_STOPCLOCKS, i_target_chip, l_is_axone)); + + FAPI_INF("p9_tp_stopclocks: Input arguments \n\t i_stop_tp_clks = %s \n\t i_stop_pib_clks = %s \n\t Axone_chip = %s", + btos(i_stop_tp_clks), btos(i_stop_pib_clks), btos(l_is_axone)); + 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..! <--"); + fapi2::current_err = fapi2::FAPI2_RC_INVALID_PARAMETER; goto fapi_try_exit; } -#ifdef __PPE__ - if(i_stop_pib_clks) { - 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 +#ifdef __PPE__ -#ifndef __PPE__ + if(l_is_axone) + { + FAPI_ERR("p9_tp_stopclocks: Calling TP stopclocks for PIB, NET & SBE regions in SBE mode is INVALID\n\t --> Skipping TP Stopclocks for PIB/NET/SBE regions..! <--"); + } + else + { + 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..! <--"); + } - if(i_stop_pib_clks) - { + fapi2::current_err = fapi2::FAPI2_RC_INVALID_PARAMETER; + goto fapi_try_exit; +#else 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)); @@ -103,28 +114,71 @@ fapi2::ReturnCode p9_tp_stopclocks(const fapi2::Target(); FAPI_TRY(fapi2::putCfamRegister(i_target_chip, PERV_ROOT_CTRL0_FSI, l_data32_root_ctrl0)); - } + + if(l_is_axone) + { + FAPI_DBG("p9_tp_stopclocks: Enabling PCB_RESET"); + //CFAM.ROOT_CTRL0.PERV_ROOT_CTRL0_PCB_RESET_DC = 1 + l_data32_root_ctrl0.setBit(); + FAPI_TRY(fapi2::putCfamRegister(i_target_chip, PERV_ROOT_CTRL0_FSI, l_data32_root_ctrl0)); + + FAPI_DBG("p9_tp_stopclocks: Switching off PIB2PCB & PCB2PCB path"); + l_data32_root_ctrl0.clearBit(); + l_data32_root_ctrl0.clearBit(); + FAPI_TRY(fapi2::putCfamRegister(i_target_chip, PERV_ROOT_CTRL0_FSI, l_data32_root_ctrl0)); + + FAPI_DBG("p9_tp_stopclocks: Clear PCB_RESET"); + //CFAM.ROOT_CTRL0.PERV_ROOT_CTRL0_PCB_RESET_DC = 0 + l_data32_root_ctrl0.clearBit(); + FAPI_TRY(fapi2::putCfamRegister(i_target_chip, PERV_ROOT_CTRL0_FSI, l_data32_root_ctrl0)); + } #endif + } + //Configuring Clock regions that needs to be clockstopped if(i_stop_tp_clks && i_stop_pib_clks) { FAPI_DBG("p9_tp_stopclocks: TP regions selected is REGIONS_ALL_INCLUDING_PLL"); - FAPI_TRY(p9_perv_sbe_cmn_regions_setup_64( - i_target_chip.getChildren(fapi2::TARGET_FILTER_TP, - fapi2::TARGET_STATE_FUNCTIONAL)[0], REGIONS_ALL_INCLUDING_PLL, l_clock_regions)); - FAPI_DBG("p9_tp_stopclocks: Regions value: %#018lX", l_clock_regions); + FAPI_TRY(p9_perv_sbe_cmn_regions_setup_64(i_target_chip.getChildren(fapi2::TARGET_FILTER_TP, + fapi2::TARGET_STATE_FUNCTIONAL)[0], REGIONS_ALL_INCLUDING_PLL, l_clock_regions)); + } + else if(i_stop_tp_clks && !i_stop_pib_clks) + { + if(l_is_axone) + { + FAPI_DBG("p9_tp_stopclocks: TP regions selected is REGIONS_ALL_EXCEPT_PIB_NET_SBE"); + FAPI_TRY(p9_perv_sbe_cmn_regions_setup_64(i_target_chip.getChildren(fapi2::TARGET_FILTER_TP, + fapi2::TARGET_STATE_FUNCTIONAL)[0], REGIONS_ALL_EXCEPT_PIB_NET_SBE, l_clock_regions)); + } + else + { + FAPI_DBG("p9_tp_stopclocks: TP regions selected is REGIONS_ALL_EXCEPT_PIB_NET"); + FAPI_TRY(p9_perv_sbe_cmn_regions_setup_64(i_target_chip.getChildren(fapi2::TARGET_FILTER_TP, + fapi2::TARGET_STATE_FUNCTIONAL)[0], REGIONS_ALL_EXCEPT_PIB_NET, l_clock_regions)); + } } - else if(i_stop_tp_clks) + else if(!i_stop_tp_clks && i_stop_pib_clks) { - FAPI_DBG("p9_tp_stopclocks: TP regions selected is REGIONS_ALL_EXCEPT_PIB_NET"); - FAPI_TRY(p9_perv_sbe_cmn_regions_setup_64( - i_target_chip.getChildren(fapi2::TARGET_FILTER_TP, - fapi2::TARGET_STATE_FUNCTIONAL)[0], REGIONS_ALL_EXCEPT_PIB_NET, l_clock_regions)); - FAPI_DBG("p9_tp_stopclocks: Regions value: %#018lX", l_clock_regions); + if(l_is_axone) + { + FAPI_DBG("p9_tp_stopclocks: TP regions selected is REGIONS_ONLY_PIB_NET_SBE"); + FAPI_TRY(p9_perv_sbe_cmn_regions_setup_64(i_target_chip.getChildren(fapi2::TARGET_FILTER_TP, + fapi2::TARGET_STATE_FUNCTIONAL)[0], REGIONS_ONLY_PIB_NET_SBE, l_clock_regions)); + } + else + { + 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_FILTER_TP, + fapi2::TARGET_STATE_FUNCTIONAL)[0], REGIONS_ONLY_PIB_NET, l_clock_regions)); + } } - if(!i_stop_tp_clks && i_stop_pib_clks) //Using CBS interface to stop clock in PIB & NET + FAPI_DBG("p9_tp_stopclocks: Regions value: %#018lX", l_clock_regions); + + + + if((!i_stop_tp_clks && i_stop_pib_clks) && !l_is_axone) //Using CBS interface to stop clock { FAPI_DBG("p9_tp_stopclocks: Call module clock start stop for PIB, NET only"); FAPI_TRY(p9_common_stopclocks_pib_net_clkstop(i_target_chip)); @@ -132,29 +186,25 @@ fapi2::ReturnCode p9_tp_stopclocks(const fapi2::Target(fapi2::TARGET_FILTER_TP, - fapi2::TARGET_STATE_FUNCTIONAL)[0], CLOCK_CMD, DONT_STARTSLAVE, DONT_STARTMASTER, - l_clock_regions, CLOCK_TYPES)); - - FAPI_DBG("p9_tp_stopclocks: Assert vital fence and set flush_inhibit"); - FAPI_TRY(p9_common_stopclocks_set_vitalfence_flushmode( - i_target_chip.getChildren(fapi2::TARGET_FILTER_TP, - fapi2::TARGET_STATE_FUNCTIONAL)[0])); - - FAPI_DBG("p9_tp_stopclocks: Raise partial good fences and set abist_muxsel, syncclk_muxsel"); - FAPI_TRY(p9_common_stopclocks_cplt_ctrl_action_function( - i_target_chip.getChildren(fapi2::TARGET_FILTER_TP, - fapi2::TARGET_STATE_FUNCTIONAL)[0])); + FAPI_TRY(p9_sbe_common_clock_start_stop(i_target_chip.getChildren(fapi2::TARGET_FILTER_TP, + fapi2::TARGET_STATE_FUNCTIONAL)[0], CLOCK_CMD, DONT_STARTSLAVE, DONT_STARTMASTER, l_clock_regions, CLOCK_TYPES)); } + FAPI_DBG("p9_tp_stopclocks: Assert vital fence and set flush_inhibit"); + FAPI_TRY(p9_common_stopclocks_set_vitalfence_flushmode(i_target_chip.getChildren + (fapi2::TARGET_FILTER_TP, fapi2::TARGET_STATE_FUNCTIONAL)[0])); + + FAPI_DBG("p9_tp_stopclocks: Raise partial good fences and set abist_muxsel, syncclk_muxsel"); + FAPI_TRY(p9_common_stopclocks_cplt_ctrl_action_function(i_target_chip.getChildren + (fapi2::TARGET_FILTER_TP, fapi2::TARGET_STATE_FUNCTIONAL)[0], l_clock_regions)); + #ifndef __PPE__ if(i_stop_pib_clks) { FAPI_DBG("p9_tp_stopclocks: Assert CFAM fences"); //Setting ROOT_CTRL0 register - //CFAM.ROOT_CTRL0.FENCE[0..6]_DC = 1 + //CFAM.ROOT_CTRL0.FENCE[0,1,3..6]_DC = 1 l_data32_root_ctrl0.setBit(); l_data32_root_ctrl0.setBit(); // Not raising PERV_ROOT_CTRL0_FENCE2_DC because we need FSI2PIB <- PERV EPS connectivity diff --git a/src/import/chips/p9/procedures/xml/attribute_info/chip_ec_attributes.xml b/src/import/chips/p9/procedures/xml/attribute_info/chip_ec_attributes.xml index a73adb95..f574ab83 100644 --- a/src/import/chips/p9/procedures/xml/attribute_info/chip_ec_attributes.xml +++ b/src/import/chips/p9/procedures/xml/attribute_info/chip_ec_attributes.xml @@ -6673,6 +6673,23 @@ + + ATTR_CHIP_EC_FEATURE_P9A_STOPCLOCKS + TARGET_TYPE_PROC_CHIP + + Returns true if stopclocks function usage is for Axone chip + + + + ENUM_ATTR_NAME_AXONE + + 0x10 + GREATER_THAN_OR_EQUAL + + + + + ATTR_CHIP_EC_FEATURE_IOF0PLL_INITF TARGET_TYPE_PROC_CHIP diff --git a/src/import/chips/p9/procedures/xml/attribute_info/p9_sbe_attributes.xml b/src/import/chips/p9/procedures/xml/attribute_info/p9_sbe_attributes.xml index d222b7a1..63be9e7e 100644 --- a/src/import/chips/p9/procedures/xml/attribute_info/p9_sbe_attributes.xml +++ b/src/import/chips/p9/procedures/xml/attribute_info/p9_sbe_attributes.xml @@ -549,6 +549,10 @@ attribute tank ATTR_CHIP_EC_FEATURE_HW415945 + + ATTR_CHIP_EC_FEATURE_P9A_STOPCLOCKS + + ATTR_CHIP_EC_FEATURE_HW404391_SCOM -- cgit v1.2.1