mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-21 22:47:56 +00:00
401a6ccfaf
Backport lots upstream changes, many of them fixes, for the mt7530 DSA driver. Some of them may or may not find they way into Linux 6.1 stable, some certainly won't because they are fixes for backported commits which aren't even present in Linux 6.1 upstream. Apart from adding new patches, also remove mutated patch 723-net-mt7531-ensure-all-MACs-are-powered-down-before-r.patch which should never have been added for Linux 6.1 -- it was applied already upstream but coincidentally would fuzzy-apply in the wrong place as well (for MT7530 instead of MT7531). While that didn't really hurt anyone it is just unneeded. The other deleted patch 795-mt7530-register-OF-node-for-internal-MDIO-bus.patch has been replaced by an equivalent commit with a more complete patch description by upstream maintainer Arınç Ünal. The remaining differences compared to the upstream driver are: * C22/C45 MDIO ops aren't split Upstream did that, backporting it would require making changes to *all* DSA drivers * 'slave' -> 'user', 'master' -> 'conduit' language change in DSA * support for selecting preferred CPU port on MT7531 Also this would require too many DSA framework changes potentially affecting other devices. If we ever really use Linux 6.1 in a release (I hope not) we can still reconsider to make the effort to backport that. In addition to some minor bug fixes and style improvements the switch should now behave more conformant when it comes to link-local frames, and we will again be able to cleanly pick patches from upstream. MAINTAIERS NOTE: Three patches are already part of Linux stable and should be removed with the next minor kernel version bump: 789-STABLE-01-net-dsa-mt7530-prevent-possible-incorrect-XTAL-frequ.patch 789-STABLE-02-net-dsa-mt7530-fix-link-local-frames-that-ingress-vl.patch 789-STABLE-03-net-dsa-mt7530-fix-handling-of-all-link-local-frames.patch Signed-off-by: Daniel Golle <daniel@makrotopia.org>
149 lines
5.3 KiB
Diff
149 lines
5.3 KiB
Diff
From fcbc5d900fa53f79963fe4626069739ee5567b4b Mon Sep 17 00:00:00 2001
|
||
From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= <arinc.unal@arinc9.com>
|
||
Date: Tue, 6 Feb 2024 01:08:06 +0300
|
||
Subject: [PATCH 34/48] net: dsa: mt7530: remove pad_setup function pointer
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=UTF-8
|
||
Content-Transfer-Encoding: 8bit
|
||
|
||
The pad_setup function pointer was introduced with 88bdef8be9f6 ("net: dsa:
|
||
mt7530: Extend device data ready for adding a new hardware"). It was being
|
||
used to set up the core clock and port 6 of the MT7530 switch, and pll of
|
||
the MT7531 switch.
|
||
|
||
All of these were moved to more appropriate locations, and it was never
|
||
used for the switch on the MT7988 SoC. Therefore, this function pointer
|
||
hasn't got a use anymore. Remove it.
|
||
|
||
Acked-by: Daniel Golle <daniel@makrotopia.org>
|
||
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
|
||
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
||
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
|
||
Link: https://lore.kernel.org/r/20240206-for-netnext-mt7530-improvements-2-v5-5-d7d92a185cb1@arinc9.com
|
||
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
||
---
|
||
drivers/net/dsa/mt7530.c | 36 ++----------------------------------
|
||
drivers/net/dsa/mt7530.h | 3 ---
|
||
2 files changed, 2 insertions(+), 37 deletions(-)
|
||
|
||
--- a/drivers/net/dsa/mt7530.c
|
||
+++ b/drivers/net/dsa/mt7530.c
|
||
@@ -453,18 +453,6 @@ mt7530_setup_port6(struct dsa_switch *ds
|
||
core_set(priv, CORE_TRGMII_GSW_CLK_CG, REG_TRGMIICK_EN);
|
||
}
|
||
|
||
-static int
|
||
-mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface)
|
||
-{
|
||
- return 0;
|
||
-}
|
||
-
|
||
-static int
|
||
-mt7531_pad_setup(struct dsa_switch *ds, phy_interface_t interface)
|
||
-{
|
||
- return 0;
|
||
-}
|
||
-
|
||
static void
|
||
mt7531_pll_setup(struct mt7530_priv *priv)
|
||
{
|
||
@@ -2631,14 +2619,6 @@ static void mt7988_mac_port_get_caps(str
|
||
}
|
||
|
||
static int
|
||
-mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state)
|
||
-{
|
||
- struct mt7530_priv *priv = ds->priv;
|
||
-
|
||
- return priv->info->pad_setup(ds, state->interface);
|
||
-}
|
||
-
|
||
-static int
|
||
mt7530_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
|
||
phy_interface_t interface)
|
||
{
|
||
@@ -2803,8 +2783,6 @@ mt753x_phylink_mac_config(struct dsa_swi
|
||
if (priv->p6_interface == state->interface)
|
||
break;
|
||
|
||
- mt753x_pad_setup(ds, state);
|
||
-
|
||
if (mt753x_mac_config(ds, port, mode, state) < 0)
|
||
goto unsupported;
|
||
|
||
@@ -3127,11 +3105,6 @@ mt753x_conduit_state_change(struct dsa_s
|
||
mt7530_rmw(priv, MT7530_MFC, CPU_EN | CPU_PORT_MASK, val);
|
||
}
|
||
|
||
-static int mt7988_pad_setup(struct dsa_switch *ds, phy_interface_t interface)
|
||
-{
|
||
- return 0;
|
||
-}
|
||
-
|
||
static int mt7988_setup(struct dsa_switch *ds)
|
||
{
|
||
struct mt7530_priv *priv = ds->priv;
|
||
@@ -3192,7 +3165,6 @@ const struct mt753x_info mt753x_table[]
|
||
.sw_setup = mt7530_setup,
|
||
.phy_read = mt7530_phy_read,
|
||
.phy_write = mt7530_phy_write,
|
||
- .pad_setup = mt7530_pad_clk_setup,
|
||
.mac_port_get_caps = mt7530_mac_port_get_caps,
|
||
.mac_port_config = mt7530_mac_config,
|
||
},
|
||
@@ -3202,7 +3174,6 @@ const struct mt753x_info mt753x_table[]
|
||
.sw_setup = mt7530_setup,
|
||
.phy_read = mt7530_phy_read,
|
||
.phy_write = mt7530_phy_write,
|
||
- .pad_setup = mt7530_pad_clk_setup,
|
||
.mac_port_get_caps = mt7530_mac_port_get_caps,
|
||
.mac_port_config = mt7530_mac_config,
|
||
},
|
||
@@ -3212,7 +3183,6 @@ const struct mt753x_info mt753x_table[]
|
||
.sw_setup = mt7531_setup,
|
||
.phy_read = mt7531_ind_phy_read,
|
||
.phy_write = mt7531_ind_phy_write,
|
||
- .pad_setup = mt7531_pad_setup,
|
||
.cpu_port_config = mt7531_cpu_port_config,
|
||
.mac_port_get_caps = mt7531_mac_port_get_caps,
|
||
.mac_port_config = mt7531_mac_config,
|
||
@@ -3223,7 +3193,6 @@ const struct mt753x_info mt753x_table[]
|
||
.sw_setup = mt7988_setup,
|
||
.phy_read = mt7531_ind_phy_read,
|
||
.phy_write = mt7531_ind_phy_write,
|
||
- .pad_setup = mt7988_pad_setup,
|
||
.cpu_port_config = mt7988_cpu_port_config,
|
||
.mac_port_get_caps = mt7988_mac_port_get_caps,
|
||
.mac_port_config = mt7988_mac_config,
|
||
@@ -3253,9 +3222,8 @@ mt7530_probe_common(struct mt7530_priv *
|
||
/* Sanity check if these required device operations are filled
|
||
* properly.
|
||
*/
|
||
- if (!priv->info->sw_setup || !priv->info->pad_setup ||
|
||
- !priv->info->phy_read || !priv->info->phy_write ||
|
||
- !priv->info->mac_port_get_caps ||
|
||
+ if (!priv->info->sw_setup || !priv->info->phy_read ||
|
||
+ !priv->info->phy_write || !priv->info->mac_port_get_caps ||
|
||
!priv->info->mac_port_config)
|
||
return -EINVAL;
|
||
|
||
--- a/drivers/net/dsa/mt7530.h
|
||
+++ b/drivers/net/dsa/mt7530.h
|
||
@@ -722,8 +722,6 @@ struct mt753x_pcs {
|
||
* @sw_setup: Holding the handler to a device initialization
|
||
* @phy_read: Holding the way reading PHY port
|
||
* @phy_write: Holding the way writing PHY port
|
||
- * @pad_setup: Holding the way setting up the bus pad for a certain
|
||
- * MAC port
|
||
* @phy_mode_supported: Check if the PHY type is being supported on a certain
|
||
* port
|
||
* @mac_port_validate: Holding the way to set addition validate type for a
|
||
@@ -739,7 +737,6 @@ struct mt753x_info {
|
||
int (*sw_setup)(struct dsa_switch *ds);
|
||
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 (*pad_setup)(struct dsa_switch *ds, phy_interface_t interface);
|
||
int (*cpu_port_config)(struct dsa_switch *ds, int port);
|
||
void (*mac_port_get_caps)(struct dsa_switch *ds, int port,
|
||
struct phylink_config *config);
|