From 0eb9f93611f3fefb61d297c1e3fc1a288173ddae Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Fri, 1 Dec 2017 22:45:05 +0100 Subject: [PATCH] libboard/serwb: retry serwb initialization on error --- artiq/firmware/libboard/serwb.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/artiq/firmware/libboard/serwb.rs b/artiq/firmware/libboard/serwb.rs index 87ad639e1..118320241 100644 --- a/artiq/firmware/libboard/serwb.rs +++ b/artiq/firmware/libboard/serwb.rs @@ -4,7 +4,12 @@ pub fn wait_init() { info!("waiting for AMC/RTM serwb bridge to be ready..."); unsafe { csr::serwb_phy_amc::control_reset_write(1); - while csr::serwb_phy_amc::control_ready_read() == 0 {} + while csr::serwb_phy_amc::control_ready_read() == 0 { + if csr::serwb_phy_amc::control_error_read() == 1 { + info!("retry serwb initialization..."); + csr::serwb_phy_amc::control_reset_write(1); + } + } } info!("done.");