mediatek: fixes for Ethernet on MT7988 SoC
* fix switch ports with modes other than 1000M/Full
* set 32-bit dma_coherent_mask to get PPE to work with 4 GiB of RAM
* sync driver for built-in 1GE PHY with MediaTek SDK sources
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 4ae2f43b3a)
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
From dee3f591103910c8d8b2a6d57879ccd2a4be4b10 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <dee3f591103910c8d8b2a6d57879ccd2a4be4b10.1706067287.git.daniel@makrotopia.org>
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Wed, 24 Jan 2024 03:19:49 +0000
|
||||
Subject: [PATCH net] net: ethernet: mtk_eth_soc: set coherent mask to get PPE
|
||||
working
|
||||
To: Felix Fietkau <nbd@nbd.name>,
|
||||
Sean Wang <sean.wang@mediatek.com>,
|
||||
Mark Lee <Mark-MC.Lee@mediatek.com>,
|
||||
Lorenzo Bianconi <lorenzo@kernel.org>,
|
||||
David S. Miller <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Matthias Brugger <matthias.bgg@gmail.com>,
|
||||
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
|
||||
Daniel Golle <daniel@makrotopia.org>,
|
||||
netdev@vger.kernel.org,
|
||||
linux-kernel@vger.kernel.org,
|
||||
linux-arm-kernel@lists.infradead.org,
|
||||
linux-mediatek@lists.infradead.org
|
||||
|
||||
Set DMA coherent mask to 32-bit which makes PPE offloading engine start
|
||||
working on BPi-R4 which got 4 GiB of RAM.
|
||||
|
||||
Fixes: 2d75891ebc09 ("net: ethernet: mtk_eth_soc: support 36-bit DMA addressing on MT7988")
|
||||
Suggested-by: Elad Yifee <eladwf@users.github.com>
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
---
|
||||
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||
@@ -4830,7 +4830,10 @@ static int mtk_probe(struct platform_dev
|
||||
}
|
||||
|
||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_36BIT_DMA)) {
|
||||
- err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(36));
|
||||
+ err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(36));
|
||||
+ if (!err)
|
||||
+ err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
|
||||
+
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "Wrong DMA config\n");
|
||||
return -EINVAL;
|
||||
@@ -0,0 +1,45 @@
|
||||
From a444877c10a665cd8a869e6d37facdb89fd95f79 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <a444877c10a665cd8a869e6d37facdb89fd95f79.1706070008.git.daniel@makrotopia.org>
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Wed, 24 Jan 2024 04:17:11 +0000
|
||||
Subject: [PATCH net] net: dsa: mt7530: fix 10M/100M speed on MT7988 switch
|
||||
To: Arınç ÜNAL <arinc.unal@arinc9.com>,
|
||||
Daniel Golle <daniel@makrotopia.org>,
|
||||
DENG Qingfang <dqfext@gmail.com>,
|
||||
Sean Wang <sean.wang@mediatek.com>,
|
||||
Andrew Lunn <andrew@lunn.ch>,
|
||||
Florian Fainelli <f.fainelli@gmail.com>,
|
||||
Vladimir Oltean <olteanv@gmail.com>,
|
||||
David S. Miller <davem@davemloft.net>,
|
||||
Eric Dumazet <edumazet@google.com>,
|
||||
Jakub Kicinski <kuba@kernel.org>,
|
||||
Paolo Abeni <pabeni@redhat.com>,
|
||||
Matthias Brugger <matthias.bgg@gmail.com>,
|
||||
AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>,
|
||||
netdev@vger.kernel.org,
|
||||
linux-kernel@vger.kernel.org,
|
||||
linux-arm-kernel@lists.infradead.org,
|
||||
linux-mediatek@lists.infradead.org
|
||||
|
||||
Setup PMCR port register for actual speed and duplex on internally
|
||||
connected PHYs of the MT7988 built-in switch. This fixes links with
|
||||
speeds other than 1000M.
|
||||
|
||||
Fixes: ("110c18bfed414 net: dsa: mt7530: introduce driver for MT7988 built-in switch")
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
---
|
||||
drivers/net/dsa/mt7530.c | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/dsa/mt7530.c
|
||||
+++ b/drivers/net/dsa/mt7530.c
|
||||
@@ -2832,8 +2832,7 @@ static void mt753x_phylink_mac_link_up(s
|
||||
/* MT753x MAC works in 1G full duplex mode for all up-clocked
|
||||
* variants.
|
||||
*/
|
||||
- if (interface == PHY_INTERFACE_MODE_INTERNAL ||
|
||||
- interface == PHY_INTERFACE_MODE_TRGMII ||
|
||||
+ if (interface == PHY_INTERFACE_MODE_TRGMII ||
|
||||
(phy_interface_mode_is_8023z(interface))) {
|
||||
speed = SPEED_1000;
|
||||
duplex = DUPLEX_FULL;
|
||||
Reference in New Issue
Block a user