diff options
author | Thi Tran <thi@us.ibm.com> | 2012-12-07 13:50:38 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-12-19 08:53:04 -0600 |
commit | f94a72b34c65ee2ab3e4d736f1c334159af99d58 (patch) | |
tree | 461a77e4e2b9b8d9de1e8bb950dcba4c67fe9272 /src/usr/hwpf/hwp/dmi_training | |
parent | d00706a9f8869af321b4ddb3dea0106d19cea312 (diff) | |
download | talos-hostboot-f94a72b34c65ee2ab3e4d736f1c334159af99d58.tar.gz talos-hostboot-f94a72b34c65ee2ab3e4d736f1c334159af99d58.zip |
Implementing io_dccal HWP to HostBoot
RTC: 41360
Change-Id: I04982bfdc11e7500106c95b7731927fe3e500cd7
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2598
Tested-by: Jenkins Server
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp/dmi_training')
-rw-r--r-- | src/usr/hwpf/hwp/dmi_training/dmi_io_dccal/dmi_io_dccal.C | 32 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/dmi_training/dmi_io_dccal/dmi_io_dccal.H | 35 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/dmi_training/dmi_training.C | 351 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/dmi_training/makefile | 5 |
4 files changed, 302 insertions, 121 deletions
diff --git a/src/usr/hwpf/hwp/dmi_training/dmi_io_dccal/dmi_io_dccal.C b/src/usr/hwpf/hwp/dmi_training/dmi_io_dccal/dmi_io_dccal.C new file mode 100644 index 000000000..a79ac0e91 --- /dev/null +++ b/src/usr/hwpf/hwp/dmi_training/dmi_io_dccal/dmi_io_dccal.C @@ -0,0 +1,32 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/dmi_training/dmi_io_dccal/dmi_io_dccal.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ +#include <fapi.H> +#include "io_dccal.H" + +extern "C" { + +ReturnCode dmi_io_dccal(const Target &master_target){ + return io_dccal(master_target); +} + +} // extern diff --git a/src/usr/hwpf/hwp/dmi_training/dmi_io_dccal/dmi_io_dccal.H b/src/usr/hwpf/hwp/dmi_training/dmi_io_dccal/dmi_io_dccal.H new file mode 100644 index 000000000..c690e323d --- /dev/null +++ b/src/usr/hwpf/hwp/dmi_training/dmi_io_dccal/dmi_io_dccal.H @@ -0,0 +1,35 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/dmi_training/dmi_io_dccal/dmi_io_dccal.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef DMI_IO_DCCAL_H_ +#define DMI_IO_DCCAL_H_ + +using namespace fapi; + +extern "C" +{ + +fapi::ReturnCode dmi_io_dccal(const fapi::Target &master_target); + +} // extern "C" + +#endif // DMI_IO_DCCAL_H diff --git a/src/usr/hwpf/hwp/dmi_training/dmi_training.C b/src/usr/hwpf/hwp/dmi_training/dmi_training.C index 92da34526..719c5eca3 100644 --- a/src/usr/hwpf/hwp/dmi_training/dmi_training.C +++ b/src/usr/hwpf/hwp/dmi_training/dmi_training.C @@ -69,9 +69,9 @@ #include "proc_cen_set_inband_addr.H" #include "mss_get_cen_ecid.H" #include "io_restore_erepair.H" - -// eRepair Restore #include <erepairAccessorHwpFuncs.H> +#include "dmi_io_dccal/dmi_io_dccal.H" +#include <pbusLinkSvc.H> namespace DMI_TRAINING { @@ -81,6 +81,12 @@ using namespace ISTEP_ERROR; using namespace ERRORLOG; using namespace TARGETING; using namespace fapi; +using namespace EDI_EI_INITIALIZATION; + +//***************************************************************** +// Function prototypes +//***************************************************************** +void get_dmi_io_targets(TargetPairs_t& o_dmi_io_targets); // @@ -582,14 +588,132 @@ void* call_dmi_erepair( void *io_pArgs ) // void* call_dmi_io_dccal( void *io_pArgs ) { - errlHndl_t l_err = NULL; + errlHndl_t l_errl = NULL; + ISTEP_ERROR::IStepError l_StepError; - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_dmi_io_dccal entry" ); + // We are not running this analog procedure in VPO + if (TARGETING::is_vpo()) + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Skip dmi_io_dccal in VPO!"); + return l_StepError.getErrorHandle(); + } + // TODO: RTC 60627 + // Reinstate this to enable dmi_io_dccal + return l_StepError.getErrorHandle(); - TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_dmi_io_dccal exit" ); + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_dmi_io_dccal entry" ); - return l_err; + TargetPairs_t l_dmi_io_dccal_targets; + get_dmi_io_targets(l_dmi_io_dccal_targets); + + + // Note: + // Due to lab tester board environment, HW procedure writer (Varkey) has + // requested to send in one target of a time (we used to send in + // the MCS and MEMBUF pair in one call). Even though they don't have to be + // in order, we should keep the pair concept here in case we need to send + // in a pair in the future again. + for (TargetPairs_t::iterator l_itr = l_dmi_io_dccal_targets.begin(); + l_itr != l_dmi_io_dccal_targets.end(); ++l_itr) + { + const fapi::Target l_fapi_mcs_target( + TARGET_TYPE_MCS_CHIPLET, + reinterpret_cast<void *> + (const_cast<TARGETING::Target*>(l_itr->first))); + + const fapi::Target l_fapi_membuf_target( + TARGET_TYPE_MEMBUF_CHIP, + reinterpret_cast<void *> + (const_cast<TARGETING::Target*>(l_itr->second))); + + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "===== Call dmi_io_dccal HWP( mcs 0x%.8X, mem 0x%.8X) : ", + TARGETING::get_huid(l_itr->first), + TARGETING::get_huid(l_itr->second)); + + EntityPath l_path; + l_path = l_itr->first->getAttr<ATTR_PHYS_PATH>(); + l_path.dump(); + l_path = l_itr->second->getAttr<ATTR_PHYS_PATH>(); + l_path.dump(); + + // Call on the MCS + FAPI_INVOKE_HWP(l_errl, dmi_io_dccal, l_fapi_mcs_target); + + if (l_errl) + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR 0x%.8X : dmi_io_dccal HWP Target MCS 0x%.8X", + l_errl->reasonCode(), TARGETING::get_huid(l_itr->first)); + /*@ + * @errortype + * @reasoncode ISTEP_DMI_IO_DCCAL_MCS_FAILED + * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE + * @moduleid ISTEP_DMI_IO_DCCAL + * @userdata1 bytes 0-1: plid identifying first error + * bytes 2-3: reason code of first error + * @userdata2 bytes 0-1: total number of elogs included + * bytes 2-3: N/A + * @devdesc call to dmi_io_dccal on MCS has failed + */ + l_StepError.addErrorDetails(ISTEP_DMI_IO_DCCAL_MCS_FAILED, + ISTEP_DMI_IO_DCCAL, + l_errl); + + errlCommit( l_errl, HWPF_COMP_ID ); + // We want to continue the training despite the error, so + // no break + } + else + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "SUCCESS : call_dmi_io_dccal HWP - Target 0x%.8X", + TARGETING::get_huid(l_itr->first)); + } + + // Call on the MEMBUF + FAPI_INVOKE_HWP(l_errl, dmi_io_dccal, l_fapi_membuf_target); + if (l_errl) + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR 0x%.8X : dmi_io_dccal HWP Target Membuf 0x%.8X", + l_errl->reasonCode(), TARGETING::get_huid(l_itr->second)); + /*@ + * @errortype + * @reasoncode ISTEP_DMI_IO_DCCAL_MEMBUF_FAILED + * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE + * @moduleid ISTEP_DMI_IO_DCCAL + * @userdata1 bytes 0-1: plid identifying first error + * bytes 2-3: reason code of first error + * @userdata2 bytes 0-1: total number of elogs included + * bytes 2-3: N/A + * @devdesc call to dmi_io_dccal on MEMBUF has failed + */ + l_StepError.addErrorDetails(ISTEP_DMI_IO_DCCAL_MEMBUF_FAILED, + ISTEP_DMI_IO_DCCAL, + l_errl); + + errlCommit( l_errl, HWPF_COMP_ID ); + // We want to continue the training despite the error, so + // no break + } + else + { + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "SUCCESS : call_dmi_io_dccal HWP - Target 0x%.8X", + TARGETING::get_huid(l_itr->second)); + } + + } + + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "call_dmi_io_dccal exit" ); + + // end task, returning any errorlogs to IStepDisp + return l_StepError.getErrorHandle(); } @@ -620,132 +744,69 @@ void* call_dmi_io_run_training( void *io_pArgs ) TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_dmi_io_run_training entry" ); + TargetPairs_t l_dmi_io_dccal_targets; + get_dmi_io_targets(l_dmi_io_dccal_targets); + TARGETING::TargetHandleList l_cpuTargetList; getAllChips(l_cpuTargetList, TYPE_PROC); - for (TargetHandleList::iterator l_cpu_iter = l_cpuTargetList.begin(); - l_cpu_iter != l_cpuTargetList.end(); - ++l_cpu_iter) + TargetPairs_t::iterator l_itr; + for (l_itr = l_dmi_io_dccal_targets.begin(); + (!l_err) && (l_itr != l_dmi_io_dccal_targets.end()); ++l_itr) { - // make a local copy of the CPU target - const TARGETING::Target* l_cpu_target = *l_cpu_iter; - - uint8_t l_cpuNum = l_cpu_target->getAttr<ATTR_POSITION>(); - - // find all MCS chiplets of the proc - TARGETING::TargetHandleList l_mcsTargetList; - getChildChiplets( l_mcsTargetList, l_cpu_target, TYPE_MCS ); - - for (TargetHandleList::iterator l_mcs_iter = l_mcsTargetList.begin(); - l_mcs_iter != l_mcsTargetList.end(); - ++l_mcs_iter) - { - // make a local copy of the MCS target - const TARGETING::Target* l_mcs_target = *l_mcs_iter; - - uint8_t l_mcsNum = l_mcs_target->getAttr<ATTR_CHIP_UNIT>(); - - // find all the Centaurs that are associated with this MCS - TARGETING::TargetHandleList l_memTargetList; - getAffinityChips(l_memTargetList, l_mcs_target, TYPE_MEMBUF); - - for (TargetHandleList::iterator l_mem_iter = l_memTargetList.begin(); - l_mem_iter != l_memTargetList.end(); - ++l_mem_iter) - { - // make a local copy of the MEMBUF target - const TARGETING::Target* l_mem_target = *l_mem_iter; - - uint8_t l_memNum = l_mem_target->getAttr<ATTR_POSITION>(); - - // struct containing custom parameters that is fed to HWP - // call the HWP with each target ( if parallel, spin off a task ) - const fapi::Target l_fapi_master_target( - TARGET_TYPE_MCS_CHIPLET, - reinterpret_cast<void *> - ( const_cast<TARGETING::Target*>(l_mcs_target) ) - ); - const fapi::Target l_fapi_slave_target( - TARGET_TYPE_MEMBUF_CHIP, - reinterpret_cast<void *> - (const_cast<TARGETING::Target*>(l_mem_target)) - ); - - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "===== Call dmi_io_run_training HWP( cpu 0x%x, mcs 0x%x, mem 0x%x ) : ", - l_cpuNum, - l_mcsNum, - l_memNum ); + const fapi::Target l_fapi_master_target( + TARGET_TYPE_MCS_CHIPLET, + reinterpret_cast<void *> + (const_cast<TARGETING::Target*>(l_itr->first))); - EntityPath l_path; - l_path = l_cpu_target->getAttr<ATTR_PHYS_PATH>(); - l_path.dump(); - l_path = l_mcs_target->getAttr<ATTR_PHYS_PATH>(); - l_path.dump(); - l_path = l_mem_target->getAttr<ATTR_PHYS_PATH>(); - l_path.dump(); - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "===== " ); - FAPI_INVOKE_HWP(l_err, dmi_io_run_training, - l_fapi_master_target, l_fapi_slave_target); - - if (l_err) - { - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "ERROR 0x%.8X : dmi_io_run_training HWP" - "( cpu 0x%x, mcs 0x%x, mem 0x%x ) ", - l_err->reasonCode(), - l_cpuNum, - l_mcsNum, - l_memNum ); - - // capture the target data in the elog - ErrlUserDetailsTarget(l_mem_target).addToLog( l_err ); - - /*@ - * @errortype - * @reasoncode ISTEP_DMI_TRAINING_FAILED - * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE - * @moduleid ISTEP_DMI_IO_RUN_TRAINING - * @userdata1 bytes 0-1: plid identifying first error - * bytes 2-3: reason code of first error - * @userdata2 bytes 0-1: total number of elogs included - * bytes 2-3: N/A - * @devdesc call to dmi_io_run_training has failed - */ - l_StepError.addErrorDetails(ISTEP_DMI_TRAINING_FAILED, - ISTEP_DMI_IO_RUN_TRAINING, - l_err); - - errlCommit( l_err, HWPF_COMP_ID ); - - break; // Break out mem target loop - } - else - { - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "SUCCESS : dmi_io_run_training HWP" - "( cpu 0x%x, mcs 0x%x, mem 0x%x ) ", - l_cpuNum, - l_mcsNum, - l_memNum ); - } + const fapi::Target l_fapi_slave_target( + TARGET_TYPE_MEMBUF_CHIP, + reinterpret_cast<void *> + (const_cast<TARGETING::Target*>(l_itr->second))); - } //end for l_mem_target + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "===== Call dmi_io_run_training HWP(mcs 0x%x, mem 0x%x ) : ", + TARGETING::get_huid(l_itr->first), + TARGETING::get_huid(l_itr->second)); - // if there is an error bail out - if ( !l_StepError.isNull() ) - { - break; // Break out l_mcs_target - } + EntityPath l_path; + l_path = l_itr->first->getAttr<ATTR_PHYS_PATH>(); + l_path.dump(); + l_path = l_itr->second->getAttr<ATTR_PHYS_PATH>(); + l_path.dump(); - } // end for l_mcs_target + FAPI_INVOKE_HWP(l_err, dmi_io_run_training, + l_fapi_master_target, l_fapi_slave_target); - if ( !l_StepError.isNull() ) + if (l_err) + { + TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, + "ERROR 0x%.8X : dmi_io_run_training HWP", + l_err->reasonCode()); + /*@ + * @errortype + * @reasoncode ISTEP_DMI_TRAINING_FAILED + * @severity ERRORLOG::ERRL_SEV_UNRECOVERABLE + * @moduleid ISTEP_DMI_IO_RUN_TRAINING + * @userdata1 bytes 0-1: plid identifying first error + * bytes 2-3: reason code of first error + * @userdata2 bytes 0-1: total number of elogs included + * bytes 2-3: N/A + * @devdesc call to dmi_io_run_training has failed + */ + l_StepError.addErrorDetails(ISTEP_DMI_TRAINING_FAILED, + ISTEP_DMI_IO_RUN_TRAINING, + l_err); + errlCommit( l_err, HWPF_COMP_ID ); + break; // Break out target list loop + } + else { - break; // Break out l_cpu_target + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "SUCCESS : dmi_io_run_training HWP"); } - } // end for l_cpu_target + } // end target pair list TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_dmi_io_run_training exit" ); @@ -983,6 +1044,56 @@ void* call_cen_set_inband_addr( void *io_pArgs ) return l_StepError.getErrorHandle(); } +// +// Utility function to get DMI IO target list +// First is MCS target, Second is MEMBUF target +// +void get_dmi_io_targets(TargetPairs_t& o_dmi_io_targets) +{ + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "get_dmi_io_targets" ); + + o_dmi_io_targets.clear(); + TARGETING::TargetHandleList l_cpuTargetList; + getAllChips(l_cpuTargetList, TYPE_PROC); + + for ( TargetHandleList::iterator l_iter = l_cpuTargetList.begin(); + l_iter != l_cpuTargetList.end(); ++l_iter ) + { + // make a local copy of the CPU target + const TARGETING::Target* l_cpu_target = *l_iter; + + // find all MCS chiplets of the proc + TARGETING::TargetHandleList l_mcsTargetList; + getChildChiplets( l_mcsTargetList, l_cpu_target, TYPE_MCS ); + + for ( TargetHandleList::iterator l_iterMCS = l_mcsTargetList.begin(); + l_iterMCS != l_mcsTargetList.end(); ++l_iterMCS ) + { + // make a local copy of the MCS target + const TARGETING::Target* l_mcs_target = *l_iterMCS; + + // find all the Centaurs that are associated with this MCS + TARGETING::TargetHandleList l_memTargetList; + getAffinityChips(l_memTargetList, l_mcs_target, TYPE_MEMBUF); + + for ( TargetHandleList::iterator l_iterMemBuf = l_memTargetList.begin(); + l_iterMemBuf != l_memTargetList.end(); ++l_iterMemBuf ) + { + // make a local copy of the MEMBUF target + const TARGETING::Target* l_mem_target = *l_iterMemBuf; + o_dmi_io_targets.insert(std::pair<const TARGETING::Target*, + const TARGETING::Target*>(l_mcs_target, l_mem_target)); + + } //end for l_mem_target + + } // end for l_mcs_target + + } // end for l_cpu_target + + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "get_dmi_io_targets exit" ); + + return; +} }; // end namespace diff --git a/src/usr/hwpf/hwp/dmi_training/makefile b/src/usr/hwpf/hwp/dmi_training/makefile index a97273d7f..8ad952631 100644 --- a/src/usr/hwpf/hwp/dmi_training/makefile +++ b/src/usr/hwpf/hwp/dmi_training/makefile @@ -43,13 +43,15 @@ EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/dmi_training/dmi_scominit EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/dmi_training/proc_cen_set_inband_addr EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/dmi_training/mss_getecid EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/io_restore_erepair +EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/dmi_training/dmi_io_dccal OBJS = dmi_training.o \ proc_cen_framelock.o \ dmi_io_run_training.o \ dmi_scominit.o \ proc_cen_set_inband_addr.o \ - mss_get_cen_ecid.o + mss_get_cen_ecid.o \ + dmi_io_dccal.o ## NOTE: add a new directory onto the vpaths when you add a new HWP VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/dmi_training/proc_cen_framelock @@ -57,5 +59,6 @@ VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/dmi_training/dmi_io_run_training VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/dmi_training/dmi_scominit VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/dmi_training/proc_cen_set_inband_addr VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/dmi_training/mss_getecid +VPATH += ${ROOTPATH}/src/usr/hwpf/hwp/dmi_training/dmi_io_dccal include ${ROOTPATH}/config.mk |