@@ -976,7 +976,9 @@ static void mt7530_setup_port5(struct dsa_switch *ds, phy_interface_t interface)
dev_dbg(ds->dev, "Setup P5, HWTRAP=0x%x, intf_sel=%s, phy-mode=%s\n",
val, p5_intf_modes(priv->p5_intf_sel), phy_modes(interface));
- priv->p5_interface = interface;
+ if (priv->p5_intf_sel == P5_INTF_SEL_PHY_P0 ||
+ priv->p5_intf_sel == P5_INTF_SEL_PHY_P4)
+ priv->p5_interface = interface;
unlock_exit:
mutex_unlock(&priv->reg_mutex);
@@ -2746,7 +2748,8 @@ mt753x_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
if (mt753x_mac_config(ds, port, mode, state) < 0)
goto unsupported;
- if (priv->p5_intf_sel != P5_DISABLED)
+ if (priv->p5_intf_sel == P5_INTF_SEL_GMAC5 ||
+ priv->p5_intf_sel == P5_INTF_SEL_GMAC5_SGMII)
priv->p5_interface = state->interface;
break;
case 6: /* Port 6, a CPU port. */