diff options
| author | Andre Marin <aamarin@us.ibm.com> | 2016-03-15 18:32:40 -0500 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-06-08 12:26:06 -0400 |
| commit | 1ec917269c199f61c77c1bc300ccb1e5aafec78f (patch) | |
| tree | cad9b6fbb2fa4eea324b1646244409eaf3c67d15 /src | |
| parent | 4edfbd997e46ab635821558047b80ba38a2d7f15 (diff) | |
| download | blackbird-hostboot-1ec917269c199f61c77c1bc300ccb1e5aafec78f.tar.gz blackbird-hostboot-1ec917269c199f61c77c1bc300ccb1e5aafec78f.zip | |
Add mss throttle files L1
Change-Id: Ia484b065f44742b95a7241104f8f537701481955
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/41504
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/import/chips/p9/procedures/hwp/memory/p9_mss_utils_to_throttle.H | 82 |
1 files changed, 82 insertions, 0 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 new file mode 100644 index 000000000..417d7c3c6 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_utils_to_throttle.H @@ -0,0 +1,82 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/memory/p9_mss_utils_to_throttle.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* [+] 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 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 + +#ifndef __P9_MSS_UTILS_TO_THROTTLE__ +#define __P9_MSS_UTILS_TO_THROTTLE__ + +#include <fapi2.H> + +namespace mss +{ + +enum throttle_multiplier : 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) +{ + divisor = DRAM_BUS_UTILS * PERCENT_CONVERSION; + divident = databus_utilization * dram_clocks; + quotient = divident / divisor; + remainder = divident % divisor; + + return quotient + (remainder == 0 ? 0 : 1); +} + +}// mss + +typedef fapi2::ReturnCode (*p9_mss_utils_to_throttle_FP_t) (const fapi2::Target<fapi2::TARGET_TYPE_MCS>&); + +extern "C" +{ + +/// +/// @brief Set the N throttle attributes for a given dram 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<fapi2::TARGET_TYPE_MCS>& i_target ); +} + +#endif |

