mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
commit
091f4ffd7c
4 changed files with 23 additions and 13 deletions
|
|
@ -45,7 +45,6 @@ print-ifr = []
|
||||||
|
|
||||||
test-boot0-keys = []
|
test-boot0-keys = []
|
||||||
alt-boot1 = []
|
alt-boot1 = []
|
||||||
force-dabao = []
|
|
||||||
|
|
||||||
verilator-only = []
|
verilator-only = []
|
||||||
default = []
|
default = []
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ use crate::secboot::try_boot;
|
||||||
// Notes:
|
// Notes:
|
||||||
// - "Towards" - not a release yet, but working towards the stated milestone
|
// - "Towards" - not a release yet, but working towards the stated milestone
|
||||||
// - Eliminating "Towards" is done at the tag-out point.
|
// - Eliminating "Towards" is done at the tag-out point.
|
||||||
const RELEASE_DESCRIPTION: &'static str = "Alpha-1";
|
const RELEASE_DESCRIPTION: &'static str = "Towards Beta-0";
|
||||||
|
|
||||||
static UART_RX: Mutex<RefCell<VecDeque<u8>>> = Mutex::new(RefCell::new(VecDeque::new()));
|
static UART_RX: Mutex<RefCell<VecDeque<u8>>> = Mutex::new(RefCell::new(VecDeque::new()));
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
|
|
@ -83,19 +83,19 @@ pub unsafe extern "C" fn rust_entry() -> ! {
|
||||||
#[cfg(feature = "alt-boot1")]
|
#[cfg(feature = "alt-boot1")]
|
||||||
crate::println!("\n~~Alt-Boot1 up! ({}: {})~~\n", crate::version::SEMVER, RELEASE_DESCRIPTION);
|
crate::println!("\n~~Alt-Boot1 up! ({}: {})~~\n", crate::version::SEMVER, RELEASE_DESCRIPTION);
|
||||||
crate::println!("Configured board type: {:?}", board_type);
|
crate::println!("Configured board type: {:?}", board_type);
|
||||||
|
|
||||||
|
#[cfg(feature = "alt-boot1")]
|
||||||
|
{
|
||||||
|
// in alt-boot1, always enable bootwait - otherwise we enter a boot loop
|
||||||
|
while one_way.get_decoded::<bao1x_api::BootWaitCoding>().expect("couldn't fetch flag")
|
||||||
|
!= bao1x_api::BootWaitCoding::Enable
|
||||||
|
{
|
||||||
|
one_way.inc_coded::<bao1x_api::BootWaitCoding>().unwrap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
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);
|
|
||||||
IS_BAOSEC.store(false, Ordering::SeqCst);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let iox = Iox::new(utra::iox::HW_IOX_BASE as *mut u32);
|
let iox = Iox::new(utra::iox::HW_IOX_BASE as *mut u32);
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ pub fn setup_dabao_se0_pin<T: IoSetup + IoGpio>(iox: &T) -> (IoxPort, u8) {
|
||||||
(DABAO_SE0_PORT, DABAO_SE0_PIN)
|
(DABAO_SE0_PORT, DABAO_SE0_PIN)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(feature = "alt-boot1"))]
|
||||||
pub fn setup_backup_region() -> u32 {
|
pub fn setup_backup_region() -> u32 {
|
||||||
let mut bu_mgr = bao1x_hal::buram::BackupManager::new();
|
let mut bu_mgr = bao1x_hal::buram::BackupManager::new();
|
||||||
if !bu_mgr.is_backup_valid() {
|
if !bu_mgr.is_backup_valid() {
|
||||||
|
|
@ -139,6 +140,7 @@ pub fn setup_backup_region() -> u32 {
|
||||||
/// This can change the board type coding to a safer, simpler board type if the declared board type has
|
/// This can change the board type coding to a safer, simpler board type if the declared board type has
|
||||||
/// problems booting.
|
/// problems booting.
|
||||||
pub fn early_init(mut board_type: bao1x_api::BoardTypeCoding) -> (bao1x_api::BoardTypeCoding, u32) {
|
pub fn early_init(mut board_type: bao1x_api::BoardTypeCoding) -> (bao1x_api::BoardTypeCoding, u32) {
|
||||||
|
#[cfg(not(feature = "alt-boot1"))]
|
||||||
if setup_backup_region() == 0 {
|
if setup_backup_region() == 0 {
|
||||||
crate::println!("backup region is clean!");
|
crate::println!("backup region is clean!");
|
||||||
}
|
}
|
||||||
|
|
@ -331,6 +333,8 @@ pub fn early_init(mut board_type: bao1x_api::BoardTypeCoding) -> (bao1x_api::Boa
|
||||||
let mut cu = bao1x_hal::coreuser::Coreuser::new();
|
let mut cu = bao1x_hal::coreuser::Coreuser::new();
|
||||||
// Coreuser needs to be set up correctly for check_slots to succeed.
|
// Coreuser needs to be set up correctly for check_slots to succeed.
|
||||||
cu.set();
|
cu.set();
|
||||||
|
// can't check slots in alt-boot mode because it's effectively baremetal as far as permissions go
|
||||||
|
#[cfg(not(feature = "alt-boot1"))]
|
||||||
crate::platform::slots::check_slots(&board_type);
|
crate::platform::slots::check_slots(&board_type);
|
||||||
// protect() is called inside sigcheck on boot!
|
// protect() is called inside sigcheck on boot!
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,13 @@ use xous_bio_bdma::*;
|
||||||
const DABAO_PINMASK: u32 = 0b0001_1111_1000_1111_0111_1000_0011_1110; // 0x1F8F783E;
|
const DABAO_PINMASK: u32 = 0b0001_1111_1000_1111_0111_1000_0011_1110; // 0x1F8F783E;
|
||||||
|
|
||||||
pub fn dabao_selftest() {
|
pub fn dabao_selftest() {
|
||||||
|
let one_way = bao1x_hal::acram::OneWayCounter::new();
|
||||||
|
while one_way.get_decoded::<bao1x_api::BootWaitCoding>().expect("couldn't fetch flag")
|
||||||
|
!= bao1x_api::BootWaitCoding::Enable
|
||||||
|
{
|
||||||
|
one_way.inc_coded::<bao1x_api::BootWaitCoding>().unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
let mut bio_ss = BioSharedState::new();
|
let mut bio_ss = BioSharedState::new();
|
||||||
let iox = bao1x_hal::iox::Iox::new(utra::iox::HW_IOX_BASE as *mut u32);
|
let iox = bao1x_hal::iox::Iox::new(utra::iox::HW_IOX_BASE as *mut u32);
|
||||||
iox.set_ports_from_bio_bitmask(DABAO_PINMASK);
|
iox.set_ports_from_bio_bitmask(DABAO_PINMASK);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue