Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [RFC PATCH] package/linux-firmware: Add more Intel WiFi 22000 series
@ 2022-08-18 13:18 Stefan Agner
  2022-08-20 12:13 ` Yann E. MORIN
  2023-04-16 11:54 ` Yann E. MORIN
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Agner @ 2022-08-18 13:18 UTC (permalink / raw)
  To: buildroot, yann.morin.1998, thomas.petazzoni; +Cc: stefan

Add more Intel WiFi 22000 series firmware files. Allow to select the
firmware version using shell globs.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
With the Intel WiFi 22000 series the amount of firmwares is just stagering. So
much so that it causes size issues in our case.

Intel firmwares seem to have an API version, which is the last digit before the
file ending .ucode. The Linux kernel sources have defines which API each
individual driver supports (e.g. Linux 5.15 22000 series kernel driver
supports ucode API 39 up to 66).

This crude method uses just file glob matching to allow to select firmwares
which match the kernel in use. However, this approach has a problem: Some
API versions are missing. E.g. simply using "66" doesn't work since some
firmware are not available with the latest API supported (e.g.
iwlwifi-so-a0-gf-a0-64.ucode).

Also if an older kernel is in use, some firmware files with an older maximum
API might just be missing, which leads to tar complaining about missing files.

In this case, we can use 6[46], which happens to select the newest version of
all firmwares (it seems that firmwares which are available with API version 66
have only been released with version 63 before).

However, this of course might be just a coincidence. Ideally Buildroot would
select the newest version available for a particular API version. Not sure if
this is easily doable.

Thoughts?

--
Stefan

 package/linux-firmware/Config.in         |  9 +++++++++
 package/linux-firmware/linux-firmware.mk | 15 ++++++++++++++-
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/package/linux-firmware/Config.in b/package/linux-firmware/Config.in
index 8ce71140da..49a40283c8 100644
--- a/package/linux-firmware/Config.in
+++ b/package/linux-firmware/Config.in
@@ -181,6 +181,15 @@ config BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_22000
 	  Firmware files for the Intel Wifi 22000 devices supported by
 	  the iwlwifi kernel driver.
 
+if BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_22000
+
+config BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_22000_UCODE_API_GLOB
+        string "*"
+        help
+	  API level for firmware files of the Intel Wifi 22000 devices.
+
+endif
+
 config BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_22260
 	bool "Intel iwlwifi 22260"
 	help
diff --git a/package/linux-firmware/linux-firmware.mk b/package/linux-firmware/linux-firmware.mk
index 64d096df14..2283cd7d5e 100644
--- a/package/linux-firmware/linux-firmware.mk
+++ b/package/linux-firmware/linux-firmware.mk
@@ -436,7 +436,20 @@ LINUX_FIRMWARE_ALL_LICENSE_FILES += LICENSE.QualcommAtheros_ath10k
 endif
 
 ifeq ($(BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_22000),y)
-LINUX_FIRMWARE_FILES += iwlwifi-QuZ-*.ucode iwlwifi-Qu-*.ucode
+LINUX_FIRMWARE_IWLWIFI_22000_UCODE_API_GLOB = $(call qstrip,$(BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_22000_UCODE_API_GLOB))
+LINUX_FIRMWARE_FILES += \
+	iwlwifi-Qu-b0-hr-b0-$(LINUX_FIRMWARE_IWLWIFI_22000_UCODE_API_GLOB).ucode \
+	iwlwifi-Qu-c0-hr-b0-$(LINUX_FIRMWARE_IWLWIFI_22000_UCODE_API_GLOB).ucode \
+	iwlwifi-Qu-b0-jf-b0-$(LINUX_FIRMWARE_IWLWIFI_22000_UCODE_API_GLOB).ucode \
+	iwlwifi-Qu-c0-jf-b0-$(LINUX_FIRMWARE_IWLWIFI_22000_UCODE_API_GLOB).ucode \
+	iwlwifi-QuZ-a0-hr-b0-$(LINUX_FIRMWARE_IWLWIFI_22000_UCODE_API_GLOB).ucode \
+	iwlwifi-QuZ-a0-jf-b0-$(LINUX_FIRMWARE_IWLWIFI_22000_UCODE_API_GLOB).ucode \
+	iwlwifi-cc-a0-$(LINUX_FIRMWARE_IWLWIFI_22000_UCODE_API_GLOB).ucode \
+	iwlwifi-so-a0-jf-b0-$(LINUX_FIRMWARE_IWLWIFI_22000_UCODE_API_GLOB).ucode \
+	iwlwifi-so-a0-hr-b0-$(LINUX_FIRMWARE_IWLWIFI_22000_UCODE_API_GLOB).ucode \
+	iwlwifi-so-a0-gf-a0-$(LINUX_FIRMWARE_IWLWIFI_22000_UCODE_API_GLOB).ucode \
+	iwlwifi-ty-a0-gf-a0-$(LINUX_FIRMWARE_IWLWIFI_22000_UCODE_API_GLOB).ucode \
+	iwlwifi-so-a0-gf4-a0-$(LINUX_FIRMWARE_IWLWIFI_22000_UCODE_API_GLOB).ucode
 LINUX_FIRMWARE_ALL_LICENSE_FILES += LICENCE.iwlwifi_firmware
 endif
 
-- 
2.37.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-04-16 11:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-18 13:18 [Buildroot] [RFC PATCH] package/linux-firmware: Add more Intel WiFi 22000 series Stefan Agner
2022-08-20 12:13 ` Yann E. MORIN
2022-08-20 13:40   ` Stefan Agner
2022-08-20 14:21     ` Yann E. MORIN
2022-08-23 19:20       ` Arnout Vandecappelle
2023-04-16 11:54 ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox