From 198985cd6d0f1a6bba670a66f757a3bf4b9265b8 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 4 May 2020 22:27:15 +0800 Subject: [PATCH] runtime: check PL DONE --- src/Cargo.lock | 14 +++++++------- src/runtime/src/main.rs | 13 +++++++++++-- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/Cargo.lock b/src/Cargo.lock index 0130b8e..ecaef5a 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -153,7 +153,7 @@ dependencies = [ [[package]] name = "libasync" version = "0.0.0" -source = "git+https://git.m-labs.hk/M-Labs/zc706.git#27094da9ff66881eff3367c25e358ccf79ebaa93" +source = "git+https://git.m-labs.hk/M-Labs/zc706.git#ce844f1b026b15f77432de0e24942ff220add283" dependencies = [ "embedded-hal", "libcortex_a9", @@ -165,7 +165,7 @@ dependencies = [ [[package]] name = "libboard_zynq" version = "0.0.0" -source = "git+https://git.m-labs.hk/M-Labs/zc706.git#27094da9ff66881eff3367c25e358ccf79ebaa93" +source = "git+https://git.m-labs.hk/M-Labs/zc706.git#ce844f1b026b15f77432de0e24942ff220add283" dependencies = [ "bit_field", "embedded-hal", @@ -181,7 +181,7 @@ dependencies = [ [[package]] name = "libcortex_a9" version = "0.0.0" -source = "git+https://git.m-labs.hk/M-Labs/zc706.git#27094da9ff66881eff3367c25e358ccf79ebaa93" +source = "git+https://git.m-labs.hk/M-Labs/zc706.git#ce844f1b026b15f77432de0e24942ff220add283" dependencies = [ "bit_field", "libregister", @@ -190,7 +190,7 @@ dependencies = [ [[package]] name = "libregister" version = "0.0.0" -source = "git+https://git.m-labs.hk/M-Labs/zc706.git#27094da9ff66881eff3367c25e358ccf79ebaa93" +source = "git+https://git.m-labs.hk/M-Labs/zc706.git#ce844f1b026b15f77432de0e24942ff220add283" dependencies = [ "bit_field", "vcell", @@ -200,7 +200,7 @@ dependencies = [ [[package]] name = "libsupport_zynq" version = "0.0.0" -source = "git+https://git.m-labs.hk/M-Labs/zc706.git#27094da9ff66881eff3367c25e358ccf79ebaa93" +source = "git+https://git.m-labs.hk/M-Labs/zc706.git#ce844f1b026b15f77432de0e24942ff220add283" dependencies = [ "compiler_builtins", "libboard_zynq", @@ -212,9 +212,9 @@ dependencies = [ [[package]] name = "linked_list_allocator" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6b60501dd4c850950bb43f970d544f6ce04e0ca021da2db2538fbe9d923f19e" +checksum = "e70e46c13c0e8374c26cec5752e3347ca1087d9711de8f45aa513a7700efd73d" [[package]] name = "log" diff --git a/src/runtime/src/main.rs b/src/runtime/src/main.rs index 1f163a2..1f725b4 100644 --- a/src/runtime/src/main.rs +++ b/src/runtime/src/main.rs @@ -8,7 +8,7 @@ extern crate log; use core::{cmp, str}; use log::info; -use libboard_zynq::{logger, timer::GlobalTimer}; +use libboard_zynq::{timer::GlobalTimer, logger, devc}; use libsupport_zynq::ram; mod proto; @@ -41,7 +41,16 @@ pub fn main_core0() { ram::init_alloc_linker(); - info!("Detected gateware: {}", identifier_read(&mut [0; 64])); + let devc = devc::DevC::new(); + if devc.is_done() { + info!("gateware already loaded"); + // Do not load again: assume that the gateware already present + // (e.g. configured via JTAG before PS startup) is what we want. + } else { + info!("loading gateware"); + unimplemented!("gateware loading"); + } + info!("detected gateware: {}", identifier_read(&mut [0; 64])); unsafe { pl::csr::rtio_core::reset_phy_write(1);