Skip to content

Commit

Permalink
net: phy: micrel: use generic config_init for KSZ8021/KSZ8031
Browse files Browse the repository at this point in the history
Use generic config_init callback also for KSZ8021 and KSZ8031.

This has been avoided this far due to commit b838b4a ("phy/micrel:
KSZ8031RNL RMII clock reconfiguration bug"), which claims that the PHY
becomes unresponsive if the broadcast-disable flag is set before
configuring the clock mode.

Turns out that the problem seemingly worked-around by the above
mentioned commit was really due to a hardware-configuration issue, where
the PHY was in fact strapped to address 3 rather than 0.

Tested-by: Bruno Thomsen <bth@kamstrup.dk>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Johan Hovold authored and David S. Miller committed Dec 26, 2014
1 parent 2c26d34 commit d0e1df9
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions drivers/net/phy/micrel.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ struct kszphy_priv {

static const struct kszphy_type ksz8021_type = {
.led_mode_reg = MII_KSZPHY_CTRL_2,
.has_broadcast_disable = true,
.has_rmii_ref_clk_sel = true,
};

Expand Down Expand Up @@ -258,19 +259,6 @@ static int kszphy_config_init(struct phy_device *phydev)
return 0;
}

static int ksz8021_config_init(struct phy_device *phydev)
{
int rc;

rc = kszphy_config_init(phydev);
if (rc)
return rc;

rc = kszphy_broadcast_disable(phydev);

return rc < 0 ? rc : 0;
}

static int ksz9021_load_values_from_of(struct phy_device *phydev,
struct device_node *of_node, u16 reg,
char *field1, char *field2,
Expand Down Expand Up @@ -584,7 +572,7 @@ static struct phy_driver ksphy_driver[] = {
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.driver_data = &ksz8021_type,
.probe = kszphy_probe,
.config_init = ksz8021_config_init,
.config_init = kszphy_config_init,
.config_aneg = genphy_config_aneg,
.read_status = genphy_read_status,
.ack_interrupt = kszphy_ack_interrupt,
Expand All @@ -601,7 +589,7 @@ static struct phy_driver ksphy_driver[] = {
.flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
.driver_data = &ksz8021_type,
.probe = kszphy_probe,
.config_init = ksz8021_config_init,
.config_init = kszphy_config_init,
.config_aneg = genphy_config_aneg,
.read_status = genphy_read_status,
.ack_interrupt = kszphy_ack_interrupt,
Expand Down

0 comments on commit d0e1df9

Please sign in to comment.