mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
commit
52b229a39c
4 changed files with 17 additions and 0 deletions
Binary file not shown.
|
|
@ -45,6 +45,7 @@ print-ifr = []
|
||||||
|
|
||||||
test-boot0-keys = []
|
test-boot0-keys = []
|
||||||
alt-boot1 = []
|
alt-boot1 = []
|
||||||
|
force-dabao = []
|
||||||
|
|
||||||
verilator-only = []
|
verilator-only = []
|
||||||
default = []
|
default = []
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,16 @@ pub unsafe extern "C" fn rust_entry() -> ! {
|
||||||
crate::println!("Configured board type: {:?}", board_type);
|
crate::println!("Configured board type: {:?}", board_type);
|
||||||
if board_type == BoardTypeCoding::Baosec {
|
if board_type == BoardTypeCoding::Baosec {
|
||||||
IS_BAOSEC.store(true, Ordering::SeqCst);
|
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);
|
let iox = Iox::new(utra::iox::HW_IOX_BASE as *mut u32);
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,12 @@ fn fill_sparse_data(dest: &mut [u8], offset: usize) {
|
||||||
let copy_len = (dest.len().saturating_sub(write_start_in_dest)).min(block.len());
|
let copy_len = (dest.len().saturating_sub(write_start_in_dest)).min(block.len());
|
||||||
|
|
||||||
dest[write_start_in_dest..write_start_in_dest + copy_len].copy_from_slice(&block[..copy_len]);
|
dest[write_start_in_dest..write_start_in_dest + copy_len].copy_from_slice(&block[..copy_len]);
|
||||||
|
#[cfg(feature = "alt-boot1")]
|
||||||
|
// patch the volume name so we can tell alt-boot apart
|
||||||
|
if addr == 0x410000 {
|
||||||
|
// patch ALT over BAO. Assumes that the block is aligned.
|
||||||
|
dest[write_start_in_dest..write_start_in_dest + 3].copy_from_slice(&[0x41, 0x4c, 0x54])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue