Files
eternalwrt-mt798x/target/linux/airoha/patches-6.12/125-v7.1-net-airoha-Rely-__field_prep-for-non-constant-masks.patch
T
Lorenzo BianconiandChristian Marangi c5a8ddd0ac airoha: backport some missing airoha_eth upstream patches
Backport more upstream patch to include all the fixes pushed upstream and
add all the preliminary patch for multi-serdes support.

While at it also move 2 patch in the 6xx numbering to the 000-1xx backport
numbering to keep things tidy.

All the affected patch manually and automatically refreshed.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
[ add comment, renumber patch, add more patch, fix PCS patch ]
Link: https://github.com/openwrt/openwrt/pull/22479
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2026-03-20 13:21:24 +01:00

45 lines
1.7 KiB
Diff

From 7600fb3b41dd6ab65ed61169df1b6099044edf97 Mon Sep 17 00:00:00 2001
From: Lorenzo Bianconi <lorenzo@kernel.org>
Date: Wed, 4 Mar 2026 11:56:47 +0100
Subject: [PATCH] net: airoha: Rely __field_prep for non-constant masks
Rely on __field_prep macros for non-constant masks preparing the values
for register updates instead of open-coding.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260304-airoha-__field_prep-v1-1-b185facc4e2f@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
drivers/net/ethernet/airoha/airoha_eth.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/drivers/net/ethernet/airoha/airoha_eth.c
+++ b/drivers/net/ethernet/airoha/airoha_eth.c
@@ -1727,7 +1727,7 @@ static int airhoha_set_gdm2_loopback(str
airoha_fe_rmw(eth,
REG_SP_DFT_CPORT(src_port >> fls(SP_CPORT_DFT_MASK)),
SP_CPORT_MASK(val),
- FE_PSE_PORT_CDM2 << __ffs(SP_CPORT_MASK(val)));
+ __field_prep(SP_CPORT_MASK(val), FE_PSE_PORT_CDM2));
if (port->id != AIROHA_GDM3_IDX && airoha_is_7581(eth))
airoha_fe_rmw(eth, REG_SRC_PORT_FC_MAP6,
@@ -1781,7 +1781,7 @@ static int airoha_dev_init(struct net_de
ppe_id = pse_port == FE_PSE_PORT_PPE2 ? 1 : 0;
airoha_fe_rmw(eth, REG_PPE_DFT_CPORT0(ppe_id),
DFT_CPORT_MASK(port->id),
- fe_cpu_port << __ffs(DFT_CPORT_MASK(port->id)));
+ __field_prep(DFT_CPORT_MASK(port->id), fe_cpu_port));
return 0;
}
@@ -2138,7 +2138,7 @@ static int airoha_qdma_set_chan_tx_sched
airoha_qdma_rmw(port->qdma, REG_CHAN_QOS_MODE(channel >> 3),
CHAN_QOS_MODE_MASK(channel),
- mode << __ffs(CHAN_QOS_MODE_MASK(channel)));
+ __field_prep(CHAN_QOS_MODE_MASK(channel), mode));
return 0;
}