net: dsa: b53: Add BCM5389 support
authorDamien Thébault <damien.thebault@vitec.com>
Thu, 31 May 2018 07:04:01 +0000 (07:04 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Jun 2018 00:08:05 +0000 (08:08 +0800)
[ Upstream commit a95691bc54af1ac4b12c354f91e9cabf1cb068df ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/devicetree/bindings/net/dsa/b53.txt
drivers/net/dsa/b53/b53_common.c
drivers/net/dsa/b53/b53_mdio.c
drivers/net/dsa/b53/b53_priv.h

index d6c6e41648d4f17814ea43775e8591a40a4c0786..6192f02af2a949e66d93d0cbb5313a971e1ea649 100644 (file)
@@ -10,6 +10,7 @@ Required properties:
       "brcm,bcm53128"
       "brcm,bcm5365"
       "brcm,bcm5395"
+      "brcm,bcm5389"
       "brcm,bcm5397"
       "brcm,bcm5398"
 
index c26debc531eec3c11f47d6528f3885fc53a08604..71525950c641d6e4beaabc5172be9d114973444f 100644 (file)
@@ -1515,6 +1515,18 @@ static const struct b53_chip_data b53_switch_chips[] = {
                .cpu_port = B53_CPU_PORT_25,
                .duplex_reg = B53_DUPLEX_STAT_FE,
        },
+       {
+               .chip_id = BCM5389_DEVICE_ID,
+               .dev_name = "BCM5389",
+               .vlans = 4096,
+               .enabled_ports = 0x1f,
+               .arl_entries = 4,
+               .cpu_port = B53_CPU_PORT,
+               .vta_regs = B53_VTA_REGS,
+               .duplex_reg = B53_DUPLEX_STAT_GE,
+               .jumbo_pm_reg = B53_JUMBO_PORT_MASK,
+               .jumbo_size_reg = B53_JUMBO_MAX_SIZE,
+       },
        {
                .chip_id = BCM5395_DEVICE_ID,
                .dev_name = "BCM5395",
@@ -1825,6 +1837,7 @@ int b53_switch_detect(struct b53_device *dev)
                else
                        dev->chip_id = BCM5365_DEVICE_ID;
                break;
+       case BCM5389_DEVICE_ID:
        case BCM5395_DEVICE_ID:
        case BCM5397_DEVICE_ID:
        case BCM5398_DEVICE_ID:
index 477a16b5660ab61f7bda3dce2438d95b5806513c..6f47ff1a795232b0638e9bdcaf8b9db100e19c66 100644 (file)
@@ -285,6 +285,7 @@ static const struct b53_io_ops b53_mdio_ops = {
 #define B53_BRCM_OUI_1 0x0143bc00
 #define B53_BRCM_OUI_2 0x03625c00
 #define B53_BRCM_OUI_3 0x00406000
+#define B53_BRCM_OUI_4 0x01410c00
 
 static int b53_mdio_probe(struct mdio_device *mdiodev)
 {
@@ -311,7 +312,8 @@ static int b53_mdio_probe(struct mdio_device *mdiodev)
         */
        if ((phy_id & 0xfffffc00) != B53_BRCM_OUI_1 &&
            (phy_id & 0xfffffc00) != B53_BRCM_OUI_2 &&
-           (phy_id & 0xfffffc00) != B53_BRCM_OUI_3) {
+           (phy_id & 0xfffffc00) != B53_BRCM_OUI_3 &&
+           (phy_id & 0xfffffc00) != B53_BRCM_OUI_4) {
                dev_err(&mdiodev->dev, "Unsupported device: 0x%08x\n", phy_id);
                return -ENODEV;
        }
@@ -360,6 +362,7 @@ static const struct of_device_id b53_of_match[] = {
        { .compatible = "brcm,bcm53125" },
        { .compatible = "brcm,bcm53128" },
        { .compatible = "brcm,bcm5365" },
+       { .compatible = "brcm,bcm5389" },
        { .compatible = "brcm,bcm5395" },
        { .compatible = "brcm,bcm5397" },
        { .compatible = "brcm,bcm5398" },
index f192a673caba4f0c687216934dbbb78190f5d0c8..68ab20baa631c676442cc4560c6b85039f3ad4e8 100644 (file)
@@ -47,6 +47,7 @@ struct b53_io_ops {
 enum {
        BCM5325_DEVICE_ID = 0x25,
        BCM5365_DEVICE_ID = 0x65,
+       BCM5389_DEVICE_ID = 0x89,
        BCM5395_DEVICE_ID = 0x95,
        BCM5397_DEVICE_ID = 0x97,
        BCM5398_DEVICE_ID = 0x98,