forked from M-Labs/artiq-zynq
retry RTIO PLL lock
This commit is contained in:
parent
0ce45b145e
commit
26874030fc
@ -112,22 +112,21 @@ fn init_rtio(timer: &mut GlobalTimer, cfg: &config::Config) {
|
|||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
unsafe {
|
loop {
|
||||||
pl::csr::rtio_crg::pll_reset_write(1);
|
unsafe {
|
||||||
pl::csr::rtio_crg::clock_sel_write(clock_sel);
|
pl::csr::rtio_crg::pll_reset_write(1);
|
||||||
}
|
pl::csr::rtio_crg::clock_sel_write(clock_sel);
|
||||||
|
pl::csr::rtio_crg::pll_reset_write(0);
|
||||||
timer.delay_ms(2);
|
}
|
||||||
|
timer.delay_ms(1);
|
||||||
unsafe {
|
let locked = unsafe { pl::csr::rtio_crg::pll_locked_read() != 0 };
|
||||||
pl::csr::rtio_crg::pll_reset_write(0);
|
if locked {
|
||||||
}
|
info!("RTIO PLL locked");
|
||||||
|
break;
|
||||||
timer.delay_ms(2);
|
} else {
|
||||||
|
warn!("RTIO PLL failed to lock, retrying...");
|
||||||
let locked = unsafe { pl::csr::rtio_crg::pll_locked_read() != 0 };
|
timer.delay_ms(500);
|
||||||
if !locked {
|
}
|
||||||
panic!("RTIO PLL failed to lock");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
|
Loading…
Reference in New Issue
Block a user