Commit a424f0de authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

net: dsa: b53: Include IMP/CPU port in dumb forwarding mode

Since Broadcom tags are not enabled in b53 (DSA_PROTO_TAG_NONE), we need
to make sure that the IMP/CPU port is included in the forwarding
decision.

Without this change, switching between non-management ports would work,
but not between management ports and non-management ports thus breaking
the default state in which DSA switch are brought up.

Fixes: 967dd82f ("net: dsa: b53: Add support for Broadcom RoboSwitch")
Reported-by: default avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 38baf3a6
...@@ -326,6 +326,7 @@ static void b53_get_vlan_entry(struct b53_device *dev, u16 vid, ...@@ -326,6 +326,7 @@ static void b53_get_vlan_entry(struct b53_device *dev, u16 vid,
static void b53_set_forwarding(struct b53_device *dev, int enable) static void b53_set_forwarding(struct b53_device *dev, int enable)
{ {
struct dsa_switch *ds = dev->ds;
u8 mgmt; u8 mgmt;
b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, &mgmt); b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, &mgmt);
...@@ -336,6 +337,15 @@ static void b53_set_forwarding(struct b53_device *dev, int enable) ...@@ -336,6 +337,15 @@ static void b53_set_forwarding(struct b53_device *dev, int enable)
mgmt &= ~SM_SW_FWD_EN; mgmt &= ~SM_SW_FWD_EN;
b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, mgmt); b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, mgmt);
/* Include IMP port in dumb forwarding mode when no tagging protocol is
* set
*/
if (ds->ops->get_tag_protocol(ds) == DSA_TAG_PROTO_NONE) {
b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_CTRL, &mgmt);
mgmt |= B53_MII_DUMB_FWDG_EN;
b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_CTRL, mgmt);
}
} }
static void b53_enable_vlan(struct b53_device *dev, bool enable) static void b53_enable_vlan(struct b53_device *dev, bool enable)
......
...@@ -104,6 +104,10 @@ ...@@ -104,6 +104,10 @@
#define B53_UC_FWD_EN BIT(6) #define B53_UC_FWD_EN BIT(6)
#define B53_MC_FWD_EN BIT(7) #define B53_MC_FWD_EN BIT(7)
/* Switch control (8 bit) */
#define B53_SWITCH_CTRL 0x22
#define B53_MII_DUMB_FWDG_EN BIT(6)
/* (16 bit) */ /* (16 bit) */
#define B53_UC_FLOOD_MASK 0x32 #define B53_UC_FLOOD_MASK 0x32
#define B53_MC_FLOOD_MASK 0x34 #define B53_MC_FLOOD_MASK 0x34
......
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