summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorChristian Geddes <crgeddes@us.ibm.com>2019-02-27 15:37:26 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-03-05 09:00:32 -0600
commit7ce2a9daac0ccf759376929b2ec40bbbc7ca3398 (patch)
treec586359fb016382ce8ce868bed2e4b1f37e8e0bf /src/usr
parentd74d3932d989bca5b533c48024ac135ec9991d64 (diff)
downloadtalos-hostboot-7ce2a9daac0ccf759376929b2ec40bbbc7ca3398.tar.gz
talos-hostboot-7ce2a9daac0ccf759376929b2ec40bbbc7ca3398.zip
Add interface to look up model type of master processor on targetService
While going through IPL flow updates for Axone I realized it would be handy to have a targetService utility function that told us what MODEL we are running hostboot for. This commit introduced the interface TargetService::getProcessorModel() which will return the model of the master processor. Change-Id: Ia4c9a578bc39f08c69946b6fbbcb800707342e7d Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/72587 Reviewed-by: Matthew Raybuck <matthew.raybuck@ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Matt Derksen <mderkse1@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-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>
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/targeting/common/targetservice.C38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/usr/targeting/common/targetservice.C b/src/usr/targeting/common/targetservice.C
index e3c3dde92..11d9022b9 100644
--- a/src/usr/targeting/common/targetservice.C
+++ b/src/usr/targeting/common/targetservice.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2018 */
+/* Contributors Listed Below - COPYRIGHT 2012,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -115,7 +115,8 @@ TRAC_INIT(&g_trac_targeting, "TARG", 4096);
TargetService::TargetService() :
iv_initialized(false),
- iv_pSys(NULL)
+ iv_pSys(NULL),
+ iv_processorModel(MODEL_NA)
{
#define TARG_FN "TargetService()"
@@ -215,6 +216,11 @@ void TargetService::init(const size_t i_maxNodes)
// call to set the top TYPE_SYS target
_setTopLevelTarget();
+
+ // Lookup the master processor's ATTR_MODEL attribute and set
+ // the instance variable on the targetService object for quick
+ // future reference
+ _setProcessorModel();
}
TARG_EXIT();
@@ -223,6 +229,34 @@ void TargetService::init(const size_t i_maxNodes)
}
//******************************************************************************
+// TargetService:: _setProcessorModel
+//******************************************************************************
+void TargetService::_setProcessorModel(void)
+{
+ #define TARG_FN "setProcessorModel()"
+ TARG_ENTER();
+
+ TargetHandle_t masterProc = NULL;
+ masterProcChipTargetHandle( masterProc );
+
+ TARG_ASSERT(masterProc, "Failed to find master processor, SW error, check MRW / XML " );
+
+ iv_processorModel = masterProc->getAttr<ATTR_MODEL>();
+
+ TARG_EXIT();
+ #undef TARG_FN
+ return;
+}
+
+//******************************************************************************
+// TargetService:: getProcessorModel
+//******************************************************************************
+ATTR_MODEL_type TargetService::getProcessorModel(void)
+{
+ return iv_processorModel;
+}
+
+//******************************************************************************
// TargetService:: _setTopLevelTarget
//******************************************************************************
OpenPOWER on IntegriCloud