diff options
author | Damien Thébault <damien.thebault@vitec.com> | 2018-05-31 03:04:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-06-01 11:15:42 -0400 |
commit | a95691bc54af1ac4b12c354f91e9cabf1cb068df (patch) | |
tree | e36ab33b9d13af26afaa4a08575d06194d43f8df | |
parent | eb7f54b90bd8f469834c5e86dcf72ebf9a629811 (diff) |
net: dsa: b53: Add BCM5389 support
This patch adds support for the BCM5389 switch connected through MDIO.
Signed-off-by: Damien Thébault <damien.thebault@vitec.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | Documentation/devicetree/bindings/net/dsa/b53.txt | 1 | ||||
-rw-r--r-- | drivers/net/dsa/b53/b53_common.c | 13 | ||||
-rw-r--r-- | drivers/net/dsa/b53/b53_mdio.c | 5 | ||||
-rw-r--r-- | drivers/net/dsa/b53/b53_priv.h | 1 |
4 files changed, 19 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/net/dsa/b53.txt b/Documentation/devicetree/bindings/net/dsa/b53.txt index 8acf51a4dfa8..47a6a7fe0b86 100644 --- a/Documentation/devicetree/bindings/net/dsa/b53.txt +++ b/Documentation/devicetree/bindings/net/dsa/b53.txt | |||
@@ -10,6 +10,7 @@ Required properties: | |||
10 | "brcm,bcm53128" | 10 | "brcm,bcm53128" |
11 | "brcm,bcm5365" | 11 | "brcm,bcm5365" |
12 | "brcm,bcm5395" | 12 | "brcm,bcm5395" |
13 | "brcm,bcm5389" | ||
13 | "brcm,bcm5397" | 14 | "brcm,bcm5397" |
14 | "brcm,bcm5398" | 15 | "brcm,bcm5398" |
15 | 16 | ||
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index 78616787f2a3..3da5fca77cbd 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c | |||
@@ -1712,6 +1712,18 @@ static const struct b53_chip_data b53_switch_chips[] = { | |||
1712 | .duplex_reg = B53_DUPLEX_STAT_FE, | 1712 | .duplex_reg = B53_DUPLEX_STAT_FE, |
1713 | }, | 1713 | }, |
1714 | { | 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 | }, | ||
1726 | { | ||
1715 | .chip_id = BCM5395_DEVICE_ID, | 1727 | .chip_id = BCM5395_DEVICE_ID, |
1716 | .dev_name = "BCM5395", | 1728 | .dev_name = "BCM5395", |
1717 | .vlans = 4096, | 1729 | .vlans = 4096, |
@@ -2034,6 +2046,7 @@ int b53_switch_detect(struct b53_device *dev) | |||
2034 | else | 2046 | else |
2035 | dev->chip_id = BCM5365_DEVICE_ID; | 2047 | dev->chip_id = BCM5365_DEVICE_ID; |
2036 | break; | 2048 | break; |
2049 | case BCM5389_DEVICE_ID: | ||
2037 | case BCM5395_DEVICE_ID: | 2050 | case BCM5395_DEVICE_ID: |
2038 | case BCM5397_DEVICE_ID: | 2051 | case BCM5397_DEVICE_ID: |
2039 | case BCM5398_DEVICE_ID: | 2052 | case BCM5398_DEVICE_ID: |
diff --git a/drivers/net/dsa/b53/b53_mdio.c b/drivers/net/dsa/b53/b53_mdio.c index fa7556f5d4fb..a533a90e3904 100644 --- a/drivers/net/dsa/b53/b53_mdio.c +++ b/drivers/net/dsa/b53/b53_mdio.c | |||
@@ -285,6 +285,7 @@ static const struct b53_io_ops b53_mdio_ops = { | |||
285 | #define B53_BRCM_OUI_1 0x0143bc00 | 285 | #define B53_BRCM_OUI_1 0x0143bc00 |
286 | #define B53_BRCM_OUI_2 0x03625c00 | 286 | #define B53_BRCM_OUI_2 0x03625c00 |
287 | #define B53_BRCM_OUI_3 0x00406000 | 287 | #define B53_BRCM_OUI_3 0x00406000 |
288 | #define B53_BRCM_OUI_4 0x01410c00 | ||
288 | 289 | ||
289 | static int b53_mdio_probe(struct mdio_device *mdiodev) | 290 | static int b53_mdio_probe(struct mdio_device *mdiodev) |
290 | { | 291 | { |
@@ -311,7 +312,8 @@ static int b53_mdio_probe(struct mdio_device *mdiodev) | |||
311 | */ | 312 | */ |
312 | if ((phy_id & 0xfffffc00) != B53_BRCM_OUI_1 && | 313 | if ((phy_id & 0xfffffc00) != B53_BRCM_OUI_1 && |
313 | (phy_id & 0xfffffc00) != B53_BRCM_OUI_2 && | 314 | (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) { | ||
315 | dev_err(&mdiodev->dev, "Unsupported device: 0x%08x\n", phy_id); | 317 | dev_err(&mdiodev->dev, "Unsupported device: 0x%08x\n", phy_id); |
316 | return -ENODEV; | 318 | return -ENODEV; |
317 | } | 319 | } |
@@ -360,6 +362,7 @@ static const struct of_device_id b53_of_match[] = { | |||
360 | { .compatible = "brcm,bcm53125" }, | 362 | { .compatible = "brcm,bcm53125" }, |
361 | { .compatible = "brcm,bcm53128" }, | 363 | { .compatible = "brcm,bcm53128" }, |
362 | { .compatible = "brcm,bcm5365" }, | 364 | { .compatible = "brcm,bcm5365" }, |
365 | { .compatible = "brcm,bcm5389" }, | ||
363 | { .compatible = "brcm,bcm5395" }, | 366 | { .compatible = "brcm,bcm5395" }, |
364 | { .compatible = "brcm,bcm5397" }, | 367 | { .compatible = "brcm,bcm5397" }, |
365 | { .compatible = "brcm,bcm5398" }, | 368 | { .compatible = "brcm,bcm5398" }, |
diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h index 1187ebd79287..3b57f47d0e79 100644 --- a/drivers/net/dsa/b53/b53_priv.h +++ b/drivers/net/dsa/b53/b53_priv.h | |||
@@ -48,6 +48,7 @@ struct b53_io_ops { | |||
48 | enum { | 48 | enum { |
49 | BCM5325_DEVICE_ID = 0x25, | 49 | BCM5325_DEVICE_ID = 0x25, |
50 | BCM5365_DEVICE_ID = 0x65, | 50 | BCM5365_DEVICE_ID = 0x65, |
51 | BCM5389_DEVICE_ID = 0x89, | ||
51 | BCM5395_DEVICE_ID = 0x95, | 52 | BCM5395_DEVICE_ID = 0x95, |
52 | BCM5397_DEVICE_ID = 0x97, | 53 | BCM5397_DEVICE_ID = 0x97, |
53 | BCM5398_DEVICE_ID = 0x98, | 54 | BCM5398_DEVICE_ID = 0x98, |