Skip to content

Commit e69647a

Browse files
Raghuram Chary Jdavem330
authored andcommitted
lan78xx: Set ASD in MAC_CR when EEE is enabled.
Description: EEE does not work with lan7800 when AutoSpeed is not set. (This can happen when EEPROM is not populated or configured incorrectly) Root-Cause: When EEE is enabled, the mac config register ASD is not set i.e. in default state, causing EEE fail. Fix: Set the register when eeprom is not present. Fixes: 55d7de9 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver") Signed-off-by: Raghuram Chary J <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent bc58a1b commit e69647a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/net/usb/lan78xx.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,6 +2351,7 @@ static int lan78xx_reset(struct lan78xx_net *dev)
23512351
u32 buf;
23522352
int ret = 0;
23532353
unsigned long timeout;
2354+
u8 sig;
23542355

23552356
ret = lan78xx_read_reg(dev, HW_CFG, &buf);
23562357
buf |= HW_CFG_LRST_;
@@ -2450,6 +2451,15 @@ static int lan78xx_reset(struct lan78xx_net *dev)
24502451
/* LAN7801 only has RGMII mode */
24512452
if (dev->chipid == ID_REV_CHIP_ID_7801_)
24522453
buf &= ~MAC_CR_GMII_EN_;
2454+
2455+
if (dev->chipid == ID_REV_CHIP_ID_7800_) {
2456+
ret = lan78xx_read_raw_eeprom(dev, 0, 1, &sig);
2457+
if (!ret && sig != EEPROM_INDICATOR) {
2458+
/* Implies there is no external eeprom. Set mac speed */
2459+
netdev_info(dev->net, "No External EEPROM. Setting MAC Speed\n");
2460+
buf |= MAC_CR_AUTO_DUPLEX_ | MAC_CR_AUTO_SPEED_;
2461+
}
2462+
}
24532463
ret = lan78xx_write_reg(dev, MAC_CR, buf);
24542464

24552465
ret = lan78xx_read_reg(dev, MAC_TX, &buf);

0 commit comments

Comments
 (0)