summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Marin <aamarin@us.ibm.com>2016-07-18 13:29:22 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-10-18 22:21:59 -0400
commit7c4bd674700a8c17fd48e5dfd91fa8051f115c20 (patch)
tree8729fdd6a2d2e95885bdc4b0d6a82635938d9613
parent3191754fe3d365ec6abc155d4e0866fbbae2acdc (diff)
downloadblackbird-hostboot-7c4bd674700a8c17fd48e5dfd91fa8051f115c20.tar.gz
blackbird-hostboot-7c4bd674700a8c17fd48e5dfd91fa8051f115c20.zip
Fix p9_mss_utils_to_throttle, create throttles API, attribute cleanup
Change-Id: I1de9b3172f3b9ccaf228943f84febbdb955ac390 Original-Change-Id: Ibdb563542adb9e4f05dd07d597a9687b1deaf3c8 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/27183 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: JACOB L. HARVEY <jlharvey@us.ibm.com> Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/31419 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.H71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.H b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.H
new file mode 100644
index 000000000..e0d0f82a8
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.H
@@ -0,0 +1,71 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/import/chips/p9/procedures/hwp/memory/lib/power_thermal/throttle.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 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.H
+/// @brief throttle API
+///
+
+// *HWP HWP Owner: Andre Marin <aamarin@us.ibm.com>
+// *HWP HWP Backup: Brian Silver <bsilver@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 2
+// *HWP Consumed by: FSP:HB
+
+#ifndef _MSS_THROTTLE_
+#define _MSS_THROTTLE_
+
+
+namespace mss
+{
+
+enum throttle_const : size_t
+{
+ // Dram data bus utilization is 4X the address bus utilization
+ DRAM_BUS_UTILS = 4,
+ PERCENT_CONVERSION = 100,
+};
+
+///
+/// @brief Calculate N (address operations) allowed within a window of M DRAM clocks
+/// @param[in] i_databus_util databus utilization percentage (e.g. 5% = 5)
+/// @param[in] i_num_dram_clocks window of M DRAM clocks
+/// @return number of throttled commands allowed
+/// @note Uses N/M Throttling.
+/// Equation: (DRAM data bus utilization Percent / 100 ) = ((N * 4) / M )
+/// Dram data bus utilization is 4X the address bus utilization
+///
+inline uint32_t throttled_cmds(const uint8_t i_databus_util, const uint32_t i_num_dram_clocks)
+{
+ constexpr uint64_t l_divisor = DRAM_BUS_UTILS * PERCENT_CONVERSION;
+ const uint64_t l_dividend = i_databus_util * i_num_dram_clocks;
+ const uint64_t l_quotient = l_dividend / l_divisor;
+ const uint64_t l_remainder = l_dividend % l_divisor;
+
+ return l_quotient + (l_remainder == 0 ? 0 : 1);
+}
+
+}// mss
+
+#endif
OpenPOWER on IntegriCloud