1
0
Fork 0

main: start_core1

This commit is contained in:
Astro 2019-11-16 00:53:30 +01:00
parent a416f48af1
commit 0bc941d789
2 changed files with 15 additions and 0 deletions

View File

@ -101,3 +101,14 @@ fn l1_cache_init() {
// way. // way.
dciall(); dciall();
} }
pub fn start_core1<T: AsMut<[u32]>>(mut stack: T) {
let stack = stack.as_mut();
let stack_start = &mut stack[stack.len() - 1];
unsafe {
CORE1_STACK = stack_start as *mut _ as u32;
}
// wake up core1
asm::sev();
}

View File

@ -36,6 +36,10 @@ pub fn main() {
ddr.memtest(); ddr.memtest();
ram::init_alloc(&mut ddr); ram::init_alloc(&mut ddr);
let core1_stack = vec![0; 2048];
println!("{} bytes stack for core1", core1_stack.len());
boot::start_core1(core1_stack);
let eth = zynq::eth::Eth::default(HWADDR.clone()); let eth = zynq::eth::Eth::default(HWADDR.clone());
println!("Eth on"); println!("Eth on");