Skip to content

Commit 42bc4fa

Browse files
lynxiskuba-moo
authored andcommitted
net: mt7531: only do PLL once after the reset
Move the PLL init of the switch out of the pad configuration of the port 6 (usally cpu port). Fix a unidirectional 100 mbit limitation on 1 gbit or 2.5 gbit links for outbound traffic on port 5 or port 6. Fixes: c288575 ("net: dsa: mt7530: Add the support of MT7531 switch") Cc: stable@vger.kernel.org Signed-off-by: Alexander Couzens <lynxis@fe80.eu> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent f8497b3 commit 42bc4fa

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

drivers/net/dsa/mt7530.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -506,14 +506,19 @@ static bool mt7531_dual_sgmii_supported(struct mt7530_priv *priv)
506506
static int
507507
mt7531_pad_setup(struct dsa_switch *ds, phy_interface_t interface)
508508
{
509-
struct mt7530_priv *priv = ds->priv;
509+
return 0;
510+
}
511+
512+
static void
513+
mt7531_pll_setup(struct mt7530_priv *priv)
514+
{
510515
u32 top_sig;
511516
u32 hwstrap;
512517
u32 xtal;
513518
u32 val;
514519

515520
if (mt7531_dual_sgmii_supported(priv))
516-
return 0;
521+
return;
517522

518523
val = mt7530_read(priv, MT7531_CREV);
519524
top_sig = mt7530_read(priv, MT7531_TOP_SIG_SR);
@@ -592,8 +597,6 @@ mt7531_pad_setup(struct dsa_switch *ds, phy_interface_t interface)
592597
val |= EN_COREPLL;
593598
mt7530_write(priv, MT7531_PLLGP_EN, val);
594599
usleep_range(25, 35);
595-
596-
return 0;
597600
}
598601

599602
static void
@@ -2331,6 +2334,8 @@ mt7531_setup(struct dsa_switch *ds)
23312334
SYS_CTRL_PHY_RST | SYS_CTRL_SW_RST |
23322335
SYS_CTRL_REG_RST);
23332336

2337+
mt7531_pll_setup(priv);
2338+
23342339
if (mt7531_dual_sgmii_supported(priv)) {
23352340
priv->p5_intf_sel = P5_INTF_SEL_GMAC5_SGMII;
23362341

@@ -2887,8 +2892,6 @@ mt7531_cpu_port_config(struct dsa_switch *ds, int port)
28872892
case 6:
28882893
interface = PHY_INTERFACE_MODE_2500BASEX;
28892894

2890-
mt7531_pad_setup(ds, interface);
2891-
28922895
priv->p6_interface = interface;
28932896
break;
28942897
default:

0 commit comments

Comments
 (0)