From 75f08175f65c93b5f1e4b0c00ddd200bce5e62e1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 25 Sep 2023 17:10:13 +0200 Subject: [PATCH] more debugging necessary here --- linux/payload/PlocMpsocHandler.cpp | 20 ++++++++++++-------- linux/payload/PlocMpsocHandler.h | 1 + 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/linux/payload/PlocMpsocHandler.cpp b/linux/payload/PlocMpsocHandler.cpp index 5c4d7f07..b8e8afe9 100644 --- a/linux/payload/PlocMpsocHandler.cpp +++ b/linux/payload/PlocMpsocHandler.cpp @@ -1222,15 +1222,19 @@ void PlocMpsocHandler::dataReceived(ActionId_t actionId, const uint8_t* data, ui } void PlocMpsocHandler::completionSuccessfulReceived(ActionId_t actionId) { + sif::debug << "recv completion of action " << actionId << std::endl; if (actionId != supv::EXE_REPORT) { sif::warning << "PlocMPSoCHandler::completionSuccessfulReceived: Did not expect the action " << "ID " << actionId << std::endl; return; } switch (powerState) { - case PowerState::PENDING_STARTUP: + case PowerState::PENDING_STARTUP: { + mpsocBootTransitionCd.resetTimer(); + powerState = PowerState::DONE; + break; + } case PowerState::PENDING_SHUTDOWN: { - sif::debug << "power switching done" << std::endl; powerState = PowerState::DONE; break; } @@ -1398,13 +1402,13 @@ bool PlocMpsocHandler::handleHwStartup() { } } if (powerState == PowerState::DONE) { - if (not !supvTransitionCd.hasTimedOut()) { - // Wait a bit for the MPSoC to fully boot. We re-use the SUPV transition countdown - // for this. + if (mpsocBootTransitionCd.hasTimedOut()) { + // Wait a bit for the MPSoC to fully boot. + uartIsolatorSwitch.pullHigh(); + powerState = PowerState::IDLE; + } else { return false; } - uartIsolatorSwitch.pullHigh(); - powerState = PowerState::IDLE; } return true; } @@ -1447,7 +1451,7 @@ void PlocMpsocHandler::handleActionCommandFailure(ActionId_t actionId) { case supv::EXE_REPORT: break; default: - sif::debug << "PlocMPSoCHandler::handleActionCommandFailure: Did not expect this action ID " + sif::debug << "PlocMPSoCHandler::handleActionCommandFailure: Did not expect the action ID " << std::endl; return; } diff --git a/linux/payload/PlocMpsocHandler.h b/linux/payload/PlocMpsocHandler.h index 2e84fc7c..8e654bab 100644 --- a/linux/payload/PlocMpsocHandler.h +++ b/linux/payload/PlocMpsocHandler.h @@ -112,6 +112,7 @@ class PlocMpsocHandler : public DeviceHandlerBase, public CommandsActionsIF { static const uint16_t PACKET_SEQUENCE_COUNT_MASK = 0x3FFF; mpsoc::HkReport hkReport; + Countdown mpsocBootTransitionCd = Countdown(5000); Countdown supvTransitionCd = Countdown(3000); MessageQueueIF* eventQueue = nullptr;