* [PATCH net-next v3 0/2] airoha: Add the capability to read firmware binary names from dts for Airoha NPU driver
@ 2026-01-19 15:32 Lorenzo Bianconi
2026-01-19 15:32 ` [PATCH net-next v3 1/2] dt-bindings: net: airoha: npu: Add firmware-name property Lorenzo Bianconi
2026-01-19 15:32 ` [PATCH net-next v3 2/2] net: airoha: npu: Add the capability to read firmware names from dts Lorenzo Bianconi
0 siblings, 2 replies; 7+ messages in thread
From: Lorenzo Bianconi @ 2026-01-19 15:32 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Lorenzo Bianconi
Cc: netdev, devicetree, linux-arm-kernel, linux-mediatek
This patch is needed because NPU firmware binaries are board specific since
they depend on the MediaTek WiFi chip used on the board (e.g. MT7996 or
MT7992). This is a preliminary patch to enable MT76 NPU offloading if
the Airoha SoC is equipped with MT7996 (Eagle) WiFi chipset.
---
Changes in v3:
- Roll-back to approach proposed in v1 using firmware-name property
- Link to v2: https://lore.kernel.org/r/20260113-airoha-npu-firmware-name-v2-0-28cb3d230206@kernel.org
Changes in v2:
- Introduce "airoha,en7581-npu-7996" compatible string to specify the
firmware and drop "firmware-name" property
- Link to v1: https://lore.kernel.org/r/20260112-airoha-npu-firmware-name-v1-0-d0b148b6710f@kernel.org
---
Lorenzo Bianconi (2):
dt-bindings: net: airoha: npu: Add firmware-name property
net: airoha: npu: Add the capability to read firmware names from dts
.../devicetree/bindings/net/airoha,en7581-npu.yaml | 7 ++++
drivers/net/ethernet/airoha/airoha_npu.c | 42 ++++++++++++++++++----
2 files changed, 43 insertions(+), 6 deletions(-)
---
base-commit: b4e486e2c46f754a515571a8ca1238fa567396dd
change-id: 20260107-airoha-npu-firmware-name-34e5002a1a3f
Best regards,
--
Lorenzo Bianconi <lorenzo@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH net-next v3 1/2] dt-bindings: net: airoha: npu: Add firmware-name property 2026-01-19 15:32 [PATCH net-next v3 0/2] airoha: Add the capability to read firmware binary names from dts for Airoha NPU driver Lorenzo Bianconi @ 2026-01-19 15:32 ` Lorenzo Bianconi 2026-01-19 20:24 ` Andrew Lunn 2026-01-20 10:08 ` Krzysztof Kozlowski 2026-01-19 15:32 ` [PATCH net-next v3 2/2] net: airoha: npu: Add the capability to read firmware names from dts Lorenzo Bianconi 1 sibling, 2 replies; 7+ messages in thread From: Lorenzo Bianconi @ 2026-01-19 15:32 UTC (permalink / raw) To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Lorenzo Bianconi Cc: netdev, devicetree, linux-arm-kernel, linux-mediatek Add firmware-name property in order to introduce the capability to specify the firmware names used for 'RiscV core' and 'Data section' binaries. This patch is needed because NPU firmware binaries are board specific since they depend on the MediaTek WiFi chip used on the board (e.g. MT7996 or MT7992) and the WiFi chip version info is not available in the NPU driver. This is a preliminary patch to enable MT76 NPU offloading if the Airoha SoC is equipped with MT7996 (Eagle) WiFi chipset. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> --- Documentation/devicetree/bindings/net/airoha,en7581-npu.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/net/airoha,en7581-npu.yaml b/Documentation/devicetree/bindings/net/airoha,en7581-npu.yaml index 19860b41286fd42f2a5ed15d5dc75ee0eb00a639..aefa19c5b42468dad841892fa5b75a47552762a0 100644 --- a/Documentation/devicetree/bindings/net/airoha,en7581-npu.yaml +++ b/Documentation/devicetree/bindings/net/airoha,en7581-npu.yaml @@ -59,6 +59,11 @@ properties: - const: ba minItems: 1 + firmware-name: + items: + - description: Firmware name of RiscV core + - description: Firmware name of Data section + required: - compatible - reg @@ -96,5 +101,7 @@ examples: memory-region = <&npu_firmware>, <&npu_pkt>, <&npu_txpkt>, <&npu_txbufid>, <&npu_ba>; memory-region-names = "firmware", "pkt", "tx-pkt", "tx-bufid", "ba"; + firmware-name = "airoha/en7581_npu_rv32.bin", + "airoha/en7581_npu_data.bin"; }; }; -- 2.52.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v3 1/2] dt-bindings: net: airoha: npu: Add firmware-name property 2026-01-19 15:32 ` [PATCH net-next v3 1/2] dt-bindings: net: airoha: npu: Add firmware-name property Lorenzo Bianconi @ 2026-01-19 20:24 ` Andrew Lunn 2026-01-20 10:08 ` Krzysztof Kozlowski 1 sibling, 0 replies; 7+ messages in thread From: Andrew Lunn @ 2026-01-19 20:24 UTC (permalink / raw) To: Lorenzo Bianconi Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, netdev, devicetree, linux-arm-kernel, linux-mediatek On Mon, Jan 19, 2026 at 04:32:40PM +0100, Lorenzo Bianconi wrote: > Add firmware-name property in order to introduce the capability to > specify the firmware names used for 'RiscV core' and 'Data section' > binaries. This patch is needed because NPU firmware binaries are board > specific since they depend on the MediaTek WiFi chip used on the board > (e.g. MT7996 or MT7992) and the WiFi chip version info is not available > in the NPU driver. This is a preliminary patch to enable MT76 NPU > offloading if the Airoha SoC is equipped with MT7996 (Eagle) WiFi chipset. > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v3 1/2] dt-bindings: net: airoha: npu: Add firmware-name property 2026-01-19 15:32 ` [PATCH net-next v3 1/2] dt-bindings: net: airoha: npu: Add firmware-name property Lorenzo Bianconi 2026-01-19 20:24 ` Andrew Lunn @ 2026-01-20 10:08 ` Krzysztof Kozlowski 1 sibling, 0 replies; 7+ messages in thread From: Krzysztof Kozlowski @ 2026-01-20 10:08 UTC (permalink / raw) To: Lorenzo Bianconi Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, netdev, devicetree, linux-arm-kernel, linux-mediatek On Mon, Jan 19, 2026 at 04:32:40PM +0100, Lorenzo Bianconi wrote: > Add firmware-name property in order to introduce the capability to > specify the firmware names used for 'RiscV core' and 'Data section' > binaries. This patch is needed because NPU firmware binaries are board > specific since they depend on the MediaTek WiFi chip used on the board > (e.g. MT7996 or MT7992) and the WiFi chip version info is not available > in the NPU driver. This is a preliminary patch to enable MT76 NPU > offloading if the Airoha SoC is equipped with MT7996 (Eagle) WiFi chipset. > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> > --- > Documentation/devicetree/bindings/net/airoha,en7581-npu.yaml | 7 +++++++ > 1 file changed, 7 insertions(+) Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Best regards, Krzysztof ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH net-next v3 2/2] net: airoha: npu: Add the capability to read firmware names from dts 2026-01-19 15:32 [PATCH net-next v3 0/2] airoha: Add the capability to read firmware binary names from dts for Airoha NPU driver Lorenzo Bianconi 2026-01-19 15:32 ` [PATCH net-next v3 1/2] dt-bindings: net: airoha: npu: Add firmware-name property Lorenzo Bianconi @ 2026-01-19 15:32 ` Lorenzo Bianconi 2026-01-19 20:29 ` Andrew Lunn 1 sibling, 1 reply; 7+ messages in thread From: Lorenzo Bianconi @ 2026-01-19 15:32 UTC (permalink / raw) To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Lorenzo Bianconi Cc: netdev, devicetree, linux-arm-kernel, linux-mediatek Introduce the capability to read the firmware binary names from device-tree using the firmware-name property if available. This patch is needed because NPU firmware binaries are board specific since they depend on the MediaTek WiFi chip used on the board (e.g. MT7996 or MT7992) and the WiFi chip version info is not available in the NPU driver. This is a preliminary patch to enable MT76 NPU offloading if the Airoha SoC is equipped with MT7996 (Eagle) WiFi chipset. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> --- drivers/net/ethernet/airoha/airoha_npu.c | 42 +++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/airoha/airoha_npu.c b/drivers/net/ethernet/airoha/airoha_npu.c index a56b3780bb627cc393b94210b6b5c72cc95baea3..d684e5cc8af2fbde3e274c6fa22c4336474092b5 100644 --- a/drivers/net/ethernet/airoha/airoha_npu.c +++ b/drivers/net/ethernet/airoha/airoha_npu.c @@ -195,18 +195,18 @@ static int airoha_npu_send_msg(struct airoha_npu *npu, int func_id, } static int airoha_npu_load_firmware(struct device *dev, void __iomem *addr, - const struct airoha_npu_fw *fw_info) + const char *fw_name, int fw_max_size) { const struct firmware *fw; int ret; - ret = request_firmware(&fw, fw_info->name, dev); + ret = request_firmware(&fw, fw_name, dev); if (ret) return ret == -ENOENT ? -EPROBE_DEFER : ret; - if (fw->size > fw_info->max_size) { + if (fw->size > fw_max_size) { dev_err(dev, "%s: fw size too overlimit (%zu)\n", - fw_info->name, fw->size); + fw_name, fw->size); ret = -E2BIG; goto out; } @@ -218,6 +218,28 @@ static int airoha_npu_load_firmware(struct device *dev, void __iomem *addr, return ret; } +static int +airoha_npu_load_firmware_from_dts(struct device *dev, void __iomem *addr, + void __iomem *base) +{ + const char *fw_names[2]; + int ret; + + ret = of_property_read_string_array(dev->of_node, "firmware-name", + fw_names, ARRAY_SIZE(fw_names)); + if (ret != ARRAY_SIZE(fw_names)) + return -EINVAL; + + ret = airoha_npu_load_firmware(dev, addr, fw_names[0], + NPU_EN7581_FIRMWARE_RV32_MAX_SIZE); + if (ret) + return ret; + + return airoha_npu_load_firmware(dev, base + REG_NPU_LOCAL_SRAM, + fw_names[1], + NPU_EN7581_FIRMWARE_DATA_MAX_SIZE); +} + static int airoha_npu_run_firmware(struct device *dev, void __iomem *base, struct resource *res) { @@ -233,14 +255,22 @@ static int airoha_npu_run_firmware(struct device *dev, void __iomem *base, if (IS_ERR(addr)) return PTR_ERR(addr); + /* Try to load firmware images using the firmware names provided via + * dts if available. + */ + if (of_find_property(dev->of_node, "firmware-name", NULL)) + return airoha_npu_load_firmware_from_dts(dev, addr, base); + /* Load rv32 npu firmware */ - ret = airoha_npu_load_firmware(dev, addr, &soc->fw_rv32); + ret = airoha_npu_load_firmware(dev, addr, soc->fw_rv32.name, + soc->fw_rv32.max_size); if (ret) return ret; /* Load data npu firmware */ return airoha_npu_load_firmware(dev, base + REG_NPU_LOCAL_SRAM, - &soc->fw_data); + soc->fw_data.name, + soc->fw_data.max_size); } static irqreturn_t airoha_npu_mbox_handler(int irq, void *npu_instance) -- 2.52.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v3 2/2] net: airoha: npu: Add the capability to read firmware names from dts 2026-01-19 15:32 ` [PATCH net-next v3 2/2] net: airoha: npu: Add the capability to read firmware names from dts Lorenzo Bianconi @ 2026-01-19 20:29 ` Andrew Lunn 2026-01-19 21:19 ` Lorenzo Bianconi 0 siblings, 1 reply; 7+ messages in thread From: Andrew Lunn @ 2026-01-19 20:29 UTC (permalink / raw) To: Lorenzo Bianconi Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, netdev, devicetree, linux-arm-kernel, linux-mediatek On Mon, Jan 19, 2026 at 04:32:41PM +0100, Lorenzo Bianconi wrote: > Introduce the capability to read the firmware binary names from device-tree > using the firmware-name property if available. > This patch is needed because NPU firmware binaries are board specific since > they depend on the MediaTek WiFi chip used on the board (e.g. MT7996 or > MT7992) and the WiFi chip version info is not available in the NPU driver. > This is a preliminary patch to enable MT76 NPU offloading if the Airoha SoC > is equipped with MT7996 (Eagle) WiFi chipset. I _think_ you need to add the firmware file names to the end of the file using MODULE_FIRMWARE(). That gives dracul, or whatever is building in initramfs, the information it needs to include them. Andrew ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next v3 2/2] net: airoha: npu: Add the capability to read firmware names from dts 2026-01-19 20:29 ` Andrew Lunn @ 2026-01-19 21:19 ` Lorenzo Bianconi 0 siblings, 0 replies; 7+ messages in thread From: Lorenzo Bianconi @ 2026-01-19 21:19 UTC (permalink / raw) To: Andrew Lunn Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, netdev, devicetree, linux-arm-kernel, linux-mediatek [-- Attachment #1: Type: text/plain, Size: 888 bytes --] On Jan 19, Andrew Lunn wrote: > On Mon, Jan 19, 2026 at 04:32:41PM +0100, Lorenzo Bianconi wrote: > > Introduce the capability to read the firmware binary names from device-tree > > using the firmware-name property if available. > > This patch is needed because NPU firmware binaries are board specific since > > they depend on the MediaTek WiFi chip used on the board (e.g. MT7996 or > > MT7992) and the WiFi chip version info is not available in the NPU driver. > > This is a preliminary patch to enable MT76 NPU offloading if the Airoha SoC > > is equipped with MT7996 (Eagle) WiFi chipset. > > I _think_ you need to add the firmware file names to the end of the > file using MODULE_FIRMWARE(). That gives dracul, or whatever is > building in initramfs, the information it needs to include them. ack, right. I will fix it in v4. Regards, Lorenzo > > Andrew [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-01-20 10:08 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-01-19 15:32 [PATCH net-next v3 0/2] airoha: Add the capability to read firmware binary names from dts for Airoha NPU driver Lorenzo Bianconi 2026-01-19 15:32 ` [PATCH net-next v3 1/2] dt-bindings: net: airoha: npu: Add firmware-name property Lorenzo Bianconi 2026-01-19 20:24 ` Andrew Lunn 2026-01-20 10:08 ` Krzysztof Kozlowski 2026-01-19 15:32 ` [PATCH net-next v3 2/2] net: airoha: npu: Add the capability to read firmware names from dts Lorenzo Bianconi 2026-01-19 20:29 ` Andrew Lunn 2026-01-19 21:19 ` Lorenzo Bianconi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox