On Mon, Jan 12, 2026 at 11:00:08AM +0100, Lorenzo Bianconi wrote:
quoted
Introduce the capability to read the firmware binary names from device-tree
using the firmware-name property if available.
This is a preliminary patch to enable NPU offloading for MT7996 (Eagle)
chipset since it requires a different binary with respect to the one
used for MT7992 on the EN7581 SoC.
When i look at
airoha_npu.c
i see:
#define NPU_EN7581_FIRMWARE_DATA "airoha/en7581_npu_data.bin"
#define NPU_EN7581_FIRMWARE_RV32 "airoha/en7581_npu_rv32.bin"
#define NPU_AN7583_FIRMWARE_DATA "airoha/an7583_npu_data.bin"
#define NPU_AN7583_FIRMWARE_RV32 "airoha/an7583_npu_rv32.bin"
static const struct airoha_npu_soc_data en7581_npu_soc_data = {
.fw_rv32 = {
.name = NPU_EN7581_FIRMWARE_RV32,
.max_size = NPU_EN7581_FIRMWARE_RV32_MAX_SIZE,
},
.fw_data = {
.name = NPU_EN7581_FIRMWARE_DATA,
.max_size = NPU_EN7581_FIRMWARE_DATA_MAX_SIZE,
},
};
static const struct airoha_npu_soc_data an7583_npu_soc_data = {
.fw_rv32 = {
.name = NPU_AN7583_FIRMWARE_RV32,
.max_size = NPU_EN7581_FIRMWARE_RV32_MAX_SIZE,
},
.fw_data = {
.name = NPU_AN7583_FIRMWARE_DATA,
.max_size = NPU_EN7581_FIRMWARE_DATA_MAX_SIZE,
},
};
static const struct of_device_id of_airoha_npu_match[] = {
{ .compatible = "airoha,en7581-npu", .data = &en7581_npu_soc_data },
{ .compatible = "airoha,an7583-npu", .data = &an7583_npu_soc_data },
{ /* sentinel */ }
};
Why cannot this scheme be extended with another compatible?
yes, that is another possibility I was thinking of but then I found
"firwmare-name" property was quite a common approach.
Something like:
static const struct of_device_id of_airoha_npu_match[] = {
...
{ .compatible = "airoha,en7581-npu-7996", .data = &en7581_7996_npu_soc_data },
...
};
What do you think?
Regards,
Lorenzo
Andrew