kernel: b53: detect revision of BCM5325
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 15 Sep 2013 13:30:49 +0000 (13:30 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 15 Sep 2013 13:30:49 +0000 (13:30 +0000)
The revision is stored in a different register than it is in other
Broadcom switches.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
SVN-Revision: 37995

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

index 4d1e0ee4ba04aecc45c0842a9022d9477ab1a484..d911ab7fb539f946c923b45df6f413f7e29a2fff 100644 (file)
@@ -1305,7 +1305,12 @@ int b53_switch_detect(struct b53_device *dev)
                }
        }
 
-       return b53_read8(dev, B53_MGMT_PAGE, B53_REV_ID, &dev->core_rev);
+       if (dev->chip_id == BCM5325_DEVICE_ID)
+               return b53_read8(dev, B53_STAT_PAGE, B53_REV_ID_25,
+                                &dev->core_rev);
+       else
+               return b53_read8(dev, B53_MGMT_PAGE, B53_REV_ID,
+                                &dev->core_rev);
 }
 EXPORT_SYMBOL(b53_switch_detect);
 
index 7b8f539be00053eafbe761c387c88dddf4ba9a11..7018ff4ebbcda962cbccb29dd24484676970111e 100644 (file)
 #define B53_DUPLEX_STAT_GE             0x08
 #define B53_DUPLEX_STAT_63XX           0x0c
 
+/* Revision ID register for BCM5325 */
+#define B53_REV_ID_25                  0x50
+
 /* Strap Value (48 bit) */
 #define B53_STRAP_VALUE                        0x70
 #define   SV_GMII_CTRL_115             BIT(27)