Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: lan743x: fix SGMII detection on PCI1xxxx B0+ during warm reset

A warm reset on boards using an EEPROM-only strap configuration (where
no MAC address is set in the image) can cause the driver to incorrectly
revert to RGMII mode. This occurs because the ENET_CONFIG_LOAD_STARTED
bit may not persist or behave as expected.

Update pci11x1x_strap_get_status() to use revision-specific validation:

- For PCI11x1x A0: Continue using the legacy check (config load started
or reset protection) to validate the SGMII strap.
- For PCI11x1x B0 and later: Use the newly available
STRAP_READ_USE_SGMII_EN_ bit in the upper strap register to validate
the lower SGMII_EN bit.

This ensures the SGMII interface is correctly identified even after a
warm reboot.

Signed-off-by: Thangaraj Samynathan <thangaraj.s@microchip.com>
Link: https://patch.msgid.link/20260318063228.17110-1-thangaraj.s@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Thangaraj Samynathan and committed by
Jakub Kicinski
e783e40f 64cf4b95

+12 -4
+11 -4
drivers/net/ethernet/microchip/lan743x_main.c
··· 28 28 29 29 #define RFE_RD_FIFO_TH_3_DWORDS 0x3 30 30 31 + static bool pci11x1x_is_a0(struct lan743x_adapter *adapter) 32 + { 33 + u32 dev_rev = adapter->csr.id_rev & ID_REV_CHIP_REV_MASK_; 34 + return dev_rev == ID_REV_CHIP_REV_PCI11X1X_A0_; 35 + } 36 + 31 37 static void pci11x1x_strap_get_status(struct lan743x_adapter *adapter) 32 38 { 33 39 u32 chip_rev; ··· 53 47 cfg_load = lan743x_csr_read(adapter, ETH_SYS_CONFIG_LOAD_STARTED_REG); 54 48 lan743x_hs_syslock_release(adapter); 55 49 hw_cfg = lan743x_csr_read(adapter, HW_CFG); 56 - 57 - if (cfg_load & GEN_SYS_LOAD_STARTED_REG_ETH_ || 58 - hw_cfg & HW_CFG_RST_PROTECT_) { 59 - strap = lan743x_csr_read(adapter, STRAP_READ); 50 + strap = lan743x_csr_read(adapter, STRAP_READ); 51 + if ((pci11x1x_is_a0(adapter) && 52 + (cfg_load & GEN_SYS_LOAD_STARTED_REG_ETH_ || 53 + hw_cfg & HW_CFG_RST_PROTECT_)) || 54 + (strap & STRAP_READ_USE_SGMII_EN_)) { 60 55 if (strap & STRAP_READ_SGMII_EN_) 61 56 adapter->is_sgmii_en = true; 62 57 else
+1
drivers/net/ethernet/microchip/lan743x_main.h
··· 27 27 #define ID_REV_CHIP_REV_MASK_ (0x0000FFFF) 28 28 #define ID_REV_CHIP_REV_A0_ (0x00000000) 29 29 #define ID_REV_CHIP_REV_B0_ (0x00000010) 30 + #define ID_REV_CHIP_REV_PCI11X1X_A0_ (0x000000A0) 30 31 #define ID_REV_CHIP_REV_PCI11X1X_B0_ (0x000000B0) 31 32 32 33 #define FPGA_REV (0x04)