diff --git a/artiq/firmware/libproto_artiq/drtioaux_proto.rs b/artiq/firmware/libproto_artiq/drtioaux_proto.rs index 3d526734d..64e279614 100644 --- a/artiq/firmware/libproto_artiq/drtioaux_proto.rs +++ b/artiq/firmware/libproto_artiq/drtioaux_proto.rs @@ -18,7 +18,7 @@ impl From> for Error { pub enum Packet { EchoRequest, EchoReply, - ResetRequest { phy: bool }, + ResetRequest, ResetAck, TSCAck, @@ -62,9 +62,7 @@ impl Packet { Ok(match reader.read_u8()? { 0x00 => Packet::EchoRequest, 0x01 => Packet::EchoReply, - 0x02 => Packet::ResetRequest { - phy: reader.read_bool()? - }, + 0x02 => Packet::ResetRequest, 0x03 => Packet::ResetAck, 0x04 => Packet::TSCAck, @@ -192,10 +190,8 @@ impl Packet { writer.write_u8(0x00)?, Packet::EchoReply => writer.write_u8(0x01)?, - Packet::ResetRequest { phy } => { - writer.write_u8(0x02)?; - writer.write_bool(phy)?; - }, + Packet::ResetRequest => + writer.write_u8(0x02)?, Packet::ResetAck => writer.write_u8(0x03)?, Packet::TSCAck => diff --git a/artiq/firmware/runtime/rtio_mgt.rs b/artiq/firmware/runtime/rtio_mgt.rs index cedfb8686..726edc886 100644 --- a/artiq/firmware/runtime/rtio_mgt.rs +++ b/artiq/firmware/runtime/rtio_mgt.rs @@ -334,7 +334,7 @@ pub mod drtio { let linkno = linkno as u8; if link_rx_up(linkno) { let reply = aux_transact(io, aux_mutex, linkno, - &drtioaux::Packet::ResetRequest { phy: false }); + &drtioaux::Packet::ResetRequest); match reply { Ok(drtioaux::Packet::ResetAck) => (), Ok(_) => error!("[LINK#{}] reset failed, received unexpected aux packet", linkno), @@ -419,7 +419,7 @@ pub fn startup(io: &Io, aux_mutex: &Mutex, } } unsafe { - csr::rtio_core::reset_phy_write(1); + csr::rtio_core::reset_phy_write(1); } drtio::startup(io, aux_mutex, routing_table, up_destinations); diff --git a/artiq/firmware/satman/main.rs b/artiq/firmware/satman/main.rs index bc12bccfd..22fb5cd75 100644 --- a/artiq/firmware/satman/main.rs +++ b/artiq/firmware/satman/main.rs @@ -75,18 +75,13 @@ fn process_aux_packet(_repeaters: &mut [repeater::Repeater], match packet { drtioaux::Packet::EchoRequest => drtioaux::send(0, &drtioaux::Packet::EchoReply), - drtioaux::Packet::ResetRequest { phy } => { + drtioaux::Packet::ResetRequest => { info!("resetting RTIO"); - if phy { - drtiosat_reset_phy(true); - drtiosat_reset_phy(false); - } else { - drtiosat_reset(true); - clock::spin_us(100); - drtiosat_reset(false); - } + drtiosat_reset(true); + clock::spin_us(100); + drtiosat_reset(false); for rep in _repeaters.iter() { - if let Err(e) = rep.rtio_reset(phy) { + if let Err(e) = rep.rtio_reset() { error!("failed to issue RTIO reset ({})", e); } } diff --git a/artiq/firmware/satman/repeater.rs b/artiq/firmware/satman/repeater.rs index ca0531ac5..f51d413aa 100644 --- a/artiq/firmware/satman/repeater.rs +++ b/artiq/firmware/satman/repeater.rs @@ -242,21 +242,17 @@ impl Repeater { Ok(()) } - pub fn rtio_reset(&self, phy: bool) -> Result<(), drtioaux::Error> { + pub fn rtio_reset(&self) -> Result<(), drtioaux::Error> { let repno = self.repno as usize; - if !phy { - unsafe { (csr::DRTIOREP[repno].reset_write)(1); } - clock::spin_us(100); - unsafe { (csr::DRTIOREP[repno].reset_write)(0); } - } + unsafe { (csr::DRTIOREP[repno].reset_write)(1); } + clock::spin_us(100); + unsafe { (csr::DRTIOREP[repno].reset_write)(0); } if self.state != RepeaterState::Up { return Ok(()); } - drtioaux::send(self.auxno, &drtioaux::Packet::ResetRequest { - phy: phy - }).unwrap(); + drtioaux::send(self.auxno, &drtioaux::Packet::ResetRequest).unwrap(); let reply = self.recv_aux_timeout(200)?; if reply != drtioaux::Packet::ResetAck { return Err(drtioaux::Error::UnexpectedReply); @@ -278,5 +274,5 @@ impl Repeater { pub fn sync_tsc(&self) -> Result<(), drtioaux::Error> { Ok(()) } - pub fn rtio_reset(&self, _phy: bool) -> Result<(), drtioaux::Error> { Ok(()) } + pub fn rtio_reset(&self) -> Result<(), drtioaux::Error> { Ok(()) } }