From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Stefan Agner <stefan@agner.ch>
Cc: thomas.petazzoni@bootlin.com, buildroot@buildroot.org
Subject: Re: [Buildroot] [RFC PATCH] package/linux-firmware: Add more Intel WiFi 22000 series
Date: Sat, 20 Aug 2022 14:13:23 +0200 [thread overview]
Message-ID: <20220820121323.GI2167049@scaer> (raw)
In-Reply-To: <0e18605c9938776a707a4aab032be74a1a9afe8e.1660828116.git.stefan@agner.ch>
Stefan, All,
On 2022-08-18 15:18 +0200, Stefan Agner spake thusly:
> 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.
You know that you can write a post-build script to tweak the target/
directory at the end of the build? That can be a workaround until a
better solution is devised.
> 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?
First: on one hand, I like the simplicity of that patch; if we can't
come up with better, I can see going with it.
But on the other hand, it is also very un-userfriendly. I don't see how
we could _reasonably_ come up with a way to cherry-pick appropriate
firmware files.
First, the linux package depends on linux-frimware, so linux-firmware
can't depend on linux; we could still use a patch-dependency, so that
linux gets at least extracted and patched before linux-firmware gets
installed, but that is going to be tricky to maintain.
We could then grab IWL_22000_UCODE_API_MIN and IWL_22000_UCODE_API_MAX
from drivers/net/wireless/intel/iwlwifi/cfg/22000.c
And then, we'd have to code some non-trivial magic that iterates over
all iwlwifi-Qu{,Z}-*.ucode and check if their API part is in the range,
and for a single "family" of firmwares, keep the highest one (how do we
know that two firmware files are f the same family? Just because they
only differ in API version?) That's a bit brittle...
[--SNIP--]
> 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
This list is not entirely alphabetically sorted.
Also, why do you extend the prefixes, from iwlwifi-QuZ- and iwlwifi-Qu-,
to include extra c0, b0, a0 and so on? Why can we just have:
iwlwifi-Qu-*-$(LINUX_FIRMWARE_IWLWIFI_22000_UCODE_API_GLOB).ucode
iwlwifi-QuZ-*-$(LINUX_FIRMWARE_IWLWIFI_22000_UCODE_API_GLOB).ucode
Oh, and in at least linu 5.17, there are also references to
iwlwifi-QuQnj-, iwlwifi-SoSnj- and a bunch of others. And
specifically, there is also iwlwifi-cc-a0- which in Buildroot is
installed with BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_22260 and not
BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_22000
So, maybe we could split the families further as an alternate solution?
Regards,
Yann E. MORIN.
> 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
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2022-08-20 12:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220820121323.GI2167049@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@buildroot.org \
--cc=stefan@agner.ch \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox