From 0e4fb4cbfe807acb569b0cb92d51c38bbecab51f Mon Sep 17 00:00:00 2001 From: morgan Date: Mon, 29 Jul 2024 17:23:00 +0800 Subject: [PATCH] cxp downconn fw: add QPLL setup --- src/libboard_artiq/src/cxp_downconn.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/libboard_artiq/src/cxp_downconn.rs b/src/libboard_artiq/src/cxp_downconn.rs index 33408b0..41acbd3 100644 --- a/src/libboard_artiq/src/cxp_downconn.rs +++ b/src/libboard_artiq/src/cxp_downconn.rs @@ -36,6 +36,13 @@ pub fn main(timer: &mut GlobalTimer) { [1, 1, 1, 0], ]; + // STEP 1: reset QPLL + csr::cxp::downconn_qpll_reset_write(1); + info!("waiting for QPLL/CPLL to lock..."); + while csr::cxp::downconn_qpll_locked_read() != 1 {} + info!("QPLL locked"); + + // STEP 2: setup tx/rx gtx csr::cxp::downconn_data_0_write(DATA[0][0]); csr::cxp::downconn_data_1_write(DATA[0][1]); csr::cxp::downconn_data_2_write(DATA[0][2]); @@ -50,9 +57,13 @@ pub fn main(timer: &mut GlobalTimer) { csr::cxp::downconn_tx_start_init_write(1); csr::cxp::downconn_rx_start_init_write(1); - info!("waiting for QPLL/CPLL to lock..."); + info!("waiting for tx setup..."); timer.delay_us(50_000); - info!("tx_phaligndone = {} ", csr::cxp::downconn_txinit_phaligndone_read(),); + info!( + "tx_phaligndone = {} | rx_phaligndone = {}", + csr::cxp::downconn_txinit_phaligndone_read(), + csr::cxp::downconn_rxinit_phaligndone_read(), + ); // enable txdata tranmission thought MGTXTXP, required by PMA loopback csr::cxp::downconn_txenable_write(1);