summaryrefslogtreecommitdiffstats
path: root/src/usr/util/utilmbox_scratch.C
diff options
context:
space:
mode:
authorDean Sanner <dsanner@us.ibm.com>2017-07-19 06:47:47 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-07-20 09:44:50 -0400
commit76aa4662e398b137b5d775d9343d36db91622b75 (patch)
treeacc3e794c44b2e3b5ecc6e8ae39bc1f612516798 /src/usr/util/utilmbox_scratch.C
parent5b3adbd548c7c1824145d2e890e2e8b31c24189a (diff)
downloadtalos-hostboot-76aa4662e398b137b5d775d9343d36db91622b75.tar.gz
talos-hostboot-76aa4662e398b137b5d775d9343d36db91622b75.zip
Support dynamic determination of powerbus freq
- Original code used ATTR_ASYNC_NEST_FREQ_MHZ to determine powerbus freq to a fixed value. This change allows the processor #V to control the powerbus freq if the MRW value for ATTR_ASYNC_NEST_FREQ_MHZ == 0xFFFF. Any other nest value will still allow the MRW to control the powerbus frequency Change-Id: I918c65a22e294d51c323ddd938f9149822016e15 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43312 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/util/utilmbox_scratch.C')
-rw-r--r--src/usr/util/utilmbox_scratch.C35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/usr/util/utilmbox_scratch.C b/src/usr/util/utilmbox_scratch.C
index 6d2c57174..ff0b44589 100644
--- a/src/usr/util/utilmbox_scratch.C
+++ b/src/usr/util/utilmbox_scratch.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -41,6 +41,7 @@
#include <sys/task.h>
#include <sys/misc.h>
#include <util/utilmbox_scratch.H>
+#include <p9_frequency_buckets.H>
#include "utilbase.H"
@@ -117,4 +118,36 @@ namespace Util
mutex_unlock(&g_mutex);
}
+ uint32_t getBootNestFreq()
+ {
+ uint32_t l_bootNestFreq;
+ INITSERVICE::SPLESS::MboxScratch4_t l_scratch4;
+
+ TARGETING::Target * l_sys = nullptr;
+ (void) TARGETING::targetService().getTopLevelTarget( l_sys );
+ assert( l_sys, "getBootNestFreq() system target is NULL");
+
+ TARGETING::ATTR_MASTER_MBOX_SCRATCH_type l_scratchRegs;
+ assert(l_sys->tryGetAttr
+ <TARGETING::ATTR_MASTER_MBOX_SCRATCH>(l_scratchRegs),
+ "getBootNestFreq() failed to get MASTER_MBOX_SCRATCH");
+ l_scratch4.data32 = l_scratchRegs[INITSERVICE::SPLESS::SCRATCH_4];
+
+ size_t sizeOfPll = sizeof(NEST_PLL_FREQ_LIST)/
+ sizeof(NEST_PLL_FREQ_LIST[0]);
+
+ assert((uint8_t)(l_scratch4.nestPllBucket-1) < (uint8_t) sizeOfPll );
+
+ // The nest PLL bucket IDs are numbered 1 - 5. Subtract 1 to
+ // take zero-based indexing into account.
+ l_bootNestFreq = NEST_PLL_FREQ_LIST[l_scratch4.nestPllBucket-1];
+
+ UTIL_FT("getBootNestFreq::The boot frequency was %d: Bucket Id = %d",
+ l_bootNestFreq,
+ l_scratch4.nestPllBucket );
+
+ return l_bootNestFreq;
+ }
+
+
};
OpenPOWER on IntegriCloud