Repository navigation
Conversation
ImagePush pushes 1 image through the FIFO and reads DEVICE_STATUS after each write. The device clears the protocol error on each DEVICE_STATUS read, so after a failed read the Recovery Agent cannot tell whether the device refused the write, and ImagePush ends the push. ImagePush::step returns PushError, which wraps AgentError, so a caller of read_prot_cap does not handle error variants that only a push returns. Signed-off-by: Christina Quast <christina.quast@9elements.com> Assisted-by: Claude Opus 5.5
RecoverySequence runs the Recovery Agent steps around the push of 1 image through ImagePush. Both RECOVERY_CTRL writes carry the CMS of the push in byte 0 and image selection 0x1 in byte 1, because the OCP Recovery code on the caliptra-mcu-sw main-2.1 branch refuses an activation with image selection 0x0. A failed RECOVERY_CTRL write with the activation ends the sequence, because the device may have taken the activation before the transport failed. Signed-off-by: Christina Quast <christina.quast@9elements.com> Assisted-by: Claude Fable 5.2
chrysh
force-pushed
the
ocp-agent-sequence
branch
from
December 4, 2026 11:18
b413b32 to
3255cd2
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #961
The Recovery Agent crate pushes 1 image through
ImagePush, and no code runs the steps around the push: the capability check, the waits on the device, theRECOVERY_CTRLwrites and the activation.RecoverySequenceruns these steps for 1 image, with 1 register access per step, asImagePushdoes.This PR stacks on the
ImagePushPR, so the commit list shows theImagePushcommit below until that PR merges. Only the top commit is new.Open questions:
RECOVERY_CTRLwrite to select the CMS, so both writes carry the CMS in byte 0. Byte 1 holds 0x1 (the image in that CMS) in both writes. The BMC emulator in caliptra-mcu-sw writes[0, 0, 0], then[0, 0, 0xf], and Caliptra core reads only byte 2 and accepts that activation, while the OCP Recovery code on caliptra-mcu-swmain-2.1refuses an activation with image selection 0x0 (OCP Recovery 1.2: questions for the OCP workgroup chipsalliance/Caliptra#787 row 5). Keep the fixed 0x1, write 0x0 in byte 1 as the emulator does, or take the image selection as a parameter ofRecoverySequence::new?DEVICE_STATUSreadingRecoveryModeReadyreturns the sequence toWaitForRecoveryStatus, and anAwaitingImagethere ends the sequence withSequenceError::ImageNotHeld. In the Device design of docs: Add the OCP Recovery design proposal #680, the eRoT that refuses a streamed image writesRecoveryModeReadytoDEVICE_STATUSandAwaitingImagetoRECOVERY_STATUSwithout a reset, so the Recovery Agent reads the same states after a refused image and before the next image. How should the sequence tell a refusal from a request for the next image?DEVICE_STATUSreturns the sequence toWaitForRecoveryStatus, the sequence reads onlyRECOVERY_STATUS, andSuccessfulkeeps the sequence waiting until the caller stops callingstep, as in the agent state diagram in docs: Add the OCP Recovery design proposal #680. End the sequence withRecoveredinstead?