diff options
author | David S. Miller <davem@davemloft.net> | 2014-08-16 22:15:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-16 22:15:21 -0400 |
commit | ed607b82cad5bc72957b4c8c4b35670950c3b0de (patch) | |
tree | f30ecee25e4f64fa837c827154ab15095ec3785c | |
parent | c9d26423e56ce1ab4d786f92aebecf859d419293 (diff) | |
parent | 82c084f56a01160afa39d4b6899b66c7153d0002 (diff) |
Merge branch 'bcm7xxx'
Florian Fainelli says:
====================
net: phy: bcm7xxx internal PHY fixes
Here are 3 small fixes for the Broadcom BCM7xxx internal PHY targeting
suspend/resume issues.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/phy/bcm7xxx.c | 42 | ||||
-rw-r--r-- | include/linux/brcmphy.h | 1 |
2 files changed, 21 insertions, 22 deletions
diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c index 526b94cea569..fdce1ea28790 100644 --- a/drivers/net/phy/bcm7xxx.c +++ b/drivers/net/phy/bcm7xxx.c | |||
@@ -157,6 +157,23 @@ static int bcm7xxx_28nm_config_init(struct phy_device *phydev) | |||
157 | return bcm7xxx_28nm_afe_config_init(phydev); | 157 | return bcm7xxx_28nm_afe_config_init(phydev); |
158 | } | 158 | } |
159 | 159 | ||
160 | static int bcm7xxx_28nm_resume(struct phy_device *phydev) | ||
161 | { | ||
162 | int ret; | ||
163 | |||
164 | /* Re-apply workarounds coming out suspend/resume */ | ||
165 | ret = bcm7xxx_28nm_config_init(phydev); | ||
166 | if (ret) | ||
167 | return ret; | ||
168 | |||
169 | /* 28nm Gigabit PHYs come out of reset without any half-duplex | ||
170 | * or "hub" compliant advertised mode, fix that. This does not | ||
171 | * cause any problems with the PHY library since genphy_config_aneg() | ||
172 | * gracefully handles auto-negotiated and forced modes. | ||
173 | */ | ||
174 | return genphy_config_aneg(phydev); | ||
175 | } | ||
176 | |||
160 | static int phy_set_clr_bits(struct phy_device *dev, int location, | 177 | static int phy_set_clr_bits(struct phy_device *dev, int location, |
161 | int set_mask, int clr_mask) | 178 | int set_mask, int clr_mask) |
162 | { | 179 | { |
@@ -212,7 +229,7 @@ static int bcm7xxx_config_init(struct phy_device *phydev) | |||
212 | } | 229 | } |
213 | 230 | ||
214 | /* Workaround for putting the PHY in IDDQ mode, required | 231 | /* Workaround for putting the PHY in IDDQ mode, required |
215 | * for all BCM7XXX PHYs | 232 | * for all BCM7XXX 40nm and 65nm PHYs |
216 | */ | 233 | */ |
217 | static int bcm7xxx_suspend(struct phy_device *phydev) | 234 | static int bcm7xxx_suspend(struct phy_device *phydev) |
218 | { | 235 | { |
@@ -257,8 +274,7 @@ static struct phy_driver bcm7xxx_driver[] = { | |||
257 | .config_init = bcm7xxx_28nm_afe_config_init, | 274 | .config_init = bcm7xxx_28nm_afe_config_init, |
258 | .config_aneg = genphy_config_aneg, | 275 | .config_aneg = genphy_config_aneg, |
259 | .read_status = genphy_read_status, | 276 | .read_status = genphy_read_status, |
260 | .suspend = bcm7xxx_suspend, | 277 | .resume = bcm7xxx_28nm_resume, |
261 | .resume = bcm7xxx_28nm_afe_config_init, | ||
262 | .driver = { .owner = THIS_MODULE }, | 278 | .driver = { .owner = THIS_MODULE }, |
263 | }, { | 279 | }, { |
264 | .phy_id = PHY_ID_BCM7439, | 280 | .phy_id = PHY_ID_BCM7439, |
@@ -270,8 +286,7 @@ static struct phy_driver bcm7xxx_driver[] = { | |||
270 | .config_init = bcm7xxx_28nm_afe_config_init, | 286 | .config_init = bcm7xxx_28nm_afe_config_init, |
271 | .config_aneg = genphy_config_aneg, | 287 | .config_aneg = genphy_config_aneg, |
272 | .read_status = genphy_read_status, | 288 | .read_status = genphy_read_status, |
273 | .suspend = bcm7xxx_suspend, | 289 | .resume = bcm7xxx_28nm_resume, |
274 | .resume = bcm7xxx_28nm_afe_config_init, | ||
275 | .driver = { .owner = THIS_MODULE }, | 290 | .driver = { .owner = THIS_MODULE }, |
276 | }, { | 291 | }, { |
277 | .phy_id = PHY_ID_BCM7445, | 292 | .phy_id = PHY_ID_BCM7445, |
@@ -283,21 +298,7 @@ static struct phy_driver bcm7xxx_driver[] = { | |||
283 | .config_init = bcm7xxx_28nm_config_init, | 298 | .config_init = bcm7xxx_28nm_config_init, |
284 | .config_aneg = genphy_config_aneg, | 299 | .config_aneg = genphy_config_aneg, |
285 | .read_status = genphy_read_status, | 300 | .read_status = genphy_read_status, |
286 | .suspend = bcm7xxx_suspend, | 301 | .resume = bcm7xxx_28nm_afe_config_init, |
287 | .resume = bcm7xxx_28nm_config_init, | ||
288 | .driver = { .owner = THIS_MODULE }, | ||
289 | }, { | ||
290 | .name = "Broadcom BCM7XXX 28nm", | ||
291 | .phy_id = PHY_ID_BCM7XXX_28, | ||
292 | .phy_id_mask = PHY_BCM_OUI_MASK, | ||
293 | .features = PHY_GBIT_FEATURES | | ||
294 | SUPPORTED_Pause | SUPPORTED_Asym_Pause, | ||
295 | .flags = PHY_IS_INTERNAL, | ||
296 | .config_init = bcm7xxx_28nm_config_init, | ||
297 | .config_aneg = genphy_config_aneg, | ||
298 | .read_status = genphy_read_status, | ||
299 | .suspend = bcm7xxx_suspend, | ||
300 | .resume = bcm7xxx_28nm_config_init, | ||
301 | .driver = { .owner = THIS_MODULE }, | 302 | .driver = { .owner = THIS_MODULE }, |
302 | }, { | 303 | }, { |
303 | .phy_id = PHY_BCM_OUI_4, | 304 | .phy_id = PHY_BCM_OUI_4, |
@@ -331,7 +332,6 @@ static struct mdio_device_id __maybe_unused bcm7xxx_tbl[] = { | |||
331 | { PHY_ID_BCM7366, 0xfffffff0, }, | 332 | { PHY_ID_BCM7366, 0xfffffff0, }, |
332 | { PHY_ID_BCM7439, 0xfffffff0, }, | 333 | { PHY_ID_BCM7439, 0xfffffff0, }, |
333 | { PHY_ID_BCM7445, 0xfffffff0, }, | 334 | { PHY_ID_BCM7445, 0xfffffff0, }, |
334 | { PHY_ID_BCM7XXX_28, 0xfffffc00 }, | ||
335 | { PHY_BCM_OUI_4, 0xffff0000 }, | 335 | { PHY_BCM_OUI_4, 0xffff0000 }, |
336 | { PHY_BCM_OUI_5, 0xffffff00 }, | 336 | { PHY_BCM_OUI_5, 0xffffff00 }, |
337 | { } | 337 | { } |
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h index 6f76277baf39..61219b9b3445 100644 --- a/include/linux/brcmphy.h +++ b/include/linux/brcmphy.h | |||
@@ -16,7 +16,6 @@ | |||
16 | #define PHY_ID_BCM7366 0x600d8490 | 16 | #define PHY_ID_BCM7366 0x600d8490 |
17 | #define PHY_ID_BCM7439 0x600d8480 | 17 | #define PHY_ID_BCM7439 0x600d8480 |
18 | #define PHY_ID_BCM7445 0x600d8510 | 18 | #define PHY_ID_BCM7445 0x600d8510 |
19 | #define PHY_ID_BCM7XXX_28 0x600d8400 | ||
20 | 19 | ||
21 | #define PHY_BCM_OUI_MASK 0xfffffc00 | 20 | #define PHY_BCM_OUI_MASK 0xfffffc00 |
22 | #define PHY_BCM_OUI_1 0x00206000 | 21 | #define PHY_BCM_OUI_1 0x00206000 |