summaryrefslogtreecommitdiffstats
path: root/src/sbefw/sbeutil.C
diff options
context:
space:
mode:
authorSachin Gupta <sgupta2m@in.ibm.com>2017-02-17 21:19:40 -0600
committerAMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>2017-02-22 08:08:55 -0500
commit1c71c41dd6d4125e2f5ab495665de48f1f977a58 (patch)
treef1ca8a70735faffebace52f36c74b1e8b286363e /src/sbefw/sbeutil.C
parent70199118e1bf5776029cfb261055f76e2f5737d3 (diff)
downloadtalos-sbe-1c71c41dd6d4125e2f5ab495665de48f1f977a58.tar.gz
talos-sbe-1c71c41dd6d4125e2f5ab495665de48f1f977a58.zip
Enable sbe runtime support for lab
It adds these two capabilities 1. Call p9_sbe_attr_setup in start. This will sync sbe attributes as istep will not be called for sbe. 2. Set pk frequency as per nest pll bucket. We need to see if step 1 has some side effect in sbe reset at runtime. Change-Id: Ib3ee7075e7bea87b225a9ab6ae55707e4f9152c3 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36701 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Shakeeb A. Pasha B K <shakeebbk@in.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com> Reviewed-by: RAJA DAS <rajadas2@in.ibm.com> Reviewed-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>
Diffstat (limited to 'src/sbefw/sbeutil.C')
-rw-r--r--src/sbefw/sbeutil.C21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/sbefw/sbeutil.C b/src/sbefw/sbeutil.C
index ac1eeacd..8ad99bca 100644
--- a/src/sbefw/sbeutil.C
+++ b/src/sbefw/sbeutil.C
@@ -5,7 +5,8 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -22,6 +23,10 @@
/* */
/* IBM_PROLOG_END_TAG */
#include "sbeutil.H"
+#include "fapi2.H"
+#include "sbetrace.H"
+// Nest frequency array
+#include "p9_frequency_buckets.H"
namespace SBE
{
bool isSimics() __attribute__((alias("__isSimicsRunning")));
@@ -38,4 +43,18 @@ namespace SBE
static bool simics = isSimics();
return simics;
}
+
+ void updatePkFreq()
+ {
+ using namespace fapi2;
+ Target<TARGET_TYPE_SYSTEM> sys;
+ uint8_t nestPllBkt = 0;
+ FAPI_ATTR_GET( ATTR_NEST_PLL_BUCKET, sys, nestPllBkt );
+ assert( nestPllBkt && (nestPllBkt <= NEST_PLL_FREQ_BUCKETS ));
+ g_sbefreq = ( NEST_PLL_FREQ_LIST[ nestPllBkt - 1 ] * 1000 * 1000 )/
+ SBE::SBE_TO_NEST_FREQ_FACTOR;
+ SBE_INFO(SBE_FUNC"Setting new frequency:0x%08X", g_sbefreq);
+ pk_timebase_freq_set(g_sbefreq);
+ }
}
+
OpenPOWER on IntegriCloud