diff --git a/bao1x-boot/boot1/Cargo.toml b/bao1x-boot/boot1/Cargo.toml index 4395d11ee..546dcde29 100644 --- a/bao1x-boot/boot1/Cargo.toml +++ b/bao1x-boot/boot1/Cargo.toml @@ -45,6 +45,7 @@ print-ifr = [] test-boot0-keys = [] alt-boot1 = [] +force-dabao = [] verilator-only = [] default = [] diff --git a/bao1x-boot/boot1/src/main.rs b/bao1x-boot/boot1/src/main.rs index 119a49c46..e46a7c31e 100644 --- a/bao1x-boot/boot1/src/main.rs +++ b/bao1x-boot/boot1/src/main.rs @@ -82,6 +82,16 @@ pub unsafe extern "C" fn rust_entry() -> ! { crate::println!("Configured board type: {:?}", board_type); if board_type == BoardTypeCoding::Baosec { IS_BAOSEC.store(true, Ordering::SeqCst); + #[cfg(all(feature = "force-dabao", feature = "alt-boot1"))] + { + while one_way.get_decoded::().expect("owc coding error") + != bao1x_api::BoardTypeCoding::Dabao + { + one_way.inc_coded::().expect("increment error"); + } + board_type = one_way.get_decoded::().expect("owc coding error"); + crate::println!("Re-configured board type: {:?}", board_type); + } } let iox = Iox::new(utra::iox::HW_IOX_BASE as *mut u32);