From 0bc941d789ef191a5fd97c31d6e3279371bde9b6 Mon Sep 17 00:00:00 2001 From: Astro Date: Sat, 16 Nov 2019 00:53:30 +0100 Subject: [PATCH] main: start_core1 --- src/boot.rs | 11 +++++++++++ src/main.rs | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/src/boot.rs b/src/boot.rs index 9d4eb8e..cf2f06b 100644 --- a/src/boot.rs +++ b/src/boot.rs @@ -101,3 +101,14 @@ fn l1_cache_init() { // way. dciall(); } + +pub fn start_core1>(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(); +} diff --git a/src/main.rs b/src/main.rs index 6a50acc..dc3929d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -36,6 +36,10 @@ pub fn main() { ddr.memtest(); 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()); println!("Eth on");