diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2014-09-19 16:07:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-19 16:27:07 -0400 |
commit | d8ebfed3f11b62ebc192af3cab64d835ff047e74 (patch) | |
tree | 76f44de1599ba25217e24f3905732010260e0df2 /drivers/net/phy/bcm7xxx.c | |
parent | aa9aef77c76113725d9dbf124c4dab414326b0a3 (diff) |
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: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/bcm7xxx.c')
-rw-r--r-- | drivers/net/phy/bcm7xxx.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c index be3a591aabba..daae69950925 100644 --- a/drivers/net/phy/bcm7xxx.c +++ b/drivers/net/phy/bcm7xxx.c | |||
@@ -196,13 +196,22 @@ static int bcm7xxx_eee_enable(struct phy_device *phydev) | |||
196 | 196 | ||
197 | static int bcm7xxx_28nm_config_init(struct phy_device *phydev) | 197 | static int bcm7xxx_28nm_config_init(struct phy_device *phydev) |
198 | { | 198 | { |
199 | int ret; | 199 | u8 rev = PHY_BRCM_7XXX_REV(phydev->dev_flags); |
200 | 200 | u8 patch = PHY_BRCM_7XXX_PATCH(phydev->dev_flags); | |
201 | ret = bcm7445_config_init(phydev); | 201 | int ret = 0; |
202 | if (ret) | 202 | |
203 | return ret; | 203 | dev_info(&phydev->dev, "PHY revision: 0x%02x, patch: %d\n", rev, patch); |
204 | |||
205 | switch (rev) { | ||
206 | case 0xa0: | ||
207 | case 0xb0: | ||
208 | ret = bcm7445_config_init(phydev); | ||
209 | break; | ||
210 | default: | ||
211 | ret = bcm7xxx_28nm_afe_config_init(phydev); | ||
212 | break; | ||
213 | } | ||
204 | 214 | ||
205 | ret = bcm7xxx_28nm_afe_config_init(phydev); | ||
206 | if (ret) | 215 | if (ret) |
207 | return ret; | 216 | return ret; |
208 | 217 | ||