mirror of https://github.com/m-labs/artiq.git
satman: forward RTIO resets
This commit is contained in:
parent
5a9cc004f2
commit
6cf3db3485
|
@ -55,6 +55,7 @@ fn process_aux_packet(_repeaters: &mut [repeater::Repeater],
|
|||
drtioaux::Packet::EchoRequest =>
|
||||
drtioaux::send_link(0, &drtioaux::Packet::EchoReply),
|
||||
drtioaux::Packet::ResetRequest { phy } => {
|
||||
info!("resetting RTIO");
|
||||
if phy {
|
||||
drtiosat_reset_phy(true);
|
||||
drtiosat_reset_phy(false);
|
||||
|
@ -62,6 +63,11 @@ fn process_aux_packet(_repeaters: &mut [repeater::Repeater],
|
|||
drtiosat_reset(true);
|
||||
drtiosat_reset(false);
|
||||
}
|
||||
for rep in _repeaters.iter() {
|
||||
if let Err(e) = rep.rtio_reset(phy) {
|
||||
error!("failed to issue RTIO reset ({})", e);
|
||||
}
|
||||
}
|
||||
drtioaux::send_link(0, &drtioaux::Packet::ResetAck)
|
||||
},
|
||||
|
||||
|
|
|
@ -227,6 +227,20 @@ impl Repeater {
|
|||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn rtio_reset(&self, phy: bool) -> Result<(), &'static str> {
|
||||
if self.state != RepeaterState::Up {
|
||||
return Ok(());
|
||||
}
|
||||
drtioaux::send_link(self.auxno, &drtioaux::Packet::ResetRequest {
|
||||
phy: phy
|
||||
}).unwrap();
|
||||
let reply = self.recv_aux_timeout(200)?;
|
||||
if reply != drtioaux::Packet::ResetAck {
|
||||
return Err("unexpected reply");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(has_drtio_routing))]
|
||||
|
|
Loading…
Reference in New Issue