mirror of
https://github.com/openwrt/openwrt.git
synced 2026-05-05 22:25:44 +04:00
46a454fb9b
Backport upstream patch for AN7583 Ethernet support. While at it also backport some additional fixes required to apply the AN7583 patches cleanly. Refresh all affected patch automatically (aside from the XSI patch that changed the implementation) Link: https://github.com/openwrt/openwrt/pull/20489 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
44 lines
1.8 KiB
Diff
44 lines
1.8 KiB
Diff
From fea8cdf6738a8b25fccbb7b109b440795a0892cb Mon Sep 17 00:00:00 2001
|
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
|
Date: Wed, 8 Oct 2025 11:27:43 +0200
|
|
Subject: [PATCH] net: airoha: Fix loopback mode configuration for GDM2 port
|
|
|
|
Add missing configuration for loopback mode in airhoha_set_gdm2_loopback
|
|
routine.
|
|
|
|
Fixes: 9cd451d414f6e ("net: airoha: Add loopback support for GDM2")
|
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
|
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
|
|
Link: https://patch.msgid.link/20251008-airoha-loopback-mode-fix-v2-1-045694fe7f60@kernel.org
|
|
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|
---
|
|
drivers/net/ethernet/airoha/airoha_eth.c | 4 +++-
|
|
drivers/net/ethernet/airoha/airoha_regs.h | 3 +++
|
|
2 files changed, 6 insertions(+), 1 deletion(-)
|
|
|
|
--- a/drivers/net/ethernet/airoha/airoha_eth.c
|
|
+++ b/drivers/net/ethernet/airoha/airoha_eth.c
|
|
@@ -1715,7 +1715,9 @@ static void airhoha_set_gdm2_loopback(st
|
|
airoha_fe_wr(eth, REG_GDM_RXCHN_EN(2), 0xffff);
|
|
airoha_fe_rmw(eth, REG_GDM_LPBK_CFG(2),
|
|
LPBK_CHAN_MASK | LPBK_MODE_MASK | LPBK_EN_MASK,
|
|
- FIELD_PREP(LPBK_CHAN_MASK, chan) | LPBK_EN_MASK);
|
|
+ FIELD_PREP(LPBK_CHAN_MASK, chan) |
|
|
+ LBK_GAP_MODE_MASK | LBK_LEN_MODE_MASK |
|
|
+ LBK_CHAN_MODE_MASK | LPBK_EN_MASK);
|
|
airoha_fe_rmw(eth, REG_GDM_LEN_CFG(2),
|
|
GDM_SHORT_LEN_MASK | GDM_LONG_LEN_MASK,
|
|
FIELD_PREP(GDM_SHORT_LEN_MASK, 60) |
|
|
--- a/drivers/net/ethernet/airoha/airoha_regs.h
|
|
+++ b/drivers/net/ethernet/airoha/airoha_regs.h
|
|
@@ -151,6 +151,9 @@
|
|
#define LPBK_LEN_MASK GENMASK(23, 10)
|
|
#define LPBK_CHAN_MASK GENMASK(8, 4)
|
|
#define LPBK_MODE_MASK GENMASK(3, 1)
|
|
+#define LBK_GAP_MODE_MASK BIT(3)
|
|
+#define LBK_LEN_MODE_MASK BIT(2)
|
|
+#define LBK_CHAN_MODE_MASK BIT(1)
|
|
#define LPBK_EN_MASK BIT(0)
|
|
|
|
#define REG_GDM_TXCHN_EN(_n) (GDM_BASE(_n) + 0x24)
|