summaryrefslogtreecommitdiffstats
path: root/src/import
diff options
context:
space:
mode:
authorJacob Harvey <jlharvey@us.ibm.com>2016-08-26 15:08:52 -0500
committerChristian R. Geddes <crgeddes@us.ibm.com>2016-10-24 11:44:10 -0400
commitb0bebe12a162430afab285c18df9265831798f69 (patch)
treeb97ba15d1ccf8edfcb36d4cf0f1a8a3ee23eeaa5 /src/import
parent693958ae4c5f0b7e453c00abda380e8a20c9aee0 (diff)
downloadtalos-hostboot-b0bebe12a162430afab285c18df9265831798f69.tar.gz
talos-hostboot-b0bebe12a162430afab285c18df9265831798f69.zip
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 <mklight@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com> Reviewed-by: Brian R. Silver <bsilver@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Louis Stermole <stermole@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/31666 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/import')
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.C50
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.H30
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.mk32
3 files changed, 93 insertions, 19 deletions
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 <aamarin@us.ibm.com>
+// *HWP HWP Owner: Jacob Harvey <jlharvey@us.ibm.com>
// *HWP HWP Backup: Brian Silver <bsilver@us.ibm.com>
// *HWP Team: Memory
// *HWP Level: 1
// *HWP Consumed by: FSP:HB
+#include <algorithm>
+#include <mss.H>
#include <fapi2.H>
#include <p9_mss_bulk_pwr_throttles.H>
+#include <lib/utils/find.H>
+#include <lib/power_thermal/throttle.H>
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<TARGET_TYPE_MCS>& 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<TARGET_TYPE_MCS> >& 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 <aamarin@us.ibm.com>
+// *HWP HWP Owner: Jacob Harvey <jlharvey@us.ibm.com>
// *HWP HWP Backup: Brian Silver <bsilver@us.ibm.com>
// *HWP Team: Memory
// *HWP Level: 1
@@ -37,17 +37,33 @@
#define __P9_MSS_BULK_PWR_THROTTLES__
#include <fapi2.H>
-
-typedef fapi2::ReturnCode (*p9_mss_bulk_pwr_throttles_FP_t) (const fapi2::Target<fapi2::TARGET_TYPE_MCS>&);
+#include <vector>
+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<fapi2::TARGET_TYPE_MCS>& 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)
+
OpenPOWER on IntegriCloud