|
@@ -33,7 +33,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
/* String, offset, and register size in bytes if different from 4 bytes */
|
|
/* String, offset, and register size in bytes if different from 4 bytes */
|
|
|
static const struct mt7530_mib_desc mt7530_mib[] = {
|
|
static const struct mt7530_mib_desc mt7530_mib[] = {
|
|
|
MIB_DESC(1, 0x00, "TxDrop"),
|
|
MIB_DESC(1, 0x00, "TxDrop"),
|
|
|
-@@ -2631,12 +2636,11 @@ static int mt7531_rgmii_setup(struct mt7
|
|
|
|
|
|
|
+@@ -2792,12 +2797,11 @@ static int mt7531_rgmii_setup(struct mt7
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -50,7 +50,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
unsigned int val;
|
|
unsigned int val;
|
|
|
|
|
|
|
|
/* For adjusting speed and duplex of SGMII force mode. */
|
|
/* For adjusting speed and duplex of SGMII force mode. */
|
|
|
-@@ -2662,6 +2666,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw
|
|
|
|
|
|
|
+@@ -2823,6 +2827,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw
|
|
|
|
|
|
|
|
/* MT7531 SGMII 1G force mode can only work in full duplex mode,
|
|
/* MT7531 SGMII 1G force mode can only work in full duplex mode,
|
|
|
* no matter MT7531_SGMII_FORCE_HALF_DUPLEX is set or not.
|
|
* no matter MT7531_SGMII_FORCE_HALF_DUPLEX is set or not.
|
|
@@ -60,7 +60,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
*/
|
|
*/
|
|
|
if ((speed == SPEED_10 || speed == SPEED_100) &&
|
|
if ((speed == SPEED_10 || speed == SPEED_100) &&
|
|
|
duplex != DUPLEX_FULL)
|
|
duplex != DUPLEX_FULL)
|
|
|
-@@ -2737,9 +2744,10 @@ static int mt7531_sgmii_setup_mode_an(st
|
|
|
|
|
|
|
+@@ -2898,9 +2905,10 @@ static int mt7531_sgmii_setup_mode_an(st
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -73,7 +73,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
u32 val;
|
|
u32 val;
|
|
|
|
|
|
|
|
/* Only restart AN when AN is enabled */
|
|
/* Only restart AN when AN is enabled */
|
|
|
-@@ -2796,6 +2804,24 @@ mt753x_mac_config(struct dsa_switch *ds,
|
|
|
|
|
|
|
+@@ -2957,6 +2965,24 @@ mt753x_mac_config(struct dsa_switch *ds,
|
|
|
return priv->info->mac_port_config(ds, port, mode, state->interface);
|
|
return priv->info->mac_port_config(ds, port, mode, state->interface);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -98,7 +98,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
static void
|
|
static void
|
|
|
mt753x_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
|
|
mt753x_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
|
|
|
const struct phylink_link_state *state)
|
|
const struct phylink_link_state *state)
|
|
|
-@@ -2857,17 +2883,6 @@ unsupported:
|
|
|
|
|
|
|
+@@ -3018,17 +3044,6 @@ unsupported:
|
|
|
mt7530_write(priv, MT7530_PMCR_P(port), mcr_new);
|
|
mt7530_write(priv, MT7530_PMCR_P(port), mcr_new);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -116,7 +116,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
static void mt753x_phylink_mac_link_down(struct dsa_switch *ds, int port,
|
|
static void mt753x_phylink_mac_link_down(struct dsa_switch *ds, int port,
|
|
|
unsigned int mode,
|
|
unsigned int mode,
|
|
|
phy_interface_t interface)
|
|
phy_interface_t interface)
|
|
|
-@@ -2877,16 +2892,13 @@ static void mt753x_phylink_mac_link_down
|
|
|
|
|
|
|
+@@ -3038,16 +3053,13 @@ static void mt753x_phylink_mac_link_down
|
|
|
mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK);
|
|
mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -139,7 +139,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static void mt753x_phylink_mac_link_up(struct dsa_switch *ds, int port,
|
|
static void mt753x_phylink_mac_link_up(struct dsa_switch *ds, int port,
|
|
|
-@@ -2899,8 +2911,6 @@ static void mt753x_phylink_mac_link_up(s
|
|
|
|
|
|
|
+@@ -3060,8 +3072,6 @@ static void mt753x_phylink_mac_link_up(s
|
|
|
struct mt7530_priv *priv = ds->priv;
|
|
struct mt7530_priv *priv = ds->priv;
|
|
|
u32 mcr;
|
|
u32 mcr;
|
|
|
|
|
|
|
@@ -148,7 +148,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
mcr = PMCR_RX_EN | PMCR_TX_EN | PMCR_FORCE_LNK;
|
|
mcr = PMCR_RX_EN | PMCR_TX_EN | PMCR_FORCE_LNK;
|
|
|
|
|
|
|
|
/* MT753x MAC works in 1G full duplex mode for all up-clocked
|
|
/* MT753x MAC works in 1G full duplex mode for all up-clocked
|
|
|
-@@ -2978,6 +2988,8 @@ mt7531_cpu_port_config(struct dsa_switch
|
|
|
|
|
|
|
+@@ -3139,6 +3149,8 @@ mt7531_cpu_port_config(struct dsa_switch
|
|
|
return ret;
|
|
return ret;
|
|
|
mt7530_write(priv, MT7530_PMCR_P(port),
|
|
mt7530_write(priv, MT7530_PMCR_P(port),
|
|
|
PMCR_CPU_PORT_SETTING(priv->id));
|
|
PMCR_CPU_PORT_SETTING(priv->id));
|
|
@@ -157,7 +157,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
mt753x_phylink_mac_link_up(ds, port, MLO_AN_FIXED, interface, NULL,
|
|
mt753x_phylink_mac_link_up(ds, port, MLO_AN_FIXED, interface, NULL,
|
|
|
speed, DUPLEX_FULL, true, true);
|
|
speed, DUPLEX_FULL, true, true);
|
|
|
|
|
|
|
|
-@@ -3017,16 +3029,13 @@ mt753x_phylink_validate(struct dsa_switc
|
|
|
|
|
|
|
+@@ -3178,16 +3190,13 @@ mt753x_phylink_validate(struct dsa_switc
|
|
|
linkmode_and(state->advertising, state->advertising, mask);
|
|
linkmode_and(state->advertising, state->advertising, mask);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -178,7 +178,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
pmsr = mt7530_read(priv, MT7530_PMSR_P(port));
|
|
pmsr = mt7530_read(priv, MT7530_PMSR_P(port));
|
|
|
|
|
|
|
|
state->link = (pmsr & PMSR_LINK);
|
|
state->link = (pmsr & PMSR_LINK);
|
|
|
-@@ -3053,8 +3062,6 @@ mt7530_phylink_mac_link_state(struct dsa
|
|
|
|
|
|
|
+@@ -3214,8 +3223,6 @@ mt7530_phylink_mac_link_state(struct dsa
|
|
|
state->pause |= MLO_PAUSE_RX;
|
|
state->pause |= MLO_PAUSE_RX;
|
|
|
if (pmsr & PMSR_TX_FC)
|
|
if (pmsr & PMSR_TX_FC)
|
|
|
state->pause |= MLO_PAUSE_TX;
|
|
state->pause |= MLO_PAUSE_TX;
|
|
@@ -187,7 +187,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
static int
|
|
|
-@@ -3096,32 +3103,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
|
|
|
|
|
|
|
+@@ -3257,32 +3264,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -249,7 +249,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
|
|
|
|
|
if (ret)
|
|
if (ret)
|
|
|
return ret;
|
|
return ret;
|
|
|
-@@ -3134,6 +3158,13 @@ mt753x_setup(struct dsa_switch *ds)
|
|
|
|
|
|
|
+@@ -3295,6 +3319,13 @@ mt753x_setup(struct dsa_switch *ds)
|
|
|
if (ret && priv->irq)
|
|
if (ret && priv->irq)
|
|
|
mt7530_free_irq_common(priv);
|
|
mt7530_free_irq_common(priv);
|
|
|
|
|
|
|
@@ -263,7 +263,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
return ret;
|
|
return ret;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-@@ -3195,9 +3226,8 @@ static const struct dsa_switch_ops mt753
|
|
|
|
|
|
|
+@@ -3356,9 +3387,8 @@ static const struct dsa_switch_ops mt753
|
|
|
.port_mirror_del = mt753x_port_mirror_del,
|
|
.port_mirror_del = mt753x_port_mirror_del,
|
|
|
.phylink_get_caps = mt753x_phylink_get_caps,
|
|
.phylink_get_caps = mt753x_phylink_get_caps,
|
|
|
.phylink_validate = mt753x_phylink_validate,
|
|
.phylink_validate = mt753x_phylink_validate,
|
|
@@ -274,7 +274,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
.phylink_mac_link_down = mt753x_phylink_mac_link_down,
|
|
.phylink_mac_link_down = mt753x_phylink_mac_link_down,
|
|
|
.phylink_mac_link_up = mt753x_phylink_mac_link_up,
|
|
.phylink_mac_link_up = mt753x_phylink_mac_link_up,
|
|
|
.get_mac_eee = mt753x_get_mac_eee,
|
|
.get_mac_eee = mt753x_get_mac_eee,
|
|
|
-@@ -3207,36 +3237,34 @@ static const struct dsa_switch_ops mt753
|
|
|
|
|
|
|
+@@ -3368,36 +3398,34 @@ static const struct dsa_switch_ops mt753
|
|
|
static const struct mt753x_info mt753x_table[] = {
|
|
static const struct mt753x_info mt753x_table[] = {
|
|
|
[ID_MT7621] = {
|
|
[ID_MT7621] = {
|
|
|
.id = ID_MT7621,
|
|
.id = ID_MT7621,
|
|
@@ -314,7 +314,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-@@ -3294,7 +3322,7 @@ mt7530_probe(struct mdio_device *mdiodev
|
|
|
|
|
|
|
+@@ -3455,7 +3483,7 @@ mt7530_probe(struct mdio_device *mdiodev
|
|
|
if (!priv->info->sw_setup || !priv->info->pad_setup ||
|
|
if (!priv->info->sw_setup || !priv->info->pad_setup ||
|
|
|
!priv->info->phy_read || !priv->info->phy_write ||
|
|
!priv->info->phy_read || !priv->info->phy_write ||
|
|
|
!priv->info->mac_port_get_caps ||
|
|
!priv->info->mac_port_get_caps ||
|
|
@@ -325,7 +325,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
priv->id = priv->info->id;
|
|
priv->id = priv->info->id;
|
|
|
--- a/drivers/net/dsa/mt7530.h
|
|
--- a/drivers/net/dsa/mt7530.h
|
|
|
+++ b/drivers/net/dsa/mt7530.h
|
|
+++ b/drivers/net/dsa/mt7530.h
|
|
|
-@@ -768,6 +768,12 @@ static const char *p5_intf_modes(unsigne
|
|
|
|
|
|
|
+@@ -773,6 +773,12 @@ static const char *p5_intf_modes(unsigne
|
|
|
|
|
|
|
|
struct mt7530_priv;
|
|
struct mt7530_priv;
|
|
|
|
|
|
|
@@ -338,7 +338,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
/* struct mt753x_info - This is the main data structure for holding the specific
|
|
/* struct mt753x_info - This is the main data structure for holding the specific
|
|
|
* part for each supported device
|
|
* part for each supported device
|
|
|
* @sw_setup: Holding the handler to a device initialization
|
|
* @sw_setup: Holding the handler to a device initialization
|
|
|
-@@ -779,18 +785,14 @@ struct mt7530_priv;
|
|
|
|
|
|
|
+@@ -784,18 +790,14 @@ struct mt7530_priv;
|
|
|
* port
|
|
* port
|
|
|
* @mac_port_validate: Holding the way to set addition validate type for a
|
|
* @mac_port_validate: Holding the way to set addition validate type for a
|
|
|
* certan MAC port
|
|
* certan MAC port
|
|
@@ -359,7 +359,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
int (*sw_setup)(struct dsa_switch *ds);
|
|
int (*sw_setup)(struct dsa_switch *ds);
|
|
|
int (*phy_read)(struct mt7530_priv *priv, int port, int regnum);
|
|
int (*phy_read)(struct mt7530_priv *priv, int port, int regnum);
|
|
|
int (*phy_write)(struct mt7530_priv *priv, int port, int regnum, u16 val);
|
|
int (*phy_write)(struct mt7530_priv *priv, int port, int regnum, u16 val);
|
|
|
-@@ -801,15 +803,9 @@ struct mt753x_info {
|
|
|
|
|
|
|
+@@ -806,15 +808,9 @@ struct mt753x_info {
|
|
|
void (*mac_port_validate)(struct dsa_switch *ds, int port,
|
|
void (*mac_port_validate)(struct dsa_switch *ds, int port,
|
|
|
phy_interface_t interface,
|
|
phy_interface_t interface,
|
|
|
unsigned long *supported);
|
|
unsigned long *supported);
|
|
@@ -375,7 +375,7 @@ Signed-off-by: Paolo Abeni <[email protected]>
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/* struct mt7530_priv - This is the main data structure for holding the state
|
|
/* struct mt7530_priv - This is the main data structure for holding the state
|
|
|
-@@ -851,6 +847,7 @@ struct mt7530_priv {
|
|
|
|
|
|
|
+@@ -856,6 +852,7 @@ struct mt7530_priv {
|
|
|
u8 mirror_tx;
|
|
u8 mirror_tx;
|
|
|
|
|
|
|
|
struct mt7530_port ports[MT7530_NUM_PORTS];
|
|
struct mt7530_port ports[MT7530_NUM_PORTS];
|