mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-20 09:03:28 +00:00
migrate loader board parameters to board files
This commit is contained in:
parent
d6790489f1
commit
1eb1a1a671
4 changed files with 5 additions and 16 deletions
|
|
@ -26,10 +26,10 @@ pub const FLG_SWAP_USED: u32 = 0x8000_0000;
|
||||||
// Locate the hard-wired IFRAM allocations for UDMA
|
// Locate the hard-wired IFRAM allocations for UDMA
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[cfg(feature = "cramium-soc")]
|
#[cfg(feature = "cramium-soc")]
|
||||||
pub const UART_IFRAM_ADDR: usize = utralib::HW_IFRAM0_MEM + utralib::HW_IFRAM0_MEM_LEN - 4096;
|
pub const UART_IFRAM_ADDR: usize = cramium_hal::board::UART_DMA_TX_BUF_PHYS;
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[cfg(feature = "cramium-soc")]
|
#[cfg(feature = "cramium-soc")]
|
||||||
pub const APP_UART_IFRAM_ADDR: usize = utralib::HW_IFRAM0_MEM + utralib::HW_IFRAM0_MEM_LEN - 3 * 4096;
|
pub const APP_UART_IFRAM_ADDR: usize = cramium_hal::board::APP_UART_IFRAM_ADDR;
|
||||||
|
|
||||||
/// This is the amount of space that the loader stack will occupy as it runs, assuming no swap and giving one
|
/// This is the amount of space that the loader stack will occupy as it runs, assuming no swap and giving one
|
||||||
/// page for the clean suspend marker
|
/// page for the clean suspend marker
|
||||||
|
|
|
||||||
|
|
@ -333,11 +333,11 @@ pub fn early_init() {
|
||||||
|
|
||||||
#[cfg(feature = "spim-test")]
|
#[cfg(feature = "spim-test")]
|
||||||
{
|
{
|
||||||
|
use cramium_hal::board::{SPIM_FLASH_IFRAM_ADDR, SPIM_RAM_IFRAM_ADDR};
|
||||||
use cramium_hal::ifram::IframRange;
|
use cramium_hal::ifram::IframRange;
|
||||||
use cramium_hal::iox::*;
|
use cramium_hal::iox::*;
|
||||||
use cramium_hal::udma::*;
|
use cramium_hal::udma::*;
|
||||||
use loader::swap::SPIM_FLASH_IFRAM_ADDR;
|
use loader::swap::SPIM_FLASH_IFRAM_ADDR;
|
||||||
use loader::swap::SPIM_RAM_IFRAM_ADDR;
|
|
||||||
|
|
||||||
fn setup_port(
|
fn setup_port(
|
||||||
iox: &mut Iox,
|
iox: &mut Iox,
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
use core::mem::size_of;
|
use core::mem::size_of;
|
||||||
|
|
||||||
use aes_gcm_siv::{AeadInPlace, Aes256GcmSiv, KeyInit, Nonce, Tag};
|
use aes_gcm_siv::{AeadInPlace, Aes256GcmSiv, KeyInit, Nonce, Tag};
|
||||||
|
use cramium_hal::board::{APP_UART_IFRAM_ADDR, SPIM_FLASH_IFRAM_ADDR, SPIM_RAM_IFRAM_ADDR};
|
||||||
use cramium_hal::ifram::IframRange;
|
use cramium_hal::ifram::IframRange;
|
||||||
use cramium_hal::iox::*;
|
use cramium_hal::iox::*;
|
||||||
use cramium_hal::sce;
|
use cramium_hal::sce;
|
||||||
use cramium_hal::udma::*;
|
use cramium_hal::udma::*;
|
||||||
use loader::APP_UART_IFRAM_ADDR;
|
|
||||||
use loader::swap::SPIM_RAM_IFRAM_ADDR;
|
|
||||||
use rand_chacha::ChaCha8Rng;
|
use rand_chacha::ChaCha8Rng;
|
||||||
use rand_chacha::rand_core::RngCore;
|
use rand_chacha::rand_core::RngCore;
|
||||||
use rand_chacha::rand_core::SeedableRng;
|
use rand_chacha::rand_core::SeedableRng;
|
||||||
|
|
@ -44,7 +43,7 @@ impl SwapHal {
|
||||||
// setup the I/O pins
|
// setup the I/O pins
|
||||||
let iox = Iox::new(utralib::generated::HW_IOX_BASE as *mut u32);
|
let iox = Iox::new(utralib::generated::HW_IOX_BASE as *mut u32);
|
||||||
let channel = cramium_hal::board::setup_memory_pins(&iox);
|
let channel = cramium_hal::board::setup_memory_pins(&iox);
|
||||||
udma_global.clock_off(PeriphId::from(channel));
|
udma_global.clock_on(PeriphId::from(channel));
|
||||||
|
|
||||||
// safety: this is safe because clocks have been set up
|
// safety: this is safe because clocks have been set up
|
||||||
let mut flash_spim = unsafe {
|
let mut flash_spim = unsafe {
|
||||||
|
|
|
||||||
|
|
@ -98,16 +98,6 @@ pub struct SwapSpec {
|
||||||
pub sram_size: u32,
|
pub sram_size: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
// RAM needs two buffers of 1k + 16 bytes = 2048 + 16 = 2064 bytes; round up to one page
|
|
||||||
#[allow(dead_code)]
|
|
||||||
#[cfg(feature = "cramium-soc")]
|
|
||||||
pub const SPIM_RAM_IFRAM_ADDR: usize = utralib::HW_IFRAM0_MEM + utralib::HW_IFRAM0_MEM_LEN - 2 * 4096;
|
|
||||||
// Flash will be released after the loader is done: it's only accessed to copy the IniS sectors into swap,
|
|
||||||
// then abandoned. It needs 4096 bytes for Rx, and 0 bytes for Tx + 16 bytes for cmd.
|
|
||||||
#[allow(dead_code)]
|
|
||||||
#[cfg(feature = "cramium-soc")]
|
|
||||||
pub const SPIM_FLASH_IFRAM_ADDR: usize = utralib::HW_IFRAM0_MEM + utralib::HW_IFRAM0_MEM_LEN - 5 * 4096;
|
|
||||||
|
|
||||||
/// Function that derives the usable amount of swap space from the total length of swap memory available.
|
/// Function that derives the usable amount of swap space from the total length of swap memory available.
|
||||||
/// This is used repeatedly in the initialization process to define the boundary between the swap page
|
/// This is used repeatedly in the initialization process to define the boundary between the swap page
|
||||||
/// storage and the message authentication code (MAC) tables.
|
/// storage and the message authentication code (MAC) tables.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue