libboard/serwb: retry serwb initialization on error

This commit is contained in:
Florent Kermarrec 2017-12-01 22:45:05 +01:00
parent 2e5b20d53d
commit 0eb9f93611
1 changed files with 6 additions and 1 deletions

View File

@ -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.");