Message ID | 20240314-for-netnext-mt7530-better-fix-xtal-frequency-v2-1-fe30795593df@arinc9.com (mailing list archive) |
---|---|
State | Accepted |
Commit | f490c492e946d8ffbe65ad4efc66de3c5ede30a4 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net,v2] net: dsa: mt7530: prevent possible incorrect XTAL frequency selection | expand |
Hello: This patch was applied to netdev/net.git (main) by David S. Miller <davem@davemloft.net>: On Thu, 14 Mar 2024 12:28:35 +0300 you wrote: > From: Arınç ÜNAL <arinc.unal@arinc9.com> > > On MT7530, the HT_XTAL_FSEL field of the HWTRAP register stores a 2-bit > value that represents the frequency of the crystal oscillator connected to > the switch IC. The field is populated by the state of the ESW_P4_LED_0 and > ESW_P4_LED_0 pins, which is done right after reset is deasserted. > > [...] Here is the summary with links: - [net,v2] net: dsa: mt7530: prevent possible incorrect XTAL frequency selection https://git.kernel.org/netdev/net/c/f490c492e946 You are awesome, thank you!
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 678b51f9cea6..6986f538a4d0 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2192,22 +2192,16 @@ mt7530_setup(struct dsa_switch *ds) } } - /* Disable LEDs before reset to prevent the MT7530 sampling a - * potentially incorrect HT_XTAL_FSEL value. - */ - mt7530_write(priv, MT7530_LED_EN, 0); - usleep_range(1000, 1100); - /* Reset whole chip through gpio pin or memory-mapped registers for * different type of hardware */ if (priv->mcm) { reset_control_assert(priv->rstc); - usleep_range(1000, 1100); + usleep_range(5000, 5100); reset_control_deassert(priv->rstc); } else { gpiod_set_value_cansleep(priv->reset, 0); - usleep_range(1000, 1100); + usleep_range(5000, 5100); gpiod_set_value_cansleep(priv->reset, 1); } @@ -2420,11 +2414,11 @@ mt7531_setup(struct dsa_switch *ds) */ if (priv->mcm) { reset_control_assert(priv->rstc); - usleep_range(1000, 1100); + usleep_range(5000, 5100); reset_control_deassert(priv->rstc); } else { gpiod_set_value_cansleep(priv->reset, 0); - usleep_range(1000, 1100); + usleep_range(5000, 5100); gpiod_set_value_cansleep(priv->reset, 1); }