summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Marin <aamarin@us.ibm.com>2016-03-15 18:32:40 -0500
committerChristian R. Geddes <crgeddes@us.ibm.com>2016-10-25 14:26:59 -0400
commitb6fdb223c2d667b87b0a47be26afe56100433097 (patch)
tree6752f9d6e447221e8da1b929638b6e56b5ca5054
parent02c1e4c150f49da6363bc237fbfe07bd88b28ff2 (diff)
downloadtalos-hostboot-b6fdb223c2d667b87b0a47be26afe56100433097.tar.gz
talos-hostboot-b6fdb223c2d667b87b0a47be26afe56100433097.zip
Add mss throttle files L1
Change-Id: Icb9acc3387a50c0ec9aee09a7b2d40b2901cddb4 Original-Change-Id: I4a8a83151b3287a38235db11cd298900119aed35 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22149 Tested-by: Jenkins Server Tested-by: Hostboot CI Reviewed-by: Brian R. Silver <bsilver@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/31794 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_utils_to_throttle.C81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_utils_to_throttle.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_utils_to_throttle.C
new file mode 100644
index 000000000..bca9c1bc1
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_utils_to_throttle.C
@@ -0,0 +1,81 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/import/chips/p9/procedures/hwp/memory/p9_mss_utils_to_throttle.C $ */
+/* */
+/* 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 */
+
+///
+/// @file p9_mss_utils_to_throttle.C
+/// @brief Set the N throttle attributes for a given dram data bus utilization.
+///
+// *HWP HWP Owner: Andre Marin <aamarin@us.ibm.com>
+// *HWP HWP Backup: Brian Silver <bsilver@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 1
+// *HWP Consumed by: FSP:HB
+
+#include <fapi2.H>
+#include <mss.H>
+#include <p9_mss_utils_to_throttle.H>
+
+using fapi2::TARGET_TYPE_MCS;
+using fapi2::TARGET_TYPE_MCA;
+using fapi2::TARGET_TYPE_DIMM;
+
+extern "C"
+{
+
+///
+/// @brief Sets number commands allowed within a given data bus utilization.
+/// @param[in] i_target the controller target
+/// @return FAPI2_RC_SUCCESS iff ok
+///
+ fapi2::ReturnCode p9_mss_utils_to_throttle( const fapi2::Target<TARGET_TYPE_MCS>& i_target )
+ {
+ uint8_t l_databus_util[mss::PORTS_PER_MCS][mss::MAX_DIMM_PER_PORT] = {0};
+ uint32_t l_dram_clocks[mss::PORTS_PER_MCS][mss::MAX_DIMM_PER_PORT] = {0};
+ uint32_t l_num_commands_allowed[mss::PORTS_PER_MCS][mss::MAX_DIMM_PER_PORT] = 0;
+
+ FAPI_TRY( mss::databus_util(i_target, &l_databus_util[0][0]) );
+ FAPI_TRY( mss::mrw_mem_m_dram_clocks(fapi2::Target<TARGET_TYPE_SYSTEM>(), &l_dram_clocks[0][0]) );
+
+ for( const auto& l_mca : i_target.getChildren<TARGET_TYPE_MCA>() )
+ {
+ l_port_num = mss::index(l_mca);
+
+ for( const auto& l_dimm : i_target.getChildren<TARGET_TYPE_DIMM>() )
+ {
+ l_dimm_num = mss::index(l_dimm);
+
+ l_num_commands_allowed = mss::commands_allowed_over_clock_window(l_databus_util[l_port_num][l_dimm_num],
+ l_dram_clocks[l_port_num][l_dimm_num]);
+ }
+ }
+
+ FAPI_ATTR_SET(fapi2::ATTR_MSS_THROTTLED_N_COMMANDS, i_target, l_num_commands_allowed)
+
+ FAPI_INF("End utils_to_throttle");
+ fapi_try_exit:
+ return fapi2::current_err;
+ }
+
+}// extern C
OpenPOWER on IntegriCloud