From: Christian Melki <christian.melki@t2data.com>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH] linux-firmware: Add new package. Version 20210818
Date: Wed, 13 Oct 2021 20:36:31 +0200 [thread overview]
Message-ID: <20211013183631.3989851-1-christian.melki@t2data.com> (raw)
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.
Signed-off-by: Christian Melki <christian.melki@t2data.com>
---
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=system_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 >= 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 <christian.melki@t2data.com>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_LINUX_FIRMWARE) += linux-firmware
+
+#
+# Paths and names
+#
+LINUX_FIRMWARE_VERSION := 20210818
+LINUX_FIRMWARE_MD5 := 736a3bbba3391d962d3c321ae04572d7
+LINUX_FIRMWARE := linux-firmware-$(LINUX_FIRMWARE_VERSION)
+LINUX_FIRMWARE_SUFFIX := tar.gz
+LINUX_FIRMWARE_URL := $(call ptx/mirror, KERNEL, kernel/firmware/$(LINUX_FIRMWARE).$(LINUX_FIRMWARE_SUFFIX))
+LINUX_FIRMWARE_SOURCE := $(SRCDIR)/$(LINUX_FIRMWARE).$(LINUX_FIRMWARE_SUFFIX)
+LINUX_FIRMWARE_DIR := $(BUILDDIR)/$(LINUX_FIRMWARE)
+LINUX_FIRMWARE_LICENSE := proprietary
+LINUX_FIRMWARE_LICENSE_FILES := \
+ file://LICENSE.amdgpu;md5=d357524f5099e2a3db3c1838921c593f \
+ file://LICENSE.amd-ucode;md5=3c5399dc9148d7f0e1f41e34b69cf14f
+
+# ----------------------------------------------------------------------------
+# 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 := 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/amd-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/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=make
--
2.30.2
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
next reply other threads:[~2021-10-13 18:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-13 18:36 Christian Melki [this message]
2021-10-15 14:11 ` Michael Olbrich
2021-10-15 19:40 ` Alexander Dahl
2021-10-16 7:21 ` Christian Melki
2021-11-04 10:08 ` Christian Melki
2021-11-04 19:16 ` Bruno Thomsen
2021-11-05 11:05 ` Michael Olbrich
2022-01-18 8:46 ` Christian Melki
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=20211013183631.3989851-1-christian.melki@t2data.com \
--to=christian.melki@t2data.com \
--cc=ptxdist@pengutronix.de \
/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