forked from M-Labs/artiq-zynq
runtime: added drtio init function
This commit is contained in:
parent
589c4bebe4
commit
da366b7a0d
|
@ -89,6 +89,19 @@ fn init_rtio(timer: &mut GlobalTimer, cfg: &Config) {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(has_drtio)]
|
||||
fn init_drtio(timer: &mut GlobalTimer)
|
||||
{
|
||||
unsafe {
|
||||
csr::drtio_transceiver::stable_clkin_write(1);
|
||||
}
|
||||
timer.delay_ms(2); // wait for CPLL/QPLL lock
|
||||
unsafe {
|
||||
csr::drtio_transceiver::txenable_write(0xffffffffu32 as _);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fn wait_for_async_rtio_error() -> nb::Result<(), Void> {
|
||||
unsafe {
|
||||
if pl::csr::rtio_core::async_error_read() != 0 {
|
||||
|
@ -177,7 +190,9 @@ pub fn main_core0() {
|
|||
let up_destinations = [false; drtio_routing::DEST_COUNT];
|
||||
#[cfg(has_drtio_routing)]
|
||||
drtio_routing::interconnect_disable_all();
|
||||
|
||||
#[cfg(has_drtio)]
|
||||
init_drtio(&mut timer);
|
||||
|
||||
init_rtio(&mut timer, &cfg);
|
||||
task::spawn(report_async_rtio_errors());
|
||||
|
||||
|
|
Loading…
Reference in New Issue