summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Sanner <dsanner@us.ibm.com>2017-04-11 21:25:45 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-09-14 09:25:09 -0400
commit8a4cc1d6b3770dade628f77bcb01ed397181730d (patch)
tree1255ae9a44396c754ae11403a6bf5b40cce03fd0
parent3d6c5417a82f5dec8e708c0f311f1634a2aad651 (diff)
downloadblackbird-hostboot-8a4cc1d6b3770dade628f77bcb01ed397181730d.tar.gz
blackbird-hostboot-8a4cc1d6b3770dade628f77bcb01ed397181730d.zip
Ability to boot in SMT1 or SMT2 in Hostboot
Change-Id: Ie377f47a5087e6a53ff57c4c4415be014f92c461 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40584 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rwxr-xr-xsrc/include/usr/hdat/hdat.H2
-rw-r--r--src/include/usr/initservice/mboxRegs.H5
-rw-r--r--src/usr/hdat/hdatpcia.C31
-rw-r--r--src/usr/intr/intrrp.C26
-rw-r--r--src/usr/isteps/istep06/thread_activate/thread_activate.C19
5 files changed, 68 insertions, 15 deletions
diff --git a/src/include/usr/hdat/hdat.H b/src/include/usr/hdat/hdat.H
index 2b4c35daa..bf005866b 100755
--- a/src/include/usr/hdat/hdat.H
+++ b/src/include/usr/hdat/hdat.H
@@ -167,6 +167,8 @@ extern const uint8_t HDAT_HDIF_ALIGN;
#define HDAT_MAX_THREADS_SUPPORTED 8
#define HDAT_MAX_EIGHT_THREADS_SUPPORTED 8
#define HDAT_MAX_FOUR_THREADS_SUPPORTED 4
+#define HDAT_MAX_TWO_THREADS_SUPPORTED 2
+
/* @enum hdatProcStatus
* Status of a processor FRU.
diff --git a/src/include/usr/initservice/mboxRegs.H b/src/include/usr/initservice/mboxRegs.H
index a98cb9305..a5b46abb3 100644
--- a/src/include/usr/initservice/mboxRegs.H
+++ b/src/include/usr/initservice/mboxRegs.H
@@ -86,11 +86,12 @@ namespace SPLESS
uint32_t goToRuntime :1; //1
uint32_t isMpipl :1; //2
uint32_t fspAttached :1; //3
- uint32_t reserved1 :1; //4
+ uint32_t reserved1 :1; //4 -- do not repurpose
uint32_t sbeInternalFFDC :1; //5
uint32_t overrideSecurity :1; //6
uint32_t allowAttrOverrides :1; //7
- uint32_t reserved2 :24; //8:31
+ uint32_t smtMode :2; //8:9
+ uint32_t reserved2 :22; //10:31 -- Available
} PACKED;
// NOTE: Used for debug tool communication during Hostboot IPL
};
diff --git a/src/usr/hdat/hdatpcia.C b/src/usr/hdat/hdatpcia.C
index 9f32cdba5..0f89604b9 100644
--- a/src/usr/hdat/hdatpcia.C
+++ b/src/usr/hdat/hdatpcia.C
@@ -162,24 +162,43 @@ errlHndl_t HdatPcia::hdatLoadPcia(uint32_t &o_size, uint32_t &o_count)
}
l_coreThreadCount = l_pTopLevel->getAttr<ATTR_THREAD_COUNT>();
+ uint64_t en_thread_mask =
+ l_pTopLevel->getAttr<TARGETING::ATTR_ENABLED_THREADS>();
+ //Check the enabled threads to see if user overrode to SMT1 or SMT2
+ //Note this only handles specific SMT1/2 -- no other permutations
+ size_t l_enabledThreads = l_coreThreadCount;
+ if (en_thread_mask == 0x8000000000000000)
+ {
+ l_enabledThreads = 1;
+ }
+ else if (en_thread_mask == 0xC000000000000000)
+ {
+ l_enabledThreads = 2;
+ }
uint32_t l_procStatus;
- HDAT_DBG("Core Thread Count[%d]", l_coreThreadCount);
+ HDAT_DBG("Core Thread Count[%d], Enabled[%d]",
+ l_coreThreadCount, l_enabledThreads);
- if ( l_coreThreadCount == HDAT_MAX_EIGHT_THREADS_SUPPORTED )
+ if ( l_enabledThreads == HDAT_MAX_EIGHT_THREADS_SUPPORTED )
{
l_procStatus =
HDAT_PROC_NOT_INSTALLED | HDAT_PRIM_THREAD | HDAT_EIGHT_THREAD;
}
- else if ( l_coreThreadCount == HDAT_MAX_FOUR_THREADS_SUPPORTED )
+ else if ( l_enabledThreads == HDAT_MAX_FOUR_THREADS_SUPPORTED )
{
l_procStatus =
HDAT_PROC_NOT_INSTALLED | HDAT_PRIM_THREAD | HDAT_FOUR_THREAD;
}
- else
+ else if ( l_enabledThreads == HDAT_MAX_TWO_THREADS_SUPPORTED )
{
l_procStatus =
HDAT_PROC_NOT_INSTALLED | HDAT_PRIM_THREAD | HDAT_TWO_THREAD;
}
+ else // Single threaded
+ {
+ l_procStatus =
+ HDAT_PROC_NOT_INSTALLED | HDAT_PRIM_THREAD;
+ }
//for each procs in the system
TARGETING::PredicateCTM l_procFilter(CLASS_CHIP, TYPE_PROC);
TARGETING::PredicateHwas l_pred;
@@ -232,7 +251,7 @@ errlHndl_t HdatPcia::hdatLoadPcia(uint32_t &o_size, uint32_t &o_count)
l_pTarget->getAttr<TARGETING::ATTR_CHIP_UNIT>();
for ( uint32_t l_threadIndex=0;
- l_threadIndex < l_coreThreadCount; ++l_threadIndex)
+ l_threadIndex < l_enabledThreads; ++l_threadIndex)
{
l_errl = hdatSetCoreInfo(index,
l_pTarget,l_pProcTarget);
@@ -325,7 +344,7 @@ errlHndl_t HdatPcia::hdatLoadPcia(uint32_t &o_size, uint32_t &o_count)
this->iv_spPcia[index].hdatThreadData.pciaThreadOffsetToData
= offsetof(hdatPciaThreadUniqueData_t, pciaThreadData);
this->iv_spPcia[index].hdatThreadData.pciaThreadNumEntries
- = l_coreThreadCount;
+ = l_enabledThreads;
this->iv_spPcia[index].hdatThreadData.
pciaThreadSizeAllocated = sizeof(hdatPciaThreadArray_t);
this->iv_spPcia[index].hdatThreadData.pciaThreadSizeActual =
diff --git a/src/usr/intr/intrrp.C b/src/usr/intr/intrrp.C
index 87e2b1374..155418fde 100644
--- a/src/usr/intr/intrrp.C
+++ b/src/usr/intr/intrrp.C
@@ -54,6 +54,7 @@
#include <arch/pvrformat.H>
#include <config.h>
#include <p9_misc_scom_addresses.H>
+#include <util/utilmbox_scratch.H>
#define INTR_TRACE_NAME INTR_COMP_NAME
@@ -3579,10 +3580,27 @@ uint64_t INTR::get_enabled_threads( void )
uint64_t en_threads = sys->getAttr<TARGETING::ATTR_ENABLED_THREADS>();
if( en_threads == 0 )
{
- //TODO RTC 151022
- //Read <SBE memory area> for enabled threads value
- // and set attribute appropriately
- en_threads = 0xF000000000000000; //Enable all the threads
+ //Read mbox scratch regs for enabled threads value
+ //and set attribute appropriately
+ INITSERVICE::SPLESS::MboxScratch3_t l_scratch3;
+ TARGETING::ATTR_MASTER_MBOX_SCRATCH_type l_scratchRegs;
+ assert(sys->tryGetAttr
+ <TARGETING::ATTR_MASTER_MBOX_SCRATCH>(l_scratchRegs),
+ "INTR::get_enabled_threads() failed to get MASTER_MBOX_SCRATCH");
+ l_scratch3.data32 = l_scratchRegs[INITSERVICE::SPLESS::SCRATCH_3];
+
+ if(l_scratch3.smtMode == 0x1)
+ {
+ en_threads = 0x8000000000000000; //SMT1 == thread 0
+ }
+ else if (l_scratch3.smtMode == 0x2)
+ {
+ en_threads = 0xC000000000000000; //SMT2 == thread 0,1
+ }
+ else
+ {
+ en_threads = 0xF000000000000000; //SMT4 == thread 0..3
+ }
sys->setAttr<TARGETING::ATTR_ENABLED_THREADS>(en_threads);
}
return en_threads;
diff --git a/src/usr/isteps/istep06/thread_activate/thread_activate.C b/src/usr/isteps/istep06/thread_activate/thread_activate.C
index dc7dce6ab..606249534 100644
--- a/src/usr/isteps/istep06/thread_activate/thread_activate.C
+++ b/src/usr/isteps/istep06/thread_activate/thread_activate.C
@@ -385,7 +385,8 @@ void activate_threads( errlHndl_t& io_rtaskRetErrl )
// AVPs might enable a subset of the available threads
uint64_t max_threads = cpu_thread_count();
- uint64_t en_threads_master =
+ uint64_t en_threads, en_threads_master;
+ en_threads = en_threads_master =
sys->getAttr<TARGETING::ATTR_ENABLED_THREADS>();
// Core0_thread: 0 1 2 3 Core1_thread: 0 1 2 3
@@ -393,9 +394,15 @@ void activate_threads( errlHndl_t& io_rtaskRetErrl )
// FUSED (SMT8) - E - - E E - -
// * E=enable, Core0_t0=master already enabled
const uint64_t SMT8_ENABLE_THREADS_MASK = 0xC000000000000000;
+ const uint64_t SMT8_FUSE0_THREADS_MASK = 0xA000000000000000;
+ const uint64_t SMT8_FUSE1_THREADS_MASK = 0x5000000000000000;
if( l_smt8 )
{
- en_threads_master &= SMT8_ENABLE_THREADS_MASK;
+ // First capture if threads 0,2 are enabled. Then eliminate
+ // odd threads and compress to bits 0,1
+ uint64_t threads = en_threads & SMT8_FUSE0_THREADS_MASK;
+ en_threads_master = threads & SMT8_ENABLE_THREADS_MASK; //T0
+ en_threads_master |= (threads << 1) & SMT8_ENABLE_THREADS_MASK;//T2
}
TRACFCOMP( g_fapiTd,
@@ -538,7 +545,13 @@ void activate_threads( errlHndl_t& io_rtaskRetErrl )
break;
}
- uint64_t en_threads_c1 = SMT8_ENABLE_THREADS_MASK;
+ // First capture if threads 1,3 are enabled. Then eliminate
+ // even threads and compress to bits 0,1
+ uint64_t en_threads_c1;
+ uint64_t threads = en_threads & SMT8_FUSE1_THREADS_MASK;
+ en_threads_c1 = (threads << 1) & SMT8_ENABLE_THREADS_MASK; //T1
+ en_threads_c1 |= (threads << 2) & SMT8_ENABLE_THREADS_MASK;//T3
+
TRACFCOMP( g_fapiTd,
"activate_threads max_threads=%d, en_threads_c1=0x%016X",
OpenPOWER on IntegriCloud