mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2024-05-19 14:06:29 +02:00
d59d69f9e1
Manually rebased: backport-5.15/704-15-v5.19-net-mtk_eth_soc-move-MAC_MCR-setting-to-mac_finish.patch Removed upstreamed: backport-5.15/060-v6.0-01-tools-build-Add-feature-test-for-init_disassemble_in.patch[1] backport-5.15/060-v6.0-02-tools-include-add-dis-asm-compat.h-to-handle-version.patch[2] backport-5.15/060-v6.0-03-tools-perf-Fix-compilation-error-with-new-binutils.patch[3] backport-5.15/060-v6.0-04-tools-bpf_jit_disasm-Fix-compilation-error-with-new-.patch[4] backport-5.15/060-v6.0-05-tools-bpftool-Fix-compilation-error-with-new-binutil.patch[5] pending-5.15/733-02-net-ethernet-mtk_eth_soc-fix-RX-data-corruption-issu.patch[6] bcm47xx/patches-5.15/170-bgmac-fix-initial-chip-reset-to-support-BCM5358.patch[7] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.103&id=51b99dc38c1a053e2e732d7f9e2740e343ae7eae 2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.103&id=451c9d7b16169645ed291ebb2ca9844caa088f2d 3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.103&id=97f005c0bdbaf656a7808586d234965385a06c58 4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.103&id=1c27fab243333821375e4d63128d60093fdbe149 5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.103&id=4441a90091931fd81607567961dc122f24f735bb 6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.103&id=2adc29350a5b4669544566f71f208d2abaec60ab 7. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.103&id=04bfc5bcdfc0fdb73587487c71b04d63807ae15a Build system: x86_64 Build-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod Run-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod Signed-off-by: John Audia <therealgraysky@proton.me>
80 lines
2.5 KiB
Diff
80 lines
2.5 KiB
Diff
From 0e37ad71b2ff772009595002da2860999e98e14e Mon Sep 17 00:00:00 2001
|
|
From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
|
|
Date: Wed, 18 May 2022 15:55:12 +0100
|
|
Subject: [PATCH 09/12] net: mtk_eth_soc: move MAC_MCR setting to mac_finish()
|
|
|
|
Move the setting of the MTK_MAC_MCR register from the end of mac_config
|
|
into the phylink mac_finish() method, to keep it as the very last write
|
|
that is done during configuration.
|
|
|
|
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
---
|
|
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 33 ++++++++++++++-------
|
|
1 file changed, 22 insertions(+), 11 deletions(-)
|
|
|
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
@@ -316,8 +316,8 @@ static void mtk_mac_config(struct phylin
|
|
struct mtk_mac *mac = container_of(config, struct mtk_mac,
|
|
phylink_config);
|
|
struct mtk_eth *eth = mac->hw;
|
|
- u32 mcr_cur, mcr_new, sid, i;
|
|
int val, ge_mode, err = 0;
|
|
+ u32 sid, i;
|
|
|
|
/* MT76x8 has no hardware settings between for the MAC */
|
|
if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628) &&
|
|
@@ -455,6 +455,25 @@ static void mtk_mac_config(struct phylin
|
|
return;
|
|
}
|
|
|
|
+ return;
|
|
+
|
|
+err_phy:
|
|
+ dev_err(eth->dev, "%s: GMAC%d mode %s not supported!\n", __func__,
|
|
+ mac->id, phy_modes(state->interface));
|
|
+ return;
|
|
+
|
|
+init_err:
|
|
+ dev_err(eth->dev, "%s: GMAC%d mode %s err: %d!\n", __func__,
|
|
+ mac->id, phy_modes(state->interface), err);
|
|
+}
|
|
+
|
|
+static int mtk_mac_finish(struct phylink_config *config, unsigned int mode,
|
|
+ phy_interface_t interface)
|
|
+{
|
|
+ struct mtk_mac *mac = container_of(config, struct mtk_mac,
|
|
+ phylink_config);
|
|
+ u32 mcr_cur, mcr_new;
|
|
+
|
|
/* Setup gmac */
|
|
mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
|
|
mcr_new = mcr_cur;
|
|
@@ -466,16 +485,7 @@ static void mtk_mac_config(struct phylin
|
|
if (mcr_new != mcr_cur)
|
|
mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id));
|
|
|
|
- return;
|
|
-
|
|
-err_phy:
|
|
- dev_err(eth->dev, "%s: GMAC%d mode %s not supported!\n", __func__,
|
|
- mac->id, phy_modes(state->interface));
|
|
- return;
|
|
-
|
|
-init_err:
|
|
- dev_err(eth->dev, "%s: GMAC%d mode %s err: %d!\n", __func__,
|
|
- mac->id, phy_modes(state->interface), err);
|
|
+ return 0;
|
|
}
|
|
|
|
static void mtk_mac_pcs_get_state(struct phylink_config *config,
|
|
@@ -582,6 +592,7 @@ static const struct phylink_mac_ops mtk_
|
|
.mac_pcs_get_state = mtk_mac_pcs_get_state,
|
|
.mac_an_restart = mtk_mac_an_restart,
|
|
.mac_config = mtk_mac_config,
|
|
+ .mac_finish = mtk_mac_finish,
|
|
.mac_link_down = mtk_mac_link_down,
|
|
.mac_link_up = mtk_mac_link_up,
|
|
};
|