@@ -331,9 +331,9 @@ static void b53_set_forwarding(struct b53_device *dev, int enable)
b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, &mgmt);
if (enable)
- mgmt |= SM_SW_FWD_EN;
+ mgmt |= SM_SW_FWD_EN | SM_SW_FWD_MODE;
else
- mgmt &= ~SM_SW_FWD_EN;
+ mgmt &= ~(SM_SW_FWD_EN | SM_SW_FWD_MODE);
b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, mgmt);
@@ -364,8 +364,6 @@ static void b53_enable_vlan(struct b53_device *dev, bool enable,
b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL5, &vc5);
}
- mgmt &= ~SM_SW_FWD_MODE;
-
if (enable) {
vc0 |= VC0_VLAN_EN | VC0_VID_CHK_EN | VC0_VID_HASH_VID;
vc1 |= VC1_RX_MCST_UNTAG_EN | VC1_RX_MCST_FWD_EN;
@@ -589,6 +587,19 @@ void b53_brcm_hdr_setup(struct dsa_switch *ds, int port)
hdr_ctl &= ~val;
b53_write8(dev, B53_MGMT_PAGE, B53_BRCM_HDR, hdr_ctl);
+ /* Set IMP port number, necessary for Broadcom tags to be used
+ * while in managed mode
+ */
+ if (tag_en) {
+ b53_read8(dev, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, &hdr_ctl);
+ hdr_ctl &= ~GC_FRM_MGMT_PORT_M;
+ val = 0;
+ if (port == 8)
+ val = GC_FRM_MGMT_PORT_MII;
+ hdr_ctl |= val;
+ b53_write8(dev, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, hdr_ctl);
+ }
+
/* Registers below are only accessible on newer devices */
if (!is58xx(dev))
return;
@@ -53,9 +53,6 @@ static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port)
reg &= ~(RX_DIS | TX_DIS);
core_writel(priv, reg, CORE_IMP_CTL);
- /* Enable forwarding */
- core_writel(priv, SW_FWDG_EN, CORE_SWMODE);
-
/* Enable IMP port in dumb mode */
reg = core_readl(priv, CORE_SWITCH_CTRL);
reg |= MII_DUMB_FWDG_EN;