From 7e6d4e186fd27274a7446ba7dcf9d0facef42caa Mon Sep 17 00:00:00 2001 From: morgan Date: Fri, 23 Aug 2024 12:49:18 +0800 Subject: [PATCH] cxp downconn fw: replace tx/rx rate with DRP --- src/libboard_artiq/src/cxp_downconn.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/libboard_artiq/src/cxp_downconn.rs b/src/libboard_artiq/src/cxp_downconn.rs index df8c283..16ae6b9 100644 --- a/src/libboard_artiq/src/cxp_downconn.rs +++ b/src/libboard_artiq/src/cxp_downconn.rs @@ -172,19 +172,22 @@ pub mod cxp_gtx { CXP_SPEED::CXP_3 | CXP_SPEED::CXP_6 | CXP_SPEED::CXP_12 => 0x0170, // FB_Divider = 100 }; + println!("0x36 = {:#06x}", qpll_read(0x36)); qpll_write(0x36, qpll_div_reg); + println!("0x36 = {:#06x}", qpll_read(0x36)); - let rxout_div = match speed { - CXP_SPEED::CXP_1 => 0b100, // 8 - CXP_SPEED::CXP_2 | CXP_SPEED::CXP_3 => 0b011, // 4 - CXP_SPEED::CXP_5 | CXP_SPEED::CXP_6 => 0b010, // 2 - CXP_SPEED::CXP_10 | CXP_SPEED::CXP_12 => 0b001, // 1 + // DEBUG: remove txoutdiv + let txrxout_div = match speed { + CXP_SPEED::CXP_1 => 0x33, // 8 + CXP_SPEED::CXP_2 | CXP_SPEED::CXP_3 => 0x22, // 4 + CXP_SPEED::CXP_5 | CXP_SPEED::CXP_6 => 0x11, // 2 + CXP_SPEED::CXP_10 | CXP_SPEED::CXP_12 => 0x00, // 1 }; - unsafe { - csr::cxp::downconn_rx_div_write(rxout_div); - csr::cxp::downconn_tx_div_write(rxout_div); - } + // OUT_DIV + println!("0x88 = {:#06x}", gtx_read(0x88)); + gtx_write(0x88, txrxout_div); + println!("0x88 = {:#06x}", gtx_read(0x88)); } fn change_cdr_cfg(speed: CXP_SPEED) {