From 2dcce4bcccc2ded0e047da9dd4332baa2dd44f6b Mon Sep 17 00:00:00 2001 From: Andre Marin Date: Tue, 15 Jan 2019 14:05:59 -0600 Subject: Add L1 for p9a_mss_bulk_pwr_throttles and p9a_mss_utils_to_throttle Change-Id: Icd016e70c11cb94dd8ab7259bc2874f5a1d84a86 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/70502 Tested-by: FSP CI Jenkins Tested-by: Jenkins Server Tested-by: HWSV CI Tested-by: Hostboot CI Reviewed-by: STEPHEN GLANCY Reviewed-by: Sheldon Bailey Reviewed-by: Louis Stermole Reviewed-by: Jennifer A. Stofer Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/72148 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Christian R. Geddes --- .../hwp/memory/p9a_mss_bulk_pwr_throttles.C | 34 ++++++++++++++++++ .../hwp/memory/p9a_mss_bulk_pwr_throttles.H | 40 ++++++++++++++++++++++ .../hwp/memory/p9a_mss_bulk_pwr_throttles.mk | 29 ++++++++++++++++ .../hwp/memory/p9a_mss_utils_to_throttle.C | 35 +++++++++++++++++++ .../hwp/memory/p9a_mss_utils_to_throttle.H | 26 ++++++++++++++ .../hwp/memory/p9a_mss_utils_to_throttle.mk | 29 ++++++++++++++++ 6 files changed, 193 insertions(+) create mode 100644 src/import/chips/p9a/procedures/hwp/memory/p9a_mss_bulk_pwr_throttles.mk create mode 100644 src/import/chips/p9a/procedures/hwp/memory/p9a_mss_utils_to_throttle.mk (limited to 'src/import/chips/p9a/procedures') 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 6222a3c7c..b6aa68510 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 4fefd77e7..6e033b877 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 000000000..aff426ea7 --- /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 1d5a23e89..0666a8772 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 0927b54f6..0cbde3d40 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 000000000..a60770713 --- /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) -- cgit v1.2.1