1
1
openwrt/target/linux/airoha/patches-6.18/605-net-pcs-airoha-add-support-for-optional-xfi-reset-li.patch
Kenneth Kasilag 8f21d26411
airoha: 6.18: refresh patches
Refreshed automatically with `make target/linux/refresh V=s`.

Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
Link: https://github.com/openwrt/openwrt/pull/21019
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-06-03 09:06:34 +02: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);
@@ -1300,6 +1308,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;