mirror of
https://github.com/openwrt/openwrt.git
synced 2026-06-17 12:40:16 +04:00
9cf794cff1
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
(cherry picked from commit 8f638f9366)
Link: https://github.com/openwrt/openwrt/pull/23538
[Adapted to patches in 25.12]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
186 lines
5.6 KiB
Diff
186 lines
5.6 KiB
Diff
From e4e5ce823bdd4601bd75ae7c206ae35e7c2fa60b Mon Sep 17 00:00:00 2001
|
|
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
|
Date: Fri, 17 Oct 2025 11:06:22 +0200
|
|
Subject: [PATCH 12/12] net: airoha: Add AN7583 SoC support
|
|
|
|
Introduce support for AN7583 ethernet controller to airoha-eth dirver.
|
|
|
|
Reviewed-by: Simon Horman <horms@kernel.org>
|
|
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
|
Link: https://patch.msgid.link/20251017-an7583-eth-support-v3-13-f28319666667@kernel.org
|
|
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|
---
|
|
drivers/net/ethernet/airoha/airoha_eth.c | 68 ++++++++++++++++++++++--
|
|
drivers/net/ethernet/airoha/airoha_eth.h | 11 ++++
|
|
drivers/net/ethernet/airoha/airoha_ppe.c | 3 ++
|
|
3 files changed, 77 insertions(+), 5 deletions(-)
|
|
|
|
--- a/drivers/net/ethernet/airoha/airoha_eth.c
|
|
+++ b/drivers/net/ethernet/airoha/airoha_eth.c
|
|
@@ -1710,10 +1710,8 @@ static int airoha_dev_set_macaddr(struct
|
|
|
|
static int airhoha_set_gdm2_loopback(struct airoha_gdm_port *port)
|
|
{
|
|
- u32 val, pse_port, chan = port->id == AIROHA_GDM3_IDX ? 4 : 0;
|
|
struct airoha_eth *eth = port->qdma->eth;
|
|
- /* XXX: handle XSI_USB_PORT and XSI_PCE1_PORT */
|
|
- u32 nbq = port->id == AIROHA_GDM3_IDX ? 4 : 0;
|
|
+ u32 val, pse_port, chan, nbq;
|
|
int src_port;
|
|
|
|
/* Forward the traffic to the proper GDM port */
|
|
@@ -1725,6 +1723,8 @@ static int airhoha_set_gdm2_loopback(str
|
|
/* Enable GDM2 loopback */
|
|
airoha_fe_wr(eth, REG_GDM_TXCHN_EN(2), 0xffffffff);
|
|
airoha_fe_wr(eth, REG_GDM_RXCHN_EN(2), 0xffff);
|
|
+
|
|
+ chan = port->id == AIROHA_GDM3_IDX ? airoha_is_7581(eth) ? 4 : 3 : 0;
|
|
airoha_fe_rmw(eth, REG_GDM_LPBK_CFG(2),
|
|
LPBK_CHAN_MASK | LPBK_MODE_MASK | LPBK_EN_MASK,
|
|
FIELD_PREP(LPBK_CHAN_MASK, chan) |
|
|
@@ -1739,6 +1739,8 @@ static int airhoha_set_gdm2_loopback(str
|
|
airoha_fe_clear(eth, REG_FE_VIP_PORT_EN, BIT(2));
|
|
airoha_fe_clear(eth, REG_FE_IFC_PORT_EN, BIT(2));
|
|
|
|
+ /* XXX: handle XSI_USB_PORT and XSI_PCE1_PORT */
|
|
+ nbq = port->id == AIROHA_GDM3_IDX && airoha_is_7581(eth) ? 4 : 0;
|
|
src_port = eth->soc->ops.get_src_port_id(port, nbq);
|
|
if (src_port < 0)
|
|
return src_port;
|
|
@@ -1752,7 +1754,7 @@ static int airhoha_set_gdm2_loopback(str
|
|
SP_CPORT_MASK(val),
|
|
FE_PSE_PORT_CDM2 << __ffs(SP_CPORT_MASK(val)));
|
|
|
|
- if (port->id != AIROHA_GDM3_IDX)
|
|
+ if (port->id != AIROHA_GDM3_IDX && airoha_is_7581(eth))
|
|
airoha_fe_rmw(eth, REG_SRC_PORT_FC_MAP6,
|
|
FC_ID_OF_SRC_PORT24_MASK,
|
|
FIELD_PREP(FC_ID_OF_SRC_PORT24_MASK, 2));
|
|
@@ -1921,6 +1923,22 @@ static bool airoha_dev_tx_queue_busy(str
|
|
return index >= tail;
|
|
}
|
|
|
|
+static int airoha_get_fe_port(struct airoha_gdm_port *port)
|
|
+{
|
|
+ struct airoha_qdma *qdma = port->qdma;
|
|
+ struct airoha_eth *eth = qdma->eth;
|
|
+
|
|
+ switch (eth->soc->version) {
|
|
+ case 0x7583:
|
|
+ return port->id == AIROHA_GDM3_IDX ? FE_PSE_PORT_GDM3
|
|
+ : port->id;
|
|
+ case 0x7581:
|
|
+ default:
|
|
+ return port->id == AIROHA_GDM4_IDX ? FE_PSE_PORT_GDM4
|
|
+ : port->id;
|
|
+ }
|
|
+}
|
|
+
|
|
static netdev_tx_t airoha_dev_xmit(struct sk_buff *skb,
|
|
struct net_device *dev)
|
|
{
|
|
@@ -1961,7 +1979,7 @@ static netdev_tx_t airoha_dev_xmit(struc
|
|
}
|
|
}
|
|
|
|
- fport = port->id == 4 ? FE_PSE_PORT_GDM4 : port->id;
|
|
+ fport = airoha_get_fe_port(port);
|
|
msg1 = FIELD_PREP(QDMA_ETH_TXMSG_FPORT_MASK, fport) |
|
|
FIELD_PREP(QDMA_ETH_TXMSG_METER_MASK, 0x7f);
|
|
|
|
@@ -3122,6 +3140,35 @@ static int airoha_en7581_get_src_port_id
|
|
return -EINVAL;
|
|
}
|
|
|
|
+static const char * const an7583_xsi_rsts_names[] = {
|
|
+ "xsi-mac",
|
|
+ "hsi0-mac",
|
|
+ "hsi1-mac",
|
|
+ "xfp-mac",
|
|
+};
|
|
+
|
|
+static int airoha_an7583_get_src_port_id(struct airoha_gdm_port *port, int nbq)
|
|
+{
|
|
+ switch (port->id) {
|
|
+ case 3:
|
|
+ /* 7583 SoC supports eth serdes on GDM3 port */
|
|
+ if (!nbq)
|
|
+ return HSGMII_LAN_7583_ETH_SRCPORT;
|
|
+ break;
|
|
+ case 4:
|
|
+ /* 7583 SoC supports PCIe and USB serdes on GDM4 port */
|
|
+ if (!nbq)
|
|
+ return HSGMII_LAN_7583_PCIE_SRCPORT;
|
|
+ if (nbq == 1)
|
|
+ return HSGMII_LAN_7583_USB_SRCPORT;
|
|
+ break;
|
|
+ default:
|
|
+ break;
|
|
+ }
|
|
+
|
|
+ return -EINVAL;
|
|
+}
|
|
+
|
|
static const struct airoha_eth_soc_data en7581_soc_data = {
|
|
.version = 0x7581,
|
|
.xsi_rsts_names = en7581_xsi_rsts_names,
|
|
@@ -3132,8 +3179,19 @@ static const struct airoha_eth_soc_data
|
|
},
|
|
};
|
|
|
|
+static const struct airoha_eth_soc_data an7583_soc_data = {
|
|
+ .version = 0x7583,
|
|
+ .xsi_rsts_names = an7583_xsi_rsts_names,
|
|
+ .num_xsi_rsts = ARRAY_SIZE(an7583_xsi_rsts_names),
|
|
+ .num_ppe = 1,
|
|
+ .ops = {
|
|
+ .get_src_port_id = airoha_an7583_get_src_port_id,
|
|
+ },
|
|
+};
|
|
+
|
|
static const struct of_device_id of_airoha_match[] = {
|
|
{ .compatible = "airoha,en7581-eth", .data = &en7581_soc_data },
|
|
+ { .compatible = "airoha,an7583-eth", .data = &an7583_soc_data },
|
|
{ /* sentinel */ }
|
|
};
|
|
MODULE_DEVICE_TABLE(of, of_airoha_match);
|
|
--- a/drivers/net/ethernet/airoha/airoha_eth.h
|
|
+++ b/drivers/net/ethernet/airoha/airoha_eth.h
|
|
@@ -74,6 +74,12 @@ enum {
|
|
};
|
|
|
|
enum {
|
|
+ HSGMII_LAN_7583_ETH_SRCPORT = 0x16,
|
|
+ HSGMII_LAN_7583_PCIE_SRCPORT = 0x18,
|
|
+ HSGMII_LAN_7583_USB_SRCPORT,
|
|
+};
|
|
+
|
|
+enum {
|
|
XSI_PCIE0_VIP_PORT_MASK = BIT(22),
|
|
XSI_PCIE1_VIP_PORT_MASK = BIT(23),
|
|
XSI_USB_VIP_PORT_MASK = BIT(25),
|
|
@@ -629,6 +635,11 @@ static inline bool airoha_is_7581(struct
|
|
return eth->soc->version == 0x7581;
|
|
}
|
|
|
|
+static inline bool airoha_is_7583(struct airoha_eth *eth)
|
|
+{
|
|
+ return eth->soc->version == 0x7583;
|
|
+}
|
|
+
|
|
bool airoha_is_valid_gdm_port(struct airoha_eth *eth,
|
|
struct airoha_gdm_port *port);
|
|
|
|
--- a/drivers/net/ethernet/airoha/airoha_ppe.c
|
|
+++ b/drivers/net/ethernet/airoha/airoha_ppe.c
|
|
@@ -37,6 +37,9 @@ static int airoha_ppe_get_num_stats_entr
|
|
if (!IS_ENABLED(CONFIG_NET_AIROHA_FLOW_STATS))
|
|
return -EOPNOTSUPP;
|
|
|
|
+ if (airoha_is_7583(ppe->eth))
|
|
+ return -EOPNOTSUPP;
|
|
+
|
|
return PPE_STATS_NUM_ENTRIES;
|
|
}
|
|
|