satman: wait for FCLK, check clk switch

This commit is contained in:
mwojcik 2023-02-14 11:54:47 +08:00
parent e86923b51d
commit 39c9ef2940

View File

@ -441,6 +441,7 @@ pub extern fn main_core0() -> i32 {
log::set_max_level(log::LevelFilter::Info); log::set_max_level(log::LevelFilter::Info);
init_gateware(); init_gateware();
timer.delay_us(500); // wait for FCLK to reset and PLL to lock
info!("ARTIQ satellite manager starting..."); info!("ARTIQ satellite manager starting...");
info!("gateware ident {}", identifier_read(&mut [0; 64])); info!("gateware ident {}", identifier_read(&mut [0; 64]));
@ -458,6 +459,13 @@ pub extern fn main_core0() -> i32 {
csr::drtio_transceiver::stable_clkin_write(1); csr::drtio_transceiver::stable_clkin_write(1);
} }
timer.delay_us(20_000); // wait for CPLL/QPLL/MMCM lock timer.delay_us(20_000); // wait for CPLL/QPLL/MMCM lock
let clk = unsafe { csr::sys_crg::current_clock_read() };
if clk == 1 {
info!("SYS CLK switched successfully");
}
else {
error!("SYS CLK did not switch");
}
unsafe { unsafe {
csr::drtio_transceiver::txenable_write(0xffffffffu32 as _); csr::drtio_transceiver::txenable_write(0xffffffffu32 as _);