|
|
|
@@ -152,32 +152,45 @@ ReturnValue_t PlocMPSoCHandler::executeAction(ActionId_t actionId, MessageQueueI
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlocMPSoCHandler::doStartUp() {
|
|
|
|
|
if (startupState == StartupState::IDLE) {
|
|
|
|
|
startupState = StartupState::HW_INIT;
|
|
|
|
|
}
|
|
|
|
|
if (startupState == StartupState::HW_INIT) {
|
|
|
|
|
#ifdef XIPHOS_Q7S
|
|
|
|
|
#if not OBSW_MPSOC_JTAG_BOOT == 1
|
|
|
|
|
switch (powerState) {
|
|
|
|
|
case PowerState::OFF:
|
|
|
|
|
commandActionHelper.commandAction(supervisorHandler, supv::START_MPSOC);
|
|
|
|
|
powerState = PowerState::BOOTING;
|
|
|
|
|
break;
|
|
|
|
|
return;
|
|
|
|
|
case PowerState::ON:
|
|
|
|
|
hkReport.setReportingEnabled(true);
|
|
|
|
|
setMode(_MODE_TO_ON);
|
|
|
|
|
uartIsolatorSwitch.pullHigh();
|
|
|
|
|
startupState = StartupState::WAIT_CYCLES;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
powerState = PowerState::ON;
|
|
|
|
|
hkReport.setReportingEnabled(true);
|
|
|
|
|
setMode(_MODE_TO_ON);
|
|
|
|
|
uartIsolatorSwitch.pullHigh();
|
|
|
|
|
startupState = StartupState::WAIT_CYCLE;
|
|
|
|
|
#endif /* not MSPOC_JTAG_BOOT == 1 */
|
|
|
|
|
#else
|
|
|
|
|
startupState = StartupState::WAIT_CYCLES;
|
|
|
|
|
powerState = PowerState::ON;
|
|
|
|
|
hkReport.setReportingEnabled(true);
|
|
|
|
|
setMode(_MODE_TO_ON);
|
|
|
|
|
#endif /* XIPHOS_Q7S */
|
|
|
|
|
}
|
|
|
|
|
if (startupState == StartupState::WAIT_CYCLES) {
|
|
|
|
|
waitCycles++;
|
|
|
|
|
if (waitCycles == 2) {
|
|
|
|
|
startupState = StartupState::DONE;
|
|
|
|
|
waitCycles = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (startupState == StartupState::DONE) {
|
|
|
|
|
setMode(_MODE_TO_ON);
|
|
|
|
|
hkReport.setReportingEnabled(true);
|
|
|
|
|
startupState = StartupState::IDLE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlocMPSoCHandler::doShutDown() {
|
|
|
|
@@ -205,11 +218,12 @@ void PlocMPSoCHandler::doShutDown() {
|
|
|
|
|
powerState = PowerState::OFF;
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
startupState = StartupState::IDLE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ReturnValue_t PlocMPSoCHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
|
|
|
|
if(getPendingCommand() == DeviceHandlerIF::NO_COMMAND_ID) {
|
|
|
|
|
// testCycles ++;
|
|
|
|
|
if (getPendingCommand() == DeviceHandlerIF::NO_COMMAND_ID) {
|
|
|
|
|
*id = mpsoc::TC_GET_HK_REPORT;
|
|
|
|
|
return buildCommandFromCommand(*id, nullptr, 0);
|
|
|
|
|
}
|
|
|
|
@@ -336,7 +350,6 @@ void PlocMPSoCHandler::fillCommandAndReplyMap() {
|
|
|
|
|
ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remainingSize,
|
|
|
|
|
DeviceCommandId_t* foundId, size_t* foundLen) {
|
|
|
|
|
ReturnValue_t result = returnvalue::OK;
|
|
|
|
|
sif::debug << "remaining size: " << remainingSize << std::endl;
|
|
|
|
|
|
|
|
|
|
SpacePacketReader spacePacket;
|
|
|
|
|
spacePacket.setReadOnlyData(start, remainingSize);
|
|
|
|
@@ -369,14 +382,12 @@ ReturnValue_t PlocMPSoCHandler::scanForReply(const uint8_t* start, size_t remain
|
|
|
|
|
*foundId = mpsoc::TM_CAM_CMD_RPT;
|
|
|
|
|
break;
|
|
|
|
|
case (mpsoc::apid::TM_HK_GET_REPORT): {
|
|
|
|
|
sif::debug << "recv hk report" << std::endl;
|
|
|
|
|
*foundLen = spacePacket.getFullPacketLen();
|
|
|
|
|
foundPacketLen = *foundLen;
|
|
|
|
|
*foundId = mpsoc::TM_GET_HK_REPORT;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case (mpsoc::apid::EXE_SUCCESS):
|
|
|
|
|
sif::debug << "recv exe success" << std::endl;
|
|
|
|
|
*foundLen = mpsoc::SIZE_EXE_REPORT;
|
|
|
|
|
*foundId = mpsoc::EXE_REPORT;
|
|
|
|
|
break;
|
|
|
|
@@ -434,9 +445,7 @@ ReturnValue_t PlocMPSoCHandler::interpretDeviceReply(DeviceCommandId_t id, const
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PlocMPSoCHandler::setNormalDatapoolEntriesInvalid() {
|
|
|
|
|
hkReport.setValidity(false, true);
|
|
|
|
|
}
|
|
|
|
|
void PlocMPSoCHandler::setNormalDatapoolEntriesInvalid() { hkReport.setValidity(false, true); }
|
|
|
|
|
|
|
|
|
|
uint32_t PlocMPSoCHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 5000; }
|
|
|
|
|
|
|
|
|
@@ -1151,7 +1160,6 @@ size_t PlocMPSoCHandler::getNextReplyLength(DeviceCommandId_t commandId) {
|
|
|
|
|
replyLen = mpsoc::SP_MAX_SIZE;
|
|
|
|
|
break;
|
|
|
|
|
default: {
|
|
|
|
|
sif::debug << "reply length " << iter->second.replyLen << std::endl;
|
|
|
|
|
replyLen = iter->second.replyLen;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|