diff options
| author | Christian Geddes <crgeddes@us.ibm.com> | 2019-02-27 15:37:26 -0600 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2019-03-05 09:00:32 -0600 |
| commit | 7ce2a9daac0ccf759376929b2ec40bbbc7ca3398 (patch) | |
| tree | c586359fb016382ce8ce868bed2e4b1f37e8e0bf /src | |
| parent | d74d3932d989bca5b533c48024ac135ec9991d64 (diff) | |
| download | blackbird-hostboot-7ce2a9daac0ccf759376929b2ec40bbbc7ca3398.tar.gz blackbird-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')
| -rw-r--r-- | src/include/usr/targeting/common/targetservice.H | 16 | ||||
| -rw-r--r-- | src/usr/targeting/common/targetservice.C | 38 |
2 files changed, 51 insertions, 3 deletions
diff --git a/src/include/usr/targeting/common/targetservice.H b/src/include/usr/targeting/common/targetservice.H index 157372126..397aec0c1 100644 --- a/src/include/usr/targeting/common/targetservice.H +++ b/src/include/usr/targeting/common/targetservice.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2018 */ +/* Contributors Listed Below - COPYRIGHT 2012,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -372,6 +372,13 @@ class TargetService friend class _TargetRawIterator<const Target*>; /** + * @brief Return the value of iv_processorModel + * + * @return ATTR_MODEL_type the model type of the master processor + */ + ATTR_MODEL_type getProcessorModel(void); + + /** * @brief Returns the top level physical target * * Returns the top level (usually system) target. Caller must check @@ -1104,9 +1111,16 @@ class TargetService */ void _setTopLevelTarget(); + /** + * @brief Set the instance variable iv_processorModel to be the value of + * attribute ATTR_MODEL of the master processor + */ + void _setProcessorModel(void); + // Instance variables bool iv_initialized; ///< Is service initialized or not Target * iv_pSys; // Top Level Target + ATTR_MODEL_type iv_processorModel; // Model of the master processor NodeData_t iv_nodeData; 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 //****************************************************************************** |

