Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[runtime] Start recovery flow in the runtime #1904

Merged
merged 10 commits into from
Feb 5, 2025

Conversation

swenson
Copy link
Contributor

@swenson swenson commented Jan 23, 2025

This stubs out the recovery flow in the runtime.

We also update the DMA peripheral so that it can be used as a
ureg::Mmio, which will allow us to use the autogenerated I3C recovery
register interface instead of hardcoding offsets.

We also had to modify ureg slightly to add Default, TryFrom<u32>,
and TryInto<u32> constraints to Uint to make it simpler to use with the
DMA interface.

This builds on #1867 and rewrites it to use the updated DMA interface.

@swenson swenson added the Caliptra v2.0 Items to be considered for v2.0 Release label Jan 23, 2025
@swenson swenson force-pushed the download-manifest-mcu-fw branch 2 times, most recently from 9152e52 to c9b226d Compare January 23, 2025 22:00
drivers/src/dma.rs Outdated Show resolved Hide resolved
mhatrevi
mhatrevi previously approved these changes Jan 28, 2025
Copy link
Collaborator

@mhatrevi mhatrevi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see the feedback.

runtime/src/drivers.rs Show resolved Hide resolved
runtime/src/recovery_flow.rs Outdated Show resolved Hide resolved
ureg/src/lib.rs Outdated Show resolved Hide resolved
ureg/src/lib.rs Outdated Show resolved Hide resolved
@swenson swenson force-pushed the download-manifest-mcu-fw branch from 0eade71 to c56a00d Compare January 30, 2025 18:51
@swenson
Copy link
Contributor Author

swenson commented Jan 30, 2025

PR updated and rebased. PTAL

@swenson swenson force-pushed the download-manifest-mcu-fw branch from c56a00d to 029bf2a Compare January 31, 2025 17:24
This stubs out the recovery flow in the runtime.

We also update the DMA peripheral so that it can be used as a
`ureg::Mmio`, which will allow us to use the autogenerated I3C recovery
register interface instead of hardcoding offsets.

We also had to modify `ureg` slightly to remove the unused `impl Uint`
for `u64` (because we don't don't support 64-bit AXI transfers) and add
a `from_u32()` method for the (unused) `u8` and `u16` implementations.

This builds on #1867 and rewrites it to use the updated DMA interface.
@swenson swenson force-pushed the download-manifest-mcu-fw branch from 029bf2a to 020f2a3 Compare January 31, 2025 17:29
To account for the offset inside the I3C registers.

Otherwise the AXI address is off by 0x100.

Also sets the PROT_CAP registers to their required values in the
emulator.
drivers/src/dma.rs Outdated Show resolved Hide resolved
mhatrevi
mhatrevi previously approved these changes Feb 5, 2025
@mhatrevi mhatrevi merged commit 6dbb9b7 into main-2.x Feb 5, 2025
5 checks passed
@swenson
Copy link
Contributor Author

swenson commented Feb 5, 2025

Thanks!

@swenson swenson deleted the download-manifest-mcu-fw branch February 5, 2025 18:14
ArthurHeymans added a commit that referenced this pull request Feb 7, 2025
The code used to be like this but the rework of #1904 changed that
again.

The RDL does not specify the semantics of the registers yet and the
weird multi dword semantics comes from an old version of OCP I3C
commands, which likely don't translate to how the hardware really works.

Signed-off-by: Arthur Heymans <[email protected]>
mhatrevi pushed a commit that referenced this pull request Feb 8, 2025
* Add active mode to model_emulated

* fix: don't complete mailbox transaction twice

The caller of process_mailbox_commands() does this already.
Doing it twice results in update reset flow being broken.

* feat: add unit tests for rom with active mode

* Fix up image size like the emulator

The code used to be like this but the rework of #1904 changed that
again.

The RDL does not specify the semantics of the registers yet and the
weird multi dword semantics comes from an old version of OCP I3C
commands, which likely don't translate to how the hardware really works.

* sw-emulator: Use exact addr and only set bits

Don't set the whole status0 bit and use the full address for the RRI
status and not the lowest bits as that could conflict with other
registers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Caliptra v2.0 Items to be considered for v2.0 Release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants