From 8c3c3293fae32931ba9383752947e8cebbdb8fac Mon Sep 17 00:00:00 2001 From: Stepan Friedl Date: Tue, 14 Jan 2025 15:59:17 +0100 Subject: [PATCH 1/3] fix(mgmt): fix setting the 100GBASE-SR4 mode in the ethernet mgmt --- comp/nic/eth_phy/comp/mgmt/mgmt.vhd | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/comp/nic/eth_phy/comp/mgmt/mgmt.vhd b/comp/nic/eth_phy/comp/mgmt/mgmt.vhd index aec5c988c..66a37991d 100644 --- a/comp/nic/eth_phy/comp/mgmt/mgmt.vhd +++ b/comp/nic/eth_phy/comp/mgmt/mgmt.vhd @@ -1243,7 +1243,7 @@ begin pma_mode_set(6 downto 3) <= "0101"; pma_mode_set(2 downto 0) <= pma_mode(2 downto 0); -- Do not change the PMA mode by default if pm_req(2) = '1' then -- 100GBASE modes with RS-FEC - if RSFEC_ABLE = '1' and fec_en_r = '1' then + if RSFEC_ABLE = '1' then pma_mode_set(2 downto 0) <= pm_req; end if; elsif pm_req(1) = '1' then @@ -1417,7 +1417,12 @@ begin when "00011" => -- r1.7: PMA control 2 & devices in package (high word) if (MI_BE(2) = '1') then pma_mode <= pma_mode_set; - fec_en_r <= MI_DWR(18); + -- 100GBASE-SR4/CR4/KR4/KP4 mode requested -> enable the RS-FEC + if pma_mode_set(6 downto 2) = "01011" then + fec_en_r <= '1'; + else + fec_en_r <= '0'; + end if; end if; when "00100" => -- PMA transmit disable if (MI_BE(2) = '1') then From 90c40af5871fa20746b56c2fa2af1e7a939015f1 Mon Sep 17 00:00:00 2001 From: Stepan Friedl Date: Thu, 16 Jan 2025 11:01:17 +0100 Subject: [PATCH 2/3] fix(mgmt): add optional PMA_TX_FAULT input --- comp/nic/eth_phy/comp/mgmt/mgmt.vhd | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/comp/nic/eth_phy/comp/mgmt/mgmt.vhd b/comp/nic/eth_phy/comp/mgmt/mgmt.vhd index 66a37991d..91c95a9cf 100644 --- a/comp/nic/eth_phy/comp/mgmt/mgmt.vhd +++ b/comp/nic/eth_phy/comp/mgmt/mgmt.vhd @@ -181,6 +181,7 @@ entity mgmt is -- PMA RX link ok PMA_RX_OK : in std_logic_vector(PMA_LANES-1 downto 0); PMD_SIG_DET : in std_logic_vector(PMA_LANES-1 downto 0); + PMA_TX_FAULT : in std_logic := '0'; -- TX driver precursor for preemphasis control PMA_PRECURSOR : out std_logic_vector(31 downto 0); -- TX driver postcursor for preemphasis control @@ -439,6 +440,18 @@ port map( BDATAOUT => pcs_rxl_stat ); +CROSS_TXFAULT: entity work.ASYNC_OPEN_LOOP +generic map(IN_REG => false, TWO_REG => true) +port map( + ACLK => '0', + ARST => '0', + ADATAIN => PMA_TX_FAULT, + -- + BCLK => MI_CLK, + BRST => '0', + BDATAOUT => tx_fault +); + GEN_BER_CROSS: for i in 0 to BER_COUNT'high generate CROSS_BERCOUNT: entity work.ASYNC_OPEN_LOOP generic map(IN_REG => false, TWO_REG => true) @@ -746,7 +759,6 @@ rx_sig_det(PMD_SIG_DET'high downto 0) <= sync_pmd_sig_det; pma_rxl_stat <= AND_REDUCE(sync_pma_rx_ok); rx_sig_det_g <= AND_REDUCE(sync_pmd_sig_det); pma_fault <= tx_fault or rx_fault; -tx_fault <= '0'; rx_fault <= (not pma_rxl_stat) or (not rx_sig_det_g); UNUSED_FLAGS: if NUM_LANES < 20 generate From 55163c123d596cc3330cb5f19866b3f6c869e2ca Mon Sep 17 00:00:00 2001 From: Stepan Friedl Date: Thu, 16 Jan 2025 11:05:03 +0100 Subject: [PATCH 3/3] fix(mgmt): fix PMA status 2 register (RX fault flag) + code cleanup --- comp/nic/eth_phy/comp/mgmt/mgmt.vhd | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/comp/nic/eth_phy/comp/mgmt/mgmt.vhd b/comp/nic/eth_phy/comp/mgmt/mgmt.vhd index 91c95a9cf..225af476f 100644 --- a/comp/nic/eth_phy/comp/mgmt/mgmt.vhd +++ b/comp/nic/eth_phy/comp/mgmt/mgmt.vhd @@ -821,15 +821,18 @@ begin mi_drd_i(16+15 downto 16+7) <= "000000000"; -- r1.7.15:7 mi_drd_i(16+ 6 downto 16+0) <= pma_mode; -- r1.7.6:0 when "0000100" => -- PMA transmit disable & status 2 -- 0x...C - mi_drd_i(15 downto 0) <= "1011" & tx_fault & rx_fault & "0100000001"; -- Status 2 - r1.8 - if SPEED_CAP_10G = '1' then - -- Add 10G abilities: -SR, -LR, -ER - mi_drd_i(7 downto 5) <= "111"; - else - -- Other speeds -> enable extended abilities in r1.11 - mi_drd_i(9) <= '1'; - end if; - mi_drd_i(31 downto 16) <= "00000" & tx_dis & tx_dis_g; -- PMD transmit disable - r1.9 + -- Status 2 - r1.8 + mi_drd_i(15 downto 14) <= "10"; -- Device present + mi_drd_i(13 downto 12) <= "11"; -- Transmit and receive fault ability + mi_drd_i(11) <= tx_fault; + mi_drd_i(10) <= rx_fault; + mi_drd_i(9) <= not SPEED_CAP_10G; -- Extended abilities in 1.11 (for speed above 10G) + mi_drd_i(8) <= '0'; -- TX disable ability + mi_drd_i(7 downto 5) <= (others => SPEED_CAP_10G); -- 10GBASE-SR+LR+ER abilities + mi_drd_i(4 downto 1) <= (others => '0'); -- 10GBASE-LX4/SW/LW/EW abilities + mi_drd_i(0) <= '1'; -- PMA local loopback ability + -- PMD transmit disable - r1.9 + mi_drd_i(31 downto 16) <= "00000" & tx_dis & tx_dis_g; when "0000101" => -- PMA/PMD extended ability registers & receive signal detect mi_drd_i(15 downto 0) <= "00000" & rx_sig_det & rx_sig_det_g; -- Receive signal detect r1.10 mi_drd_i(31 downto 16) <= "0000000000000000"; -- Extended ability register r1.11