[openwrt/openwrt] kernel: drop Maxlinear PHY LED control hack
LEDE Commits
lede-commits at lists.infradead.org
Thu Mar 20 17:48:43 PDT 2025
dangole pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5016c960bc2e37a4193739ee4f50c8d458552c6a
commit 5016c960bc2e37a4193739ee4f50c8d458552c6a
Author: Aleksander Jan Bajkowski <olek2 at wp.pl>
AuthorDate: Sat Mar 1 15:41:07 2025 +0100
kernel: drop Maxlinear PHY LED control hack
All devices have already been migrated to the upstream PHY LED
API. This prevents users from adding new devices using this hack.
Signed-off-by: Aleksander Jan Bajkowski <olek2 at wp.pl>
---
.../765-mxl-gpy-control-LED-reg-from-DT.patch | 74 ----------------------
...l-gpy-don-t-use-SGMII-AN-if-using-phylink.patch | 8 +--
2 files changed, 4 insertions(+), 78 deletions(-)
diff --git a/target/linux/generic/hack-6.6/765-mxl-gpy-control-LED-reg-from-DT.patch b/target/linux/generic/hack-6.6/765-mxl-gpy-control-LED-reg-from-DT.patch
deleted file mode 100644
index 041f05e59b..0000000000
--- a/target/linux/generic/hack-6.6/765-mxl-gpy-control-LED-reg-from-DT.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 94b90966095f3fa625897e8f53d215882f6e19b3 Mon Sep 17 00:00:00 2001
-From: David Bauer <mail at david-bauer.net>
-Date: Sat, 11 Mar 2023 17:00:01 +0100
-Subject: [PATCH] mxl-gpy: control LED reg from DT
-
-Add dynamic configuration for the LED control registers on MXL PHYs.
-
-This patch has been tested with MaxLinear GPY211C. It is unlikely to be
-accepted upstream, as upstream plans on integrating their own framework
-for handling these LEDs.
-
-For the time being, use this hack to configure PHY driven device-LEDs to
-show the correct state.
-
-A possible alternative might be to expose the LEDs using the kernel LED
-framework and bind it to the netdevice. This might also be upstreamable,
-although it is a considerable extra amount of work.
-
-Signed-off-by: David Bauer <mail at david-bauer.net>
----
- drivers/net/phy/mxl-gpy.c | 37 ++++++++++++++++++++++++++++++++++++-
- 1 file changed, 36 insertions(+), 1 deletion(-)
-
---- a/drivers/net/phy/mxl-gpy.c
-+++ b/drivers/net/phy/mxl-gpy.c
-@@ -10,6 +10,7 @@
- #include <linux/bitfield.h>
- #include <linux/hwmon.h>
- #include <linux/mutex.h>
-+#include <linux/of.h>
- #include <linux/phy.h>
- #include <linux/polynomial.h>
- #include <linux/property.h>
-@@ -293,10 +294,39 @@ out:
- return ret;
- }
-
-+static int gpy_led_write(struct phy_device *phydev)
-+{
-+ struct device_node *node = phydev->mdio.dev.of_node;
-+ u32 led_regs[GPY_MAX_LEDS];
-+ int i, ret;
-+ u16 val = 0xff00;
-+
-+ if (!IS_ENABLED(CONFIG_OF_MDIO))
-+ return 0;
-+
-+ if (of_property_read_u32_array(node, "mxl,led-config", led_regs, GPY_MAX_LEDS))
-+ return 0;
-+
-+ if (of_property_read_bool(node, "mxl,led-drive-vdd"))
-+ val &= 0x0fff;
-+
-+ /* Enable LED function handling on all ports*/
-+ phy_write(phydev, PHY_LED, val);
-+
-+ /* Write LED register values */
-+ for (i = 0; i < GPY_MAX_LEDS; i++) {
-+ ret = phy_write_mmd(phydev, MDIO_MMD_VEND1, VSPEC1_LED(i), (u16)led_regs[i]);
-+ if (ret < 0)
-+ return ret;
-+ }
-+
-+ return 0;
-+}
-+
- static int gpy_config_init(struct phy_device *phydev)
- {
- /* Nothing to configure. Configuration Requirement Placeholder */
-- return 0;
-+ return gpy_led_write(phydev);
- }
-
- static int gpy_probe(struct phy_device *phydev)
diff --git a/target/linux/mediatek/patches-6.6/732-net-phy-mxl-gpy-don-t-use-SGMII-AN-if-using-phylink.patch b/target/linux/mediatek/patches-6.6/732-net-phy-mxl-gpy-don-t-use-SGMII-AN-if-using-phylink.patch
index 252263ad11..b29b0d52ed 100644
--- a/target/linux/mediatek/patches-6.6/732-net-phy-mxl-gpy-don-t-use-SGMII-AN-if-using-phylink.patch
+++ b/target/linux/mediatek/patches-6.6/732-net-phy-mxl-gpy-don-t-use-SGMII-AN-if-using-phylink.patch
@@ -14,7 +14,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
--- a/drivers/net/phy/mxl-gpy.c
+++ b/drivers/net/phy/mxl-gpy.c
-@@ -402,8 +402,11 @@ static bool gpy_2500basex_chk(struct phy
+@@ -372,8 +372,11 @@ static bool gpy_2500basex_chk(struct phy
phydev->speed = SPEED_2500;
phydev->interface = PHY_INTERFACE_MODE_2500BASEX;
@@ -28,7 +28,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
return true;
}
-@@ -454,6 +457,14 @@ static int gpy_config_aneg(struct phy_de
+@@ -424,6 +427,14 @@ static int gpy_config_aneg(struct phy_de
u32 adv;
int ret;
@@ -43,7 +43,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
if (phydev->autoneg == AUTONEG_DISABLE) {
/* Configure half duplex with genphy_setup_forced,
* because genphy_c45_pma_setup_forced does not support.
-@@ -576,6 +587,8 @@ static int gpy_update_interface(struct p
+@@ -546,6 +557,8 @@ static int gpy_update_interface(struct p
switch (phydev->speed) {
case SPEED_2500:
phydev->interface = PHY_INTERFACE_MODE_2500BASEX;
@@ -52,7 +52,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
ret = phy_modify_mmd(phydev, MDIO_MMD_VEND1, VSPEC1_SGMII_CTRL,
VSPEC1_SGMII_CTRL_ANEN, 0);
if (ret < 0) {
-@@ -589,7 +602,7 @@ static int gpy_update_interface(struct p
+@@ -559,7 +572,7 @@ static int gpy_update_interface(struct p
case SPEED_100:
case SPEED_10:
phydev->interface = PHY_INTERFACE_MODE_SGMII;
More information about the lede-commits
mailing list