Skip to content

Commit d3002da

Browse files
committed
mediatek: update MediaTek PHY patchset
The previous iteration of MediaTek's PHY patches caused various weird bugs. Drop culprit patch 733-10-net-phy-mediatek-Extend-1G-TX-RX-link-pulse-time.patch and use the most recent iteration of the patchset which has been posted to the netdev mailing list. Link: https://patchwork.kernel.org/project/netdevbpf/list/?series=895513&state=* Signed-off-by: Daniel Golle <[email protected]>
1 parent 77c3d74 commit d3002da

13 files changed

+45
-455
lines changed

target/linux/mediatek/patches-6.6/733-01-net-phy-mediatek-Re-organize-MediaTek-ethernet-phy-d.patch

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
From c14e7c954fd752fbb3da17a8bcf65cd9dbf41186 Mon Sep 17 00:00:00 2001
1+
From 656f5fdeb6ee6fa95c28cab3b535e2e09ef59c57 Mon Sep 17 00:00:00 2001
22
From: "SkyLake.Huang" <[email protected]>
3-
Date: Mon, 1 Jul 2024 18:54:05 +0800
4-
Subject: [PATCH 01/13] net: phy: mediatek: Re-organize MediaTek ethernet phy
3+
Date: Fri, 4 Oct 2024 18:24:05 +0800
4+
Subject: [PATCH 1/9] net: phy: mediatek: Re-organize MediaTek ethernet phy
55
drivers
66

77
Re-organize MediaTek ethernet phy driver files and get ready to integrate
8-
some common functions and add new 2.5G phy driver.
8+
some common functions (and add new 2.5G phy driver).
99
mtk-ge.c: MT7530 Gphy on MT7621 & MT7531 Gphy
1010
mtk-ge-soc.c: Built-in Gphy on MT7981 & Built-in switch Gphy on MT7988
11-
mtk-2p5ge.c: Planned for built-in 2.5G phy on MT7988
11+
(mtk-2p5ge.c: Planned for built-in 2.5G phy on MT7988
12+
--> in another patchset)
1213

1314
Signed-off-by: SkyLake.Huang <[email protected]>
1415
---
@@ -18,7 +19,7 @@ Signed-off-by: SkyLake.Huang <[email protected]>
1819
drivers/net/phy/mediatek/Makefile | 3 +++
1920
.../mtk-ge-soc.c} | 0
2021
.../phy/{mediatek-ge.c => mediatek/mtk-ge.c} | 0
21-
7 files changed, 29 insertions(+), 20 deletions(-)
22+
6 files changed, 27 insertions(+), 18 deletions(-)
2223
create mode 100644 drivers/net/phy/mediatek/Kconfig
2324
create mode 100644 drivers/net/phy/mediatek/Makefile
2425
rename drivers/net/phy/{mediatek-ge-soc.c => mediatek/mtk-ge-soc.c} (100%)

target/linux/mediatek/patches-6.6/733-02-net-phy-mediatek-Fix-spelling-errors-and-rearrange-v.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 12054d38fc55adbfa2b40299ad8af3449d882ee2 Mon Sep 17 00:00:00 2001
1+
From 61bcabdb69418215ea05bdc48cb88459d757f505 Mon Sep 17 00:00:00 2001
22
From: "SkyLake.Huang" <[email protected]>
3-
Date: Mon, 1 Jul 2024 18:54:06 +0800
4-
Subject: [PATCH 02/13] net: phy: mediatek: Fix spelling errors and rearrange
3+
Date: Fri, 4 Oct 2024 18:24:06 +0800
4+
Subject: [PATCH 2/9] net: phy: mediatek: Fix spelling errors and rearrange
55
variables
66

77
This patch fixes spelling errors which comes from mediatek-ge-soc.c and

target/linux/mediatek/patches-6.6/733-03-net-phy-mediatek-Move-LED-helper-functions-into-mtk-.patch

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 434e41555c45ec10b19320024163bb009da168bc Mon Sep 17 00:00:00 2001
1+
From 16bbd4ecb67ec1899ad8aa1eb1219a6d576cbaaf Mon Sep 17 00:00:00 2001
22
From: "SkyLake.Huang" <[email protected]>
3-
Date: Mon, 1 Jul 2024 18:54:07 +0800
4-
Subject: [PATCH 03/13] net: phy: mediatek: Move LED helper functions into mtk
3+
Date: Fri, 4 Oct 2024 18:24:07 +0800
4+
Subject: [PATCH 3/9] net: phy: mediatek: Move LED helper functions into mtk
55
phy lib
66

77
This patch creates mtk-phy-lib.c & mtk-phy.h and integrates mtk-ge-soc.c's
@@ -15,7 +15,7 @@ Signed-off-by: SkyLake.Huang <[email protected]>
1515
drivers/net/phy/mediatek/mtk-ge-soc.c | 262 +++----------------------
1616
drivers/net/phy/mediatek/mtk-phy-lib.c | 251 +++++++++++++++++++++++
1717
drivers/net/phy/mediatek/mtk.h | 82 ++++++++
18-
6 files changed, 368 insertions(+), 235 deletions(-)
18+
5 files changed, 366 insertions(+), 235 deletions(-)
1919
create mode 100644 drivers/net/phy/mediatek/mtk-phy-lib.c
2020
create mode 100644 drivers/net/phy/mediatek/mtk.h
2121

target/linux/mediatek/patches-6.6/733-04-net-phy-mediatek-Improve-readability-of-mtk-phy-lib..patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 2783929879854d5750ba82e2e203663313362abb Mon Sep 17 00:00:00 2001
1+
From 2b118202583eb05a1799d435d2dce974dc3f5b16 Mon Sep 17 00:00:00 2001
22
From: "SkyLake.Huang" <[email protected]>
3-
Date: Mon, 1 Jul 2024 18:54:08 +0800
4-
Subject: [PATCH 04/13] net: phy: mediatek: Improve readability of
3+
Date: Fri, 4 Oct 2024 18:24:08 +0800
4+
Subject: [PATCH 4/9] net: phy: mediatek: Improve readability of
55
mtk-phy-lib.c's mtk_phy_led_hw_ctrl_set()
66

77
This patch removes parens around TRIGGER_NETDEV_RX/TRIGGER_NETDEV_TX in

target/linux/mediatek/patches-6.6/733-05-net-phy-mediatek-Integrate-read-write-page-helper-fu.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 58c1270423ab48464cdc31ef71ffe7f5b2441961 Mon Sep 17 00:00:00 2001
1+
From 59e7082cb8c8e89bceb44cc60df156d818c8da96 Mon Sep 17 00:00:00 2001
22
From: "SkyLake.Huang" <[email protected]>
3-
Date: Mon, 1 Jul 2024 18:54:09 +0800
4-
Subject: [PATCH 05/13] net: phy: mediatek: Integrate read/write page helper
3+
Date: Fri, 4 Oct 2024 18:24:09 +0800
4+
Subject: [PATCH 5/9] net: phy: mediatek: Integrate read/write page helper
55
functions
66

77
This patch integrates read/write page helper functions as MTK phy lib.

target/linux/mediatek/patches-6.6/733-06-net-phy-mediatek-Hook-LED-helper-functions-in-mtk-ge.patch

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
From 9403f1d54598ae56386a8bf47a5b6b34c884e4f5 Mon Sep 17 00:00:00 2001
1+
From 5b605457b93d0979ab623ef2aa6eb456c46e511c Mon Sep 17 00:00:00 2001
22
From: "SkyLake.Huang" <[email protected]>
3-
Date: Mon, 1 Jul 2024 18:54:10 +0800
4-
Subject: [PATCH 06/13] net: phy: mediatek: Hook LED helper functions in
5-
mtk-ge.c
3+
Date: Fri, 4 Oct 2024 18:24:10 +0800
4+
Subject: [PATCH 6/9] net: phy: mediatek: Hook LED helper functions in mtk-ge.c
65

76
We have mtk-phy-lib.c now so that we can use LED helper functions in
87
mtk-ge.c(mt7531 part). It also means that mt7531/mt7981/mt7988's
@@ -83,14 +82,14 @@ Signed-off-by: SkyLake.Huang <[email protected]>
8382
+}
8483
+
8584
+static const unsigned long supported_triggers =
86-
+ (BIT(TRIGGER_NETDEV_FULL_DUPLEX) |
87-
+ BIT(TRIGGER_NETDEV_HALF_DUPLEX) |
88-
+ BIT(TRIGGER_NETDEV_LINK) |
89-
+ BIT(TRIGGER_NETDEV_LINK_10) |
90-
+ BIT(TRIGGER_NETDEV_LINK_100) |
91-
+ BIT(TRIGGER_NETDEV_LINK_1000) |
92-
+ BIT(TRIGGER_NETDEV_RX) |
93-
+ BIT(TRIGGER_NETDEV_TX));
85+
+ BIT(TRIGGER_NETDEV_FULL_DUPLEX) |
86+
+ BIT(TRIGGER_NETDEV_HALF_DUPLEX) |
87+
+ BIT(TRIGGER_NETDEV_LINK) |
88+
+ BIT(TRIGGER_NETDEV_LINK_10) |
89+
+ BIT(TRIGGER_NETDEV_LINK_100) |
90+
+ BIT(TRIGGER_NETDEV_LINK_1000) |
91+
+ BIT(TRIGGER_NETDEV_RX) |
92+
+ BIT(TRIGGER_NETDEV_TX);
9493
+
9594
+static int mt753x_phy_led_hw_is_supported(struct phy_device *phydev, u8 index,
9695
+ unsigned long rules)

target/linux/mediatek/patches-6.6/733-07-net-phy-mediatek-add-MT7530-MT7531-s-PHY-ID-macros.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 51ee83602dbb84716180d9b6e43f6bebb0c2d7bd Mon Sep 17 00:00:00 2001
1+
From c5ff7bece642dbba601be89e70f78ff037ca084f Mon Sep 17 00:00:00 2001
22
From: "SkyLake.Huang" <[email protected]>
3-
Date: Mon, 1 Jul 2024 18:54:11 +0800
4-
Subject: [PATCH 07/13] net: phy: mediatek: add MT7530 & MT7531's PHY ID macros
3+
Date: Fri, 4 Oct 2024 18:24:11 +0800
4+
Subject: [PATCH 7/9] net: phy: mediatek: add MT7530 & MT7531's PHY ID macros
55

66
This patch adds MT7530 & MT7531's PHY ID macros in mtk-ge.c so that
77
it follows the same rule of mtk-ge-soc.c.

target/linux/mediatek/patches-6.6/733-08-net-phy-mediatek-Change-mtk-ge-soc.c-line-wrapping.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From e73df692396b0d6bdcb2317299fa1e8e547f3446 Mon Sep 17 00:00:00 2001
1+
From dbe70a9353b5095a90af61a051486484765ada6f Mon Sep 17 00:00:00 2001
22
From: "SkyLake.Huang" <[email protected]>
3-
Date: Mon, 1 Jul 2024 18:54:12 +0800
4-
Subject: [PATCH 08/13] net: phy: mediatek: Change mtk-ge-soc.c line wrapping
3+
Date: Fri, 4 Oct 2024 18:24:12 +0800
4+
Subject: [PATCH 8/9] net: phy: mediatek: Change mtk-ge-soc.c line wrapping
55

66
This patch shrinks mtk-ge-soc.c line wrapping to 80 characters.
77

target/linux/mediatek/patches-6.6/733-09-net-phy-mediatek-Add-token-ring-access-helper-functi.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 60228de48d8bfde62b4db5945314e6a62079f091 Mon Sep 17 00:00:00 2001
1+
From ca024bc7267a8c0439325d352f9b8818ba0f2cf0 Mon Sep 17 00:00:00 2001
22
From: "SkyLake.Huang" <[email protected]>
3-
Date: Mon, 1 Jul 2024 18:54:13 +0800
4-
Subject: [PATCH 09/13] net: phy: mediatek: Add token ring access helper
3+
Date: Fri, 4 Oct 2024 18:24:13 +0800
4+
Subject: [PATCH 9/9] net: phy: mediatek: Add token ring access helper
55
functions in mtk-phy-lib
66

77
This patch adds TR(token ring) manipulations and adds correct

target/linux/mediatek/patches-6.6/733-10-net-phy-mediatek-Extend-1G-TX-RX-link-pulse-time.patch

-219
This file was deleted.

target/linux/mediatek/patches-6.6/733-11-net-phy-add-driver-for-built-in-2.5G-ethernet-PHY-on.patch

+5-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Signed-off-by: SkyLake.Huang <[email protected]>
4242
+obj-$(CONFIG_MEDIATEK_2P5GE_PHY) += mtk-2p5ge.o
4343
--- /dev/null
4444
+++ b/drivers/net/phy/mediatek/mtk-2p5ge.c
45-
@@ -0,0 +1,432 @@
45+
@@ -0,0 +1,436 @@
4646
+// SPDX-License-Identifier: GPL-2.0+
4747
+#include <linux/bitfield.h>
4848
+#include <linux/firmware.h>
@@ -59,6 +59,10 @@ Signed-off-by: SkyLake.Huang <[email protected]>
5959
+
6060
+#define MTK_2P5GPHY_ID_MT7988 (0x00339c11)
6161
+
62+
+#define MTK_PHY_PAGE_EXTENDED_1 0x0001
63+
+#define MTK_PHY_AUX_CTRL_AND_STATUS 0x14
64+
+#define MTK_PHY_ENABLE_DOWNSHIFT BIT(4)
65+
+
6266
+#define MT7988_2P5GE_PMB_FW "mediatek/mt7988/i2p5ge-phy-pmb.bin"
6367
+#define MT7988_2P5GE_PMB_FW_SIZE (0x20000)
6468
+#define MT7988_2P5GE_PMB_FW_BASE (0x0f100000)

0 commit comments

Comments
 (0)