ARTIQ Zynq-based core device support
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.5 KiB

#![recursion_limit="1024"] // for futures_util::select!
extern crate alloc;
extern crate log;
use core::{cmp, str};
use log::info;
use libboard_zynq::{timer::GlobalTimer, logger, devc};
use libsupport_zynq::ram;
mod proto;
mod comms;
#[path = "../../../build/"]
mod pl;
mod rtio;
mod kernel;
mod moninj;
fn identifier_read(buf: &mut [u8]) -> &str {
unsafe {
let len = pl::csr::identifier::data_read();
let len = cmp::min(len, buf.len() as u8);
for i in 0..len {
pl::csr::identifier::address_write(1 + i);
buf[i as usize] = pl::csr::identifier::data_read();
str::from_utf8_unchecked(&buf[..len as usize])
pub fn main_core0() {
let timer = GlobalTimer::start();
let _ = logger::init();
info!("NAR3/Zynq7000 starting...");
let devc = devc::DevC::new();
if devc.is_done() {
info!("gateware already loaded");
// Do not load again: assume that the gateware already present is
// what we want (e.g. gateware configured via JTAG before PS
// startup, or by FSBL).
} else {
info!("loading gateware");
unimplemented!("gateware loading");
info!("detected gateware: {}", identifier_read(&mut [0; 64]));
unsafe {