Skip to content

Commit

Permalink
[runtime] Start recovery flow in the runtime
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
swenson committed Jan 23, 2025
1 parent b764d0a commit 9152e52
Show file tree
Hide file tree
Showing 12 changed files with 514 additions and 208 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions auth-manifest/types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use zeroize::Zeroize;

pub const AUTH_MANIFEST_MARKER: u32 = 0x4154_4D4E;
pub const AUTH_MANIFEST_IMAGE_METADATA_MAX_COUNT: usize = 127;
pub const AUTH_MANIFEST_PREAMBLE_SIZE: usize = 7168;

bitflags::bitflags! {
#[derive(Default, Copy, Clone, Debug)]
Expand Down Expand Up @@ -187,3 +188,17 @@ pub struct AuthorizationManifest {

pub image_metadata_col: AuthManifestImageMetadataCollection,
}

#[cfg(test)]
mod test {
use crate::{AuthManifestPreamble, AUTH_MANIFEST_PREAMBLE_SIZE};
use zerocopy::AsBytes;

#[test]
fn test_auth_preamble_size() {
assert_eq!(
AUTH_MANIFEST_PREAMBLE_SIZE,
AuthManifestPreamble::default().as_bytes().len()
);
}
}
2 changes: 1 addition & 1 deletion common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub use pcr::{PcrLogEntry, PcrLogEntryId, RT_FW_CURRENT_PCR, RT_FW_JOURNEY_PCR};
pub const FMC_ORG: u32 = 0x40000000;
pub const FMC_SIZE: u32 = 21 * 1024;
pub const RUNTIME_ORG: u32 = FMC_ORG + FMC_SIZE;
pub const RUNTIME_SIZE: u32 = 100 * 1024;
pub const RUNTIME_SIZE: u32 = 128 * 1024;

pub use memory_layout::{DATA_ORG, FHT_ORG, FHT_SIZE, MAN1_ORG};
pub use wdt::{restart_wdt, start_wdt, stop_wdt, WdtTimeout};
Loading

0 comments on commit 9152e52

Please sign in to comment.