uint8_t getOCCDIMMPos(const TargetHandle_t i_mba, const TargetHandle_t i_dimm) { //To make the OCC DIMM # 0 - 7: 0bABC // A: MBA ATTR_CHIP_UNIT: 0 or 1 // B: DIMM ATTR_MBA_PORT: 0 or 1 // C: DIMM ATTR_MBA_DIMM: 0 or 1 //Note: No CDIMM systems in plan. May need to revisit //this if there are any as OCC may not care about logical DIMMs. const uint8_t mbaUnit = i_mba->getAttr<ATTR_CHIP_UNIT>(); const uint8_t mbaPort = i_dimm->getAttr<ATTR_MBA_PORT>(); const uint8_t mbaDIMM = i_dimm->getAttr<ATTR_MBA_DIMM>(); TMGT_DBG("DIMM 0x%X unit %d port %d pos %d = %d", i_dimm->getAttr<ATTR_HUID>(), mbaUnit, mbaPort, mbaDIMM, ((mbaUnit << 2) | (mbaPort << 1) | mbaDIMM)); return ((mbaUnit << 2) | (mbaPort << 1) | mbaDIMM); }
// Handle OCC poll response void Occ::pollRspHandler(const uint8_t * i_pollResponse, const uint16_t i_pollResponseSize) { static uint32_t L_elog_retry_count = 0; TMGT_DBG("OCC Poll Response", i_pollResponse, i_pollResponseSize); const occPollRspStruct_t *pollRsp = (occPollRspStruct_t *) i_pollResponse; const occPollRspStruct_t *lastPollRsp = (occPollRspStruct_t *) iv_lastPollResponse; // Trace if any data changed if ((false == iv_lastPollValid) || (memcmp(pollRsp, lastPollRsp, OCC_POLL_DATA_MIN_SIZE) != 0)) { TMGT_INF("OCC%d Poll change: Status:%04X Occs:%02X Cfg:%02X " "State:%02X Error:%06X/%08X", iv_instance, (pollRsp->status << 8) | pollRsp->extStatus, pollRsp->occsPresent, pollRsp->requestedCfg, pollRsp->state, (pollRsp->errorId<<16) | pollRsp->errorLength, pollRsp->errorAddress); } do { if (false == iv_commEstablished) { // 1st poll response, so comm has been established for this OCC iv_commEstablished = true; TMGT_INF("pollRspHandler: FW Level for OCC%d: %.16s", iv_instance, pollRsp->codeLevel); } // Check for Error Logs if (pollRsp->errorId != 0) { if ((pollRsp->errorId != lastPollRsp->errorId) || (L_elog_retry_count < 3)) { if (pollRsp->errorId == lastPollRsp->errorId) { // Only retry same errorId a few times... L_elog_retry_count++; TMGT_ERR("pollRspHandler: Requesting elog 0x%02X" " (retry %d)", pollRsp->errorId, L_elog_retry_count); } else { L_elog_retry_count = 0; } // Handle a new error log from the OCC occProcessElog(this, pollRsp->errorId, pollRsp->errorAddress, pollRsp->errorLength); if (iv_needsReset) { // Update state if changed... // (since dropping out of poll rsp handler) if (iv_state != pollRsp->state) { iv_state = (occStateId)pollRsp->state; TMGT_INF("pollRspHandler: updating OCC%d state" " to %s", iv_instance, state_string(iv_state)); } break; } } } if ((OCC_STATE_ACTIVE == pollRsp->state) || (OCC_STATE_OBSERVATION == pollRsp->state)) { // Check role status if (((OCC_ROLE_SLAVE == iv_role) && ((pollRsp->status & OCC_STATUS_MASTER) != 0)) || ((OCC_ROLE_MASTER == iv_role) && ((pollRsp->status & OCC_STATUS_MASTER) == 0))) { TMGT_ERR("pollRspHandler: OCC%d Status role mismatch" " (role:0x%02X, status:0x%02X 0x%02X)", iv_instance, iv_role, pollRsp->status, pollRsp->extStatus); iv_needsReset = true; // TODO RTC 109224 //iv_resetReason = OCC_RESET_REASON_ERROR; break; } } //iv_requestedFormat = (occCfgDataFormat)pollRsp->requestedCfg; if (pollRsp->requestedCfg != 0x00) { TMGT_INF("pollRspHandler: OCC%d is requesting cfg format" " 0x%02X", iv_instance, pollRsp->requestedCfg); } // Check for state change if (iv_state != pollRsp->state) { iv_state = (occStateId)pollRsp->state; TMGT_INF("pollRspHandler: updating OCC%d state to %s", iv_instance, state_string(iv_state)); } // Copy rspData to lastPollResponse memcpy(iv_lastPollResponse, pollRsp, OCC_POLL_DATA_MIN_SIZE); iv_lastPollValid = true; } while(0); // NOTE: When breaking out of the above while loop, the new poll // response is NOT copied to lastPollResponse (should only // break when reset required) if (true == iv_needsReset) { // Save full poll response memcpy(iv_lastPollResponse, pollRsp, OCC_POLL_DATA_MIN_SIZE); iv_lastPollValid = true; iv_state = (occStateId)pollRsp->state; } } // end Occ::pollRspHandler()