From b0bebe12a162430afab285c18df9265831798f69 Mon Sep 17 00:00:00 2001 From: Jacob Harvey Date: Fri, 26 Aug 2016 15:08:52 -0500 Subject: Modifying ATTRs for memory power thermal Added MSS_MRW_ATTRs to base_hwp_file, implemented bulk_pwr and utils_to_throttle APIs for the OCC team. Added simple structural changes Change-Id: I7a0885e434a87e1ace8fca10f1471271bb947eba Original-Change-Id: I9483be7f06c95c8c4dfe4823443052efde6fa776 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28916 Reviewed-by: Matt K. Light Reviewed-by: Christian R. Geddes Reviewed-by: STEPHEN GLANCY Reviewed-by: Brian R. Silver Tested-by: Jenkins Server Tested-by: Hostboot CI Reviewed-by: Louis Stermole Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/31666 Tested-by: FSP CI Jenkins --- .../hwp/memory/p9_mss_bulk_pwr_throttles.C | 50 ++++++++++++++++------ .../hwp/memory/p9_mss_bulk_pwr_throttles.H | 30 ++++++++++--- .../hwp/memory/p9_mss_bulk_pwr_throttles.mk | 32 ++++++++++++++ 3 files changed, 93 insertions(+), 19 deletions(-) create mode 100644 src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.mk (limited to 'src/import/chips') diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.C index a0d7a8b07..65d3bd083 100644 --- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.C +++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.C @@ -27,31 +27,57 @@ /// @file p9_mss_bulk_pwr_throttles.C /// @brief Set the throttle attributes based on a power limit for the dimms on the channel pair /// -// *HWP HWP Owner: Andre Marin +// *HWP HWP Owner: Jacob Harvey // *HWP HWP Backup: Brian Silver // *HWP Team: Memory // *HWP Level: 1 // *HWP Consumed by: FSP:HB +#include +#include #include #include +#include +#include using fapi2::TARGET_TYPE_MCS; - +using fapi2::TARGET_TYPE_MCA; +using fapi2::TARGET_TYPE_DIMM; extern "C" { -/// -/// @brief Set the throttle attributes based on a power limit for the dimms on the channel pair -/// @param[in] i_target the controller target -/// @return FAPI2_RC_SUCCESS iff ok -/// - fapi2::ReturnCode p9_mss_bulk_pwr_throttles( const fapi2::Target& i_target ) + /// + /// @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 MCS's on the same VDDR domain + /// @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 in p9_mss_bulk_pwr_throttles + /// @note determines the throttle levels based off of the port's power curve, + /// sets the slot throttles to the same + /// @note Enums are POWER for power egulator throttles and THERMAL for thermal throttles + /// @note equalizes the throttles to the lowest of runtime and the lowest slot-throttle value + /// + + fapi2::ReturnCode p9_mss_bulk_pwr_throttles( const std::vector< fapi2::Target >& i_targets, + throttle_type t) { FAPI_INF("Start bulk_pwr_throttles"); - FAPI_INF("End bulk_pwr_throttles"); - return fapi2::FAPI2_RC_SUCCESS; - } + FAPI_TRY ( mss::bulk_thermal_throttles (i_targets) ); + + //Check for THERMAL + if (t == THERMAL) + { + FAPI_TRY ( mss::bulk_thermal_throttles (i_targets) ); + } + //else do POWER + else + { + FAPI_TRY ( mss::bulk_power_regulator_throttles (i_targets) ); + } -}// extern C + FAPI_INF("End bulk_pwr_throttles"); + fapi_try_exit: + return fapi2::current_err; + } +} //extern C diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.H b/src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.H index 721ea1962..25215dbc4 100644 --- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.H +++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.H @@ -27,7 +27,7 @@ /// @file p9_mss_bulk_pwr_throttles.H /// @brief Set the throttle attributes based on a power limit for the dimms on the channel pair /// -// *HWP HWP Owner: Andre Marin +// *HWP HWP Owner: Jacob Harvey // *HWP HWP Backup: Brian Silver // *HWP Team: Memory // *HWP Level: 1 @@ -37,17 +37,33 @@ #define __P9_MSS_BULK_PWR_THROTTLES__ #include - -typedef fapi2::ReturnCode (*p9_mss_bulk_pwr_throttles_FP_t) (const fapi2::Target&); +#include +typedef fapi2::ReturnCode (*p9_mss_bulk_pwr_throttles_FP_t) (const + std::vector< fapi2::Target< fapi2::TARGET_TYPE_MCS>>&); extern "C" { + + enum throttle_type : size_t + { + POWER = 0, + THERMAL = 1, + }; + /// -/// @brief Set the throttle attributes based on a power limit for the dimms on the channel pair -/// @param[in] i_target controller target -/// @return FAPI2_RC_SUCCESS iff ok +/// @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 MCS's on the same VDDR domain +/// @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 in p9_mss_bulk_pwr_throttles +/// @note determines the throttle levels based off of the port's power curve, +/// sets the slot throttles to the same +/// @note Enums are POWER for power egulator throttles and THERMAL for thermal throttles +/// @note equalizes the throttles to the lowest of runtime and the lowest slot-throttle value /// - fapi2::ReturnCode p9_mss_bulk_pwr_throttles( const fapi2::Target& i_target ); + + fapi2::ReturnCode p9_mss_bulk_pwr_throttles (const std::vector < fapi2::Target< fapi2::TARGET_TYPE_MCS>>& i_targets, + throttle_type t ); } #endif diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.mk b/src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.mk new file mode 100644 index 000000000..062318312 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.mk @@ -0,0 +1,32 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.mk $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2015,2016 +# [+] 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 the macros and things for MSS procedures +-include 00common.mk + +PROCEDURE=p9_mss_bulk_pwr_throttles +$(eval $(call ADD_MEMORY_INCDIRS,$(PROCEDURE))) +$(call BUILD_PROCEDURE) + -- cgit v1.2.1