mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
bring loader up to latest API spec
This commit is contained in:
parent
671ac1625f
commit
130571b0f4
4 changed files with 47 additions and 32 deletions
|
|
@ -18,6 +18,7 @@ armv7 = { git = "https://github.com/Foundation-Devices/armv7.git", branch = "upd
|
|||
atsama5d27 = { git = "https://github.com/Foundation-Devices/atsama5d27.git", branch = "master", optional = true }
|
||||
sha2-loader = { path = "./sha2-loader", default-features = false, optional = true }
|
||||
cramium-hal = { path = "../libs/cramium-hal", optional = true, default-features = false }
|
||||
cramium-api = { path = "../libs/cramium-api", optional = true, default-features = false }
|
||||
ux-api = { path = "../libs/ux-api", optional = true, default-features = false }
|
||||
xous-pl230 = { path = "../libs/xous-pl230", optional = true, features = [
|
||||
"tests",
|
||||
|
|
@ -80,14 +81,14 @@ renode = [
|
|||
cramium-soc = [
|
||||
"utralib/cramium-soc",
|
||||
"debug-print",
|
||||
"cramium-hal",
|
||||
"ux-api",
|
||||
"cramium-hal/cramium-soc",
|
||||
"cramium-api",
|
||||
"rand_chacha",
|
||||
"sram-margin",
|
||||
# "boot-delay",
|
||||
]
|
||||
board-baosec = [
|
||||
"cramium-hal/board-baosec",
|
||||
"cramium-hal/loader-baosec",
|
||||
"updates",
|
||||
"usb",
|
||||
"libm",
|
||||
|
|
@ -96,10 +97,10 @@ board-baosec = [
|
|||
"ed25519-dalek",
|
||||
"sha2",
|
||||
"digest",
|
||||
"ux-api/board-baosec",
|
||||
"ux-api/loader-baosec",
|
||||
]
|
||||
board-baosor = ["cramium-hal/board-baosor"]
|
||||
board-dabao = ["cramium-hal/board-dabao"]
|
||||
board-baosor = ["cramium-hal/loader-baosor"]
|
||||
board-dabao = ["cramium-hal/loader-dabao"]
|
||||
cramium-fpga = ["utralib/cramium-fpga", "debug-print"]
|
||||
atsama5d27 = ["utralib/atsama5d27", "armv7", "dep:atsama5d27"]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
#[cfg(any(feature = "board-baosec", feature = "board-baosor"))]
|
||||
use cramium_hal::axp2101::Axp2101;
|
||||
#[cfg(not(feature = "verilator-only"))]
|
||||
use cramium_hal::iox::{Iox, IoxDir, IoxEnable, IoxFunction, IoxPort};
|
||||
use cramium_api::{
|
||||
udma::{PeriphId, UdmaGlobalConfig},
|
||||
*,
|
||||
};
|
||||
#[cfg(not(feature = "verilator-only"))]
|
||||
use cramium_hal::iox::Iox;
|
||||
#[cfg(feature = "cramium-soc")]
|
||||
use cramium_hal::udma;
|
||||
#[cfg(any(feature = "board-baosec", feature = "board-baosor"))]
|
||||
use cramium_hal::udma::PeriphId;
|
||||
#[cfg(any(feature = "board-baosec", feature = "board-baosor"))]
|
||||
use cramium_hal::udma::UdmaGlobalConfig;
|
||||
use cramium_hal::{axp2101::Axp2101, udma::GlobalConfig};
|
||||
use utralib::generated::*;
|
||||
|
||||
#[cfg(feature = "qr")]
|
||||
|
|
@ -240,17 +241,17 @@ pub fn early_init() -> u32 {
|
|||
|
||||
// Set up the UDMA_UART block to the correct baud rate and enable status
|
||||
#[allow(unused_mut)] // some configs require mut
|
||||
let mut udma_global = udma::GlobalConfig::new(utra::udma_ctrl::HW_UDMA_CTRL_BASE as *mut u32);
|
||||
udma_global.clock_on(udma::PeriphId::Uart1);
|
||||
let mut udma_global = GlobalConfig::new(utra::udma_ctrl::HW_UDMA_CTRL_BASE as *mut u32);
|
||||
udma_global.clock_on(PeriphId::Uart1);
|
||||
udma_global.map_event(
|
||||
udma::PeriphId::Uart1,
|
||||
udma::PeriphEventType::Uart(udma::EventUartOffset::Rx),
|
||||
udma::EventChannel::Channel0,
|
||||
PeriphId::Uart1,
|
||||
PeriphEventType::Uart(EventUartOffset::Rx),
|
||||
EventChannel::Channel0,
|
||||
);
|
||||
udma_global.map_event(
|
||||
udma::PeriphId::Uart1,
|
||||
udma::PeriphEventType::Uart(udma::EventUartOffset::Tx),
|
||||
udma::EventChannel::Channel1,
|
||||
PeriphId::Uart1,
|
||||
PeriphEventType::Uart(EventUartOffset::Tx),
|
||||
EventChannel::Channel1,
|
||||
);
|
||||
|
||||
let baudrate: u32 = 115200;
|
||||
|
|
@ -372,7 +373,12 @@ pub fn early_init() -> u32 {
|
|||
// show the boot logo
|
||||
use ux_api::minigfx::FrameBuffer;
|
||||
|
||||
let mut sh1107 = cramium_hal::sh1107::Oled128x128::new(perclk, &mut iox, &mut udma_global);
|
||||
let mut sh1107 = cramium_hal::sh1107::Oled128x128::new(
|
||||
cramium_hal::sh1107::MainThreadToken::new(),
|
||||
perclk,
|
||||
&mut iox,
|
||||
&mut udma_global,
|
||||
);
|
||||
sh1107.init();
|
||||
crate::platform::cramium::bootlogo::show_logo(&mut sh1107);
|
||||
sh1107.buffer_swap();
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
use core::mem::size_of;
|
||||
|
||||
use aes_gcm_siv::{AeadInPlace, Aes256GcmSiv, KeyInit, Nonce, Tag};
|
||||
use cramium_api::udma::*;
|
||||
use cramium_api::*;
|
||||
use cramium_hal::board::{APP_UART_IFRAM_ADDR, SPIM_FLASH_IFRAM_ADDR, SPIM_RAM_IFRAM_ADDR};
|
||||
use cramium_hal::ifram::IframRange;
|
||||
use cramium_hal::iox::*;
|
||||
use cramium_hal::iox::Iox;
|
||||
use cramium_hal::sce;
|
||||
use cramium_hal::udma::*;
|
||||
use cramium_hal::udma::{GlobalConfig, Spim, SpimClkPha, SpimClkPol, SpimCs};
|
||||
use rand_chacha::ChaCha8Rng;
|
||||
use rand_chacha::rand_core::RngCore;
|
||||
use rand_chacha::rand_core::SeedableRng;
|
||||
|
|
@ -396,16 +398,16 @@ pub fn userspace_maps(cfg: &mut BootConfig) {
|
|||
// Set up the UDMA_UART block to the correct baud rate and enable status
|
||||
let udma_global =
|
||||
cramium_hal::udma::GlobalConfig::new(utralib::utra::udma_ctrl::HW_UDMA_CTRL_BASE as *mut u32);
|
||||
udma_global.clock_on(cramium_hal::udma::PeriphId::Uart0);
|
||||
udma_global.clock_on(PeriphId::Uart0);
|
||||
udma_global.map_event(
|
||||
cramium_hal::udma::PeriphId::Uart0,
|
||||
cramium_hal::udma::PeriphEventType::Uart(cramium_hal::udma::EventUartOffset::Rx),
|
||||
cramium_hal::udma::EventChannel::Channel2,
|
||||
PeriphId::Uart0,
|
||||
PeriphEventType::Uart(EventUartOffset::Rx),
|
||||
EventChannel::Channel2,
|
||||
);
|
||||
udma_global.map_event(
|
||||
cramium_hal::udma::PeriphId::Uart0,
|
||||
cramium_hal::udma::PeriphEventType::Uart(cramium_hal::udma::EventUartOffset::Tx),
|
||||
cramium_hal::udma::EventChannel::Channel3,
|
||||
PeriphId::Uart0,
|
||||
PeriphEventType::Uart(EventUartOffset::Tx),
|
||||
EventChannel::Channel3,
|
||||
);
|
||||
|
||||
let baudrate: u32 = 115200;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
use core::convert::TryInto;
|
||||
use core::fmt::Write;
|
||||
|
||||
use cramium_api::*;
|
||||
use cramium_hal::board::SPIM_FLASH_IFRAM_ADDR;
|
||||
use cramium_hal::ifram::IframRange;
|
||||
use cramium_hal::iox::{IoGpio, IoSetup, Iox, IoxPort, IoxValue};
|
||||
use cramium_hal::iox::Iox;
|
||||
use cramium_hal::mbox::{
|
||||
MBOX_PROTOCOL_REV, Mbox, MboxError, MboxToCm7Pkt, PAYLOAD_LEN_WORDS, RERAM_PAGE_SIZE_BYTES, ToCm7Op,
|
||||
ToRvOp,
|
||||
|
|
@ -108,7 +109,12 @@ pub fn process_update(perclk: u32) {
|
|||
let mut udma_global = udma::GlobalConfig::new(utra::udma_ctrl::HW_UDMA_CTRL_BASE as *mut u32);
|
||||
|
||||
let iox_kbd = iox.clone();
|
||||
let mut sh1107 = cramium_hal::sh1107::Oled128x128::new(perclk, &mut iox, &mut udma_global);
|
||||
let mut sh1107 = cramium_hal::sh1107::Oled128x128::new(
|
||||
cramium_hal::sh1107::MainThreadToken::new(),
|
||||
perclk,
|
||||
&mut iox,
|
||||
&mut udma_global,
|
||||
);
|
||||
|
||||
gfx::msg(&mut sh1107, " START to boot", Point::new(0, 16), Mono::White.into(), Mono::Black.into());
|
||||
gfx::msg(&mut sh1107, " SELECT to update", Point::new(0, 0), Mono::White.into(), Mono::Black.into());
|
||||
|
|
|
|||
Loading…
Reference in a new issue