]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: dsa: b53: Define chip IDs for more bcm63xx SoCs
authorKyle Hendry <kylehendrydev@gmail.com>
Thu, 24 Jul 2025 03:52:42 +0000 (20:52 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 25 Jul 2025 21:07:33 +0000 (14:07 -0700)
Add defines for bcm6318, bcm6328, bcm6362, bcm6368 chip IDs,
update tables and switch init.

Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20250724035300.20497-4-kylehendrydev@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/b53/b53_common.c
drivers/net/dsa/b53/b53_mmap.c
drivers/net/dsa/b53/b53_priv.h

index 77acc7b8abfb22b98f57e546a6c3f5ba321a5798..9942fb6f7f4b04d019d44d2960d173241d04ccdb 100644 (file)
@@ -1410,7 +1410,7 @@ static void b53_adjust_63xx_rgmii(struct dsa_switch *ds, int port,
        b53_read8(dev, B53_CTRL_PAGE, B53_RGMII_CTRL_P(port), &rgmii_ctrl);
        rgmii_ctrl &= ~(RGMII_CTRL_DLL_RXC | RGMII_CTRL_DLL_TXC);
 
-       if (is63268(dev))
+       if (is6318_268(dev))
                rgmii_ctrl |= RGMII_CTRL_MII_OVERRIDE;
 
        rgmii_ctrl |= RGMII_CTRL_ENABLE_GMII;
@@ -2774,19 +2774,6 @@ static const struct b53_chip_data b53_switch_chips[] = {
                .jumbo_pm_reg = B53_JUMBO_PORT_MASK_63XX,
                .jumbo_size_reg = B53_JUMBO_MAX_SIZE_63XX,
        },
-       {
-               .chip_id = BCM63268_DEVICE_ID,
-               .dev_name = "BCM63268",
-               .vlans = 4096,
-               .enabled_ports = 0, /* pdata must provide them */
-               .arl_bins = 4,
-               .arl_buckets = 1024,
-               .imp_port = 8,
-               .vta_regs = B53_VTA_REGS_63XX,
-               .duplex_reg = B53_DUPLEX_STAT_63XX,
-               .jumbo_pm_reg = B53_JUMBO_PORT_MASK_63XX,
-               .jumbo_size_reg = B53_JUMBO_MAX_SIZE_63XX,
-       },
        {
                .chip_id = BCM53010_DEVICE_ID,
                .dev_name = "BCM53010",
@@ -2936,13 +2923,17 @@ static const struct b53_chip_data b53_switch_chips[] = {
 
 static int b53_switch_init(struct b53_device *dev)
 {
+       u32 chip_id = dev->chip_id;
        unsigned int i;
        int ret;
 
+       if (is63xx(dev))
+               chip_id = BCM63XX_DEVICE_ID;
+
        for (i = 0; i < ARRAY_SIZE(b53_switch_chips); i++) {
                const struct b53_chip_data *chip = &b53_switch_chips[i];
 
-               if (chip->chip_id == dev->chip_id) {
+               if (chip->chip_id == chip_id) {
                        if (!dev->enabled_ports)
                                dev->enabled_ports = chip->enabled_ports;
                        dev->name = chip->dev_name;
index c687360a5b7f11a838044e28aa06bafe6de1d782..f97556c6ca2a836b5616ca7e4e99751c0f50804e 100644 (file)
@@ -348,16 +348,16 @@ static const struct of_device_id b53_mmap_of_table[] = {
                .data = (void *)BCM63XX_DEVICE_ID,
        }, {
                .compatible = "brcm,bcm6318-switch",
-               .data = (void *)BCM63268_DEVICE_ID,
+               .data = (void *)BCM6318_DEVICE_ID,
        }, {
                .compatible = "brcm,bcm6328-switch",
-               .data = (void *)BCM63XX_DEVICE_ID,
+               .data = (void *)BCM6328_DEVICE_ID,
        }, {
                .compatible = "brcm,bcm6362-switch",
-               .data = (void *)BCM63XX_DEVICE_ID,
+               .data = (void *)BCM6362_DEVICE_ID,
        }, {
                .compatible = "brcm,bcm6368-switch",
-               .data = (void *)BCM63XX_DEVICE_ID,
+               .data = (void *)BCM6368_DEVICE_ID,
        }, {
                .compatible = "brcm,bcm63268-switch",
                .data = (void *)BCM63268_DEVICE_ID,
index f1124f5e50daf4e5200af517ccedcb8237464f6b..458775f9516437f242a7936d7b85094cb634321f 100644 (file)
@@ -73,6 +73,10 @@ enum {
        BCM53125_DEVICE_ID = 0x53125,
        BCM53128_DEVICE_ID = 0x53128,
        BCM63XX_DEVICE_ID = 0x6300,
+       BCM6318_DEVICE_ID = 0x6318,
+       BCM6328_DEVICE_ID = 0x6328,
+       BCM6362_DEVICE_ID = 0x6362,
+       BCM6368_DEVICE_ID = 0x6368,
        BCM63268_DEVICE_ID = 0x63268,
        BCM53010_DEVICE_ID = 0x53010,
        BCM53011_DEVICE_ID = 0x53011,
@@ -220,12 +224,17 @@ static inline int is531x5(struct b53_device *dev)
 static inline int is63xx(struct b53_device *dev)
 {
        return dev->chip_id == BCM63XX_DEVICE_ID ||
+               dev->chip_id == BCM6318_DEVICE_ID ||
+               dev->chip_id == BCM6328_DEVICE_ID ||
+               dev->chip_id == BCM6362_DEVICE_ID ||
+               dev->chip_id == BCM6368_DEVICE_ID ||
                dev->chip_id == BCM63268_DEVICE_ID;
 }
 
-static inline int is63268(struct b53_device *dev)
+static inline int is6318_268(struct b53_device *dev)
 {
-       return dev->chip_id == BCM63268_DEVICE_ID;
+       return dev->chip_id == BCM6318_DEVICE_ID ||
+               dev->chip_id == BCM63268_DEVICE_ID;
 }
 
 static inline int is5301x(struct b53_device *dev)