Message ID | 20240320-for-net-mt7530-fix-25mhz-xtal-with-direct-phy-access-v1-1-d92f605f1160@arinc9.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 5f563c31ff0c40ce395d0bae7daa94c7950dac97 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] net: dsa: mt7530: fix improper frames on all 25MHz and 40MHz XTAL MT7530 | expand |
Hello: This patch was applied to netdev/net.git (main) by Paolo Abeni <pabeni@redhat.com>: On Wed, 20 Mar 2024 23:45:30 +0300 you wrote: > From: Arınç ÜNAL <arinc.unal@arinc9.com> > > The MT7530 switch after reset initialises with a core clock frequency that > works with a 25MHz XTAL connected to it. For 40MHz XTAL, the core clock > frequency must be set to 500MHz. > > The mt7530_pll_setup() function is responsible of setting the core clock > frequency. Currently, it runs on MT7530 with 25MHz and 40MHz XTAL. This > causes MT7530 switch with 25MHz XTAL to egress and ingress frames > improperly. > > [...] Here is the summary with links: - [net] net: dsa: mt7530: fix improper frames on all 25MHz and 40MHz XTAL MT7530 https://git.kernel.org/netdev/net/c/5f563c31ff0c You are awesome, thank you!
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 6986f538a4d0..c856a13bc2f1 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2232,8 +2232,6 @@ mt7530_setup(struct dsa_switch *ds) SYS_CTRL_PHY_RST | SYS_CTRL_SW_RST | SYS_CTRL_REG_RST); - mt7530_pll_setup(priv); - /* Lower Tx driving for TRGMII path */ for (i = 0; i < NUM_TRGMII_CTRL; i++) mt7530_write(priv, MT7530_TRGMII_TD_ODT(i), @@ -2249,6 +2247,9 @@ mt7530_setup(struct dsa_switch *ds) val |= MHWTRAP_MANUAL; mt7530_write(priv, MT7530_MHWTRAP, val); + if ((val & HWTRAP_XTAL_MASK) == HWTRAP_XTAL_40MHZ) + mt7530_pll_setup(priv); + mt753x_trap_frames(priv); /* Enable and reset MIB counters */