mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-20 09:03:28 +00:00
add handling for dabao case in baremetal
This commit is contained in:
parent
8b5f27daae
commit
7e47d27d37
3 changed files with 23 additions and 13 deletions
|
|
@ -42,12 +42,13 @@ artyvexii = ["utralib/artyvexii", "linked_list_allocator"]
|
||||||
bao1x = [
|
bao1x = [
|
||||||
"utralib/bao1x",
|
"utralib/bao1x",
|
||||||
"linked_list_allocator",
|
"linked_list_allocator",
|
||||||
"bao1x-hal/loader-baosec",
|
|
||||||
"bao1x-hal/debug-print-uart",
|
"bao1x-hal/debug-print-uart",
|
||||||
"bao1x-api",
|
"bao1x-api",
|
||||||
"digest",
|
"digest",
|
||||||
"sha2-bao1x",
|
"sha2-bao1x",
|
||||||
]
|
]
|
||||||
|
board-baosec = ["bao1x-hal/loader-baosec"]
|
||||||
|
board-dabao = ["bao1x-hal/board-dabao"]
|
||||||
# activates BIO test suite
|
# activates BIO test suite
|
||||||
bao1x-bio = [
|
bao1x-bio = [
|
||||||
"xous-bio-bdma/bio-mul",
|
"xous-bio-bdma/bio-mul",
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ pub const SCRATCH_PAGE: usize = HEAP_START + HEAP_LEN + 4096;
|
||||||
pub const UART_IFRAM_ADDR: usize = bao1x_hal::board::UART_DMA_TX_BUF_PHYS;
|
pub const UART_IFRAM_ADDR: usize = bao1x_hal::board::UART_DMA_TX_BUF_PHYS;
|
||||||
|
|
||||||
pub const SYSTEM_CLOCK_FREQUENCY: u32 = 700_000_000;
|
pub const SYSTEM_CLOCK_FREQUENCY: u32 = 700_000_000;
|
||||||
use bao1x_api::SYSTEM_TICK_INTERVAL_MS;
|
|
||||||
|
|
||||||
pub fn early_init() {
|
pub fn early_init() {
|
||||||
let iox = Iox::new(utra::iox::HW_IOX_BASE as *mut u32);
|
let iox = Iox::new(utra::iox::HW_IOX_BASE as *mut u32);
|
||||||
|
|
@ -91,13 +90,23 @@ pub fn early_init() {
|
||||||
|
|
||||||
// Baosec specific:
|
// Baosec specific:
|
||||||
// Setup I/Os so things that should be powered off are actually off
|
// Setup I/Os so things that should be powered off are actually off
|
||||||
bao1x_hal::board::setup_display_pins(&iox);
|
#[cfg(feature = "board-baosec")]
|
||||||
bao1x_hal::board::setup_memory_pins(&iox);
|
{
|
||||||
bao1x_hal::board::setup_i2c_pins(&iox);
|
bao1x_hal::board::setup_display_pins(&iox);
|
||||||
bao1x_hal::board::setup_camera_pins(&iox);
|
bao1x_hal::board::setup_memory_pins(&iox);
|
||||||
bao1x_hal::board::setup_kb_pins(&iox);
|
bao1x_hal::board::setup_i2c_pins(&iox);
|
||||||
bao1x_hal::board::setup_oled_power_pin(&iox);
|
bao1x_hal::board::setup_camera_pins(&iox);
|
||||||
bao1x_hal::board::setup_trng_power_pin(&iox);
|
bao1x_hal::board::setup_kb_pins(&iox);
|
||||||
|
bao1x_hal::board::setup_oled_power_pin(&iox);
|
||||||
|
bao1x_hal::board::setup_trng_power_pin(&iox);
|
||||||
|
}
|
||||||
|
#[cfg(feature = "board-dabao")]
|
||||||
|
{
|
||||||
|
// this actively drives the pin high, allowing USB to connect
|
||||||
|
bao1x_hal::board::setup_usb_pins(&iox);
|
||||||
|
// this puts the pin into a tri-state
|
||||||
|
bao1x_hal::board::setup_boot_pin(&iox);
|
||||||
|
}
|
||||||
crate::println!("scratch page: {:x}, heap start: {:x}", SCRATCH_PAGE, HEAP_START);
|
crate::println!("scratch page: {:x}, heap start: {:x}", SCRATCH_PAGE, HEAP_START);
|
||||||
crate::println!("CPU freq: {} MHz", SYSTEM_CLOCK_FREQUENCY / 2);
|
crate::println!("CPU freq: {} MHz", SYSTEM_CLOCK_FREQUENCY / 2);
|
||||||
}
|
}
|
||||||
|
|
@ -109,7 +118,7 @@ pub fn setup_timer() {
|
||||||
timer.wfo(utra::timer0::EV_ENABLE_ZERO, 0);
|
timer.wfo(utra::timer0::EV_ENABLE_ZERO, 0);
|
||||||
timer.wfo(utra::timer0::EV_PENDING_ZERO, 1);
|
timer.wfo(utra::timer0::EV_PENDING_ZERO, 1);
|
||||||
|
|
||||||
let ms = SYSTEM_TICK_INTERVAL_MS;
|
let ms = 1;
|
||||||
timer.wfo(utra::timer0::EN_EN, 0b0); // disable the timer
|
timer.wfo(utra::timer0::EN_EN, 0b0); // disable the timer
|
||||||
// load its values
|
// load its values
|
||||||
timer.wfo(utra::timer0::LOAD_LOAD, 0);
|
timer.wfo(utra::timer0::LOAD_LOAD, 0);
|
||||||
|
|
|
||||||
|
|
@ -669,7 +669,7 @@ impl Repl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[cfg(all(feature = "bao1x", not(feature = "bao1x-evb")))]
|
#[cfg(all(feature = "bao1x", feature = "board-baosec"))]
|
||||||
"ldo" => {
|
"ldo" => {
|
||||||
if args.len() != 1 {
|
if args.len() != 1 {
|
||||||
return Err(Error::help("vdd85 [on|off]"));
|
return Err(Error::help("vdd85 [on|off]"));
|
||||||
|
|
@ -736,7 +736,7 @@ impl Repl {
|
||||||
iox.set_gpio_pin_value(IoxPort::PA, 5, IoxValue::High);
|
iox.set_gpio_pin_value(IoxPort::PA, 5, IoxValue::High);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[cfg(all(feature = "bao1x", not(feature = "bao1x-evb")))]
|
#[cfg(all(feature = "bao1x", feature = "board-baosec"))]
|
||||||
"wfi" => {
|
"wfi" => {
|
||||||
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);
|
||||||
|
|
||||||
|
|
@ -1143,7 +1143,7 @@ impl Repl {
|
||||||
crate::print!(", mon");
|
crate::print!(", mon");
|
||||||
#[cfg(feature = "bao1x-bio")]
|
#[cfg(feature = "bao1x-bio")]
|
||||||
crate::print!(", bio, bdma, pin");
|
crate::print!(", bio, bdma, pin");
|
||||||
#[cfg(all(feature = "bao1x", not(feature = "bao1x-evb")))]
|
#[cfg(all(feature = "bao1x", feature = "board-baosec"))]
|
||||||
crate::print!(", ldo, wfi");
|
crate::print!(", ldo, wfi");
|
||||||
#[cfg(feature = "bao1x-usb")]
|
#[cfg(feature = "bao1x-usb")]
|
||||||
crate::print!(", usb");
|
crate::print!(", usb");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue