From a93fdb8c9d0a3f5c31bee776d50057d97d681541 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 4 Jan 2019 23:38:00 +0800 Subject: [PATCH] drtio: disable all destinations in gateware at startup Otherwise, kernels fail to get a RTIODestinationUnreachable exception when attempting to reach a DRTIO destination that has never been up. --- artiq/firmware/libboard_artiq/drtio_routing.rs | 7 +++++++ artiq/firmware/runtime/main.rs | 2 ++ 2 files changed, 9 insertions(+) diff --git a/artiq/firmware/libboard_artiq/drtio_routing.rs b/artiq/firmware/libboard_artiq/drtio_routing.rs index 562517342..8e6c526fb 100644 --- a/artiq/firmware/libboard_artiq/drtio_routing.rs +++ b/artiq/firmware/libboard_artiq/drtio_routing.rs @@ -97,3 +97,10 @@ pub fn interconnect_enable_all(routing_table: &RoutingTable, rank: u8) { interconnect_enable(routing_table, rank, i as u8); } } + +#[cfg(has_drtio_routing)] +pub fn interconnect_disable_all() { + for i in 0..DEST_COUNT { + interconnect_disable(i as u8); + } +} diff --git a/artiq/firmware/runtime/main.rs b/artiq/firmware/runtime/main.rs index cbaeb1e26..c905d5df4 100644 --- a/artiq/firmware/runtime/main.rs +++ b/artiq/firmware/runtime/main.rs @@ -289,6 +289,8 @@ fn startup_ethernet() { drtio_routing::RoutingTable::default_empty())); let up_destinations = urc::Urc::new(RefCell::new( [false; drtio_routing::DEST_COUNT])); + #[cfg(has_drtio_routing)] + drtio_routing::interconnect_disable_all(); let aux_mutex = sched::Mutex::new(); let mut scheduler = sched::Scheduler::new();