/* String, offset, and register size in bytes if different from 4 bytes */
static const struct mt7530_mib_desc mt7530_mib[] = {
MIB_DESC(1, 0x00, "TxDrop"),
-@@ -2539,12 +2544,11 @@ static int mt7531_rgmii_setup(struct mt7
+@@ -2544,12 +2549,11 @@ static int mt7531_rgmii_setup(struct mt7
return 0;
}
unsigned int val;
/* For adjusting speed and duplex of SGMII force mode. */
-@@ -2570,6 +2574,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw
+@@ -2575,6 +2579,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw
/* MT7531 SGMII 1G force mode can only work in full duplex mode,
* no matter MT7531_SGMII_FORCE_HALF_DUPLEX is set or not.
*/
if ((speed == SPEED_10 || speed == SPEED_100) &&
duplex != DUPLEX_FULL)
-@@ -2645,9 +2652,10 @@ static int mt7531_sgmii_setup_mode_an(st
+@@ -2650,9 +2657,10 @@ static int mt7531_sgmii_setup_mode_an(st
return 0;
}
u32 val;
/* Only restart AN when AN is enabled */
-@@ -2704,6 +2712,24 @@ mt753x_mac_config(struct dsa_switch *ds,
+@@ -2709,6 +2717,24 @@ mt753x_mac_config(struct dsa_switch *ds,
return priv->info->mac_port_config(ds, port, mode, state->interface);
}
static void
mt753x_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
const struct phylink_link_state *state)
-@@ -2765,17 +2791,6 @@ unsupported:
+@@ -2770,17 +2796,6 @@ unsupported:
mt7530_write(priv, MT7530_PMCR_P(port), mcr_new);
}
static void mt753x_phylink_mac_link_down(struct dsa_switch *ds, int port,
unsigned int mode,
phy_interface_t interface)
-@@ -2785,16 +2800,13 @@ static void mt753x_phylink_mac_link_down
+@@ -2790,16 +2805,13 @@ static void mt753x_phylink_mac_link_down
mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK);
}
}
static void mt753x_phylink_mac_link_up(struct dsa_switch *ds, int port,
-@@ -2807,8 +2819,6 @@ static void mt753x_phylink_mac_link_up(s
+@@ -2812,8 +2824,6 @@ static void mt753x_phylink_mac_link_up(s
struct mt7530_priv *priv = ds->priv;
u32 mcr;
mcr = PMCR_RX_EN | PMCR_TX_EN | PMCR_FORCE_LNK;
/* MT753x MAC works in 1G full duplex mode for all up-clocked
-@@ -2886,6 +2896,8 @@ mt7531_cpu_port_config(struct dsa_switch
+@@ -2891,6 +2901,8 @@ mt7531_cpu_port_config(struct dsa_switch
return ret;
mt7530_write(priv, MT7530_PMCR_P(port),
PMCR_CPU_PORT_SETTING(priv->id));
mt753x_phylink_mac_link_up(ds, port, MLO_AN_FIXED, interface, NULL,
speed, DUPLEX_FULL, true, true);
-@@ -2925,16 +2937,13 @@ mt753x_phylink_validate(struct dsa_switc
+@@ -2930,16 +2942,13 @@ mt753x_phylink_validate(struct dsa_switc
linkmode_and(state->advertising, state->advertising, mask);
}
pmsr = mt7530_read(priv, MT7530_PMSR_P(port));
state->link = (pmsr & PMSR_LINK);
-@@ -2961,8 +2970,6 @@ mt7530_phylink_mac_link_state(struct dsa
+@@ -2966,8 +2975,6 @@ mt7530_phylink_mac_link_state(struct dsa
state->pause |= MLO_PAUSE_RX;
if (pmsr & PMSR_TX_FC)
state->pause |= MLO_PAUSE_TX;
}
static int
-@@ -3004,32 +3011,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
+@@ -3009,32 +3016,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
return 0;
}
if (ret)
return ret;
-@@ -3042,6 +3066,13 @@ mt753x_setup(struct dsa_switch *ds)
+@@ -3047,6 +3071,13 @@ mt753x_setup(struct dsa_switch *ds)
if (ret && priv->irq)
mt7530_free_irq_common(priv);
return ret;
}
-@@ -3103,9 +3134,8 @@ static const struct dsa_switch_ops mt753
+@@ -3108,9 +3139,8 @@ static const struct dsa_switch_ops mt753
.port_mirror_del = mt753x_port_mirror_del,
.phylink_get_caps = mt753x_phylink_get_caps,
.phylink_validate = mt753x_phylink_validate,
.phylink_mac_link_down = mt753x_phylink_mac_link_down,
.phylink_mac_link_up = mt753x_phylink_mac_link_up,
.get_mac_eee = mt753x_get_mac_eee,
-@@ -3115,36 +3145,34 @@ static const struct dsa_switch_ops mt753
+@@ -3120,36 +3150,34 @@ static const struct dsa_switch_ops mt753
static const struct mt753x_info mt753x_table[] = {
[ID_MT7621] = {
.id = ID_MT7621,
},
};
-@@ -3202,7 +3230,7 @@ mt7530_probe(struct mdio_device *mdiodev
+@@ -3207,7 +3235,7 @@ mt7530_probe(struct mdio_device *mdiodev
if (!priv->info->sw_setup || !priv->info->pad_setup ||
!priv->info->phy_read || !priv->info->phy_write ||
!priv->info->mac_port_get_caps ||