generic: 6.18: drop stale hunk of Filogic SerDes patch

Daniel Pawlik figured out that a stale patch hunk breaks one of the
two 10G SerDes PCS ports of MT7988. Remove the hunk to make 10G
Ethernet work on both SerDes PCS with Linux 6.18.

Testing was done using a Aquantia AQR113C SFP+ module.

Signed-off-by: Daniel Pawlik <pawlik.dan@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
Daniel Pawlik 2026-04-20 13:29:29 +02:00 committed by Daniel Golle
parent a8d5544c83
commit c576e95b2f
6 changed files with 36 additions and 57 deletions

View File

@ -37,7 +37,7 @@ Signed-off-by: Bo-Cun Chen <bc-bocun.chen@mediatek.com>
.glo_cfg = 0x4604,
.rst_idx = 0x4608,
.delay_irq = 0x460c,
@@ -4178,6 +4181,56 @@ static void mtk_set_mcr_max_rx(struct mt
@@ -4176,6 +4179,56 @@ static void mtk_set_mcr_max_rx(struct mt
mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id));
}
@ -94,7 +94,7 @@ Signed-off-by: Bo-Cun Chen <bc-bocun.chen@mediatek.com>
static void mtk_hw_reset(struct mtk_eth *eth)
{
u32 val;
@@ -4657,6 +4710,8 @@ static void mtk_pending_work(struct work
@@ -4655,6 +4708,8 @@ static void mtk_pending_work(struct work
rtnl_lock();
set_bit(MTK_RESETTING, &eth->state);

View File

@ -4,12 +4,13 @@ Date: Tue, 12 Dec 2023 03:51:14 +0000
Subject: [PATCH] net: ethernet: mtk_eth_soc: add paths and SerDes modes for
MT7988
MT7988 comes with a built-in 2.5G PHY as well as SerDes lanes to
connect external PHYs or transceivers in USXGMII, 10GBase-R, 5GBase-R,
2500Base-X, 1000Base-X and Cisco SGMII interface modes.
MT7988 comes with a new 10G/USXGMII SerDes PCS to connect external PHYs or
transceivers in USXGMII, 10GBase-R and 5GBase-R interface modes in addition
to the existing 2500Base-X, 1000Base-X and Cisco SGMII modes supported by
the existing LynxI PCS.
Implement support for configuring for the new paths to SerDes interfaces
and the internal 2.5G PHY.
Implement support for configuring for the new paths to the 10G SerDes
interfaces.
Add USXGMII PCS driver for 10GBase-R, 5GBase-R and USXGMII mode, and
setup the new PHYA on MT7988 to access the also still existing old
@ -270,14 +271,14 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
+ if (mtk_interface_mode_is_xgmii(eth, state->interface)) {
+ mtk_w32(mac->hw, MTK_GDMA_XGDM_SEL, MTK_GDMA_EG_CTRL(mac->id));
+ mtk_w32(mac->hw, MAC_MCR_FORCE_LINK_DOWN, MTK_MAC_MCR(mac->id));
+
- if (mac->id == MTK_GMAC1_ID)
- mtk_setup_bridge_switch(eth);
+ if (mac->id == MTK_GMAC1_ID)
+ mtk_setup_bridge_switch(eth);
+ } else {
+ mtk_w32(eth, 0, MTK_GDMA_EG_CTRL(mac->id));
- if (mac->id == MTK_GMAC1_ID)
- mtk_setup_bridge_switch(eth);
+
+ /* FIXME: In current hardware design, we have to reset FE
+ * when swtiching XGDM to GDM. Therefore, here trigger an SER
+ * to let GDM go back to the initial state.
@ -306,29 +307,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
/* Enable SGMII */
if (interface == PHY_INTERFACE_MODE_SGMII ||
phy_interface_mode_is_8023z(interface))
@@ -861,7 +935,7 @@ static void mtk_xgdm_mac_link_up(struct
int speed, int duplex, bool tx_pause,
bool rx_pause)
{
- u32 mcr;
+ u32 mcr, force_link = 0;
if (mac->id == MTK_GMAC1_ID)
return;
@@ -872,8 +946,10 @@ static void mtk_xgdm_mac_link_up(struct
mtk_m32(mac->hw, XMAC_GLB_CNTCLR, XMAC_GLB_CNTCLR,
MTK_XMAC_CNT_CTRL(mac->id));
- mtk_m32(mac->hw, MTK_XGMAC_FORCE_LINK(mac->id),
- MTK_XGMAC_FORCE_LINK(mac->id), MTK_XGMAC_STS(mac->id));
+ if (mac->interface == PHY_INTERFACE_MODE_INTERNAL || mac->id == MTK_GMAC3_ID)
+ force_link = MTK_XGMAC_FORCE_LINK(mac->id);
+
+ mtk_m32(mac->hw, MTK_XGMAC_FORCE_LINK(mac->id), force_link, MTK_XGMAC_STS(mac->id));
mcr = mtk_r32(mac->hw, MTK_XMAC_MCR(mac->id));
mcr &= ~(XMAC_MCR_FORCE_TX_FC | XMAC_MCR_FORCE_RX_FC |
@@ -903,6 +979,10 @@ static void mtk_mac_link_up(struct phyli
@@ -903,6 +977,10 @@ static void mtk_mac_link_up(struct phyli
else
mtk_gdm_mac_link_up(mac, phy, mode, interface, speed, duplex,
tx_pause, rx_pause);
@ -339,7 +318,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
}
static void mtk_mac_disable_tx_lpi(struct phylink_config *config)
@@ -3765,6 +3845,9 @@ static int mtk_open(struct net_device *d
@@ -3765,6 +3843,9 @@ static int mtk_open(struct net_device *d
ppe_num = eth->soc->ppe_num;
@ -349,7 +328,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0);
if (err) {
netdev_err(dev, "%s: could not attach PHY: %d\n", __func__,
@@ -3912,6 +3995,9 @@ static int mtk_stop(struct net_device *d
@@ -3912,6 +3993,9 @@ static int mtk_stop(struct net_device *d
for (i = 0; i < ARRAY_SIZE(eth->ppe); i++)
mtk_ppe_stop(eth->ppe[i]);
@ -359,7 +338,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
return 0;
}
@@ -4968,6 +5054,7 @@ static const struct net_device_ops mtk_n
@@ -4968,6 +5052,7 @@ static const struct net_device_ops mtk_n
static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
{
const __be32 *_id = of_get_property(np, "reg", NULL);
@ -367,7 +346,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
phy_interface_t phy_mode;
struct phylink *phylink;
struct mtk_mac *mac;
@@ -5004,16 +5091,44 @@ static int mtk_add_mac(struct mtk_eth *e
@@ -5004,16 +5089,44 @@ static int mtk_add_mac(struct mtk_eth *e
mac->id = id;
mac->hw = eth;
mac->of_node = np;
@ -420,7 +399,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
}
memset(mac->hwlro_ip, 0, sizeof(mac->hwlro_ip));
@@ -5099,8 +5214,21 @@ static int mtk_add_mac(struct mtk_eth *e
@@ -5099,8 +5212,21 @@ static int mtk_add_mac(struct mtk_eth *e
phy_interface_zero(mac->phylink_config.supported_interfaces);
__set_bit(PHY_INTERFACE_MODE_INTERNAL,
mac->phylink_config.supported_interfaces);
@ -442,7 +421,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
phylink = phylink_create(&mac->phylink_config,
of_fwnode_handle(mac->of_node),
phy_mode, &mtk_phylink_ops);
@@ -5156,6 +5284,26 @@ free_netdev:
@@ -5156,6 +5282,26 @@ free_netdev:
return err;
}
@ -469,7 +448,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
void mtk_eth_set_dma_device(struct mtk_eth *eth, struct device *dma_dev)
{
struct net_device *dev, *tmp;
@@ -5309,7 +5457,8 @@ static int mtk_probe(struct platform_dev
@@ -5309,7 +5455,8 @@ static int mtk_probe(struct platform_dev
regmap_write(cci, 0, 3);
}
@ -479,7 +458,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
err = mtk_sgmii_init(eth);
if (err)
@@ -5418,6 +5567,24 @@ static int mtk_probe(struct platform_dev
@@ -5418,6 +5565,24 @@ static int mtk_probe(struct platform_dev
}
}
@ -504,7 +483,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SHARED_INT)) {
err = devm_request_irq(eth->dev, eth->irq[MTK_FE_IRQ_SHARED],
mtk_handle_irq, 0,
@@ -5528,6 +5695,11 @@ static void mtk_remove(struct platform_d
@@ -5528,6 +5693,11 @@ static void mtk_remove(struct platform_d
mtk_stop(eth->netdev[i]);
mac = netdev_priv(eth->netdev[i]);
phylink_disconnect_phy(mac->phylink);

View File

@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -5733,7 +5733,7 @@ static const struct mtk_soc_data mt2701_
@@ -5731,7 +5731,7 @@ static const struct mtk_soc_data mt2701_
DESC_SIZE(struct mtk_rx_dma),
.irq_done_mask = MTK_RX_DONE_INT,
.dma_l4_valid = RX_DMA_L4_VALID,
@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
},
@@ -5761,7 +5761,7 @@ static const struct mtk_soc_data mt7621_
@@ -5759,7 +5759,7 @@ static const struct mtk_soc_data mt7621_
DESC_SIZE(struct mtk_rx_dma),
.irq_done_mask = MTK_RX_DONE_INT,
.dma_l4_valid = RX_DMA_L4_VALID,
@ -48,7 +48,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
},
@@ -5791,7 +5791,7 @@ static const struct mtk_soc_data mt7622_
@@ -5789,7 +5789,7 @@ static const struct mtk_soc_data mt7622_
DESC_SIZE(struct mtk_rx_dma),
.irq_done_mask = MTK_RX_DONE_INT,
.dma_l4_valid = RX_DMA_L4_VALID,
@ -57,7 +57,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
},
@@ -5820,7 +5820,7 @@ static const struct mtk_soc_data mt7623_
@@ -5818,7 +5818,7 @@ static const struct mtk_soc_data mt7623_
DESC_SIZE(struct mtk_rx_dma),
.irq_done_mask = MTK_RX_DONE_INT,
.dma_l4_valid = RX_DMA_L4_VALID,
@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
},
@@ -5846,7 +5846,7 @@ static const struct mtk_soc_data mt7629_
@@ -5844,7 +5844,7 @@ static const struct mtk_soc_data mt7629_
DESC_SIZE(struct mtk_rx_dma),
.irq_done_mask = MTK_RX_DONE_INT,
.dma_l4_valid = RX_DMA_L4_VALID,
@ -75,7 +75,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
},
@@ -5878,7 +5878,7 @@ static const struct mtk_soc_data mt7981_
@@ -5876,7 +5876,7 @@ static const struct mtk_soc_data mt7981_
.dma_l4_valid = RX_DMA_L4_VALID_V2,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
@ -84,7 +84,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
},
};
@@ -5908,7 +5908,7 @@ static const struct mtk_soc_data mt7986_
@@ -5906,7 +5906,7 @@ static const struct mtk_soc_data mt7986_
.dma_l4_valid = RX_DMA_L4_VALID_V2,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,
@ -93,7 +93,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
},
};
@@ -5961,7 +5961,7 @@ static const struct mtk_soc_data rt5350_
@@ -5959,7 +5959,7 @@ static const struct mtk_soc_data rt5350_
.dma_l4_valid = RX_DMA_L4_VALID_PDMA,
.dma_max_len = MTK_TX_DMA_BUF_LEN,
.dma_len_offset = 16,

View File

@ -25,7 +25,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
help
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4863,6 +4863,7 @@ static int mtk_get_sset_count(struct net
@@ -4861,6 +4861,7 @@ static int mtk_get_sset_count(struct net
static void mtk_ethtool_pp_stats(struct mtk_eth *eth, u64 *data)
{
@ -33,7 +33,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
struct page_pool_stats stats = {};
int i;
@@ -4875,6 +4876,7 @@ static void mtk_ethtool_pp_stats(struct
@@ -4873,6 +4874,7 @@ static void mtk_ethtool_pp_stats(struct
page_pool_get_stats(ring->page_pool, &stats);
}
page_pool_ethtool_stats_get(data, &stats);

View File

@ -106,7 +106,7 @@ Signed-off-by: Bo-Cun Chen <bc-bocun.chen@mediatek.com>
mdelay(20);
mtk_m32(mac->hw, XMAC_GLB_CNTCLR, XMAC_GLB_CNTCLR,
MTK_XMAC_CNT_CTRL(mac->id));
@@ -2984,10 +3014,16 @@ static int mtk_tx_alloc(struct mtk_eth *
@@ -2982,10 +3012,16 @@ static int mtk_tx_alloc(struct mtk_eth *
mtk_w32(eth, val, soc->reg_map->qdma.qtx_cfg + ofs);
val = MTK_QTX_SCH_MIN_RATE_EN |
@ -126,7 +126,7 @@ Signed-off-by: Bo-Cun Chen <bc-bocun.chen@mediatek.com>
if (mtk_is_netsys_v1(eth))
val |= MTK_QTX_SCH_LEAKY_BUCKET_EN;
mtk_w32(eth, val, soc->reg_map->qdma.qtx_sch + ofs);
@@ -5969,6 +6005,36 @@ static const struct mtk_soc_data mt7986_
@@ -5967,6 +6003,36 @@ static const struct mtk_soc_data mt7986_
},
};
@ -163,7 +163,7 @@ Signed-off-by: Bo-Cun Chen <bc-bocun.chen@mediatek.com>
static const struct mtk_soc_data mt7988_data = {
.reg_map = &mt7988_reg_map,
.ana_rgc3 = 0x128,
@@ -6030,6 +6096,7 @@ const struct of_device_id of_mtk_match[]
@@ -6028,6 +6094,7 @@ const struct of_device_id of_mtk_match[]
{ .compatible = "mediatek,mt7629-eth", .data = &mt7629_data },
{ .compatible = "mediatek,mt7981-eth", .data = &mt7981_data },
{ .compatible = "mediatek,mt7986-eth", .data = &mt7986_data },

View File

@ -15,7 +15,7 @@ Signed-off-by: Bo-Cun Chen <bc-bocun.chen@mediatek.com>
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -4570,27 +4570,40 @@ static int mtk_hw_init(struct mtk_eth *e
@@ -4568,27 +4568,40 @@ static int mtk_hw_init(struct mtk_eth *e
mtk_w32(eth, PSE_DUMMY_WORK_GDM(1) | PSE_DUMMY_WORK_GDM(2) |
PSE_DUMMY_WORK_GDM(3) | DUMMY_PAGE_THR, PSE_DUMY_REQ);