From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 15 Oct 2021 21:41:44 +0200 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 1mbT5M-000503-EE for lore@lore.pengutronix.de; Fri, 15 Oct 2021 21:41:44 +0200 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 1mbT5L-0001V0-QI; Fri, 15 Oct 2021 21:41:43 +0200 Received: from mout.kundenserver.de ([217.72.192.75]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbT4Y-0001U3-6h for ptxdist@pengutronix.de; Fri, 15 Oct 2021 21:40:55 +0200 Received: from methusalix.internal.home.lespocky.de ([92.117.61.237]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MKKd7-1mIyJo3QX1-00LkP8; Fri, 15 Oct 2021 21:40:51 +0200 Received: from falbala.internal.home.lespocky.de ([192.168.243.94]) by methusalix.internal.home.lespocky.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mbT4R-0000eZ-2o; Fri, 15 Oct 2021 21:40:48 +0200 Date: Fri, 15 Oct 2021 21:40:45 +0200 From: Alexander Dahl To: Christian Melki , ptxdist@pengutronix.de Message-ID: <20211015194045.pb66ut44m5hyujks@falbala.internal.home.lespocky.de> Mail-Followup-To: Christian Melki , ptxdist@pengutronix.de References: <20211013183631.3989851-1-christian.melki@t2data.com> <20211015141111.GJ2239952@pengutronix.de> MIME-Version: 1.0 In-Reply-To: <20211015141111.GJ2239952@pengutronix.de> User-Agent: NeoMutt/20170113 (1.7.2) X-Scan-Signature: 169ae66c78a0619a11ab7cc14bdc1661 X-Provags-ID: V03:K1:2aWjUCSwzqOYs0XDmyRD7Ukogrm4/WocnoaF5Pdc45dp9pwth4U 1dkA+YfnwYjGGKrRDJztkcowoIkRuPqL/7xKP7MLAtgHh8CR7UYn1GKdxaEZv9nGj35m8kf fDA7h+91C07aVtPUrxFToWt3YNRl4v6GNgkRbHP6Hd7JkhN7m3dRj+/cfTGg7lY8L7Gp2X8 o7DDMSFKCdVp5dv1trknQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:bjTxSy107Uk=:ljJqqpdTX2FjaQj06JOOEs 8LtgZ5bJK7ojqfIUeATN1qzr3QThmymT0xGLYCupJOo2dC5rjnslA5+GyY1NVoaE5j5A72ypp oZVOM2/75tNRrUQ/DWCrV9Lr5/GcY3nuqilbifKmmUR5LCd6UN0t54XNPDfrAikVMgQ01XDvq 2q0tLdYbZbMzY204jq80V6jnqyWOHen/ndImjr23k7ldvmVpURoWdan19E5VwlqCcqZa+35V8 VD2JQYI2S5yE/0u9/UppW9GkgGPnoo0/+2k/O96tVeWTcttXM7WilKOrOwAFvfWTn51JMNB/4 C3SLuj+XOqrteIY9bD56V4tJc+0E6YfHIgeNFKnXa4DjQ24qXm9BEqc57e0Plt/sqV+fr7krZ nECflJB4bqXvhytm0eyUkdA/SyoAhjEALMrOUKKCvZoR37xeymsAzELPEDPYHT4J4VgeAa+24 yK3HYeXSPNw5+R9lTouJgVyliG20o7GAJ+Cgrch9fnsFqdYPKblNliz7k/t9oc7Ovtq0WXc2Y gSvBdo3jriuUqvLOGBN4KterIh7FKweL3rR3XaKOcjRMjq+ydrmy+eRNWAL592CbCA+w+tgNg ikkVcMitJimPXSwjDQWM0atEQzcdjjJOMmreTFGhs6LEcdvWUK/biwC66XM7JTwVk18629RPb fgPpZ6OnExuf5Q8NI2MQgqsp/NzubmbtV2EiFmu3vjcuCDFuMaUHRkbu6Ib1Lks2yvUa5osgS EXE30AKhExTGwTGTrfCFcYMcI+2klPn6eZPCfQ== X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.ext.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=4.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.2 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 Content-Type: multipart/mixed; boundary="===============0397908400==" 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 --===============0397908400== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7fnxy3nvrors3tlf" Content-Disposition: inline --7fnxy3nvrors3tlf Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. > >=20 > > Due to the large space required by some firmwares as a whole, > > compression can optionally be enabled. >=20 > Hmmm, I'm not sure about this. I've always dumped selected firmware files > and their license into projectroot/ and created a local package. Mostly f= or > two reasons: >=20 > 1. I wanted the fine control to explicitly update individual firmware > files. >=20 > 2. I never found a good way to split the package options. For example, > installing all iwlwifi* files seems excessive but so does adding an option > for each on. >=20 > 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. =20 Same thing basically applies for proprietary firmware you develop yourself. 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/ >=20 > Michael >=20 > > 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 > >=20 > > 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 vario= us 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 kerne= l >=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 condit= ions > > +# 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/firmware/$(L= INUX_FIRMWARE).$(LINUX_FIRMWARE_SUFFIX)) > > +LINUX_FIRMWARE_SOURCE :=3D $(SRCDIR)/$(LINUX_FIRMWARE).$(LINUX_FIRMWAR= E_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 ") > > + @$(call install_fixup, linux-firmware,DESCRIPTION,missing) > > +ifdef PTXCONF_LINUX_FIRMWARE_AMDCPU > > + @$(call install_copy, linux-firmware, 0, 0, 0755, /lib/firmware/amd-u= code) > > + @$(call install_glob, linux-firmware, 0, 0, -, /lib/firmware/amd-ucod= e, *) > > +endif > > +ifdef PTXCONF_LINUX_FIRMWARE_AMDGPU > > + @$(call install_copy, linux-firmware, 0, 0, 0755, /lib/firmware/amdgp= u) > > +ifdef PTXCONF_LINUX_FIRMWARE_AMDGPU_RAVEN_RIDGE_APU > > + @$(call install_glob, linux-firmware, 0, 0, -, /lib/firmware/amdgpu, = *raven_*) > > +endif > > +ifdef PTXCONF_LINUX_FIRMWARE_AMDGPU_RAVEN2_VEGA_MOBILE > > + @$(call install_glob, linux-firmware, 0, 0, -, /lib/firmware/amdgpu, = *raven2*) > > +endif > > +endif > > + @$(call install_finish, linux-firmware) > > + > > + @$(call touch) > > + > > +# vim: syntax=3Dmake > > --=20 > > 2.30.2 > >=20 > >=20 > > _______________________________________________ > > ptxdist mailing list > > ptxdist@pengutronix.de > > To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-reque= st@pengutronix.de > >=20 >=20 > --=20 > 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 | >=20 > _______________________________________________ > ptxdist mailing list > ptxdist@pengutronix.de > To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request= @pengutronix.de --=20 /"\ ASCII RIBBON | =BBWith the first link, the chain is forged. The first \ / CAMPAIGN | speech censured, the first thought forbidden, the X AGAINST | first freedom denied, chains us all irrevocably.=AB / \ HTML MAIL | (Jean-Luc Picard, quoting Judge Aaron Satie) --7fnxy3nvrors3tlf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEwo7muQJjlc+Prwj6NK3NAHIhXMYFAmFp2T0ACgkQNK3NAHIh XMZMww/9FpqfrRZ5q+9E6z/Ku9V33rcjenl6ts+/p1gTt53vXrt4Wwtd4z269MEQ JMQT1xdwVgL3VUmDbgyQmoGsOYc9gS4s5PMaiutOPwUam5RktYILFWphw8OXCgl8 lAQWIH3cilxMXTnRVj/2JT7SXia5h94g+rYyRtdiutPi4RsEek1nTgf4jon5hvZS VlbEdZ33hBVC/sgSbcQCjBgfPW1KrcKj8ENTopK7Ribe5lyUdaxL9JTjgNVjVMZu wLGhAybb1Ir+WmP6GKpSgU2mu27hCTiia5Cj9BcErEDxhpbyE+og+Crp80Aa01x0 GkRZPWCBsZ7Wi6KgIF3uMMm7LCXdDm6T4e5Z91VkyI7tOJDgxkea2wdZP1GpROPb lPX6L+k93pn0uxUfFTqkBp7e+xaOxjBQCo9uVUWJ4tbQRzpjKi8IUKytBv0t3c0E Nykd/4SDzc8vTpxGuGMelSTxLvJIS1dHmqCWmWhof0YH3cUm3ANQylU6Ccj0KFDn dR2C3jWUMECIUXvShbuvfJelWWd326dQxsGdTwsNFa4k2y7xpk3ANeNUyTYspfBi 6PiD0Km8AOzpIQMtc5+h6thU5ebFi0WNUq2yw/gmwi5hZmkeVUEbJlhpqmJrb1XF +0veu9Ny9orqSZZL0VmUiasRtlVE6fRwoafx7aHlphJEzVDJ6ms= =IAEz -----END PGP SIGNATURE----- --7fnxy3nvrors3tlf-- --===============0397908400== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de --===============0397908400==--