1
0
Fork 0

cxp downconn fw: replace tx/rx rate with DRP

This commit is contained in:
morgan 2024-08-23 12:49:18 +08:00
parent 7631907d76
commit 7e6d4e186f
1 changed files with 12 additions and 9 deletions

View File

@ -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) {