Skip to content

Commit

Permalink
Add interface to look up model type of master processor on targetService
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
crgeddes authored and dcrowell77 committed Mar 5, 2019
1 parent d74d393 commit 7ce2a9d
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 3 deletions.
16 changes: 15 additions & 1 deletion src/include/usr/targeting/common/targetservice.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* Contributors Listed Below - COPYRIGHT 2012,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -371,6 +371,13 @@ class TargetService
friend class _TargetRawIterator<Target*>;
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
*
Expand Down Expand Up @@ -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;

Expand Down
38 changes: 36 additions & 2 deletions src/usr/targeting/common/targetservice.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* Contributors Listed Below - COPYRIGHT 2012,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -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()"

Expand Down Expand Up @@ -215,13 +216,46 @@ 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();

#undef TARG_FN
}

//******************************************************************************
// 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
//******************************************************************************
Expand Down

0 comments on commit 7ce2a9d

Please sign in to comment.