Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8ebfed3 authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller
Browse files

net: phy: bcm7xxx: utilize PHY revision in config_init



Now that the GENET and SF2 drivers have been updated to communicate us
what is the revision of the BCM7xxx integrated PHY, utilize that
information in the config_init() callback to call into the appropriate
workaround function based on our revision.

While at it, we also print the revision and patch level to help debug
new chips.

Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aa9aef77
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -196,13 +196,22 @@ static int bcm7xxx_eee_enable(struct phy_device *phydev)

static int bcm7xxx_28nm_config_init(struct phy_device *phydev)
{
	int ret;
	u8 rev = PHY_BRCM_7XXX_REV(phydev->dev_flags);
	u8 patch = PHY_BRCM_7XXX_PATCH(phydev->dev_flags);
	int ret = 0;

	ret = bcm7445_config_init(phydev);
	if (ret)
		return ret;
	dev_info(&phydev->dev, "PHY revision: 0x%02x, patch: %d\n", rev, patch);

	switch (rev) {
	case 0xa0:
	case 0xb0:
		ret = bcm7445_config_init(phydev);
		break;
	default:
		ret = bcm7xxx_28nm_afe_config_init(phydev);
		break;
	}

	if (ret)
		return ret;