@@ -1642,7 +1642,6 @@ static int tn40_priv_init(struct tn40_priv *priv)
/* Set GPIO[9:0] to output 0 */
tn40_write_reg(priv, 0x51E0, 0x30010006); /* GPIO_OE_ WR CMD */
tn40_write_reg(priv, 0x51F0, 0x0); /* GPIO_OE_ DATA */
- tn40_write_reg(priv, TN40_REG_MDIO_CMD_STAT, 0x3ec8);
/* we use tx descriptors to load a firmware. */
ret = tn40_create_tx_ring(priv);
@@ -185,14 +185,13 @@ int tn40_mdiobus_init(struct tn40_priv *priv)
ret);
}
- tn40_mdio_set_speed(priv, TN40_MDIO_SPEED_1MHZ);
+ tn40_mdio_set_speed(priv, TN40_MDIO_SPEED_6MHZ);
ret = devm_mdiobus_register(&pdev->dev, bus);
if (ret) {
dev_err(&pdev->dev, "failed to register mdiobus %d %u %u\n",
ret, bus->state, MDIOBUS_UNREGISTERED);
goto err_swnodes_unregister;
}
- tn40_mdio_set_speed(priv, TN40_MDIO_SPEED_6MHZ);
priv->mdio = bus;
return 0;
Optimize MDIO speed settings. The PHYs of all currently supported TN4010 cards support 6 MHz operation. Therefore select 6 MHz already before devm_mdiobus_register, which also saves another call to tn40_mdio_set_speed afterwards. As a nice side effect, the loading of the firmware for the AQR105 PHY is then reduced from 30 s to 5 s. Remove the write to TN40_REG_MDIO_CMD_STAT in tn40_priv_init, which is equivalent to tn40_mdio_set_speed to 1 Mhz and therefore would revert the 6 MHz speedup of the MDIO communication. Signed-off-by: Hans-Frieder Vogt <hfdevel@gmx.net> --- drivers/net/ethernet/tehuti/tn40.c | 1 - drivers/net/ethernet/tehuti/tn40_mdio.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) -- 2.45.2