
Sercomm H-500s is a BCM63268 with 128M, internal and external (Quantenna) wifi and external BCM53134S switch. This device is already supported in bcm63xx target, so more information can be found in https://openwrt.org/toh/sercomm/h500-s. It's a perfect example of a device with internal and external switch coexistance since most devices only have ports on one of the switches but not both of them. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
99 lines
3.2 KiB
Diff
99 lines
3.2 KiB
Diff
From 8ec46b847fc64a40da5c2c891e1732c863703bb5 Mon Sep 17 00:00:00 2001
|
|
From: Paul Geurts <paul.geurts@prodrive-technologies.com>
|
|
Date: Wed, 22 Mar 2023 20:17:04 +0100
|
|
Subject: [PATCH] net: dsa: b53: mdio: add support for BCM53134
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Add support for the BCM53134 Ethernet switch in the existing b53 dsa driver.
|
|
The BCM53134 is very familiar to the BCM58XX series.
|
|
|
|
Signed-off-by: Paul Geurts <paul.geurts@prodrive-technologies.com>
|
|
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
|
---
|
|
drivers/net/dsa/b53/b53_common.c | 15 +++++++++++++++
|
|
drivers/net/dsa/b53/b53_mdio.c | 5 ++++-
|
|
drivers/net/dsa/b53/b53_priv.h | 4 +++-
|
|
3 files changed, 22 insertions(+), 2 deletions(-)
|
|
|
|
--- a/drivers/net/dsa/b53/b53_common.c
|
|
+++ b/drivers/net/dsa/b53/b53_common.c
|
|
@@ -2609,6 +2609,20 @@ static const struct b53_chip_data b53_sw
|
|
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
|
|
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
|
|
},
|
|
+ {
|
|
+ .chip_id = BCM53134_DEVICE_ID,
|
|
+ .dev_name = "BCM53134",
|
|
+ .vlans = 4096,
|
|
+ .enabled_ports = 0x12f,
|
|
+ .imp_port = 8,
|
|
+ .cpu_port = B53_CPU_PORT,
|
|
+ .vta_regs = B53_VTA_REGS,
|
|
+ .arl_bins = 4,
|
|
+ .arl_buckets = 1024,
|
|
+ .duplex_reg = B53_DUPLEX_STAT_GE,
|
|
+ .jumbo_pm_reg = B53_JUMBO_PORT_MASK,
|
|
+ .jumbo_size_reg = B53_JUMBO_MAX_SIZE,
|
|
+ },
|
|
};
|
|
|
|
static int b53_switch_init(struct b53_device *dev)
|
|
@@ -2785,6 +2799,7 @@ int b53_switch_detect(struct b53_device
|
|
case BCM53012_DEVICE_ID:
|
|
case BCM53018_DEVICE_ID:
|
|
case BCM53019_DEVICE_ID:
|
|
+ case BCM53134_DEVICE_ID:
|
|
dev->chip_id = id32;
|
|
break;
|
|
default:
|
|
--- a/drivers/net/dsa/b53/b53_mdio.c
|
|
+++ b/drivers/net/dsa/b53/b53_mdio.c
|
|
@@ -286,6 +286,7 @@ static const struct b53_io_ops b53_mdio_
|
|
#define B53_BRCM_OUI_2 0x03625c00
|
|
#define B53_BRCM_OUI_3 0x00406000
|
|
#define B53_BRCM_OUI_4 0x01410c00
|
|
+#define B53_BRCM_OUI_5 0xae025000
|
|
|
|
static int b53_mdio_probe(struct mdio_device *mdiodev)
|
|
{
|
|
@@ -313,7 +314,8 @@ static int b53_mdio_probe(struct mdio_de
|
|
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_4) {
|
|
+ (phy_id & 0xfffffc00) != B53_BRCM_OUI_4 &&
|
|
+ (phy_id & 0xfffffc00) != B53_BRCM_OUI_5) {
|
|
dev_err(&mdiodev->dev, "Unsupported device: 0x%08x\n", phy_id);
|
|
return -ENODEV;
|
|
}
|
|
@@ -377,6 +379,7 @@ static const struct of_device_id b53_of_
|
|
{ .compatible = "brcm,bcm53115" },
|
|
{ .compatible = "brcm,bcm53125" },
|
|
{ .compatible = "brcm,bcm53128" },
|
|
+ { .compatible = "brcm,bcm53134" },
|
|
{ .compatible = "brcm,bcm5365" },
|
|
{ .compatible = "brcm,bcm5389" },
|
|
{ .compatible = "brcm,bcm5395" },
|
|
--- a/drivers/net/dsa/b53/b53_priv.h
|
|
+++ b/drivers/net/dsa/b53/b53_priv.h
|
|
@@ -85,6 +85,7 @@ enum {
|
|
BCM583XX_DEVICE_ID = 0x58300,
|
|
BCM7445_DEVICE_ID = 0x7445,
|
|
BCM7278_DEVICE_ID = 0x7278,
|
|
+ BCM53134_DEVICE_ID = 0x5075,
|
|
};
|
|
|
|
#define B53_N_PORTS 9
|
|
@@ -210,7 +211,8 @@ static inline int is58xx(struct b53_devi
|
|
return dev->chip_id == BCM58XX_DEVICE_ID ||
|
|
dev->chip_id == BCM583XX_DEVICE_ID ||
|
|
dev->chip_id == BCM7445_DEVICE_ID ||
|
|
- dev->chip_id == BCM7278_DEVICE_ID;
|
|
+ dev->chip_id == BCM7278_DEVICE_ID ||
|
|
+ dev->chip_id == BCM53134_DEVICE_ID;
|
|
}
|
|
|
|
#define B53_63XX_RGMII0 4
|