diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2017-11-11 02:22:55 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-13 04:34:54 +0300 |
commit | 11606039604c4ce2d3c5045e30efb0c687a6a0de (patch) | |
tree | 67604fef5c28a9d6ac6cbd6cd052d9818e5c6fc6 /drivers/net/dsa/b53/b53_common.c | |
parent | b74b70c44986dee87881fbed3d912e02c5dcf78c (diff) | |
download | linux-11606039604c4ce2d3c5045e30efb0c687a6a0de.tar.xz |
net: dsa: b53: Support prepended Broadcom tags
On BCM58xx devices (Northstar Plus), there is an accelerator attached to
port 8 which would only work if we use prepended Broadcom tags. Resolve
that difference in our get_tag_protocol() function by setting the
appropriate tagging protocol in that case. We need to change
b53_brcm_hdr_setup() a little bit now since we can deal with two types
of Broadcom tags.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/b53/b53_common.c')
-rw-r--r-- | drivers/net/dsa/b53/b53_common.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index f72aeb9ed12a..f5a8dd96fd75 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -541,8 +541,8 @@ EXPORT_SYMBOL(b53_disable_port); void b53_brcm_hdr_setup(struct dsa_switch *ds, int port) { - bool tag_en = !!(ds->ops->get_tag_protocol(ds, port) == - DSA_TAG_PROTO_BRCM); + bool tag_en = !(ds->ops->get_tag_protocol(ds, port) == + DSA_TAG_PROTO_NONE); struct b53_device *dev = ds->priv; u8 hdr_ctl, val; u16 reg; @@ -1505,8 +1505,14 @@ static enum dsa_tag_protocol b53_get_tag_protocol(struct dsa_switch *ds, */ if (is5325(dev) || is5365(dev) || !b53_can_enable_brcm_tags(ds, port)) return DSA_TAG_PROTO_NONE; - else - return DSA_TAG_PROTO_BRCM; + + /* Broadcom BCM58xx chips have a flow accelerator on Port 8 + * which requires us to use the prepended Broadcom tag type + */ + if (dev->chip_id == BCM58XX_DEVICE_ID && port == B53_CPU_PORT) + return DSA_TAG_PROTO_BRCM_PREPEND; + + return DSA_TAG_PROTO_BRCM; } int b53_mirror_add(struct dsa_switch *ds, int port, |