Skip to content

Commit a95691b

Browse files
Damien Thébaultdavem330
authored andcommitted
net: dsa: b53: Add BCM5389 support
This patch adds support for the BCM5389 switch connected through MDIO. Signed-off-by: Damien Thébault <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent eb7f54b commit a95691b

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

Documentation/devicetree/bindings/net/dsa/b53.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Required properties:
1010
"brcm,bcm53128"
1111
"brcm,bcm5365"
1212
"brcm,bcm5395"
13+
"brcm,bcm5389"
1314
"brcm,bcm5397"
1415
"brcm,bcm5398"
1516

drivers/net/dsa/b53/b53_common.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,6 +1711,18 @@ static const struct b53_chip_data b53_switch_chips[] = {
17111711
.cpu_port = B53_CPU_PORT_25,
17121712
.duplex_reg = B53_DUPLEX_STAT_FE,
17131713
},
1714+
{
1715+
.chip_id = BCM5389_DEVICE_ID,
1716+
.dev_name = "BCM5389",
1717+
.vlans = 4096,
1718+
.enabled_ports = 0x1f,
1719+
.arl_entries = 4,
1720+
.cpu_port = B53_CPU_PORT,
1721+
.vta_regs = B53_VTA_REGS,
1722+
.duplex_reg = B53_DUPLEX_STAT_GE,
1723+
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
1724+
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
1725+
},
17141726
{
17151727
.chip_id = BCM5395_DEVICE_ID,
17161728
.dev_name = "BCM5395",
@@ -2034,6 +2046,7 @@ int b53_switch_detect(struct b53_device *dev)
20342046
else
20352047
dev->chip_id = BCM5365_DEVICE_ID;
20362048
break;
2049+
case BCM5389_DEVICE_ID:
20372050
case BCM5395_DEVICE_ID:
20382051
case BCM5397_DEVICE_ID:
20392052
case BCM5398_DEVICE_ID:

drivers/net/dsa/b53/b53_mdio.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ static const struct b53_io_ops b53_mdio_ops = {
285285
#define B53_BRCM_OUI_1 0x0143bc00
286286
#define B53_BRCM_OUI_2 0x03625c00
287287
#define B53_BRCM_OUI_3 0x00406000
288+
#define B53_BRCM_OUI_4 0x01410c00
288289

289290
static int b53_mdio_probe(struct mdio_device *mdiodev)
290291
{
@@ -311,7 +312,8 @@ static int b53_mdio_probe(struct mdio_device *mdiodev)
311312
*/
312313
if ((phy_id & 0xfffffc00) != B53_BRCM_OUI_1 &&
313314
(phy_id & 0xfffffc00) != B53_BRCM_OUI_2 &&
314-
(phy_id & 0xfffffc00) != B53_BRCM_OUI_3) {
315+
(phy_id & 0xfffffc00) != B53_BRCM_OUI_3 &&
316+
(phy_id & 0xfffffc00) != B53_BRCM_OUI_4) {
315317
dev_err(&mdiodev->dev, "Unsupported device: 0x%08x\n", phy_id);
316318
return -ENODEV;
317319
}
@@ -360,6 +362,7 @@ static const struct of_device_id b53_of_match[] = {
360362
{ .compatible = "brcm,bcm53125" },
361363
{ .compatible = "brcm,bcm53128" },
362364
{ .compatible = "brcm,bcm5365" },
365+
{ .compatible = "brcm,bcm5389" },
363366
{ .compatible = "brcm,bcm5395" },
364367
{ .compatible = "brcm,bcm5397" },
365368
{ .compatible = "brcm,bcm5398" },

drivers/net/dsa/b53/b53_priv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ struct b53_io_ops {
4848
enum {
4949
BCM5325_DEVICE_ID = 0x25,
5050
BCM5365_DEVICE_ID = 0x65,
51+
BCM5389_DEVICE_ID = 0x89,
5152
BCM5395_DEVICE_ID = 0x95,
5253
BCM5397_DEVICE_ID = 0x97,
5354
BCM5398_DEVICE_ID = 0x98,

0 commit comments

Comments
 (0)