[PATCH net-next 4/6] net: airoha: npu: Read NPU interrupt lines from the DTS

Lorenzo Bianconi lorenzo at kernel.org
Tue Jul 1 15:23:33 PDT 2025


Read all NPU supported IRQ lines from NPU device-tree node.
This is a preliminary patch to enable wlan flowtable offload for EN7581
SoC.

Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
---
 drivers/net/ethernet/airoha/airoha_npu.c | 8 ++++++++
 drivers/net/ethernet/airoha/airoha_npu.h | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/drivers/net/ethernet/airoha/airoha_npu.c b/drivers/net/ethernet/airoha/airoha_npu.c
index 7d552ab7f692ba0f720e4fef89082e6ab233d809..1cf431469ca034bbaeb922fed3ebdab41aafef05 100644
--- a/drivers/net/ethernet/airoha/airoha_npu.c
+++ b/drivers/net/ethernet/airoha/airoha_npu.c
@@ -848,6 +848,14 @@ static int airoha_npu_probe(struct platform_device *pdev)
 		INIT_WORK(&core->wdt_work, airoha_npu_wdt_work);
 	}
 
+	for (i = 0; i < ARRAY_SIZE(npu->irqs); i++) {
+		irq = platform_get_irq(pdev, i + ARRAY_SIZE(npu->cores) + 1);
+		if (irq < 0)
+			return irq;
+
+		npu->irqs[i] = irq;
+	}
+
 	err = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
 	if (err)
 		return err;
diff --git a/drivers/net/ethernet/airoha/airoha_npu.h b/drivers/net/ethernet/airoha/airoha_npu.h
index 23318b708f81eacc11753f54350ae33ea83a11ee..19cfc6b7fb52f4a176d91c7b39383b4c3e13d777 100644
--- a/drivers/net/ethernet/airoha/airoha_npu.h
+++ b/drivers/net/ethernet/airoha/airoha_npu.h
@@ -5,6 +5,7 @@
  */
 
 #define NPU_NUM_CORES		8
+#define NPU_NUM_IRQ		6
 
 struct airoha_npu {
 	struct device *dev;
@@ -17,6 +18,8 @@ struct airoha_npu {
 		struct work_struct wdt_work;
 	} cores[NPU_NUM_CORES];
 
+	int irqs[NPU_NUM_IRQ];
+
 	struct airoha_foe_stats __iomem *stats;
 
 	struct {

-- 
2.50.0




More information about the Linux-mediatek mailing list