From 4f09f9f6573e174c72b684b883d77f824fe949fe Mon Sep 17 00:00:00 2001 From: Mark Wenning Date: Thu, 12 Jan 2012 14:41:33 -0600 Subject: 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 Reviewed-by: A. Patrick Williams III --- src/usr/hwas/hwas.C | 109 +++++++++++++++++++++++++++++++++++++----- src/usr/hwas/test/hwas1test.H | 71 --------------------------- 2 files changed, 96 insertions(+), 84 deletions(-) (limited to 'src/usr/hwas') 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 #include #include +#include +#include #include + #include #include #include @@ -57,33 +60,113 @@ void init_target_states( void *io_pArgs ) { INITSERVICE::TaskArgs *pTaskArgs = static_cast( 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(); - + l_hwasState = l_TargetItr->getAttr(); l_hwasState.poweredOn = false; l_hwasState.present = false; l_hwasState.functional = false; l_hwasState.changedSinceLastIPL = false; l_hwasState.gardLevel = 0; + l_TargetItr->setAttr( l_hwasState ); + } - // Now write the modified value back to Targeting. - l_pTarget->setAttr( 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(); + l_hwasState.poweredOn = true; + l_hwasState.present = true; + l_hwasState.functional = true; + l_hwasState.changedSinceLastIPL = false; + l_hwasState.gardLevel = 0; + l_pMasterProcChipTargetHandle->setAttr( 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(); + l_hwasState.poweredOn = true; + l_hwasState.present = true; + l_hwasState.functional = true; + l_hwasState.changedSinceLastIPL = false; + l_hwasState.gardLevel = 0; + l_mcsTargetList[i]->setAttr( 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() == 0 ) + || ( l_mcsTargetList[i]->getAttr() == 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() ); + + 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(); + l_hwasState.poweredOn = true; + l_hwasState.present = true; + l_hwasState.functional = true; + l_hwasState.changedSinceLastIPL = false; + l_hwasState.gardLevel = 0; + l_memTargetList[ii]->setAttr( 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; igetAttr().poweredOn) - || ( l_list[i]->getAttr().present) - || ( l_list[i]->getAttr().functional) - || ( l_list[i]->getAttr().changedSinceLastIPL) - || ( l_list[i]->getAttr().gardLevel) - ) - { - l_list[i]->getAttr().dump(); - TS_TRACE( " poweredOn = 0x%x", - l_list[i]->getAttr().poweredOn ); - TS_TRACE( " present = 0x%x", - l_list[i]->getAttr().present ); - TS_TRACE( " l_functional = 0x%x", - l_list[i]->getAttr().functional ); - TS_TRACE( " l_changedSinceLastIPL = 0x%x", - l_list[i]->getAttr().changedSinceLastIPL ); - TS_TRACE( " l_gardLevel = 0x%x", - l_list[i]->getAttr().gardLevel ); - - TS_FAIL( "Attribute fields not correct: "); - } - } - - TS_TRACE( "testHWASdefaultPresence exit" ); - } /** * @brief Write to all the attributes and then read them back. -- cgit v1.2.1