From 6aad15a22cf17833485a92c5e8c0034d12c78afb Mon Sep 17 00:00:00 2001 From: hauke Date: Sun, 15 Sep 2013 13:30:49 +0000 Subject: kernel: b53: detect revision of BCM5325 The revision is stored in a different register than it is in other Broadcom switches. Signed-off-by: Hauke Mehrtens git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37995 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/generic/files/drivers/net/phy/b53/b53_common.c | 7 ++++++- target/linux/generic/files/drivers/net/phy/b53/b53_regs.h | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'target/linux') diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c index 4d1e0ee4ba..d911ab7fb5 100644 --- a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c +++ b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c @@ -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); diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h b/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h index 7b8f539be0..7018ff4ebb 100644 --- a/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h +++ b/target/linux/generic/files/drivers/net/phy/b53/b53_regs.h @@ -135,6 +135,9 @@ #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) -- cgit v1.2.3