From 3e223a4466e9ab93d6fe271c108b101b05b22bcf Mon Sep 17 00:00:00 2001 From: Andre Marin Date: Mon, 18 Jul 2016 13:29:22 -0500 Subject: [PATCH] Fix p9_mss_utils_to_throttle, create throttles API, attribute cleanup Change-Id: Ic5bb202315cfa0cdc0ddead43231e4b6bfed5ec1 Original-Change-Id: Ibdb563542adb9e4f05dd07d597a9687b1deaf3c8 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/27183 Tested-by: Jenkins Server Tested-by: Hostboot CI Reviewed-by: JACOB L. HARVEY Reviewed-by: STEPHEN GLANCY Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41506 Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- .../hwp/memory/p9_mss_utils_to_throttle.H | 35 +++---------------- 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_utils_to_throttle.H b/src/import/chips/p9/procedures/hwp/memory/p9_mss_utils_to_throttle.H index 638a3c3b890..ab8d051e9d2 100644 --- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_utils_to_throttle.H +++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_utils_to_throttle.H @@ -25,12 +25,15 @@ /// /// @file p9_mss_utils_to_throttle.H -/// @brief Set the N throttle attributes for a given dram data bus utilization. +/// @brief Sets throttles +/// TMGT will call this procedure to set the N address operations (commands) +/// allowed within a window of M DRAM clocks given the minimum dram data bus utilization. /// + // *HWP HWP Owner: Andre Marin // *HWP HWP Backup: Brian Silver // *HWP Team: Memory -// *HWP Level: 1 +// *HWP Level: 2 // *HWP Consumed by: FSP:HB #ifndef __P9_MSS_UTILS_TO_THROTTLE__ @@ -38,34 +41,6 @@ #include -namespace mss -{ - -enum THROTTLE_UTILS : uint64_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] databus_util databus utilization percentage (e.g. 5% = 5) -/// @param[in] num_dram_clocks window of M DRAM clocks -/// @return FAPI2_RC_SUCCESS iff ok -/// -inline uint32_t commands_allowed_over_clock_window(uint8_t databus_util, uint32_t num_dram_clocks) -{ - uint32_t divisor = DRAM_BUS_UTILS * PERCENT_CONVERSION; - uint32_t divident = databus_util * num_dram_clocks; - uint32_t quotient = divident / divisor; - uint32_t remainder = divident % divisor; - - return quotient + (remainder == 0 ? 0 : 1); -} - -}// mss - typedef fapi2::ReturnCode (*p9_mss_utils_to_throttle_FP_t) (const fapi2::Target&); extern "C"