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 <hauke@hauke-m.de>

SVN-Revision: 37995
lede-17.01
Hauke Mehrtens 2013-09-15 13:30:49 +00:00
parent 49d7c57fd1
commit f5989e7f59
2 changed files with 9 additions and 1 deletions

View 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);

View File

@ -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)