forked from M-Labs/nac3
1
0
Fork 0

use new core1 startup mechanism

This commit is contained in:
Sebastien Bourdeauducq 2020-05-06 22:16:34 +08:00
parent ae2cee5f7e
commit 90faeb6fa2
4 changed files with 10 additions and 12 deletions

View File

@ -15,7 +15,7 @@ in
version = "0.1.0"; version = "0.1.0";
src = ./src; src = ./src;
cargoSha256 = "1b40w3ycc0hx6hahxgz935vv01q1lirbrn4cb4k0r3dmgzvsdk6l"; cargoSha256 = "0pa5m7pwpiyd1agfgfhywd8dkm6pbjx76nca4dngpw77h893c5bc";
nativeBuildInputs = [ nativeBuildInputs = [
pkgs.gnumake pkgs.gnumake

10
src/Cargo.lock generated
View File

@ -153,7 +153,7 @@ dependencies = [
[[package]] [[package]]
name = "libasync" name = "libasync"
version = "0.0.0" version = "0.0.0"
source = "git+https://git.m-labs.hk/M-Labs/zc706.git#ce844f1b026b15f77432de0e24942ff220add283" source = "git+https://git.m-labs.hk/M-Labs/zc706.git#4e1f46b3e232609b7bc8d818f60ce07fa769d93b"
dependencies = [ dependencies = [
"embedded-hal", "embedded-hal",
"libcortex_a9", "libcortex_a9",
@ -165,7 +165,7 @@ dependencies = [
[[package]] [[package]]
name = "libboard_zynq" name = "libboard_zynq"
version = "0.0.0" version = "0.0.0"
source = "git+https://git.m-labs.hk/M-Labs/zc706.git#ce844f1b026b15f77432de0e24942ff220add283" source = "git+https://git.m-labs.hk/M-Labs/zc706.git#4e1f46b3e232609b7bc8d818f60ce07fa769d93b"
dependencies = [ dependencies = [
"bit_field", "bit_field",
"embedded-hal", "embedded-hal",
@ -181,7 +181,7 @@ dependencies = [
[[package]] [[package]]
name = "libcortex_a9" name = "libcortex_a9"
version = "0.0.0" version = "0.0.0"
source = "git+https://git.m-labs.hk/M-Labs/zc706.git#ce844f1b026b15f77432de0e24942ff220add283" source = "git+https://git.m-labs.hk/M-Labs/zc706.git#4e1f46b3e232609b7bc8d818f60ce07fa769d93b"
dependencies = [ dependencies = [
"bit_field", "bit_field",
"libregister", "libregister",
@ -190,7 +190,7 @@ dependencies = [
[[package]] [[package]]
name = "libregister" name = "libregister"
version = "0.0.0" version = "0.0.0"
source = "git+https://git.m-labs.hk/M-Labs/zc706.git#ce844f1b026b15f77432de0e24942ff220add283" source = "git+https://git.m-labs.hk/M-Labs/zc706.git#4e1f46b3e232609b7bc8d818f60ce07fa769d93b"
dependencies = [ dependencies = [
"bit_field", "bit_field",
"vcell", "vcell",
@ -200,7 +200,7 @@ dependencies = [
[[package]] [[package]]
name = "libsupport_zynq" name = "libsupport_zynq"
version = "0.0.0" version = "0.0.0"
source = "git+https://git.m-labs.hk/M-Labs/zc706.git#ce844f1b026b15f77432de0e24942ff220add283" source = "git+https://git.m-labs.hk/M-Labs/zc706.git#4e1f46b3e232609b7bc8d818f60ce07fa769d93b"
dependencies = [ dependencies = [
"compiler_builtins", "compiler_builtins",
"libboard_zynq", "libboard_zynq",

View File

@ -28,7 +28,7 @@ pub struct Control {
impl Control { impl Control {
pub fn start() -> Self { pub fn start() -> Self {
let core1 = Core1::start(); let core1 = Core1::start(true);
let (core0_tx, core1_rx) = sync_channel(4); let (core0_tx, core1_rx) = sync_channel(4);
let (core1_tx, core0_rx) = sync_channel(4); let (core1_tx, core0_rx) = sync_channel(4);

View File

@ -12,7 +12,7 @@ use libboard_zynq::{
logger, logger,
timer::GlobalTimer, timer::GlobalTimer,
}; };
use libsupport_zynq::boot; use libsupport_zynq as _;
extern "C" { extern "C" {
@ -48,7 +48,7 @@ pub fn main_core0() {
if result < 0 { if result < 0 {
error!("decompression failed"); error!("decompression failed");
} else { } else {
boot::Core1::start(); // Start core0 only, for compatibility with FSBL.
info!("executing payload"); info!("executing payload");
unsafe { unsafe {
(mem::transmute::<*mut u8, fn()>(ddr.ptr::<u8>()))(); (mem::transmute::<*mut u8, fn()>(ddr.ptr::<u8>()))();
@ -60,7 +60,5 @@ pub fn main_core0() {
#[no_mangle] #[no_mangle]
pub fn main_core1() { pub fn main_core1() {
unsafe { panic!("core1 started but should not have");
(mem::transmute::<u32, fn()>(0x00100000))();
}
} }