kernel: b53: add soft reset for BCM539x switches
authorHauke Mehrtens <hauke@hauke-m.de>
Sat, 14 Sep 2013 16:14:02 +0000 (16:14 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 14 Sep 2013 16:14:02 +0000 (16:14 +0000)
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
SVN-Revision: 37987

target/linux/generic/files/drivers/net/phy/b53/b53_common.c
target/linux/generic/files/drivers/net/phy/b53/b53_priv.h

index 25ab412f800ebaf411736b13bf0c9b5f50e04280..d1fc930f270dcfdc3c121a52a6b965fe94b41a30 100644 (file)
@@ -477,6 +477,11 @@ static int b53_switch_reset(struct b53_device *dev)
 
        b53_switch_reset_gpio(dev);
 
+       if (is539x(dev)) {
+               b53_write8(dev, B53_CTRL_PAGE, B53_SOFTRESET, 0x83);
+               b53_write8(dev, B53_CTRL_PAGE, B53_SOFTRESET, 0x00);
+       }
+
        b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, &mgmt);
 
        if (!(mgmt & SM_SW_FWD_EN)) {
index 53da4064072b7829e4dd285a13513a6c64480f41..308a729a3c7d82d98b927c1fdec706963362c5a4 100644 (file)
@@ -122,6 +122,13 @@ static inline int is5397_98(struct b53_device *dev)
                dev->chip_id == BCM5398_DEVICE_ID;
 }
 
+static inline int is539x(struct b53_device *dev)
+{
+       return dev->chip_id == BCM5395_DEVICE_ID ||
+               dev->chip_id == BCM5397_DEVICE_ID ||
+               dev->chip_id == BCM5398_DEVICE_ID;
+}
+
 static inline int is531x5(struct b53_device *dev)
 {
        return dev->chip_id == BCM53115_DEVICE_ID ||