//****************************************************************************** // fapiGetOtherSideOfMemChannel function //****************************************************************************** fapi::ReturnCode fapiGetOtherSideOfMemChannel( const fapi::Target& i_target, fapi::Target & o_target, const fapi::TargetState i_state) { fapi::ReturnCode l_rc; TargetHandleList l_targetList; FAPI_DBG(ENTER_MRK "fapiGetOtherSideOfMemChannel. State: 0x%08x", i_state); TargetHandle_t l_target = reinterpret_cast<TargetHandle_t>(i_target.get()); if (l_target == NULL) { FAPI_ERR("fapiGetOtherSideOfMemChannel. Embedded NULL target pointer"); /*@ * @errortype * @moduleid fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL * @reasoncode fapi::RC_EMBEDDED_NULL_TARGET_PTR * @devdesc Target has embedded null target pointer */ const bool hbSwError = true; errlHndl_t l_pError = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE, fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL, fapi::RC_EMBEDDED_NULL_TARGET_PTR, 0, 0, hbSwError); // Attach the error log to the fapi::ReturnCode l_rc.setPlatError(reinterpret_cast<void *> (l_pError)); } else if (i_target.getType() == fapi::TARGET_TYPE_MCS_CHIPLET) { // find the Centaur that is associated with this MCS getChildAffinityTargets(l_targetList, l_target, CLASS_CHIP, TYPE_MEMBUF, false); if(l_targetList.size() != 1) // one and only one expected { FAPI_ERR("fapiGetOtherSideOfMemChannel. expect 1 Centaur %d", l_targetList.size()); /*@ * @errortype * @moduleid fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL * @reasoncode fapi::RC_NO_SINGLE_MEMBUFF * @userdata1 Number of Memory Buffers * @userdata2 MCS HUID * @devdesc fapiGetOtherSideOfMemChannel could not find exactly * one target on the other side of the correct state */ const bool hbSwError = true; errlHndl_t l_pError = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE, fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL, fapi::RC_NO_SINGLE_MEMBUFF, l_targetList.size(), TARGETING::get_huid(l_target), hbSwError); // Attach the error log to the fapi::ReturnCode l_rc.setPlatError(reinterpret_cast<void *> (l_pError)); } else { o_target.setType(fapi::TARGET_TYPE_MEMBUF_CHIP); o_target.set(reinterpret_cast<void *>(l_targetList[0])); } } else if (i_target.getType() == fapi::TARGET_TYPE_MEMBUF_CHIP) { // find the MCS that is associated with this Centaur getParentAffinityTargets (l_targetList, l_target, CLASS_UNIT, TYPE_MCS, false); if(l_targetList.size() != 1) // one and only one expected { FAPI_ERR("fapiGetOtherSideOfMemChannel. expect 1 MCS %d", l_targetList.size()); /*@ * @errortype * @moduleid fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL * @reasoncode fapi::RC_NO_SINGLE_MCS * @userdata1 Number of MCSs * @userdata2 Membuf HUID * @devdesc fapiGetOtherSideOfMemChannel could not find exactly * one target on the other side of the correct state */ const bool hbSwError = true; errlHndl_t l_pError = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE, fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL, fapi::RC_NO_SINGLE_MCS, l_targetList.size(), TARGETING::get_huid(l_target), hbSwError); // Attach the error log to the fapi::ReturnCode l_rc.setPlatError(reinterpret_cast<void *> (l_pError)); } else { o_target.setType(fapi::TARGET_TYPE_MCS_CHIPLET); o_target.set(reinterpret_cast<void *>(l_targetList[0])); } } else { FAPI_ERR("fapiGetOtherSideOfMemChannel. target 0x%08x not supported", i_target.getType()); /*@ * @errortype * @moduleid fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL * @reasoncode fapi::RC_UNSUPPORTED_REQUEST * @userdata1 Requested type * @userdata2 Unsupported Target HUID * @devdesc fapiGetOtherSideOfMemChannel request for unsupported * or invalid target type */ const bool hbSwError = true; errlHndl_t l_pError = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE, fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL, fapi::RC_UNSUPPORTED_REQUEST, i_target.getType(), TARGETING::get_huid(l_target), hbSwError); // Attach the error log to the fapi::ReturnCode l_rc.setPlatError(reinterpret_cast<void *> (l_pError)); } if (!l_rc) // OK so far, check that state is as requested { HwasState l_state = l_targetList[0]->getAttr<ATTR_HWAS_STATE>(); if (((i_state == fapi::TARGET_STATE_PRESENT) && !l_state.present) || ((i_state == fapi::TARGET_STATE_FUNCTIONAL) && !l_state.functional)) { FAPI_ERR("fapiGetOtherSideOfMemChannel. state mismatch"); /*@ * @errortype * @moduleid fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL * @reasoncode fapi::RC_STATE_MISMATCH * @userdata1 Requested state * @userdata2 Other Target HUID * @devdesc fapiGetOtherSideOfMemChannel target not present or * functional as requested */ const bool hbSwError = true; errlHndl_t l_pError = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE, fapi::MOD_FAPI_GET_OTHER_SIDE_OF_MEM_CHANNEL, fapi::RC_STATE_MISMATCH, i_state, TARGETING::get_huid(l_targetList[0]), hbSwError); // Attach the error log to the fapi::ReturnCode l_rc.setPlatError(reinterpret_cast<void *> (l_pError)); } } FAPI_DBG(EXIT_MRK "fapiGetOtherSideOfMemChannel. rc = 0x%x", static_cast<uint32_t>(l_rc)); return l_rc; }
//****************************************************************************** // fapiGetParentChip function //****************************************************************************** fapi::ReturnCode fapiGetParentChip( const fapi::Target& i_chiplet, fapi::Target & o_chip) { FAPI_DBG(ENTER_MRK "fapiGetParentChip"); fapi::ReturnCode l_rc; // Extract the HostBoot Target pointer for the input chiplet TARGETING::Target * l_pChiplet = reinterpret_cast<TARGETING::Target*>(i_chiplet.get()); // Check that the input target is a chiplet if (!i_chiplet.isChiplet()) { FAPI_ERR("fapiGetParentChip. Input target type 0x%08x is not a chiplet", i_chiplet.getType()); /*@ * @errortype * @moduleid fapi::MOD_FAPI_GET_PARENT_CHIP * @reasoncode fapi::RC_INVALID_REQUEST * @userdata1 Type of input target * @userdata2 Input Target HUID * @devdesc fapiGetParentChip request for non-chiplet */ const bool hbSwError = true; errlHndl_t l_pError = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE, fapi::MOD_FAPI_GET_PARENT_CHIP, fapi::RC_INVALID_REQUEST, i_chiplet.getType(), TARGETING::get_huid(l_pChiplet), hbSwError); // Attach the error log to the fapi::ReturnCode l_rc.setPlatError(reinterpret_cast<void *> (l_pError)); } else { if (l_pChiplet == NULL) { /*@ * @errortype * @moduleid fapi::MOD_FAPI_GET_PARENT_CHIP * @reasoncode fapi::RC_EMBEDDED_NULL_TARGET_PTR * @devdesc Target has embedded null target pointer */ const bool hbSwError = true; errlHndl_t l_pError = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE, fapi::MOD_FAPI_GET_PARENT_CHIP, fapi::RC_EMBEDDED_NULL_TARGET_PTR, 0, 0, hbSwError); // Attach the error log to the fapi::ReturnCode l_rc.setPlatError(reinterpret_cast<void *> (l_pError)); } else { const TARGETING::Target * l_pChip = TARGETING::getParentChip(l_pChiplet); if (l_pChip == NULL) { FAPI_ERR("fapiGetParentChip. Parent not found"); /*@ * @errortype * @moduleid fapi::MOD_FAPI_GET_PARENT_CHIP * @reasoncode fapi::RC_NO_SINGLE_PARENT * @userdata1 Input Chiplet Target HUID * @devdesc fapiGetParentChip did not find one parent */ const bool hbSwError = true; errlHndl_t l_pError = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_UNRECOVERABLE, fapi::MOD_FAPI_GET_PARENT_CHIP, fapi::RC_NO_SINGLE_PARENT, TARGETING::get_huid(l_pChiplet), 0, hbSwError); // Attach the error log to the fapi::ReturnCode l_rc.setPlatError(reinterpret_cast<void *> (l_pError)); } else { // Set the output chip type if (l_pChip->getAttr<TARGETING::ATTR_TYPE>() == TARGETING::TYPE_PROC) { o_chip.setType(fapi::TARGET_TYPE_PROC_CHIP); } else { o_chip.setType(fapi::TARGET_TYPE_MEMBUF_CHIP); } // Set the output chip (platform specific) handle o_chip.set(reinterpret_cast<void *> (const_cast<TARGETING::Target*>(l_pChip))); } } } FAPI_DBG(EXIT_MRK "fapiGetParentChip"); return l_rc; }