From 428ea28a9102d966eda5b9c39644ff66c5f59c59 Mon Sep 17 00:00:00 2001 From: Ian McIntyre Date: Sat, 24 Oct 2026 07:30:47 -0400 Subject: 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. --- src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 46963e6..f4c933c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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::*; } -- cgit v1.2.3