summaryrefslogtreecommitdiffstats
path: root/src/usr/hwas
diff options
context:
space:
mode:
authorMark Wenning <wenning@us.ibm.com>2012-01-12 14:41:33 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-02-07 11:44:17 -0600
commit4f09f9f6573e174c72b684b883d77f824fe949fe (patch)
tree3af5fd3be72d3166b4c78e24aa10311a6c348e90 /src/usr/hwas
parent7839259660f10f1b31db833fce37aa323e749f41 (diff)
downloadtalos-hostboot-4f09f9f6573e174c72b684b883d77f824fe949fe.tar.gz
talos-hostboot-4f09f9f6573e174c72b684b883d77f824fe949fe.zip
RTC4545 and RCT4541 - HWP support
- branch HWP_test3 Add support for IStep HWPs: HostBoot - DMI Training 11.7 proc_cen_framelock : Initialize EDI Frame HostBoot - Establish System SMP 11.4 dmi_io_run_training : Run training on ext buses - add support for 2 centaurs - push to Gerrit for full review - review responses - final review responses Change-Id: Iab9d7c145eb6834cec5edcd0a6b97622cf0ce86b Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/621 Tested-by: Jenkins Server Reviewed-by: Mark W. Wenning <wenning@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwas')
-rw-r--r--src/usr/hwas/hwas.C109
-rw-r--r--src/usr/hwas/test/hwas1test.H71
2 files changed, 96 insertions, 84 deletions
diff --git a/src/usr/hwas/hwas.C b/src/usr/hwas/hwas.C
index ffc971503..acf7b9ded 100644
--- a/src/usr/hwas/hwas.C
+++ b/src/usr/hwas/hwas.C
@@ -40,7 +40,10 @@
#include <initservice/taskargs.H>
#include <errl/errlentry.H>
#include <targeting/targetservice.H>
+#include <targeting/iterators/rangefilter.H>
+#include <targeting/predicates/predicatectm.H>
#include <fsi/fsiif.H>
+
#include <hwas/hwas.H>
#include <hwas/deconfigGard.H>
#include <targeting/util.H>
@@ -57,33 +60,113 @@ void init_target_states( void *io_pArgs )
{
INITSERVICE::TaskArgs *pTaskArgs =
static_cast<INITSERVICE::TaskArgs *>( io_pArgs );
+ TARGETING::HwasState l_hwasState;
TRACDCOMP( g_trac_hwas, "init_target_states entry: set default HWAS state:" );
// loop through all the targets and set HWAS_STATE to a known default
- TARGETING::TargetIterator l_pTarget = TARGETING::targetService().begin();
+ TARGETING::TargetIterator l_TargetItr = TARGETING::targetService().begin();
for( ;
- l_pTarget != TARGETING::targetService().end();
- ++l_pTarget
- )
+ l_TargetItr != TARGETING::targetService().end();
+ ++l_TargetItr
+ )
{
- // HWAS_STATE attribute definition in the attribute_types.xml file
- // gets translated into TARGETING::HwasState .
- // fetch it from targeting - this is not strictly necessary (right now)
- // but makes debug easier later.
- TARGETING::HwasState l_hwasState =
- l_pTarget->getAttr<ATTR_HWAS_STATE>();
-
+ l_hwasState = l_TargetItr->getAttr<ATTR_HWAS_STATE>();
l_hwasState.poweredOn = false;
l_hwasState.present = false;
l_hwasState.functional = false;
l_hwasState.changedSinceLastIPL = false;
l_hwasState.gardLevel = 0;
+ l_TargetItr->setAttr<ATTR_HWAS_STATE>( l_hwasState );
+ }
- // Now write the modified value back to Targeting.
- l_pTarget->setAttr<ATTR_HWAS_STATE>( l_hwasState );
+
+
+ /**
+ * @todo Enable cpu 0 and centaur 0 for now.
+ */
+ // $$$$$ TEMPORARY $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
+ // get the master processor, this should be CPU 0
+ TARGETING::Target* l_pMasterProcChipTargetHandle = NULL;
+ (void)TARGETING::targetService().masterProcChipTargetHandle(
+ l_pMasterProcChipTargetHandle);
+ if (l_pMasterProcChipTargetHandle == NULL)
+ {
+ TRACFCOMP( g_trac_hwas, "FAILED to get master processor target");
}
+ else
+ {
+ // set master chip to poweredOn, present, functional
+ l_hwasState = l_pMasterProcChipTargetHandle->getAttr<ATTR_HWAS_STATE>();
+ l_hwasState.poweredOn = true;
+ l_hwasState.present = true;
+ l_hwasState.functional = true;
+ l_hwasState.changedSinceLastIPL = false;
+ l_hwasState.gardLevel = 0;
+ l_pMasterProcChipTargetHandle->setAttr<ATTR_HWAS_STATE>( l_hwasState );
+
+ // get the mcs "chiplets" associated with this cpu
+ TARGETING::PredicateCTM l_mcsChipFilter(CLASS_UNIT, TYPE_MCS);
+ TARGETING::TargetHandleList l_mcsTargetList;
+ TARGETING::targetService().getAssociated(
+ l_mcsTargetList,
+ l_pMasterProcChipTargetHandle,
+ TARGETING::TargetService::CHILD,
+ TARGETING::TargetService::IMMEDIATE,
+ &l_mcsChipFilter );
+ // debug...
+ TRACDCOMP( g_trac_hwas,
+ "%d MCSs for master processor",
+ l_mcsTargetList.size() );
+
+ for ( uint8_t i=0; i < l_mcsTargetList.size(); i++ )
+ {
+ // set each MCS to poweredON, present, functional
+ l_hwasState = l_mcsTargetList[i]->getAttr<ATTR_HWAS_STATE>();
+ l_hwasState.poweredOn = true;
+ l_hwasState.present = true;
+ l_hwasState.functional = true;
+ l_hwasState.changedSinceLastIPL = false;
+ l_hwasState.gardLevel = 0;
+ l_mcsTargetList[i]->setAttr<ATTR_HWAS_STATE>( l_hwasState );
+
+
+ // If ATTR_CHIP_UNIT==0 or 1, find the centaur underneath it
+ // and set it to good as well.
+ if ( ( l_mcsTargetList[i]->getAttr<ATTR_CHIP_UNIT>() == 0 )
+ || ( l_mcsTargetList[i]->getAttr<ATTR_CHIP_UNIT>() == 1 )
+ )
+ {
+ TARGETING::PredicateCTM l_membufChips(CLASS_CHIP, TYPE_MEMBUF);
+ TARGETING::TargetHandleList l_memTargetList;
+ TARGETING::targetService().getAssociated(l_memTargetList,
+ l_mcsTargetList[i],
+ TARGETING::TargetService::CHILD_BY_AFFINITY,
+ TARGETING::TargetService::ALL,
+ &l_membufChips);
+ // debug...
+ TRACDCOMP( g_trac_hwas,
+ "%d MEMBUFSs associated with MCS %d",
+ l_memTargetList.size(),
+ l_mcsTargetList[i]->getAttr<ATTR_CHIP_UNIT>() );
+
+ for ( uint8_t ii=0; ii < l_memTargetList.size(); ii++ )
+ {
+ // set the Centaur(s) connected to MCS0 to poweredOn,
+ // present, functional
+ l_hwasState = l_memTargetList[ii]->getAttr<ATTR_HWAS_STATE>();
+ l_hwasState.poweredOn = true;
+ l_hwasState.present = true;
+ l_hwasState.functional = true;
+ l_hwasState.changedSinceLastIPL = false;
+ l_hwasState.gardLevel = 0;
+ l_memTargetList[ii]->setAttr<ATTR_HWAS_STATE>( l_hwasState );
+ } // end for
+ } // end if
+ } // end for
+ } // end else
+ // $$$$$ TEMPORARY $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
// wait here on the barrier, then end the task.
pTaskArgs->waitChildSync();
diff --git a/src/usr/hwas/test/hwas1test.H b/src/usr/hwas/test/hwas1test.H
index 4cc83e2f1..97a1051b7 100644
--- a/src/usr/hwas/test/hwas1test.H
+++ b/src/usr/hwas/test/hwas1test.H
@@ -58,77 +58,6 @@ class HWAS1test: public CxxTest::TestSuite
{
public:
- /**
- * @brief Walk some ofthe targets and verify that HWAS_STATE is set
- * correctly.
- *
- * @note Results of this test will change as more stuff gets added to
- * HWAS - how to fix?
- */
- void testHWASdefaultPresence()
- {
- TS_TRACE( "testHWASdefaultPresence entry" );
-
- using namespace TARGETING;
-
- TargetService& l_targetService = targetService();
- l_targetService.init();
-
-
- // get top level
- // Post init
- // Test: void getTopLevelTarget(Target*& o_targetHandle) const;
-
- Target* l_pTopLevel = NULL;
- (void) l_targetService.getTopLevelTarget(l_pTopLevel);
- if (l_pTopLevel == NULL)
- {
- TS_FAIL("Top level handle was NULL when initialization complete");
- }
-
- // Post init
- // Test: void getAssociated(
- // const Target* i_pTarget,
- // ASSOCIATION_TYPE i_type,
- // RECURSION_LEVEL i_recursionLevel,
- // TargetHandleList& o_list) const;
-
- TargetHandleList l_list;
- (void) l_targetService.getAssociated(
- l_list,
- l_pTopLevel,
- TARGETING::TargetService::CHILD,
- TARGETING::TargetService::ALL);
-
- TS_TRACE("Child list size is 0x%x", l_list.size() );
- for (uint64_t i=0; i<l_list.size(); i++ )
- {
- // 2011-10-19 all attribute fields should be 0 at this point.
- if ( ( l_list[i]->getAttr<ATTR_HWAS_STATE>().poweredOn)
- || ( l_list[i]->getAttr<ATTR_HWAS_STATE>().present)
- || ( l_list[i]->getAttr<ATTR_HWAS_STATE>().functional)
- || ( l_list[i]->getAttr<ATTR_HWAS_STATE>().changedSinceLastIPL)
- || ( l_list[i]->getAttr<ATTR_HWAS_STATE>().gardLevel)
- )
- {
- l_list[i]->getAttr<ATTR_PHYS_PATH>().dump();
- TS_TRACE( " poweredOn = 0x%x",
- l_list[i]->getAttr<ATTR_HWAS_STATE>().poweredOn );
- TS_TRACE( " present = 0x%x",
- l_list[i]->getAttr<ATTR_HWAS_STATE>().present );
- TS_TRACE( " l_functional = 0x%x",
- l_list[i]->getAttr<ATTR_HWAS_STATE>().functional );
- TS_TRACE( " l_changedSinceLastIPL = 0x%x",
- l_list[i]->getAttr<ATTR_HWAS_STATE>().changedSinceLastIPL );
- TS_TRACE( " l_gardLevel = 0x%x",
- l_list[i]->getAttr<ATTR_HWAS_STATE>().gardLevel );
-
- TS_FAIL( "Attribute fields not correct: ");
- }
- }
-
- TS_TRACE( "testHWASdefaultPresence exit" );
- }
/**
* @brief Write to all the attributes and then read them back.
OpenPOWER on IntegriCloud