diff options
| author | Ian McIntyre <me@mciantyre.dev> | 2026-10-24 07:30:47 -0400 |
|---|---|---|
| committer | Ian McIntyre <me@mciantyre.dev> | 2026-10-27 11:35:22 -0400 |
| commit | 428ea28a9102d966eda5b9c39644ff66c5f59c59 (patch) | |
| tree | cc553277851f4f421701563ce340f827d83ea4db /src/lib.rs | |
| parent | 5ad4b42b4bd810eecf47d3a13853658ffb263a16 (diff) | |
Preload RAM sections, maybe, if ECC RAM is active
Blasting all of RAM with zeros would wipe ourselves away if we were
executing from RAM. It also wipes out the HAB event log, which seems to
reside in the boot ROM reservation.
We now zero individual memory regions. Similar to the copy loops,
we'll skip the loop if the VMA and LMA are equal. It looks silly to
zero things like bss when we know cortex-m's reset handler will do it;
but, the usual loop doesn't use the 64 bit writes we'd need to preload
ciphers in ITCM and OCRAM.
Tested RAM loading with probe-rs, using an 1170EVK w/ ECC RAM active.
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -198,11 +198,19 @@ #![cfg_attr(all(target_arch = "arm", target_os = "none"), no_std)] +/// `__ecc_ram_config` bit set when ITCM ECC is active. +const ECC_ITCM_ACTIVE: u32 = 1 << 0; +/// `__ecc_ram_config` bit set when DTCM ECC is active. +const ECC_DTCM_ACTIVE: u32 = 1 << 1; + cfg_if::cfg_if! { if #[cfg(all(target_arch = "arm", target_os = "none"))] { mod target; pub use target::*; } else { + /// `__ecc_ram_config` bit set when OCRAM ECC is active. + const ECC_OCRAM_ACTIVE: u32 = 1 << 2; + mod host; pub use host::*; } |
