-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
4edfbd9
commit 1ec9172
Showing
1 changed file
with
82 additions
and
0 deletions.
There are no files selected for viewing
82 changes: 82 additions & 0 deletions
82
src/import/chips/p9/procedures/hwp/memory/p9_mss_utils_to_throttle.H
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |