diff options
author | Mike Baiocchi <baiocchi@us.ibm.com> | 2013-06-28 17:10:13 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-07-09 15:19:54 -0500 |
commit | cf9d170610549a41e0466eee3d071795784b426b (patch) | |
tree | 91788d782d37d7bcf8f8633b9202c2374c41e149 /src/usr/intr | |
parent | 9936f9dc396b8c01f87dbeeba9458cfff24b0fc1 (diff) | |
download | talos-hostboot-cf9d170610549a41e0466eee3d071795784b426b.tar.gz talos-hostboot-cf9d170610549a41e0466eee3d071795784b426b.zip |
Use SBE Setting of Thread Count or Fail
This commit takes out the workaround of using a default setting
of a thread count if the SBE didn't set the right value in a
scratch register. The current SBE code now does this, and we
will now fail if for some reason the value isn't set. This commit
also includes sim action file updates to model this behavior.
Change-Id: I83608c402fac675c0287fa3ce38cf75237bcff26
RTC: 63991
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5255
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/intr')
-rw-r--r-- | src/usr/intr/intrrp.C | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/src/usr/intr/intrrp.C b/src/usr/intr/intrrp.C index a8dd2ca6d..8838d22cf 100644 --- a/src/usr/intr/intrrp.C +++ b/src/usr/intr/intrrp.C @@ -96,25 +96,40 @@ uint64_t get_enabled_threads( void ) // Read the scratch reg that the SBE setup // Enabled threads are listed as a bitstring in bits 16:23 // A value of zero means the SBE hasn't set them up yet - while( en_threads == 0 ) + + // Loop for 1 sec (1000 x 1 msec) for this value to be set + uint64_t loop_count = 0; + const uint64_t LOOP_MAX = 1000; + + while( (en_threads == 0) && (loop_count < LOOP_MAX) ) { en_threads = mmio_scratch_read(MMIO_SCRATCH_AVP_THREADS); - //@todo RTC:63991 - Remove this after we get the new SBE image if( en_threads == 0 ) { - // Default to all threads enabled - uint64_t max_threads = cpu_thread_count(); - en_threads = - ((1ull << max_threads) - 1ull) << (48ull - max_threads); + // Sleep if value has not been set + nanosleep(0,NS_PER_MSEC); // 1 msec } + + // Update the counter + loop_count++; + } + + // If LOOP_MAX reached, CRIT_ASSERT + if ( unlikely(loop_count == LOOP_MAX) ) + { + TRACFCOMP( g_trac_intr,"SBE Didn't Set Active Threads"); + crit_assert(0); + } + else + { + en_threads = en_threads << 16; //left-justify the threads + TRACFCOMP( g_trac_intr, + "Enabled Threads = %.16X", + en_threads ); + sys->setAttr<TARGETING::ATTR_ENABLED_THREADS>(en_threads); } - en_threads = en_threads << 16; //left-justify the threads - TRACFCOMP( g_trac_intr, - "Enabled Threads = %.16X", - en_threads ); - sys->setAttr<TARGETING::ATTR_ENABLED_THREADS>(en_threads); } TRACDCOMP( g_trac_intr, "en_threads=%.16X", en_threads ); return en_threads; |