mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
lan78xx: Read initial EEE status from DT
Add two new DT properties:
* microchip,eee-enabled - a boolean to enable EEE
* microchip,tx-lpi-timer - time in microseconds to wait before entering
low power state
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
This commit is contained in:
@@ -2900,6 +2900,27 @@ static int lan78xx_phy_init(struct lan78xx_net *dev)
|
||||
goto phylink_uninit;
|
||||
}
|
||||
|
||||
if (of_property_read_bool(phydev->mdio.dev.of_node,
|
||||
"microchip,eee-enabled")) {
|
||||
struct ethtool_keee edata;
|
||||
memset(&edata, 0, sizeof(edata));
|
||||
|
||||
linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
|
||||
edata.advertised);
|
||||
linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT,
|
||||
edata.advertised);
|
||||
|
||||
edata.eee_enabled = true;
|
||||
edata.tx_lpi_enabled = true;
|
||||
if (of_property_read_u32(phydev->mdio.dev.of_node,
|
||||
"microchip,tx-lpi-timer",
|
||||
&edata.tx_lpi_timer))
|
||||
edata.tx_lpi_timer = 600; /* non-aggressive */
|
||||
(void)lan78xx_set_eee(dev->net, &edata);
|
||||
|
||||
phy_support_eee(phydev);
|
||||
}
|
||||
|
||||
ret = lan78xx_configure_leds_from_dt(dev, phydev);
|
||||
if (ret < 0)
|
||||
goto phylink_uninit;
|
||||
|
||||
Reference in New Issue
Block a user