delete no working path

This commit is contained in:
Juan Esf91
2025-03-16 17:58:57 -03:00
committed by Igor
parent 485a6d62cc
commit 843315ccb4

View File

@@ -1,121 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: John Doe <john.doe@somewhere.on.planet>
Date: Sat, 15 Mar 2025 20:51:03 -0300
Subject: PATCH drivers: net: ethernet: stmmac: add yt8531c led fixup
Signed-off-by: John Doe <john.doe@somewhere.on.planet>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 71 ++++++++++
1 file changed, 71 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index c8cf84fa4091..737cbcb2088b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -60,10 +60,18 @@
PTP_TCR_TSCTRLSSR)
#define STMMAC_ALIGN(x) ALIGN(ALIGN(x, SMP_CACHE_BYTES), 16)
#define TSO_MAX_BUFF_SIZE (SZ_16K - 1)
+#define YT8531C_PHY_ID 0x4f51e91b
+#define YT8531C_PHY_ID_MASK 0x001fffff
+#define REG_DEBUG_ADDR_OFFSET 0x1e
+#define REG_DEBUG_DATA 0x1f
+
+#define YT8531C_EXTREG_LED1 0xA00D
+#define YT8531C_EXTREG_LED2 0xA00E
+
/* Module parameters */
#define TX_TIMEO 5000
static int watchdog = TX_TIMEO;
module_param(watchdog, int, 0644);
MODULE_PARM_DESC(watchdog, "Transmit timeout in milliseconds (default 5s)");
@@ -7395,10 +7403,67 @@ static int stmmac_xdp_rx_timestamp(const struct xdp_md *_ctx, u64 *timestamp)
static const struct xdp_metadata_ops stmmac_xdp_metadata_ops = {
.xmo_rx_timestamp = stmmac_xdp_rx_timestamp,
};
+static int ytphy_read_ext(struct phy_device *phydev, u32 regnum)
+{
+ int ret;
+
+ phy_lock_mdio_bus(phydev);
+ ret = __phy_write(phydev, REG_DEBUG_ADDR_OFFSET, regnum);
+ if (ret < 0)
+ goto err_handle;
+
+ ret = __phy_read(phydev, REG_DEBUG_DATA);
+ if (ret < 0)
+ goto err_handle;
+
+err_handle:
+ phy_unlock_mdio_bus(phydev);
+ return ret;
+}
+
+static int ytphy_write_ext(struct phy_device *phydev, u32 regnum, u16 val)
+{
+ int ret;
+
+ phy_lock_mdio_bus(phydev);
+ ret = __phy_write(phydev, REG_DEBUG_ADDR_OFFSET, regnum);
+ if (ret < 0)
+ goto err_handle;
+
+ ret = __phy_write(phydev, REG_DEBUG_DATA, val);
+ if (ret < 0)
+ goto err_handle;
+
+err_handle:
+ phy_unlock_mdio_bus(phydev);
+ return ret;
+}
+
+static int phy_yt8531c_led_fixup(struct phy_device *phydev)
+{
+ int ret;
+ int val;
+
+ val = ytphy_read_ext(phydev, YT8531C_EXTREG_LED1);
+ if (val < 0)
+ return val;
+ val = 0x1e00; /* 10/100/1000Mbps blink*/
+ ret = ytphy_write_ext(phydev, YT8531C_EXTREG_LED1, val);
+ if (ret < 0)
+ return ret;
+
+ val = ytphy_read_ext(phydev, YT8531C_EXTREG_LED2);
+ if (val < 0)
+ return val;
+ val = 0x1800; /* 10/100/1000Mbps light*/
+ ret = ytphy_write_ext(phydev, YT8531C_EXTREG_LED2, val);
+ return ret;
+}
+
/**
* stmmac_dvr_probe
* @device: device pointer
* @plat_dat: platform data pointer
* @res: stmmac resource pointer
@@ -7704,10 +7769,16 @@ int stmmac_dvr_probe(struct device *device,
/* Let pm_runtime_put() disable the clocks.
* If CONFIG_PM is not enabled, the clocks will stay powered.
*/
pm_runtime_put(device);
+ /* Register fixup for PHY YT8531C */
+ ret = phy_register_fixup_for_uid(YT8531C_PHY_ID, YT8531C_PHY_ID_MASK, phy_yt8531c_led_fixup);
+ if (ret) {
+ dev_warn(priv->device, "Failed to register fixup for PHY YT8531C.\n");
+ }
+
return ret;
error_netdev_register:
phylink_destroy(priv->phylink);
error_phy_setup:
--
Created with Armbian build tools https://github.com/armbian/build