234dc8b99ae3b306689f9c8848431344f9cc5d26
[openwrt/staging/xback.git] /
1 From a1740b16c83729d908c760eaa821f27b51e58a13 Mon Sep 17 00:00:00 2001
2 From: Lorenzo Bianconi <lorenzo@kernel.org>
3 Date: Mon, 11 Aug 2025 17:31:40 +0200
4 Subject: [PATCH 4/6] net: airoha: npu: Read NPU wlan interrupt lines from the
5 DTS
6
7 Read all NPU wlan IRQ lines from the NPU device-tree node.
8 NPU module fires wlan irq lines when the traffic to/from the WiFi NIC is
9 not hw accelerated (these interrupts will be consumed by the MT76 driver
10 in subsequent patches).
11 This is a preliminary patch to enable wlan flowtable offload for EN7581
12 SoC.
13
14 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
15 Link: https://patch.msgid.link/20250811-airoha-en7581-wlan-offlaod-v7-5-58823603bb4e@kernel.org
16 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
17 ---
18 drivers/net/ethernet/airoha/airoha_npu.c | 9 +++++++++
19 drivers/net/ethernet/airoha/airoha_npu.h | 3 +++
20 2 files changed, 12 insertions(+)
21
22 --- a/drivers/net/ethernet/airoha/airoha_npu.c
23 +++ b/drivers/net/ethernet/airoha/airoha_npu.c
24 @@ -696,6 +696,15 @@ static int airoha_npu_probe(struct platf
25 INIT_WORK(&core->wdt_work, airoha_npu_wdt_work);
26 }
27
28 + /* wlan IRQ lines */
29 + for (i = 0; i < ARRAY_SIZE(npu->irqs); i++) {
30 + irq = platform_get_irq(pdev, i + ARRAY_SIZE(npu->cores) + 1);
31 + if (irq < 0)
32 + return irq;
33 +
34 + npu->irqs[i] = irq;
35 + }
36 +
37 err = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
38 if (err)
39 return err;
40 --- a/drivers/net/ethernet/airoha/airoha_npu.h
41 +++ b/drivers/net/ethernet/airoha/airoha_npu.h
42 @@ -5,6 +5,7 @@
43 */
44
45 #define NPU_NUM_CORES 8
46 +#define NPU_NUM_IRQ 6
47
48 enum airoha_npu_wlan_set_cmd {
49 WLAN_FUNC_SET_WAIT_PCIE_ADDR,
50 @@ -68,6 +69,8 @@ struct airoha_npu {
51 struct work_struct wdt_work;
52 } cores[NPU_NUM_CORES];
53
54 + int irqs[NPU_NUM_IRQ];
55 +
56 struct airoha_foe_stats __iomem *stats;
57
58 struct {