From b06c124b3ec9bb8b4ea73470a3cff3582a02bb06 Mon Sep 17 00:00:00 2001 From: bunnie Date: Thu, 15 Jan 2026 17:04:11 +0800 Subject: [PATCH] add a routine to print the info region The info region is a region of RRAM that is used to configure the chip - boot security, what CPUs can run, access control lists, etc. There's no secrets in here, but it's very helpful to inspect for audits and correctness of configuration, so a routine is added to print it in boot1. --- bao1x-boot/boot1/src/repl.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bao1x-boot/boot1/src/repl.rs b/bao1x-boot/boot1/src/repl.rs index e10d31f13..94f36d887 100644 --- a/bao1x-boot/boot1/src/repl.rs +++ b/bao1x-boot/boot1/src/repl.rs @@ -557,6 +557,14 @@ impl Repl { let mut rcurst = CSR::new(utra::sysctrl::HW_SYSCTRL_BASE as *mut u32); rcurst.wo(utra::sysctrl::SFR_RCURST0, 0x55AA); } + "ifr" => { + // safety: the IFR region is aligned and exists here. It is sealed by hardware in USER mode, + // and should report as all 0's. + let ifr = unsafe { core::slice::from_raw_parts(0x6040_0000 as *const u8, 0x400) }; + for (i, chunk) in ifr.chunks(32).enumerate() { + crate::println!(" {:03x}: {:02x?}", i * 32, chunk); + } + } #[cfg(feature = "test-boot0-keys")] "publock" => { let rram = CSR::new(utra::rrc::HW_RRC_BASE as *mut u32); @@ -655,7 +663,7 @@ impl Repl { _ => { crate::println!("Command not recognized: {}", cmd); crate::print!( - "Commands include: reset, echo, altboot, boot, bootwait, idmode, localecho, uf2, boardtype, audit, lockdown, paranoid, self_destruct" + "Commands include: reset, echo, altboot, boot, bootwait, idmode, localecho, uf2, boardtype, audit, lockdown, paranoid, self_destruct, ifr" ); #[cfg(feature = "test-boot0-keys")] crate::print!(", publock");