mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
add a feature to force board type
this is useful in the limited case that the board type is incorrect in alt-boot mode. saves a step having to type in a command to fix it.
This commit is contained in:
parent
395791b70b
commit
d9cc765419
2 changed files with 11 additions and 0 deletions
|
|
@ -45,6 +45,7 @@ print-ifr = []
|
|||
|
||||
test-boot0-keys = []
|
||||
alt-boot1 = []
|
||||
force-dabao = []
|
||||
|
||||
verilator-only = []
|
||||
default = []
|
||||
|
|
|
|||
|
|
@ -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::<bao1x_api::BoardTypeCoding>().expect("owc coding error")
|
||||
!= bao1x_api::BoardTypeCoding::Dabao
|
||||
{
|
||||
one_way.inc_coded::<bao1x_api::BoardTypeCoding>().expect("increment error");
|
||||
}
|
||||
board_type = one_way.get_decoded::<bao1x_api::BoardTypeCoding>().expect("owc coding error");
|
||||
crate::println!("Re-configured board type: {:?}", board_type);
|
||||
}
|
||||
}
|
||||
|
||||
let iox = Iox::new(utra::iox::HW_IOX_BASE as *mut u32);
|
||||
|
|
|
|||
Loading…
Reference in a new issue