1 From e612922de7070a28802216650ee88128a57290de Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= <arinc.unal@arinc9.com>
3 Date: Tue, 6 Feb 2024 01:08:05 +0300
4 Subject: [PATCH 15/30] net: dsa: mt7530: call port 6 setup from
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 mt7530_pad_clk_setup() is called if port 6 is enabled. It used to do more
11 things than setting up port 6. That part was moved to more appropriate
12 locations, mt7530_setup() and mt7530_pll_setup().
14 Now that all it does is set up port 6, rename it to mt7530_setup_port6(),
15 and move it to a more appropriate location, under mt7530_mac_config().
17 Change mt7530_setup_port6() to void as there're no error cases.
19 Leave an empty mt7530_pad_clk_setup() to satisfy the pad_setup function
22 This is the code path for setting up the ports before:
24 dsa_switch_ops :: phylink_mac_config() -> mt753x_phylink_mac_config()
25 -> mt753x_mac_config()
26 -> mt753x_info :: mac_port_config() -> mt7530_mac_config()
27 -> mt7530_setup_port5()
29 -> mt753x_info :: pad_setup() -> mt7530_pad_clk_setup()
33 dsa_switch_ops :: phylink_mac_config() -> mt753x_phylink_mac_config()
34 -> mt753x_mac_config()
35 -> mt753x_info :: mac_port_config() -> mt7530_mac_config()
36 -> mt7530_setup_port5()
37 -> mt7530_setup_port6()
39 Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
40 Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
41 Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
42 Link: https://lore.kernel.org/r/20240206-for-netnext-mt7530-improvements-2-v5-4-d7d92a185cb1@arinc9.com
43 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
45 drivers/net/dsa/mt7530.c | 19 +++++++++++--------
46 1 file changed, 11 insertions(+), 8 deletions(-)
48 --- a/drivers/net/dsa/mt7530.c
49 +++ b/drivers/net/dsa/mt7530.c
50 @@ -414,8 +414,8 @@ mt753x_preferred_default_local_cpu_port(
53 /* Setup port 6 interface mode and TRGMII TX circuit */
55 -mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface)
57 +mt7530_setup_port6(struct dsa_switch *ds, phy_interface_t interface)
59 struct mt7530_priv *priv = ds->priv;
60 u32 ncpo1, ssc_delta, xtal;
61 @@ -426,7 +426,7 @@ mt7530_pad_clk_setup(struct dsa_switch *
62 if (interface == PHY_INTERFACE_MODE_RGMII) {
63 mt7530_rmw(priv, MT7530_P6ECR, P6_INTF_MODE_MASK,
69 mt7530_rmw(priv, MT7530_P6ECR, P6_INTF_MODE_MASK, P6_INTF_MODE(1));
70 @@ -465,7 +465,11 @@ mt7530_pad_clk_setup(struct dsa_switch *
72 /* Enable the MT7530 TRGMII clocks */
73 core_set(priv, CORE_TRGMII_GSW_CLK_CG, REG_TRGMIICK_EN);
77 +mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface)
82 @@ -2826,11 +2830,10 @@ mt7530_mac_config(struct dsa_switch *ds,
84 struct mt7530_priv *priv = ds->priv;
86 - /* Only need to setup port5. */
90 - mt7530_setup_port5(priv->ds, interface);
92 + mt7530_setup_port5(priv->ds, interface);
94 + mt7530_setup_port6(priv->ds, interface);