summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.C
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/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.C
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/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.C')
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_bulk_pwr_throttles.C50
1 files changed, 38 insertions, 12 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
OpenPOWER on IntegriCloud