diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/shared/mss_const.H b/src/import/chips/p9/procedures/hwp/memory/lib/shared/mss_const.H index d8272397335..30c22a22708 100644 --- a/src/import/chips/p9/procedures/hwp/memory/lib/shared/mss_const.H +++ b/src/import/chips/p9/procedures/hwp/memory/lib/shared/mss_const.H @@ -485,16 +485,6 @@ enum test_type } // namespace mcbist -/// -/// @brief throttle_type used to set bulk_pwr_throttls to run POWER or THERMAL throttling -/// @note OCC will be using the POWER option -/// -enum class throttle_type -{ - POWER = 0, - THERMAL = 1, -}; - enum class shmoo_edge : std::size_t { LEFT, diff --git a/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_bulk_pwr_throttles.C b/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_bulk_pwr_throttles.C index 6222a3c7c9d..b6aa6851095 100644 --- a/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_bulk_pwr_throttles.C +++ b/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_bulk_pwr_throttles.C @@ -22,3 +22,37 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ + +/// +/// @file p9a_mss_bulk_pwr_throttles.C +/// @brief Set the OCMB throttle attributes based on any power limits (thermal, regulator, or bulk) +/// +// *HWP HWP Owner: Andre A. Marin +// *HWP HWP Backup: Louis Stermole +// *HWP Team: Memory +// *HWP Level: 1 +// *HWP Consumed by: FSP:HB + +#include +#include +#include + +/// +/// @brief Set ATTR_MSS_PORT_MAXPOWER, ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_SLOT, ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_PORT +/// @param[in] i_targets vector of OCMB_CHIP's on the same processor or in the same node +/// @param[in] i_throttle_type thermal boolean to determine whether to calculate throttles based on the power regulator or thermal limits +/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK +/// @note Called by p9a_mss_eff_config_thermal or by TMGT +/// @note determines the throttle levels based off of the DIMM's power curve, sets the slot throttles to the same +/// @note Enums are POWER for power regulator throttles and THERMAL for thermal throttles +/// @note equalizes the throttles to the lowest of runtime and the lowest slot-throttle value +/// +fapi2::ReturnCode p9a_mss_bulk_pwr_throttles(const std::vector< fapi2::Target >& + i_targets, + const mss::throttle_type i_throttle_type) +{ + FAPI_INF("Start p9a_mss_bulk_pwr_throttles for %s type throttling", + (( i_throttle_type == mss::throttle_type::THERMAL) ? "THERMAL" : "POWER")); + + return fapi2::FAPI2_RC_SUCCESS; +} diff --git a/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_bulk_pwr_throttles.H b/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_bulk_pwr_throttles.H index 4fefd77e7b8..6e033b87733 100644 --- a/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_bulk_pwr_throttles.H +++ b/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_bulk_pwr_throttles.H @@ -22,3 +22,43 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ + +/// +/// @file p9a_mss_bulk_pwr_throttles.H +/// @brief Set the OCMB throttle attributes based on any power limits (thermal, regulator, or bulk) +/// +// *HWP HWP Owner: Andre A. Marin +// *HWP HWP Backup: Louis Stermole +// *HWP Team: Memory +// *HWP Level: 1 +// *HWP Consumed by: FSP:HB + +#ifndef __P9A_MSS_BULK_PWR_THROTTLES__ +#define __P9A_MSS_BULK_PWR_THROTTLES__ + +#include +#include +#include + +typedef fapi2::ReturnCode (*p9a_mss_bulk_pwr_throttles_FP_t) (const + std::vector< fapi2::Target< fapi2::TARGET_TYPE_OCMB_CHIP>>&, const mss::throttle_type i_throttle_type); + +extern "C" +{ + + /// + /// @brief Set ATTR_MSS_PORT_MAXPOWER, ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_SLOT, ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_PORT + /// @param[in] i_targets vector of OCMB_CHIP's on the same processor or in the same node + /// @param[in] thermal boolean to determine whether to calculate throttles based on the power regulator or thermal limits + /// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff get is OK + /// @note Called by p9a_mss_eff_config_thermal or by TMGT + /// @note determines the throttle levels based off of the DIMM's power curve, sets the slot throttles to the same + /// @note Enums are POWER for power regulator throttles and THERMAL for thermal throttles + /// @note equalizes the throttles to the lowest of runtime and the lowest slot-throttle value + /// + fapi2::ReturnCode p9a_mss_bulk_pwr_throttles (const std::vector < fapi2::Target< fapi2::TARGET_TYPE_OCMB_CHIP>>& + i_targets, + const mss::throttle_type i_throttle_type ); +} + +#endif diff --git a/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_bulk_pwr_throttles.mk b/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_bulk_pwr_throttles.mk new file mode 100644 index 00000000000..aff426ea7a1 --- /dev/null +++ b/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_bulk_pwr_throttles.mk @@ -0,0 +1,29 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/import/chips/p9a/procedures/hwp/memory/p9a_mss_bulk_pwr_throttles.mk $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2019 +# [+] International Business Machines Corp. +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. See the License for the specific language governing +# permissions and limitations under the License. +# +# IBM_PROLOG_END_TAG +-include 00p9a_common.mk + +PROCEDURE=p9a_mss_bulk_pwr_throttles +$(eval $(call ADD_MEMORY_INCDIRS,$(PROCEDURE))) +$(call BUILD_PROCEDURE) diff --git a/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_utils_to_throttle.C b/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_utils_to_throttle.C index 1d5a23e89dd..0666a87720d 100644 --- a/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_utils_to_throttle.C +++ b/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_utils_to_throttle.C @@ -22,3 +22,38 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ + +/// +/// @file p9a_mss_utils_to_throttle.C +/// @brief Sets throttles and power attributes for a given utilization value +/// @note TMGT will call this procedure to set the N address operations (commands) +/// allowed within a window of M DRAM clocks given the minimum dram data bus utilization. +//// If input utilization is zero, then safemode values from MRW will be used +/// + +// *HWP HWP Owner: Andre A. Marin +// *HWP HWP Backup: Louis Stermole +// *HWP Team: Memory +// *HWP Level: 1 +// *HWP Consumed by: FSP:HB + +#include + +// fapi2 +#include + +/// +/// @brief Determines throttle and power values for a given port databus utilization. +/// @param[in] i_targets vector of OCMB_CHIPs to set throttle and power attributes on +/// @return FAPI2_RC_SUCCESS iff ok +/// @note ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_SLOT will be set to worst case of all slots passed in +/// @note input ATTR_MSS_DATABUS_UTIL and ATTR_MSS_MEM_WATT_TARGET +/// @note output ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_SLOT, ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_PORT, and ATTR_MSS_PORT_MAXPOWER +/// @note Does not set runtime throttles or set registers to throttle values` +/// +fapi2::ReturnCode p9a_mss_utils_to_throttle( const std::vector< fapi2::Target >& + i_targets ) +{ + FAPI_INF("Entering p9a_mss_utils_to_throttle"); + return fapi2::FAPI2_RC_SUCCESS; +} diff --git a/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_utils_to_throttle.H b/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_utils_to_throttle.H index 0927b54f6d3..0cbde3d40cb 100644 --- a/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_utils_to_throttle.H +++ b/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_utils_to_throttle.H @@ -22,3 +22,29 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ + +#ifndef __P9A_MSS_UTILS_TO_THROTTLE__ +#define __P9A_MSS_UTILS_TO_THROTTLE__ + +#include +#include + +typedef fapi2::ReturnCode (*p9a_mss_utils_to_throttle_FP_t) (const + std::vector< fapi2::Target >&); + +extern "C" +{ + + /// + /// @brief Determines throttle and power values for a given port databus utilization. + /// @param[in] i_targets vector of OCMB_CHIPs to set throttle and power attributes on + /// @return FAPI2_RC_SUCCESS iff ok + /// @note ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_SLOT will be set to worst case of all slots passed in + /// @note output ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_SLOT, ATTR_MSS_MEM_THROTTLED_N_COMMANDS_PER_PORT, and ATTR_MSS_PORT_MAXPOWER + /// @note Does not set runtime throttles or set registers to throttle values` + /// + fapi2::ReturnCode p9a_mss_utils_to_throttle(const std::vector >& + i_targets); +} + +#endif diff --git a/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_utils_to_throttle.mk b/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_utils_to_throttle.mk new file mode 100644 index 00000000000..a607707134c --- /dev/null +++ b/src/import/chips/p9a/procedures/hwp/memory/p9a_mss_utils_to_throttle.mk @@ -0,0 +1,29 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/import/chips/p9a/procedures/hwp/memory/p9a_mss_utils_to_throttle.mk $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2019 +# [+] International Business Machines Corp. +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. See the License for the specific language governing +# permissions and limitations under the License. +# +# IBM_PROLOG_END_TAG +-include 00p9a_common.mk + +PROCEDURE=p9a_mss_utils_to_throttle +$(eval $(call ADD_MEMORY_INCDIRS,$(PROCEDURE))) +$(call BUILD_PROCEDURE) diff --git a/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H b/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H index c3c3a8f4a86..7f52ebe3a5b 100644 --- a/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H +++ b/src/import/generic/memory/lib/utils/shared/mss_generic_consts.H @@ -310,6 +310,15 @@ enum nibble_mask MASK_NIBBLE1 = 0x0f, }; +/// +/// @brief throttle_type used to set bulk_pwr_throttls to run POWER or THERMAL throttling +/// @note OCC will be using the POWER option +/// +enum class throttle_type +{ + POWER = 0, + THERMAL = 1, +}; /// /// @brief Trait classes for proc_type