mirror of
https://github.com/openwrt/openwrt.git
synced 2026-06-17 12:40:16 +04:00
8f638f9366
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.91 Remove upstreamed patches: - airoha/patches-6.12/017-v6.13-net-airoha-Implement-BQL-support.patch[1] - airoha/patches-6.12/138-v7.1-net-airoha-Add-missing-RX_CPU_IDX-configuration-in-a.patch[2] - airoha/patches-6.12/149-v7.1-net-airoha-Move-ndesc-initialization-at-end-of-airoh.patch[3] - generic/backport-6.12/940-v7.1-net-dsa-realtek-rtl8365mb-fix-mode-mask-calculation.patch[5] Manually rebased patches: - airoha/patches-6.12/048-01-v6.15-net-airoha-Move-airoha_eth-driver-in-a-dedicated-fol.patch[1] - ath79/patches-6.12/800-leds-add-reset-controller-based-driver.patch[4] - bcm27xx/patches-6.12/950-0122-bcmgenet-Better-coalescing-parameter-defaults.patch[6] We also backported four patches to fix perf tool regression: - generic/backport-6.12/216-01-revert-perf-cgroup-update-metric-leader-in-evlist__e.patch - generic/backport-6.12/216-02-revert-perf-tool_pmu-fix-aggregation-on-duration_tim.patch - generic/backport-6.12/216-03-revert-perf-python-add-parse_events-function.patch - generic/backport-6.12/216-04-revert-perf-tool_pmu-factor-tool-events-into-their-o.patch All other patches are automatically refreshed. [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.91&id=ca24fcac1daaa5e8a667981d81986a3eb4b9fb04 [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.91&id=f00037a99bc2332ef59dc85298b98b20af165904 [3] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.91&id=d36be272adda7f313e39dd118086955d993bf6a7 [4] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.91&id=07d3611389ba7d78b80ea360a42ce32ab2521fbc [5] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.91&id=3354d6c62fd4baa7b32cbd80cc5a8aa3f2bd0656 [6] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.91&id=b84351dcc359667bc952131c1424b692ec83dce2 Signed-off-by: Shiji Yang <yangshiji66@outlook.com> Link: https://github.com/openwrt/openwrt/pull/23444 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
163 lines
5.9 KiB
Diff
163 lines
5.9 KiB
Diff
From df8e1e4a2eb5f8ecdef36c502601e8afbc6ad891 Mon Sep 17 00:00:00 2001
|
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
|
Date: Wed, 24 Dec 2025 17:29:33 +0100
|
|
Subject: [PATCH] net: airoha: Reset PPE default cput port in
|
|
airoha_ppe_hw_init()
|
|
|
|
Before this patch the default PPE cpu port used for a specific GDM
|
|
device was set running ndo_init() callback during device initialization.
|
|
The selected PPE cpu port configured for the specific GDM device depends
|
|
on the QDMA block assigned to the GDM device. The selected QDMA block
|
|
depends on LAN/WAN configuration as specified in commmit XXXX.
|
|
However, the user selected PPE cpu port can be different with respect to
|
|
the one hardcoded in the NPU firmware binary. The hardcoded PPE cput port
|
|
value is loaded initializing the PPE engine running npu ops ppe_init()
|
|
callback in airoha_ppe_offload_setup routine.
|
|
Reset the default value for PPE cpu ports in airoha_ppe_hw_init routine
|
|
in order to apply the user requested configuration according to the device
|
|
DTS setup.
|
|
Please note this patch is fixing an issue not visible to the user (so we
|
|
do not need to backport it) since airoha_eth driver currently supports just
|
|
the internal phy available via the MT7530 DSA switch and there are no WAN
|
|
interfaces officially supporte since PCS/external phy is not merged mainline
|
|
yet (it will be posted with following patches).
|
|
|
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
|
---
|
|
drivers/net/ethernet/airoha/airoha_eth.c | 28 +++++------------------
|
|
drivers/net/ethernet/airoha/airoha_eth.h | 2 ++
|
|
drivers/net/ethernet/airoha/airoha_ppe.c | 23 ++++++++++++++++++-
|
|
drivers/net/ethernet/airoha/airoha_regs.h | 7 +++---
|
|
4 files changed, 33 insertions(+), 27 deletions(-)
|
|
|
|
--- a/drivers/net/ethernet/airoha/airoha_eth.c
|
|
+++ b/drivers/net/ethernet/airoha/airoha_eth.c
|
|
@@ -1776,8 +1776,7 @@ static int airoha_dev_init(struct net_de
|
|
{
|
|
struct airoha_gdm_port *port = netdev_priv(dev);
|
|
struct airoha_eth *eth = port->eth;
|
|
- u32 fe_cpu_port;
|
|
- u8 ppe_id;
|
|
+ int i;
|
|
|
|
/* QDMA0 is used for lan ports while QDMA1 is used for WAN ports */
|
|
port->qdma = ð->qdma[!airoha_is_lan_gdm_port(port)];
|
|
@@ -1795,28 +1794,13 @@ static int airoha_dev_init(struct net_de
|
|
if (err)
|
|
return err;
|
|
}
|
|
- fallthrough;
|
|
- case AIROHA_GDM2_IDX:
|
|
- if (airoha_ppe_is_enabled(eth, 1)) {
|
|
- /* For PPE2 always use secondary cpu port. */
|
|
- fe_cpu_port = FE_PSE_PORT_CDM2;
|
|
- ppe_id = 1;
|
|
- break;
|
|
- }
|
|
- fallthrough;
|
|
- default: {
|
|
- u8 qdma_id = port->qdma - ð->qdma[0];
|
|
-
|
|
- /* For PPE1 select cpu port according to the running QDMA. */
|
|
- fe_cpu_port = qdma_id ? FE_PSE_PORT_CDM2 : FE_PSE_PORT_CDM1;
|
|
- ppe_id = 0;
|
|
break;
|
|
- }
|
|
+ default:
|
|
+ break;
|
|
}
|
|
|
|
- airoha_fe_rmw(eth, REG_PPE_DFT_CPORT0(ppe_id),
|
|
- DFT_CPORT_MASK(port->id),
|
|
- __field_prep(DFT_CPORT_MASK(port->id), fe_cpu_port));
|
|
+ for (i = 0; i < eth->soc->num_ppe; i++)
|
|
+ airoha_ppe_set_cpu_port(port, i);
|
|
|
|
return 0;
|
|
}
|
|
@@ -1919,7 +1903,7 @@ static u32 airoha_get_dsa_tag(struct sk_
|
|
#endif
|
|
}
|
|
|
|
-static int airoha_get_fe_port(struct airoha_gdm_port *port)
|
|
+int airoha_get_fe_port(struct airoha_gdm_port *port)
|
|
{
|
|
struct airoha_qdma *qdma = port->qdma;
|
|
struct airoha_eth *eth = qdma->eth;
|
|
--- a/drivers/net/ethernet/airoha/airoha_eth.h
|
|
+++ b/drivers/net/ethernet/airoha/airoha_eth.h
|
|
@@ -646,9 +646,11 @@ static inline bool airoha_is_7583(struct
|
|
return eth->soc->version == 0x7583;
|
|
}
|
|
|
|
+int airoha_get_fe_port(struct airoha_gdm_port *port);
|
|
bool airoha_is_valid_gdm_port(struct airoha_eth *eth,
|
|
struct airoha_gdm_port *port);
|
|
|
|
+void airoha_ppe_set_cpu_port(struct airoha_gdm_port *port, u8 ppe_id);
|
|
bool airoha_ppe_is_enabled(struct airoha_eth *eth, int index);
|
|
void airoha_ppe_check_skb(struct airoha_ppe_dev *dev, struct sk_buff *skb,
|
|
u16 hash, bool rx_wlan);
|
|
--- a/drivers/net/ethernet/airoha/airoha_ppe.c
|
|
+++ b/drivers/net/ethernet/airoha/airoha_ppe.c
|
|
@@ -85,6 +85,20 @@ static u32 airoha_ppe_get_timestamp(stru
|
|
return FIELD_GET(AIROHA_FOE_IB1_BIND_TIMESTAMP, timestamp);
|
|
}
|
|
|
|
+void airoha_ppe_set_cpu_port(struct airoha_gdm_port *port, u8 ppe_id)
|
|
+{
|
|
+ struct airoha_qdma *qdma = port->qdma;
|
|
+ u8 fport = airoha_get_fe_port(port);
|
|
+ struct airoha_eth *eth = qdma->eth;
|
|
+ u8 qdma_id = qdma - ð->qdma[0];
|
|
+ u32 fe_cpu_port;
|
|
+
|
|
+ fe_cpu_port = qdma_id ? FE_PSE_PORT_CDM2 : FE_PSE_PORT_CDM1;
|
|
+ airoha_fe_rmw(eth, REG_PPE_DFT_CPORT(ppe_id, fport),
|
|
+ DFT_CPORT_MASK(fport),
|
|
+ __field_prep(DFT_CPORT_MASK(fport), fe_cpu_port));
|
|
+}
|
|
+
|
|
static void airoha_ppe_hw_init(struct airoha_ppe *ppe)
|
|
{
|
|
u32 sram_ppe_num_data_entries = PPE_SRAM_NUM_ENTRIES, sram_num_entries;
|
|
@@ -147,7 +161,9 @@ static void airoha_ppe_hw_init(struct ai
|
|
|
|
airoha_fe_wr(eth, REG_PPE_HASH_SEED(i), PPE_HASH_SEED);
|
|
|
|
- for (p = 0; p < ARRAY_SIZE(eth->ports); p++)
|
|
+ for (p = 0; p < ARRAY_SIZE(eth->ports); p++) {
|
|
+ struct airoha_gdm_port *port = eth->ports[p];
|
|
+
|
|
airoha_fe_rmw(eth, REG_PPE_MTU(i, p),
|
|
FP0_EGRESS_MTU_MASK |
|
|
FP1_EGRESS_MTU_MASK,
|
|
@@ -155,6 +171,11 @@ static void airoha_ppe_hw_init(struct ai
|
|
AIROHA_MAX_MTU) |
|
|
FIELD_PREP(FP1_EGRESS_MTU_MASK,
|
|
AIROHA_MAX_MTU));
|
|
+ if (!port)
|
|
+ continue;
|
|
+
|
|
+ airoha_ppe_set_cpu_port(port, i);
|
|
+ }
|
|
}
|
|
}
|
|
|
|
--- a/drivers/net/ethernet/airoha/airoha_regs.h
|
|
+++ b/drivers/net/ethernet/airoha/airoha_regs.h
|
|
@@ -312,10 +312,9 @@
|
|
#define REG_PPE_HASH_SEED(_n) (((_n) ? PPE2_BASE : PPE1_BASE) + 0x244)
|
|
#define PPE_HASH_SEED 0x12345678
|
|
|
|
-#define REG_PPE_DFT_CPORT0(_n) (((_n) ? PPE2_BASE : PPE1_BASE) + 0x248)
|
|
-#define DFT_CPORT_MASK(_n) GENMASK(3 + ((_n) << 2), ((_n) << 2))
|
|
-
|
|
-#define REG_PPE_DFT_CPORT1(_n) (((_n) ? PPE2_BASE : PPE1_BASE) + 0x24c)
|
|
+#define REG_PPE_DFT_CPORT_BASE(_n) (((_n) ? PPE2_BASE : PPE1_BASE) + 0x248)
|
|
+#define REG_PPE_DFT_CPORT(_m, _n) (REG_PPE_DFT_CPORT_BASE(_m) + (((_n) / 8) << 2))
|
|
+#define DFT_CPORT_MASK(_n) GENMASK(3 + (((_n) % 8) << 2), (((_n) % 8) << 2))
|
|
|
|
#define REG_PPE_TB_HASH_CFG(_n) (((_n) ? PPE2_BASE : PPE1_BASE) + 0x250)
|
|
#define PPE_DRAM_HASH1_MODE_MASK GENMASK(31, 28)
|