void* call_dmi_pre_trainadv (void *io_pArgs) { IStepError l_StepError; errlHndl_t l_err = NULL; TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_dmi_pre_trainadv entry" ); TARGETING::TargetHandleList l_dmiTargetList; getAllChiplets(l_dmiTargetList, TYPE_DMI); TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, "call_dmi_pre_trainadv: %d DMIs found", l_dmiTargetList.size()); for (const auto & l_dmi_target : l_dmiTargetList) { TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "p9_io_dmi_pre_trainadv HWP target HUID %.8x", TARGETING::get_huid(l_dmi_target)); //get the membuf associated with this DMI. TARGETING::TargetHandleList l_pChildMembufList; getChildAffinityTargetsByState(l_pChildMembufList, l_dmi_target, CLASS_CHIP, TYPE_MEMBUF, UTIL_FILTER_PRESENT); // call the HWP p9_io_dmi_pre_trainadv only if membuf connected. //we can't expect more than one membufs connected to a DMI if (l_pChildMembufList.size() == 1) { // call the HWP with each DMI target fapi2::Target<fapi2::TARGET_TYPE_DMI> l_fapi_dmi_target (l_dmi_target); fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP> l_fapi_membuf_target (l_pChildMembufList[0]); FAPI_INVOKE_HWP(l_err, p9_io_dmi_pre_trainadv, l_fapi_dmi_target, l_fapi_membuf_target ); // process return code. if ( l_err ) { TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "ERROR 0x%.8X: p9_io_dmi_pre_trainadv HWP on target HUID %.8x", l_err->reasonCode(), TARGETING::get_huid(l_dmi_target) ); // capture the target data in the elog ErrlUserDetailsTarget(l_dmi_target).addToLog( l_err ); // Create IStep error log and cross reference to error that occurred l_StepError.addErrorDetails( l_err ); // Commit Error errlCommit( l_err, ISTEP_COMP_ID ); } else { TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "SUCCESS : p9_io_dmi_pre_trainadv HWP"); } } else //No associated membuf { TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "p9_io_dmi_pre_trainadv HWP skipped, no associated membufs %d" ,l_pChildMembufList.size()); } } TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_dmi_pre_trainadv exit" ); // end task, returning any errorlogs to IStepDisp return l_StepError.getErrorHandle(); }
//************************************************************************** // FREQVOLTSVC::setWofFrequencyUpliftSelected //************************************************************************** void setWofFrequencyUpliftSelected() { // get mrw data TARGETING::Target* l_pTopLevel = NULL; (void)TARGETING::targetService().getTopLevelTarget(l_pTopLevel); ATTR_WOF_FREQUENCY_UPLIFT_type l_upliftTable = {{{0}}}; ATTR_WOF_PROC_SORT_type l_procSortTable = {{0}}; ATTR_NOMINAL_FREQ_MHZ_type l_sysNomFreqMhz = l_pTopLevel->getAttr<ATTR_NOMINAL_FREQ_MHZ>(); ATTR_WOF_ENABLED_type l_wofEnabled = l_pTopLevel->getAttr < TARGETING::ATTR_WOF_ENABLED > (); // tryGetAttr used due to complex data type. Expected to always work. if (!l_pTopLevel->tryGetAttr<ATTR_WOF_FREQUENCY_UPLIFT>(l_upliftTable)) { // The zero initialized values will be used for the select array TRACFCOMP(g_fapiTd, "Failed to get ATTR_WOF_FREQUENCY_UPLIFT"); } // tryGetAttr used due to complex data type. Expected to always work. if ( !l_pTopLevel->tryGetAttr<ATTR_WOF_PROC_SORT>(l_procSortTable)) { // Not finding the sort table will result in not finding the index // which will result in a log later TRACFCOMP(g_fapiTd, "Failed to get ATTR_WOF_PROC_SORT"); } // get the list of procs TargetHandleList l_procTargetList; getAllChips(l_procTargetList, TYPE_PROC, true); // for each proc, fill in Wof Frequency Uplift Selected attribute for (TargetHandleList::const_iterator l_proc_iter = l_procTargetList.begin(); l_proc_iter != l_procTargetList.end(); ++l_proc_iter) { TARGETING::Target * l_pProcTarget = *l_proc_iter; // find number of active cores TARGETING::TargetHandleList l_presCoreList; getChildAffinityTargetsByState( l_presCoreList, const_cast<TARGETING::Target*>(l_pProcTarget), TARGETING::CLASS_UNIT, TARGETING::TYPE_CORE, TARGETING::UTIL_FILTER_PRESENT); uint8_t l_activeCores = l_presCoreList.size(); TRACDCOMP(g_fapiTd, "setWofFrequencyUpliftSelected:" " number of active cores is %d ", l_activeCores); // find WOF index. For example: // ATTR_WOF_PROC_SORT = // Cores/Nom Freq/Index // 8 3325 1 // 10 2926 2 // 12 2561 3 // 12 3093 4 // Use WOF index=3 for active cores=12 && nom freq=2561 uint8_t l_wofIndex = 0; for (uint8_t i=0;i<4;i++) { if ( (l_activeCores == l_procSortTable[i][0]) && (l_sysNomFreqMhz == l_procSortTable[i][1]) ) { l_wofIndex = l_procSortTable[i][2]; break; } } TRACDCOMP(g_fapiTd, "setWofFrequencyUpliftSelected:" " WOF index is %d ", l_wofIndex); // validate WOF index ATTR_WOF_FREQUENCY_UPLIFT_SELECTED_type l_selectedTable = {{0}}; if ( (!l_wofIndex) || (l_wofIndex > 4)) { if (l_wofEnabled) // log error if WOF enabled { TRACFCOMP(g_fapiTd, "setWofFrequencyUpliftSelected:" " No WOF table index match found HUID:0x%08X" " active cores=%d, nom freq=%d, index=%d", l_pProcTarget->getAttr<TARGETING::ATTR_HUID>(), l_activeCores, l_sysNomFreqMhz, l_wofIndex); errlHndl_t l_err = NULL; /*@ * @errortype * @moduleid fapi::MOD_GET_WOF_FREQ_UPLIFT_SELECTED * @reasoncode fapi::RC_INVALID_WOF_INDEX * @userdata1[0:31] Proc HUID * @userdata1[32:63] WOF Freq Uplift Index * @userdata2[0:31] Number of active cores * @userdata2[32:63] Nomimal Frequency * @devdesc When WOF is enabled, the WOF Freq * Uplift index should be 1,2,3, or 4 */ l_err = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE, fapi::MOD_GET_WOF_FREQ_UPLIFT_SELECTED, fapi::RC_INVALID_WOF_INDEX, TWO_UINT32_TO_UINT64( l_pProcTarget->getAttr<TARGETING::ATTR_HUID>(), l_wofIndex), TWO_UINT32_TO_UINT64( l_activeCores, l_sysNomFreqMhz)); // Callout HW as WOF mrw data is incorrect l_err->addHwCallout(l_pProcTarget, HWAS::SRCI_PRIORITY_MED, HWAS::NO_DECONFIG, HWAS::GARD_NULL); // Include WOF processor sort table TRACFBIN (g_fapiTd, "WOF processor sort table", l_procSortTable, sizeof(l_procSortTable)); l_err->collectTrace(FAPI_TRACE_NAME); // log error and keep going errlCommit(l_err,HWPF_COMP_ID); } // make sure zeros are set in the selected table attribute memset(l_selectedTable, 0, sizeof(l_selectedTable)); } else { // use index to set Wof Frequency Uplift selected attribute // note: mrw index is 1 based memcpy(l_selectedTable, &l_upliftTable[l_wofIndex-1][0][0], sizeof(l_selectedTable)); } if (!l_pProcTarget->trySetAttr<ATTR_WOF_FREQUENCY_UPLIFT_SELECTED> (l_selectedTable)) { //unlikely, crash TRACFCOMP(g_fapiTd, "Failed to set ATTR_WOF_FREQUENCY_UPLIFT_SELECTED"); assert(0); } } return; }
void* call_mss_power_cleanup (void *io_pArgs) { errlHndl_t l_err = NULL; IStepError l_stepError; TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_power_cleanup entry" ); TARGETING::TargetHandleList l_mcbistTargetList; getAllChiplets(l_mcbistTargetList, TYPE_MCBIST); for (const auto & l_target : l_mcbistTargetList) { // Dump current run on target TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "Running mss_power_cleanup HWP on " "target HUID %.8X", TARGETING::get_huid(l_target)); fapi2::Target <fapi2::TARGET_TYPE_MCBIST> l_fapi_target (l_target); // call the HWP with each fapi2::Target FAPI_INVOKE_HWP(l_err, p9_mss_power_cleanup, l_fapi_target); if (l_err) { TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, "ERROR 0x%.8X: mss_power_cleanup HWP returns error", l_err->reasonCode()); // capture the target data in the elog ErrlUserDetailsTarget(l_target).addToLog(l_err); // Create IStep error log and cross reference to error that // occurred l_stepError.addErrorDetails( l_err ); // Commit Error errlCommit( l_err, HWPF_COMP_ID ); } else { TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "SUCCESS : mss_power_cleanup HWP( )" ); } } // -- Cumulus only // Get a list of all present Centaurs TargetHandleList l_presCentaurs; getChipResources(l_presCentaurs, TYPE_MEMBUF, UTIL_FILTER_PRESENT); // For each present Centaur for (TargetHandleList::const_iterator l_cenIter = l_presCentaurs.begin(); l_cenIter != l_presCentaurs.end(); ++l_cenIter) { // Make a local copy of the target for ease of use TARGETING::Target * l_pCentaur = *l_cenIter; // Retrieve HUID of current Centaur TARGETING::ATTR_HUID_type l_currCentaurHuid = TARGETING::get_huid(l_pCentaur); // Find all present MBAs associated with this Centaur TARGETING::TargetHandleList l_presMbas; getChildAffinityTargetsByState(l_presMbas, l_pCentaur, CLASS_UNIT, TYPE_MBA, UTIL_FILTER_PRESENT); // If not at least two MBAs found if (l_presMbas.size() < 2) { TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, "Not enough MBAs found for Centaur target HUID %.8X, " "skipping this Centaur.", l_currCentaurHuid); continue; } // Cache current MBA HUIDs for tracing TARGETING::ATTR_HUID_type l_currMBA0Huid = TARGETING::get_huid(l_presMbas[0]); TARGETING::ATTR_HUID_type l_currMBA1Huid = TARGETING::get_huid(l_presMbas[1]); TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, "Running mss_power_cleanup HWP on " "Centaur HUID %.8X, MBA0 HUID %.8X, " "MBA1 HUID %.8X, ", l_currCentaurHuid, l_currMBA0Huid, l_currMBA1Huid); // Create FAPI Targets. fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP> l_fapiCentaurTarget( l_pCentaur ); fapi2::Target<fapi2::TARGET_TYPE_MBA_CHIPLET> l_fapiMba0Target( l_presMbas[0] ); fapi2::Target<fapi2::TARGET_TYPE_MBA_CHIPLET> l_fapiMba1Target( l_presMbas[1] ); // Call the HWP with each fapi::Target FAPI_INVOKE_HWP(l_err, p9c_mss_power_cleanup, l_fapiCentaurTarget, l_fapiMba0Target, l_fapiMba1Target); if (l_err) { TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, "mss_power_cleanup HWP failed to perform" " cleanup on centaur: 0x%.8X HWP_ERROR: 0x%.8X", l_currCentaurHuid,l_err->reasonCode()); // Capture the target data in the error log ErrlUserDetailsTarget(l_pCentaur).addToLog(l_err); // Create IStep error log and cross reference error that occurred l_stepError.addErrorDetails(l_err); // Commit error errlCommit(l_err, HWPF_COMP_ID); } else { // Success TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, "Successfully ran mss_power_cleanup HWP on " "Centaur HUID %.8X, MBA0 HUID %.8X, " "MBA1 HUID %.8X, ", l_currCentaurHuid, l_currMBA0Huid, l_currMBA1Huid); } } TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_power_cleanup exit" ); // end task, returning any errorlogs to IStepDisp return l_stepError.getErrorHandle(); }