prplos/target/linux/airoha/patches-6.6/605-net-pcs-airoha-add-support-for-optional-xfi-reset-li.patch
Christian Marangi ea18ff5339 airoha: update PCS driver with new upstream version
Manually update the PCS driver with new proposed upstream version. This
can't be normally cherry-picked from main branch as main branch now use
standalone PCS feature that is problematic to port for very old kernel
(6.6)

Link: https://github.com/openwrt/openwrt/pull/24263
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 443ec4032a78cbeb52c5761b7702033904fa6a11)
2026-08-18 11:40:42 +01:00

64 lines
2.2 KiB
Diff

From 961800f3badd72e4efda39f219ac4cbec5791433 Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Sat, 26 Jul 2025 22:58:10 +0200
Subject: [PATCH 7/8] net: pcs: airoha: add support for optional xfi reset line
On Airoha AN7583 there is a dedicated reset line for the PON XFI Serdes.
This is needed to permit changing the WAN sel register or the system
will stall on accessing the XFI register.
Add support for this optional dedicated reset to permit correct
configuration of the PON Serdes.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
drivers/net/pcs/airoha/pcs-airoha-common.c | 12 ++++++++++++
drivers/net/pcs/airoha/pcs-airoha.h | 1 +
2 files changed, 13 insertions(+)
--- a/drivers/net/pcs/airoha/pcs-airoha-common.c
+++ b/drivers/net/pcs/airoha/pcs-airoha-common.c
@@ -144,6 +144,10 @@ static int airoha_pcs_setup_scu(struct a
const struct airoha_pcs_match_data *data = priv->data;
int ret;
+ ret = reset_control_assert(priv->xfi_rst);
+ if (ret)
+ return ret;
+
switch (data->port_type) {
case AIROHA_PCS_ETH:
airoha_pcs_setup_scu_eth(priv, interface);
@@ -161,6 +165,10 @@ static int airoha_pcs_setup_scu(struct a
break;
}
+ ret = reset_control_deassert(priv->xfi_rst);
+ if (ret)
+ return ret;
+
/* TODO better handle reset from MAC */
ret = reset_control_bulk_assert(ARRAY_SIZE(priv->rsts),
priv->rsts);
@@ -1298,6 +1306,10 @@ static int airoha_pcs_probe(struct platf
if (ret)
return dev_err_probe(dev, ret, "failed to get bulk reset lines\n");
+ priv->xfi_rst = devm_reset_control_get_optional_exclusive(dev, "xfi");
+ if (IS_ERR(priv->xfi_rst))
+ return dev_err_probe(dev, PTR_ERR(priv->xfi_rst), "failed to get xfi reset lines\n");
+
/* For Ethernet PCS, read the AN7581 SoC revision to check if
* manual rx calibration is needed. This is only limited to
* any SoC revision before E2.
--- a/drivers/net/pcs/airoha/pcs-airoha.h
+++ b/drivers/net/pcs/airoha/pcs-airoha.h
@@ -1654,6 +1654,7 @@ struct airoha_pcs_priv {
struct regmap *pcs_ana;
struct regmap_field **pcs_ana_fields[2];
+ struct reset_control *xfi_rst;
struct reset_control_bulk_data rsts[AIROHA_PCS_MAX_NUM_RSTS];
struct phy *phy;