diff options
Diffstat (limited to 'src/import/chips')
6 files changed, 108 insertions, 60 deletions
diff --git a/src/import/chips/p9/common/include/p9_const_common.H b/src/import/chips/p9/common/include/p9_const_common.H index 4d62685b0..5b325a13f 100644 --- a/src/import/chips/p9/common/include/p9_const_common.H +++ b/src/import/chips/p9/common/include/p9_const_common.H @@ -78,24 +78,25 @@ struct has_fixfld static const uint8_t value = 255; }; -const uint32_t N0_CHIPLET_ID = 2; -const uint32_t N1_CHIPLET_ID = 3; -const uint32_t N2_CHIPLET_ID = 4; -const uint32_t N3_CHIPLET_ID = 5; -const uint32_t XB_CHIPLET_ID = 6; -const uint32_t MC01_CHIPLET_ID = 7; -const uint32_t MC23_CHIPLET_ID = 8; -const uint32_t OB0_CHIPLET_ID = 9; -const uint32_t OB1_CHIPLET_ID = 10; -const uint32_t OB2_CHIPLET_ID = 11; -const uint32_t OB3_CHIPLET_ID = 12; -const uint32_t PCI0_CHIPLET_ID = 13; -const uint32_t PCI1_CHIPLET_ID = 14; -const uint32_t PCI2_CHIPLET_ID = 15; -const uint32_t EC0_CHIPLET_ID = 0x20; +const uint32_t PERV_CHIPLET_ID = 0x01; +const uint32_t N0_CHIPLET_ID = 0x02; +const uint32_t N1_CHIPLET_ID = 0x03; +const uint32_t N2_CHIPLET_ID = 0x04; +const uint32_t N3_CHIPLET_ID = 0x05; +const uint32_t XB_CHIPLET_ID = 0x06; +const uint32_t MC01_CHIPLET_ID = 0x07; +const uint32_t MC23_CHIPLET_ID = 0x08; +const uint32_t OB0_CHIPLET_ID = 0x09; +const uint32_t OB1_CHIPLET_ID = 0x0A; +const uint32_t OB2_CHIPLET_ID = 0x0B; +const uint32_t OB3_CHIPLET_ID = 0x0C; +const uint32_t PCI0_CHIPLET_ID = 0x0D; +const uint32_t PCI1_CHIPLET_ID = 0x0E; +const uint32_t PCI2_CHIPLET_ID = 0x0F; +const uint32_t EC0_CHIPLET_ID = 0x20; const uint32_t EC23_CHIPLET_ID = 0x37; -const uint32_t EQ0_CHIPLET_ID = 0x10; -const uint32_t EQ5_CHIPLET_ID = 0x15; +const uint32_t EQ0_CHIPLET_ID = 0x10; +const uint32_t EQ5_CHIPLET_ID = 0x15; #define FIXREG8(name, expr, unit, meth, newexpr) template<> struct has_fixup<uint8_t,unit,meth,expr> { static const uint8_t value = newexpr; }; #define FIXREG32(name, expr, unit, meth, newexpr) template<> struct has_fixup<uint32_t,unit,meth,expr> { static const uint32_t value = newexpr; }; #define FIXREG64(name, expr, unit, meth, newexpr) template<> struct has_fixup<uint64_t,unit,meth,expr> { static const uint64_t value = newexpr; }; diff --git a/src/import/chips/p9/procedures/hwp/cache/p9_hcd_cache_stopclocks.C b/src/import/chips/p9/procedures/hwp/cache/p9_hcd_cache_stopclocks.C index 3ebd18f75..e5e5f4555 100644 --- a/src/import/chips/p9/procedures/hwp/cache/p9_hcd_cache_stopclocks.C +++ b/src/import/chips/p9/procedures/hwp/cache/p9_hcd_cache_stopclocks.C @@ -67,13 +67,15 @@ fapi2::ReturnCode p9_hcd_cache_stopclocks( const fapi2::Target<fapi2::TARGET_TYPE_EQ>& i_target, const p9hcd::P9_HCD_CLK_CTRL_CONSTANTS i_select_regions, - const p9hcd::P9_HCD_EX_CTRL_CONSTANTS i_select_ex) + const p9hcd::P9_HCD_EX_CTRL_CONSTANTS i_select_ex, + const bool i_sync_stop_quad_clk) { FAPI_INF(">>p9_hcd_cache_stopclocks: regions[%016llx] ex[%d]", i_select_regions, i_select_ex); fapi2::ReturnCode l_rc; fapi2::buffer<uint64_t> l_data64; fapi2::buffer<uint64_t> l_temp64; + uint64_t l_region_clock = 0; uint64_t l_l3mask_pscom = 0; uint32_t l_loops1ms = 0; uint32_t l_scom_addr = 0; @@ -193,7 +195,7 @@ p9_hcd_cache_stopclocks( // Stop L2 clocks // ------------------------------- - if (i_select_ex) + if (i_select_ex && !i_sync_stop_quad_clk) FAPI_EXEC_HWP(fapi2::current_err, p9_hcd_l2_stopclocks, i_target, i_select_ex); @@ -205,10 +207,33 @@ p9_hcd_cache_stopclocks( FAPI_DBG("Clear all SCAN_REGION_TYPE bits"); FAPI_TRY(putScom(i_target, EQ_SCAN_REGION_TYPE, MASK_ZERO)); - FAPI_DBG("Stop cache clocks via CLK_REGION"); - l_data64 = (p9hcd::CLK_STOP_CMD | - i_select_regions | - p9hcd::CLK_THOLD_ALL); + l_region_clock = i_select_regions; + + if(i_sync_stop_quad_clk) + { + if (i_select_ex & p9hcd::EVEN_EX) + { + l_region_clock |= p9hcd::CLK_REGION_EX0_L2; + } + + if (i_select_ex & p9hcd::ODD_EX) + { + l_region_clock |= p9hcd::CLK_REGION_EX1_L2; + } + + FAPI_DBG("Stop cache clocks via CLK_REGION in master mode to perform stop quad clocks synchronously"); + l_data64 = (p9hcd::CLK_STOP_CMD_MASTER | + l_region_clock | + p9hcd::CLK_THOLD_ALL); + } + else + { + FAPI_DBG("Stop cache clocks via CLK_REGION"); + l_data64 = (p9hcd::CLK_STOP_CMD | + l_region_clock | + p9hcd::CLK_THOLD_ALL); + } + FAPI_TRY(putScom(i_target, EQ_CLK_REGION, l_data64)); FAPI_DBG("Poll for cache clocks stopped via CPLT_STAT0[8]"); @@ -230,7 +255,7 @@ p9_hcd_cache_stopclocks( FAPI_DBG("Check cache clocks stopped"); FAPI_TRY(getScom(i_target, EQ_CLOCK_STAT_SL, l_data64)); - FAPI_ASSERT((((~l_data64) & i_select_regions) == 0), + FAPI_ASSERT((((~l_data64) & l_region_clock) == 0), fapi2::PMPROC_CACHECLKSTOP_FAILED().set_EQCLKSTAT(l_data64), "Cache Clock Stop Failed"); FAPI_DBG("Cache clocks stopped now"); @@ -243,7 +268,7 @@ p9_hcd_cache_stopclocks( FAPI_TRY(putScom(i_target, EQ_CPLT_CTRL1_OR, MASK_SET(3))); FAPI_DBG("Assert regional fences via CPLT_CTRL1[4-14]"); - FAPI_TRY(putScom(i_target, EQ_CPLT_CTRL1_OR, i_select_regions)); + FAPI_TRY(putScom(i_target, EQ_CPLT_CTRL1_OR, l_region_clock)); // Gate the PCBMux request so scanning doesn't cause random requests for(auto& it : l_core_functional_vector) @@ -281,7 +306,7 @@ p9_hcd_cache_stopclocks( // QCCR[2/6] L3_EX0/1_EDRAM_VROW_VBLH_ENABLE_DC // QCCR[3/7] EDRAM_VPP_ENABLE_DC - if (i_select_regions & p9hcd::CLK_REGION_EX0_REFR) + if (l_region_clock & p9hcd::CLK_REGION_EX0_REFR) { FAPI_DBG("Sequence EX0 EDRAM disables via QPPM_QCCR[0-3]"); FAPI_TRY(putScom(i_target, EQ_QPPM_QCCR_WCLEAR, MASK_SET(3))); @@ -290,7 +315,7 @@ p9_hcd_cache_stopclocks( FAPI_TRY(putScom(i_target, EQ_QPPM_QCCR_WCLEAR, MASK_SET(0))); } - if (i_select_regions & p9hcd::CLK_REGION_EX1_REFR) + if (l_region_clock & p9hcd::CLK_REGION_EX1_REFR) { FAPI_DBG("Sequence EX1 EDRAM disables via QPPM_QCCR[4-7]"); FAPI_TRY(putScom(i_target, EQ_QPPM_QCCR_WCLEAR, MASK_SET(7))); diff --git a/src/import/chips/p9/procedures/hwp/cache/p9_hcd_cache_stopclocks.H b/src/import/chips/p9/procedures/hwp/cache/p9_hcd_cache_stopclocks.H index 0961ac4d5..a093cbcea 100644 --- a/src/import/chips/p9/procedures/hwp/cache/p9_hcd_cache_stopclocks.H +++ b/src/import/chips/p9/procedures/hwp/cache/p9_hcd_cache_stopclocks.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -45,20 +45,24 @@ typedef fapi2::ReturnCode (*p9_hcd_cache_stopclocks_FP_t) ( const fapi2::Target<fapi2::TARGET_TYPE_EQ>&, const p9hcd::P9_HCD_CLK_CTRL_CONSTANTS, - const p9hcd::P9_HCD_EX_CTRL_CONSTANTS); + const p9hcd::P9_HCD_EX_CTRL_CONSTANTS, + const bool); extern "C" { /// @brief Quad Clock Stop /// @param [in] i_target TARGET_TYPE_EQ target -/// @param [in] i_skip_regions select clk regions to skip on stopclocks +/// @param [in] i_select_regions select clk regions on stopclocks +/// @param [in] i_select_ex select ex's on stopclocks +/// @param [in] i_sync_stop_quad_clk to stop CACHE & CORE chiplet clocks synchronously /// @return FAPI2_RC_SUCCESS if success, else error code fapi2::ReturnCode p9_hcd_cache_stopclocks( const fapi2::Target<fapi2::TARGET_TYPE_EQ>& i_target, const p9hcd::P9_HCD_CLK_CTRL_CONSTANTS i_select_regions, - const p9hcd::P9_HCD_EX_CTRL_CONSTANTS i_select_ex); + const p9hcd::P9_HCD_EX_CTRL_CONSTANTS i_select_ex, + const bool i_sync_stop_quad_clk = false); } diff --git a/src/import/chips/p9/procedures/hwp/core/p9_hcd_core_stopclocks.C b/src/import/chips/p9/procedures/hwp/core/p9_hcd_core_stopclocks.C index 53220e890..d730e565d 100644 --- a/src/import/chips/p9/procedures/hwp/core/p9_hcd_core_stopclocks.C +++ b/src/import/chips/p9/procedures/hwp/core/p9_hcd_core_stopclocks.C @@ -32,7 +32,7 @@ // *HWP Backup HWP Owner : Greg Still <stillgs@us.ibm.com> // *HWP FW Owner : Sangeetha T S <sangeet2@in.ibm.com> // *HWP Team : PM -// *HWP Consumed by : HB:PREV +// *HWP Consumed by : HB:PERV // *HWP Level : 2 //------------------------------------------------------------------------------ @@ -65,7 +65,8 @@ enum P9_HCD_CORE_STOPCLOCKS_CONSTANTS fapi2::ReturnCode p9_hcd_core_stopclocks( - const fapi2::Target<fapi2::TARGET_TYPE_CORE>& i_target) + const fapi2::Target<fapi2::TARGET_TYPE_CORE>& i_target, + const bool i_sync_stop_quad_clk) { FAPI_INF(">>p9_hcd_core_stopclocks"); fapi2::ReturnCode l_rc; @@ -159,35 +160,47 @@ p9_hcd_core_stopclocks( FAPI_DBG("Clear all SCAN_REGION_TYPE bits"); FAPI_TRY(putScom(i_target, C_SCAN_REGION_TYPE, MASK_ZERO)); - FAPI_DBG("Stop core clocks(all but pll) via CLK_REGION"); - l_data64 = (p9hcd::CLK_STOP_CMD | - p9hcd::CLK_REGION_ALL_BUT_PLL | - p9hcd::CLK_THOLD_ALL); - FAPI_TRY(putScom(i_target, C_CLK_REGION, l_data64)); - - FAPI_DBG("Poll for core clocks stopped via CPLT_STAT0[8]"); - l_loops1ms = 1E6 / CORE_CLK_STOP_POLLING_HW_NS_DELAY; - - do + if(i_sync_stop_quad_clk) { - fapi2::delay(CORE_CLK_STOP_POLLING_HW_NS_DELAY, - CORE_CLK_STOP_POLLING_SIM_CYCLE_DELAY); + FAPI_DBG("Stop core clocks(all but pll) via CLK_REGION in SLAVE mode"); + l_data64 = (p9hcd::CLK_STOP_CMD_SLAVE | + p9hcd::CLK_REGION_ALL_BUT_PLL | + p9hcd::CLK_THOLD_ALL); + FAPI_TRY(putScom(i_target, C_CLK_REGION, l_data64)); - FAPI_TRY(getScom(i_target, C_CPLT_STAT0, l_data64)); } - while((l_data64.getBit<8>() != 1) && ((--l_loops1ms) != 0)); + else + { + FAPI_DBG("Stop core clocks(all but pll) via CLK_REGION"); + l_data64 = (p9hcd::CLK_STOP_CMD | + p9hcd::CLK_REGION_ALL_BUT_PLL | + p9hcd::CLK_THOLD_ALL); + FAPI_TRY(putScom(i_target, C_CLK_REGION, l_data64)); - FAPI_ASSERT((l_loops1ms != 0), - fapi2::PMPROC_CORECLKSTOP_TIMEOUT().set_CORECPLTSTAT(l_data64), - "Core Clock Stop Timeout"); + FAPI_DBG("Poll for core clocks stopped via CPLT_STAT0[8]"); + l_loops1ms = 1E6 / CORE_CLK_STOP_POLLING_HW_NS_DELAY; - FAPI_DBG("Check core clocks stopped via CLOCK_STAT_SL[4-13]"); - FAPI_TRY(getScom(i_target, C_CLOCK_STAT_SL, l_data64)); + do + { + fapi2::delay(CORE_CLK_STOP_POLLING_HW_NS_DELAY, + CORE_CLK_STOP_POLLING_SIM_CYCLE_DELAY); + + FAPI_TRY(getScom(i_target, C_CPLT_STAT0, l_data64)); + } + while((l_data64.getBit<8>() != 1) && ((--l_loops1ms) != 0)); - FAPI_ASSERT((((~l_data64) & p9hcd::CLK_REGION_ALL_BUT_PLL) == 0), - fapi2::PMPROC_CORECLKSTOP_FAILED().set_CORECLKSTAT(l_data64), - "Core Clock Stop Failed"); - FAPI_DBG("Core clocks stopped now"); + FAPI_ASSERT((l_loops1ms != 0), + fapi2::PMPROC_CORECLKSTOP_TIMEOUT().set_CORECPLTSTAT(l_data64), + "Core Clock Stop Timeout"); + + FAPI_DBG("Check core clocks stopped via CLOCK_STAT_SL[4-13]"); + FAPI_TRY(getScom(i_target, C_CLOCK_STAT_SL, l_data64)); + + FAPI_ASSERT((((~l_data64) & p9hcd::CLK_REGION_ALL_BUT_PLL) == 0), + fapi2::PMPROC_CORECLKSTOP_FAILED().set_CORECLKSTAT(l_data64), + "Core Clock Stop Failed"); + FAPI_DBG("Core clocks stopped now"); + } // ------------------------------- // Disable core clock sync diff --git a/src/import/chips/p9/procedures/hwp/core/p9_hcd_core_stopclocks.H b/src/import/chips/p9/procedures/hwp/core/p9_hcd_core_stopclocks.H index 0462aecfa..db966d22e 100644 --- a/src/import/chips/p9/procedures/hwp/core/p9_hcd_core_stopclocks.H +++ b/src/import/chips/p9/procedures/hwp/core/p9_hcd_core_stopclocks.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ +/* Contributors Listed Below - COPYRIGHT 2016,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -31,7 +31,7 @@ // *HWP Backup HWP Owner : Greg Still <stillgs@us.ibm.com> // *HWP FW Owner : Sangeetha T S <sangeet2@in.ibm.com> // *HWP Team : PM -// *HWP Consumed by : HB:PREV +// *HWP Consumed by : HB:PERV // *HWP Level : 2 #ifndef __P9_HCD_CORE_STOPCLOCKS_H__ @@ -42,17 +42,20 @@ /// @typedef p9_hcd_core_stopclocks_FP_t /// function pointer typedef definition for HWP call support typedef fapi2::ReturnCode (*p9_hcd_core_stopclocks_FP_t) ( - const fapi2::Target<fapi2::TARGET_TYPE_CORE>&); + const fapi2::Target<fapi2::TARGET_TYPE_CORE>&, + const bool); extern "C" { /// @brief Quad Clock Stop /// @param [in] i_target TARGET_TYPE_EX target +/// @param [in] i_sync_stop_quad_clk to stop CACHE & CORE chiplet clocks synchronously /// @return FAPI2_RC_SUCCESS if success, else error code fapi2::ReturnCode p9_hcd_core_stopclocks( - const fapi2::Target<fapi2::TARGET_TYPE_CORE>& i_target); + const fapi2::Target<fapi2::TARGET_TYPE_CORE>& i_target, + const bool i_sync_stop_quad_clk = false); } diff --git a/src/import/chips/p9/procedures/hwp/lib/p9_hcd_common.H b/src/import/chips/p9/procedures/hwp/lib/p9_hcd_common.H index c6da343a4..05fc2fa21 100644 --- a/src/import/chips/p9/procedures/hwp/lib/p9_hcd_common.H +++ b/src/import/chips/p9/procedures/hwp/lib/p9_hcd_common.H @@ -170,6 +170,8 @@ enum P9_HCD_MULTICAST_CONSTANTS enum P9_HCD_CLK_CTRL_CONSTANTS { CLK_STOP_CMD = BIT64(0), + CLK_STOP_CMD_SLAVE = BIT64(0) | BIT64(2), + CLK_STOP_CMD_MASTER = BIT64(0) | BIT64(3), CLK_START_CMD = BIT64(1), CLK_REGION_PERV = BIT64(4), CLK_REGION_ANEP = BIT64(10), |