Commit 5040cc99 authored by Arun Parameswaran's avatar Arun Parameswaran Committed by David S. Miller

net: dsa: b53: Fix for brcm tag issue in Cygnus SoC

In the Broadcom Cygnus SoC, the brcm tag needs to be inserted
in between the mac address and the ether type (should use
'DSA_PROTO_TAG_BRCM') for the packets sent to the internal
b53 switch.

Since the Cygnus was added with the BCM58XX device id and the
BCM58XX uses 'DSA_PROTO_TAG_BRCM_PREPEND', the data path is
broken, due to the incorrect brcm tag location.

Add a new b53 device id (BCM583XX) for Cygnus family to fix the
issue. Add the new device id to the BCM58XX family as Cygnus
is similar to the BCM58XX in most other functionalities.

Fixes: 11606039 ("net: dsa: b53: Support prepended Broadcom tags")
Signed-off-by: default avatarArun Parameswaran <arun.parameswaran@broadcom.com>
Acked-by: default avatarScott Branden <scott.branden@broadcom.com>
Reported-by: default avatarClément Péron <peron.clem@gmail.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Tested-by: default avatarClément Péron <peron.clem@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4016a7f1
...@@ -684,7 +684,8 @@ static int b53_switch_reset(struct b53_device *dev) ...@@ -684,7 +684,8 @@ static int b53_switch_reset(struct b53_device *dev)
* still use this driver as a library and need to perform the reset * still use this driver as a library and need to perform the reset
* earlier. * earlier.
*/ */
if (dev->chip_id == BCM58XX_DEVICE_ID) { if (dev->chip_id == BCM58XX_DEVICE_ID ||
dev->chip_id == BCM583XX_DEVICE_ID) {
b53_read8(dev, B53_CTRL_PAGE, B53_SOFTRESET, &reg); b53_read8(dev, B53_CTRL_PAGE, B53_SOFTRESET, &reg);
reg |= SW_RST | EN_SW_RST | EN_CH_RST; reg |= SW_RST | EN_SW_RST | EN_CH_RST;
b53_write8(dev, B53_CTRL_PAGE, B53_SOFTRESET, reg); b53_write8(dev, B53_CTRL_PAGE, B53_SOFTRESET, reg);
...@@ -1935,6 +1936,18 @@ static const struct b53_chip_data b53_switch_chips[] = { ...@@ -1935,6 +1936,18 @@ static const struct b53_chip_data b53_switch_chips[] = {
.jumbo_pm_reg = B53_JUMBO_PORT_MASK, .jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE, .jumbo_size_reg = B53_JUMBO_MAX_SIZE,
}, },
{
.chip_id = BCM583XX_DEVICE_ID,
.dev_name = "BCM583xx/11360",
.vlans = 4096,
.enabled_ports = 0x103,
.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 = BCM7445_DEVICE_ID, .chip_id = BCM7445_DEVICE_ID,
.dev_name = "BCM7445", .dev_name = "BCM7445",
......
...@@ -62,6 +62,7 @@ enum { ...@@ -62,6 +62,7 @@ enum {
BCM53018_DEVICE_ID = 0x53018, BCM53018_DEVICE_ID = 0x53018,
BCM53019_DEVICE_ID = 0x53019, BCM53019_DEVICE_ID = 0x53019,
BCM58XX_DEVICE_ID = 0x5800, BCM58XX_DEVICE_ID = 0x5800,
BCM583XX_DEVICE_ID = 0x58300,
BCM7445_DEVICE_ID = 0x7445, BCM7445_DEVICE_ID = 0x7445,
BCM7278_DEVICE_ID = 0x7278, BCM7278_DEVICE_ID = 0x7278,
}; };
...@@ -181,6 +182,7 @@ static inline int is5301x(struct b53_device *dev) ...@@ -181,6 +182,7 @@ static inline int is5301x(struct b53_device *dev)
static inline int is58xx(struct b53_device *dev) static inline int is58xx(struct b53_device *dev)
{ {
return dev->chip_id == BCM58XX_DEVICE_ID || return dev->chip_id == BCM58XX_DEVICE_ID ||
dev->chip_id == BCM583XX_DEVICE_ID ||
dev->chip_id == BCM7445_DEVICE_ID || dev->chip_id == BCM7445_DEVICE_ID ||
dev->chip_id == BCM7278_DEVICE_ID; dev->chip_id == BCM7278_DEVICE_ID;
} }
......
...@@ -364,7 +364,7 @@ static const struct of_device_id b53_srab_of_match[] = { ...@@ -364,7 +364,7 @@ static const struct of_device_id b53_srab_of_match[] = {
{ .compatible = "brcm,bcm53018-srab" }, { .compatible = "brcm,bcm53018-srab" },
{ .compatible = "brcm,bcm53019-srab" }, { .compatible = "brcm,bcm53019-srab" },
{ .compatible = "brcm,bcm5301x-srab" }, { .compatible = "brcm,bcm5301x-srab" },
{ .compatible = "brcm,bcm11360-srab", .data = (void *)BCM58XX_DEVICE_ID }, { .compatible = "brcm,bcm11360-srab", .data = (void *)BCM583XX_DEVICE_ID },
{ .compatible = "brcm,bcm58522-srab", .data = (void *)BCM58XX_DEVICE_ID }, { .compatible = "brcm,bcm58522-srab", .data = (void *)BCM58XX_DEVICE_ID },
{ .compatible = "brcm,bcm58525-srab", .data = (void *)BCM58XX_DEVICE_ID }, { .compatible = "brcm,bcm58525-srab", .data = (void *)BCM58XX_DEVICE_ID },
{ .compatible = "brcm,bcm58535-srab", .data = (void *)BCM58XX_DEVICE_ID }, { .compatible = "brcm,bcm58535-srab", .data = (void *)BCM58XX_DEVICE_ID },
...@@ -372,7 +372,7 @@ static const struct of_device_id b53_srab_of_match[] = { ...@@ -372,7 +372,7 @@ static const struct of_device_id b53_srab_of_match[] = {
{ .compatible = "brcm,bcm58623-srab", .data = (void *)BCM58XX_DEVICE_ID }, { .compatible = "brcm,bcm58623-srab", .data = (void *)BCM58XX_DEVICE_ID },
{ .compatible = "brcm,bcm58625-srab", .data = (void *)BCM58XX_DEVICE_ID }, { .compatible = "brcm,bcm58625-srab", .data = (void *)BCM58XX_DEVICE_ID },
{ .compatible = "brcm,bcm88312-srab", .data = (void *)BCM58XX_DEVICE_ID }, { .compatible = "brcm,bcm88312-srab", .data = (void *)BCM58XX_DEVICE_ID },
{ .compatible = "brcm,cygnus-srab", .data = (void *)BCM58XX_DEVICE_ID }, { .compatible = "brcm,cygnus-srab", .data = (void *)BCM583XX_DEVICE_ID },
{ .compatible = "brcm,nsp-srab", .data = (void *)BCM58XX_DEVICE_ID }, { .compatible = "brcm,nsp-srab", .data = (void *)BCM58XX_DEVICE_ID },
{ /* sentinel */ }, { /* sentinel */ },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment