*/
mt7530_write(priv, MT7530_PCR_P(port),
PCR_MATRIX(dsa_user_ports(priv->ds)));
-@@ -1130,27 +1454,42 @@ mt7530_port_vlan_del(struct dsa_switch *
+@@ -1122,27 +1446,42 @@ mt7530_port_vlan_del(struct dsa_switch *
return 0;
}
val = mt7530_read(priv, MT7530_PCR_P(port));
if (ingress) {
-@@ -1165,7 +1504,7 @@ static int mt7530_port_mirror_add(struct
+@@ -1157,7 +1496,7 @@ static int mt7530_port_mirror_add(struct
return 0;
}
struct dsa_mall_mirror_tc_entry *mirror)
{
struct mt7530_priv *priv = ds->priv;
-@@ -1182,9 +1521,9 @@ static void mt7530_port_mirror_del(struc
+@@ -1174,9 +1513,9 @@ static void mt7530_port_mirror_del(struc
mt7530_write(priv, MT7530_PCR_P(port), val);
if (!priv->mirror_rx && !priv->mirror_tx) {
}
}
-@@ -1290,7 +1629,7 @@ mt7530_setup(struct dsa_switch *ds)
+@@ -1282,7 +1621,7 @@ mt7530_setup(struct dsa_switch *ds)
PCR_MATRIX_CLR);
if (dsa_is_cpu_port(ds, i))
else
mt7530_port_disable(ds, i);
-@@ -1344,6 +1683,118 @@ mt7530_setup(struct dsa_switch *ds)
+@@ -1336,6 +1675,118 @@ mt7530_setup(struct dsa_switch *ds)
return 0;
}
static bool
mt7530_phy_mode_supported(struct dsa_switch *ds, int port,
const struct phylink_link_state *state)
-@@ -1382,6 +1833,47 @@ unsupported:
+@@ -1374,6 +1825,47 @@ unsupported:
return false;
}
static bool
mt753x_phy_mode_supported(struct dsa_switch *ds, int port,
const struct phylink_link_state *state)
-@@ -1414,6 +1906,227 @@ mt7530_mac_config(struct dsa_switch *ds,
+@@ -1406,6 +1898,227 @@ mt7530_mac_config(struct dsa_switch *ds,
return 0;
}
static int
mt753x_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
const struct phylink_link_state *state)
-@@ -1449,6 +2162,8 @@ mt753x_phylink_mac_config(struct dsa_swi
+@@ -1441,6 +2154,8 @@ mt753x_phylink_mac_config(struct dsa_swi
if (mt753x_mac_config(ds, port, mode, state) < 0)
goto unsupported;
break;
case 6: /* 1st cpu port */
if (priv->p6_interface == state->interface)
-@@ -1468,7 +2183,8 @@ unsupported:
+@@ -1460,7 +2175,8 @@ unsupported:
return;
}
dev_err(ds->dev, "%s: in-band negotiation unsupported\n",
__func__);
return;
-@@ -1478,7 +2194,7 @@ unsupported:
+@@ -1470,7 +2186,7 @@ unsupported:
mcr_new = mcr_cur;
mcr_new &= ~PMCR_LINK_SETTINGS_MASK;
mcr_new |= PMCR_IFG_XMIT(1) | PMCR_MAC_MODE | PMCR_BACKOFF_EN |
/* Are we connected to external phy */
if (port == 5 && dsa_is_user_port(ds, 5))
-@@ -1488,7 +2204,18 @@ unsupported:
+@@ -1480,7 +2196,18 @@ unsupported:
mt7530_write(priv, MT7530_PMCR_P(port), mcr_new);
}
unsigned int mode,
phy_interface_t interface)
{
-@@ -1497,7 +2224,19 @@ static void mt7530_phylink_mac_link_down
+@@ -1489,7 +2216,19 @@ static void mt7530_phylink_mac_link_down
mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK);
}
unsigned int mode,
phy_interface_t interface,
struct phy_device *phydev,
-@@ -1507,18 +2246,29 @@ static void mt7530_phylink_mac_link_up(s
+@@ -1499,18 +2238,29 @@ static void mt7530_phylink_mac_link_up(s
struct mt7530_priv *priv = ds->priv;
u32 mcr;
break;
}
if (duplex == DUPLEX_FULL) {
-@@ -1532,6 +2282,45 @@ static void mt7530_phylink_mac_link_up(s
+@@ -1524,6 +2274,45 @@ static void mt7530_phylink_mac_link_up(s
mt7530_set(priv, MT7530_PMCR_P(port), mcr);
}
static void
mt7530_mac_port_validate(struct dsa_switch *ds, int port,
unsigned long *supported)
-@@ -1540,6 +2329,14 @@ mt7530_mac_port_validate(struct dsa_swit
+@@ -1532,6 +2321,14 @@ mt7530_mac_port_validate(struct dsa_swit
phylink_set(supported, 1000baseX_Full);
}
static void
mt753x_phylink_validate(struct dsa_switch *ds, int port,
unsigned long *supported,
-@@ -1556,7 +2353,8 @@ mt753x_phylink_validate(struct dsa_switc
+@@ -1548,7 +2345,8 @@ mt753x_phylink_validate(struct dsa_switc
phylink_set_port_modes(mask);
phylink_set(mask, 10baseT_Half);
phylink_set(mask, 10baseT_Full);
phylink_set(mask, 100baseT_Half);
-@@ -1575,6 +2373,11 @@ mt753x_phylink_validate(struct dsa_switc
+@@ -1567,6 +2365,11 @@ mt753x_phylink_validate(struct dsa_switc
linkmode_and(supported, supported, mask);
linkmode_and(state->advertising, state->advertising, mask);
}
static int
-@@ -1665,6 +2468,63 @@ static int mt7530_set_mac_eee(struct dsa
+@@ -1657,6 +2460,63 @@ static int mt7530_set_mac_eee(struct dsa
return 0;
}
static int
mt753x_phylink_mac_link_state(struct dsa_switch *ds, int port,
struct phylink_link_state *state)
-@@ -1718,13 +2578,14 @@ static const struct dsa_switch_ops mt753
+@@ -1710,13 +2570,14 @@ static const struct dsa_switch_ops mt753
.port_vlan_prepare = mt7530_port_vlan_prepare,
.port_vlan_add = mt7530_port_vlan_add,
.port_vlan_del = mt7530_port_vlan_del,
.get_mac_eee = mt7530_get_mac_eee,
.set_mac_eee = mt7530_set_mac_eee,
};
-@@ -1752,11 +2613,26 @@ static const struct mt753x_info mt753x_t
+@@ -1744,11 +2605,26 @@ static const struct mt753x_info mt753x_t
.mac_port_get_state = mt7530_phylink_mac_link_state,
.mac_port_config = mt7530_mac_config,
},