From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 05 Nov 2021 12:06:29 +0100 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mix3F-0007FO-J1 for lore@lore.pengutronix.de; Fri, 05 Nov 2021 12:06:29 +0100 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mix3F-0000ul-92; Fri, 05 Nov 2021 12:06:29 +0100 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mix2g-0000uI-81; Fri, 05 Nov 2021 12:05:54 +0100 Received: from [2a0a:edc0:0:1101:1d::39] (helo=dude03.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mix2f-0006wl-Gd; Fri, 05 Nov 2021 12:05:53 +0100 Received: from mol by dude03.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1mix2f-00DrHI-76; Fri, 05 Nov 2021 12:05:53 +0100 Date: Fri, 5 Nov 2021 12:05:53 +0100 From: Michael Olbrich To: Christian Melki Message-ID: Mail-Followup-To: Christian Melki , ptxdist@pengutronix.de References: <20211013183631.3989851-1-christian.melki@t2data.com> <20211015141111.GJ2239952@pengutronix.de> <20211015194045.pb66ut44m5hyujks@falbala.internal.home.lespocky.de> <48419c7f-1a04-c22f-c294-db74f7fd901a@t2data.com> <7d214a35-d76d-9f3e-7712-8fb746cd9673@t2data.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <7d214a35-d76d-9f3e-7712-8fb746cd9673@t2data.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain Subject: Re: [ptxdist] [PATCH] linux-firmware: Add new package. Version 20210818 X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: ptxdist@pengutronix.de Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false On Thu, Nov 04, 2021 at 11:08:02AM +0100, Christian Melki wrote: > Bump. > = > No more opinions? Go? No go? Changes? > = > On 10/16/21 9:21 AM, Christian Melki wrote: > > On 10/15/21 21:40, Alexander Dahl wrote: > > > Hei hei, > > > = > > > On Fri, Oct 15, 2021 at 04:11:11PM +0200, Michael Olbrich wrote: > > > > On Wed, Oct 13, 2021 at 08:36:31PM +0200, Christian Melki wrote: > > > > > Firmware is needed by a lot of modern devices. > > > > > Includes various radio interfaces, GPU and CPU stuff. > > > > > = > > > > > Due to the large space required by some firmwares as a whole, > > > > > compression can optionally be enabled. > > > > = > > > > Hmmm, I'm not sure about this. I've always dumped selected firmware= files > > > > and their license into projectroot/ and created a local package. Mo= stly for > > > > two reasons: > > > > = > > > > 1. I wanted the fine control to explicitly update individual firmwa= re > > > > files. > > > > = > > > > 2. I never found a good way to split the package options. For examp= le, > > > > installing all iwlwifi* files seems excessive but so does adding an= option > > > > for each on. > > > > = > > > > Any other opinions on this? > > > = > > > I can share some experience from the fli4l [1] project, but from a > > > different viewing angle. Most firmware is not free in a FOSS licensed > > > way, so it's hard to find a generic solution, especially when getting > > > the license stuff right. That's why we opted for free (as in under > > > FOSS license) firmware only, which means: user is responsible for > > > handling non-free firmware. > > > = > > > Same thing basically applies for proprietary firmware you develop you= rself. > > > = > > > So I think the approach Michael suggested in this case is a useful > > > one: just put the few blobs and license stuff you need into your BSP. > > > = > > > This obviously would not work if the user can plug arbitrary hardware > > > like WiFi cards, but if hardware is restricted, and most embededded > > > projects are (?), then this is no problem. > > > = > > > However if you don't have control which additional hardware your users > > > plug, and you still want to support it, you would need a more generic > > > approach. > > > = > > > Greets > > > Alex > > > = > > > [1] https://www.fli4l.de/ > > > = > > = > > Hi. > > = > > I think I can clarify my raison d'=EAtre a bit. > > The kernel isn't overly informative on what it is loading or has loaded > > (history) as a default. I patch the firmware class or use dyndbg to get > > all the loaded firmware files from this standard package. From time to > > time things can be a little bit non-obvious, such as the Raven Ridge APU > > requiring a blob named Raven2-something. > > So I usually end up providing all the blobs (names do change) with the > > latest firmware package, get all the files when I'm happy with the > > configuration and filter it down. Because the whole package is rather h= uge. > > = > > So for my part, I still have to provide linux-firmware bits and that I > > partly go through the same thing anyway. > > = > > I agree that the *.in is rather non-optimal, but I'm open to > > suggestions. Maybe an *all* and a *filter list* once you're done is bet= ter? All and a filter makes sense. How about this: Install with install_glob and use * as default glob. Allow custom globs from the config. List all licenses in LINUX_FIRMWARE_LICENSE_FILES. Use a config option to allow listing just the file names, and then: LINUX_FIRMWARE_SELECTED_LICENCES :=3D $(call remove_quotes, PTXCONF_LINUX_F= IRMWARE_LICENCES) ifneq ($(LINUX_FIRMWARE_SELECTED_LICENCES),) LINUX_FIRMWARE_LICENSE_FILES :=3D $(filter $(addsuffix %,$(addprefix file:/= /,$(LINUX_FIRMWARE_SELECTED_LICENCES))),$(LINUX_FIRMWARE_LICENSE_FILES)) endif Michael > > Regards, > > Christian > > = > > > > = > > > > Michael > > > > = > > > > > Signed-off-by: Christian Melki > > > > > --- > > > > > rules/linux-firmware.in | 55 ++++++++++++++++++++++ > > > > > rules/linux-firmware.make | 99 ++++++++++++++++++++++++++++++++= +++++++ > > > > > 2 files changed, 154 insertions(+) > > > > > create mode 100644 rules/linux-firmware.in > > > > > create mode 100644 rules/linux-firmware.make > > > > > = > > > > > diff --git a/rules/linux-firmware.in b/rules/linux-firmware.in > > > > > new file mode 100644 > > > > > index 000000000..1abbec6bd > > > > > --- /dev/null > > > > > +++ b/rules/linux-firmware.in > > > > > @@ -0,0 +1,55 @@ > > > > > +## SECTION=3Dsystem_libraries > > > > > + > > > > > +menuconfig LINUX_FIRMWARE > > > > > + tristate > > > > > + prompt "linux-firmware " > > > > > + help > > > > > + Linux firmware is a collection of firmwares that are used for= various hardwares. > > > > > + > > > > > +if LINUX_FIRMWARE > > > > > + > > > > > +config LINUX_FIRMWARE_COMPRESSION > > > > > + tristate > > > > > + prompt "xz compression support" > > > > > + select HOST_XZ > > > > > + help > > > > > + Linux firmware files can be compressed with xz. Needs a linux= kernel >=3D 5.3 > > > > > + > > > > > +menu "CPU Microcode" > > > > > + > > > > > +config LINUX_FIRMWARE_AMDCPU > > > > > + bool "AMD CPU u-code" > > > > > + help > > > > > + Firmware files for AMD CPUs. > > > > > + > > > > > +endmenu > > > > > + > > > > > +menu "Video firmware" > > > > > + > > > > > +config LINUX_FIRMWARE_AMDGPU > > > > > + bool "AMD GPU video card firmware" > > > > > + help > > > > > + Firmware files for AMD GPU video cards. > > > > > + Indexed according to https://wiki.gentoo.org/wiki/AMDGPU > > > > > + > > > > > +if LINUX_FIRMWARE_AMDGPU > > > > > + > > > > > +menu "AMDGPU video firmware" > > > > > + > > > > > +config LINUX_FIRMWARE_AMDGPU_RAVEN_RIDGE_APU > > > > > + bool "RAVEN RIDGE APU AMD GPU video card firmware" > > > > > + help > > > > > + Firmware files for RAVEN RIDGE APU AMD GPU video cards. > > > > > + > > > > > +config LINUX_FIRMWARE_AMDGPU_RAVEN2_VEGA_MOBILE > > > > > + bool "RAVEN2 VEGA MOBILE AMD GPU video card firmware" > > > > > + help > > > > > + Firmware files for RAVEN2 VEGA MOBILE AMD GPU video cards. > > > > > + > > > > > +endmenu > > > > > + > > > > > +endif > > > > > + > > > > > +endmenu > > > > > + > > > > > +endif > > > > > diff --git a/rules/linux-firmware.make b/rules/linux-firmware.make > > > > > new file mode 100644 > > > > > index 000000000..3a3a300e6 > > > > > --- /dev/null > > > > > +++ b/rules/linux-firmware.make > > > > > @@ -0,0 +1,99 @@ > > > > > +# -*-makefile-*- > > > > > +# > > > > > +# Copyright (C) 2021 by Christian Melki > > > > > +# > > > > > +# For further information about the PTXdist project and license = conditions > > > > > +# see the README file. > > > > > +# > > > > > + > > > > > +# > > > > > +# We provide this package > > > > > +# > > > > > +PACKAGES-$(PTXCONF_LINUX_FIRMWARE) +=3D linux-firmware > > > > > + > > > > > +# > > > > > +# Paths and names > > > > > +# > > > > > +LINUX_FIRMWARE_VERSION :=3D 20210818 > > > > > +LINUX_FIRMWARE_MD5 :=3D 736a3bbba3391d962d3c321ae04572d7 > > > > > +LINUX_FIRMWARE :=3D linux-firmware-$(LINUX_FIRMWARE_VERSION) > > > > > +LINUX_FIRMWARE_SUFFIX :=3D tar.gz > > > > > +LINUX_FIRMWARE_URL :=3D $(call ptx/mirror, KERNEL, kernel/firmwa= re/$(LINUX_FIRMWARE).$(LINUX_FIRMWARE_SUFFIX)) > > > > > +LINUX_FIRMWARE_SOURCE :=3D $(SRCDIR)/$(LINUX_FIRMWARE).$(LINUX_F= IRMWARE_SUFFIX) > > > > > +LINUX_FIRMWARE_DIR :=3D $(BUILDDIR)/$(LINUX_FIRMWARE) > > > > > +LINUX_FIRMWARE_LICENSE :=3D proprietary > > > > > +LINUX_FIRMWARE_LICENSE_FILES :=3D \ > > > > > + file://LICENSE.amdgpu;md5=3Dd357524f5099e2a3db3c1838921c593f \ > > > > > + file://LICENSE.amd-ucode;md5=3D3c5399dc9148d7f0e1f41e34b69cf14f > > > > > + > > > > > +# --------------------------------------------------------------= -------------- > > > > > +# Extract > > > > > +# --------------------------------------------------------------= -------------- > > > > > + > > > > > +$(STATEDIR)/linux-firmware.extract: > > > > > + @$(call targetinfo) > > > > > + @$(call clean, $(LINUX_FIRMWARE_DIR)) > > > > > + @$(call extract, LINUX_FIRMWARE) > > > > > + @$(call patchin, LINUX_FIRMWARE) > > > > > + @$(call touch) > > > > > + > > > > > +# --------------------------------------------------------------= -------------- > > > > > +# Prepare > > > > > +# --------------------------------------------------------------= -------------- > > > > > + > > > > > +LINUX_FIRMWARE_CONF_TOOL :=3D NO > > > > > + > > > > > +# --------------------------------------------------------------= -------------- > > > > > +# Compile > > > > > +# --------------------------------------------------------------= -------------- > > > > > + > > > > > +$(STATEDIR)/linux-firmware.compile: > > > > > + @$(call targetinfo) > > > > > + @$(call touch) > > > > > + > > > > > +# --------------------------------------------------------------= -------------- > > > > > +# Install > > > > > +# --------------------------------------------------------------= -------------- > > > > > + > > > > > +$(STATEDIR)/linux-firmware.install: > > > > > + @$(call targetinfo) > > > > > + @$(call world/install, LINUX_FIRMWARE) > > > > > +ifdef PTXCONF_LINUX_FIRMWARE_COMPRESSION > > > > > + @find $(LINUX_FIRMWARE_PKGDIR) -type f \ > > > > > + -not -name "*.xz" \ > > > > > + -not -name "*.ucode" \ > > > > > + -exec echo "Compressing " "{}" "..." \; \ > > > > > + -exec xz -C crc32 "{}" \; > > > > > +endif > > > > > + @$(call touch) > > > > > + > > > > > +# --------------------------------------------------------------= -------------- > > > > > +# Target-Install > > > > > +# --------------------------------------------------------------= -------------- > > > > > + > > > > > +$(STATEDIR)/linux-firmware.targetinstall: > > > > > + @$(call targetinfo) > > > > > + > > > > > + @$(call install_init, linux-firmware) > > > > > + @$(call install_fixup, linux-firmware,PRIORITY,optional) > > > > > + @$(call install_fixup, linux-firmware,SECTION,base) > > > > > + @$(call install_fixup, linux-firmware,AUTHOR,"Christian Melki <= christian.melki@t2data.com>") > > > > > + @$(call install_fixup, linux-firmware,DESCRIPTION,missing) > > > > > +ifdef PTXCONF_LINUX_FIRMWARE_AMDCPU > > > > > + @$(call install_copy, linux-firmware, 0, 0, 0755, /lib/firmware= /amd-ucode) > > > > > + @$(call install_glob, linux-firmware, 0, 0, -, /lib/firmware/am= d-ucode, *) > > > > > +endif > > > > > +ifdef PTXCONF_LINUX_FIRMWARE_AMDGPU > > > > > + @$(call install_copy, linux-firmware, 0, 0, 0755, /lib/firmware= /amdgpu) > > > > > +ifdef PTXCONF_LINUX_FIRMWARE_AMDGPU_RAVEN_RIDGE_APU > > > > > + @$(call install_glob, linux-firmware, 0, 0, -, /lib/firmware/am= dgpu, *raven_*) > > > > > +endif > > > > > +ifdef PTXCONF_LINUX_FIRMWARE_AMDGPU_RAVEN2_VEGA_MOBILE > > > > > + @$(call install_glob, linux-firmware, 0, 0, -, /lib/firmware/am= dgpu, *raven2*) > > > > > +endif > > > > > +endif > > > > > + @$(call install_finish, linux-firmware) > > > > > + > > > > > + @$(call touch) > > > > > + > > > > > +# vim: syntax=3Dmake > > > > > -- = > > > > > 2.30.2 > > > > > = > > > > > = > > > > > _______________________________________________ > > > > > ptxdist mailing list > > > > > ptxdist@pengutronix.de > > > > > To unsubscribe, send a mail with subject "unsubscribe" to ptxdist= -request@pengutronix.de > > > > > = > > > > = > > > > -- = > > > > Pengutronix e.K. | = | > > > > Steuerwalder Str. 21 | http://www.pengutronix= .de/ | > > > > 31137 Hildesheim, Germany | Phone: +49-5121-206917= -0 | > > > > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917= -5555 | > > > > = > > > > _______________________________________________ > > > > ptxdist mailing list > > > > ptxdist@pengutronix.de > > > > To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-r= equest@pengutronix.de > > > = > > = > > = > > _______________________________________________ > > ptxdist mailing list > > ptxdist@pengutronix.de > > To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-reque= st@pengutronix.de > > = > = > _______________________________________________ > ptxdist mailing list > ptxdist@pengutronix.de > To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request= @pengutronix.de -- = Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@p= engutronix.de