From nobody Mon May 01 06:33:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8th74S3kz47t6Y; Mon, 1 May 2023 06:33:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q8th7437qz3tYr; Mon, 1 May 2023 06:33:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682922807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fq4Tcesdcj4Vp+jEwmY92OBq9sGlVSbpjkEhfLQemIA=; b=Wdgg0qMPvW2kPqVuxyEEOvBBtMBeGN8MoYtPuMnpwo1oTtF1oIWWtdHn5S0HcrIllJrKpV umeX7ZU0oAA+nK3FErI+oFdzKJVf78VL9s7/a4h5e7yheUSjc05YF5Az2gbFMiYG+V3qE7 a+DVtR83b1u5vADC272TuLXI4cVXJONHR8H3gSsUJG4GnMN4ZHG6ydbOcIsAdgcO8QBwz8 5Iwi15NYs3ig82GI9OC8DfWZc6glJy619JvYfziOemRkS2KBbEcUEOBj4CjnA4fg0JjU5J +WiR1PlYybpUYN0/0Vh/CLdR7JoCDTKSPRMHQSji13y8QFiGr6zMeIBaRdvElA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682922807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fq4Tcesdcj4Vp+jEwmY92OBq9sGlVSbpjkEhfLQemIA=; b=PbbnWn3SBF59x2+MBRa6bZdzU5txOTzBLKe3RNcV3Gu2wjU/NBWhgY9bSsErj1T5Ku+rYG VQUcenbOXuenXpvkgVSL0Qbu+KyZfRD0hNu4DaQmF9MCNWvW1S/7+jGyAHSgwnXf84s3uk CUsBdw9fnJ5dNqtqwCb4rfepPEpKxfm+Vl1vmnKoXPtGFk14Y2J0f77HzSY21t+oOxl/vt NI4OWZlRiINp8axXU4WrNhjAuJFT1jxB1SckpW+AfgIBTZt6GShaVm5XJLTndB5MWzqM4L 3HBD6DAs8iWzdEjyw+aSANuZUXWMpKTLFh2oHJTj1fyljoiWRpQrMmuuD38o8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682922807; a=rsa-sha256; cv=none; b=DwoZdbz8M+wOlZTLmpJtGzMS6TDr91413yfpsFPn1SdTFqeO4cygNnJ+LiKZfXCFT8FI5l l6dF1DhOa7OGf9EGOm7WOVCAhwXYNCA/FvB15NssDp8/s5RfuIltmgDdhHI8JkN4cHpTCC 5gMlGLGrJbBGvdEgJWCloOVnsZCQdC6w+icCe02WZnw+SjKXdk6c7l8K9nZaev+NzHjZJX sMbcDwOepAVj8I9aKahKr5xeD685Tjv04n5G3jJcaljOYtkKCMO1NvNAIsl74rc0xCO0j7 x6UAlVCr9Rqs/x2HU5RpKk6nfhrYg7ZWdPanWmhD5DYHLpgtYvi0jCeMfBP2HQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8th735pwzvn3; Mon, 1 May 2023 06:33:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3416XReB013078; Mon, 1 May 2023 06:33:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3416XRFq013077; Mon, 1 May 2023 06:33:27 GMT (envelope-from git) Date: Mon, 1 May 2023 06:33:27 GMT Message-Id: <202305010633.3416XRFq013077@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: d198b8774d2c - main - fwget: Introduce new utility List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d198b8774d2cfb6f140893e1c6236af9e97d1497 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=d198b8774d2cfb6f140893e1c6236af9e97d1497 commit d198b8774d2cfb6f140893e1c6236af9e97d1497 Author: Emmanuel Vadot AuthorDate: 2023-04-26 05:46:20 +0000 Commit: Emmanuel Vadot CommitDate: 2023-05-01 06:32:59 +0000 fwget: Introduce new utility This script's goal is to check the system for peripherals that needs firmware and install the needed packages for them. For now it only support pci subsystem and only video classes for AMD and Intel GPUs. Reviewed by: bapt Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D39825 --- etc/mtree/BSD.usr.dist | 2 + release/packages/Makefile.package | 2 + usr.sbin/Makefile | 1 + usr.sbin/fwget/Makefile | 7 ++ usr.sbin/fwget/fwget.8 | 64 +++++++++++++++++ usr.sbin/fwget/fwget.sh | 110 +++++++++++++++++++++++++++++ usr.sbin/fwget/pci/Makefile | 11 +++ usr.sbin/fwget/pci/pci | 84 ++++++++++++++++++++++ usr.sbin/fwget/pci/pci_video_amd | 139 +++++++++++++++++++++++++++++++++++++ usr.sbin/fwget/pci/pci_video_intel | 78 +++++++++++++++++++++ 10 files changed, 498 insertions(+) diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index 2e7c999124fd..9a6ede64fa73 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -152,6 +152,8 @@ .. dwatch .. + fwget + .. hyperv .. lpr diff --git a/release/packages/Makefile.package b/release/packages/Makefile.package index 47e0ee1c224b..9bd2994c882a 100644 --- a/release/packages/Makefile.package +++ b/release/packages/Makefile.package @@ -64,6 +64,8 @@ ftp_COMMENT= FTP Utilities ftp_DESC= FTP Utilities ftpd_COMMENT= FTP Daemon ftpd_DESC= FTP Daemon +fwget_COMMENT= FWGET Utility +fwget_DESC= FWGET Utility games_COMMENT= Games games_DESC= Games gdb_COMMENT= GDB Utilities diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index fb707e515eaa..76e3a29bbfc9 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -28,6 +28,7 @@ SUBDIR= adduser \ fifolog \ fstyp \ fwcontrol \ + fwget \ getfmac \ getpmac \ gstat \ diff --git a/usr.sbin/fwget/Makefile b/usr.sbin/fwget/Makefile new file mode 100644 index 000000000000..1cdf0f18230d --- /dev/null +++ b/usr.sbin/fwget/Makefile @@ -0,0 +1,7 @@ +PACKAGE= fwget + +SCRIPTS= fwget +MAN= fwget.8 +SUBDIR= pci + +.include diff --git a/usr.sbin/fwget/fwget.8 b/usr.sbin/fwget/fwget.8 new file mode 100644 index 000000000000..71cee817b7e6 --- /dev/null +++ b/usr.sbin/fwget/fwget.8 @@ -0,0 +1,64 @@ +.\" Copyright (c) 2023 Beckhoff Automation GmbH & Co. KG +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd Apr 26, 2023 +.Dt FWGET 8 +.Os +.Sh NAME +.Nm fwget +.Nd Install firmwares for the running system +.Sh SYNOPSIS +.Nm +.Op Fl v +.Op Fl n +.Ar subsystem +.Sh DESCRIPTION +The +.Nm +utility can be used to install firmwares packaged needed for the running +system +.Pp +If not specified the +.Ar subsystem +argument will default to pci cards. +.Pp +The options are as follows: +.Bl -tag -width +.It Fl n +Dry run, only show needed packages +.It Fl v +Be more verbose +.El +.Sh SEE ALSO +.Xr firmware 9 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 14.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +utility and this manual page were written by +.An Emmanuel Vadot Aq Mt manu@FreeBSD.org +for Beckhoff Automation GmbH & Co. KG . diff --git a/usr.sbin/fwget/fwget.sh b/usr.sbin/fwget/fwget.sh new file mode 100644 index 000000000000..cd5ee7a7048c --- /dev/null +++ b/usr.sbin/fwget/fwget.sh @@ -0,0 +1,110 @@ +#!/bin/sh + +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright 2023 Beckhoff Automation GmbH & Co. KG +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted providing that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +: ${LIBEXEC_PATH:="/usr/libexec/fwget"} + +usage() +{ + cat <&1 4>&2 +} + +log() +{ + echo $@ 1>&3 +} + +log_verbose() +{ + if [ "${VERBOSE}" = "n" ]; then + return + fi + + echo $@ 1>&3 +} + +DRY_RUN=n +VERBOSE=n + +log_start + +while [ $# -gt 0 ]; do + case $1 in + -n) + DRY_RUN=y + ;; + -v) + VERBOSE=y + ;; + *) + subsystems="${subsystems} $1" + ;; + esac + shift +done + +# Default searching PCI subsystem +if [ -z "${subsystems}" ]; then + subsystems="pci" +fi + +# Fail early on unsupported subsystem +for subsystem in ${subsystems}; do + if [ ! -f ${LIBEXEC_PATH}/${subsystem} ]; then + usage + fi + . ${LIBEXEC_PATH}/${subsystem} +done + +packages="" +for subsystem in ${subsystems}; do + package=$(${subsystem}_search_packages) + + packages="${packages} ${package}" +done + +echo "Needed packages: ${packages}" +if [ "${DRY_RUN}" = "y" ]; then + exit 0 +fi + +pkg install -q ${package} diff --git a/usr.sbin/fwget/pci/Makefile b/usr.sbin/fwget/pci/Makefile new file mode 100644 index 000000000000..5cf3b0cd2ed9 --- /dev/null +++ b/usr.sbin/fwget/pci/Makefile @@ -0,0 +1,11 @@ +PACKAGE= fwget + +SCRIPTS=pci \ + pci_video_amd \ + pci_video_intel + +BINDIR= ${LIBEXECDIR}/fwget + +MAN= + +.include diff --git a/usr.sbin/fwget/pci/pci b/usr.sbin/fwget/pci/pci new file mode 100644 index 000000000000..f97cb97d16fe --- /dev/null +++ b/usr.sbin/fwget/pci/pci @@ -0,0 +1,84 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright 2023 Beckhoff Automation GmbH & Co. KG +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted providing that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +pci_get_class() +{ + local hexclass=$(echo $1 | sed 's/.*class=\(0x[0-9a-z]*\).*/\1/') + case "${hexclass}" in + 0x030000) + echo "video" + ;; + esac +} + +pci_get_vendor() +{ + local hexvendor=$(echo $1 | sed 's/.*\ vendor=\(0x[0-9a-z]*\).*/\1/') + + case "${hexvendor}" in + 0x8086) + echo "intel" + ;; + 0x1002) + echo "amd" + ;; + esac +} + +pci_get_device() +{ + local hexdevice=$(echo $1 | sed 's/.*\ device=\(0x[0-9a-z]*\).*/\1/') + + echo ${hexdevice} +} + +pci_search_packages() +{ + local IFS + + oldifs=$IFS + IFS=$'\n' + for fulldevice in $(pciconf -l); do + class=$(pci_get_class "${fulldevice}") + if [ -z "${class}" ]; then + continue + fi + vendor=$(pci_get_vendor "${fulldevice}") + if [ -z "${vendor}" ]; then + continue + fi + device=$(pci_get_device "${fulldevice}") + + log_verbose "Trying to match device ${device} in class ${class} and vendor ${vendor} with pci_${class}_${vendor}" 1>&3 + if [ ! -f ${LIBEXEC_PATH}/pci_${class}_${vendor} ]; then + continue + fi + . ${LIBEXEC_PATH}/pci_${class}_${vendor} + + pci_${class}_${vendor} ${device} + done + IFS=${oldifs} +} diff --git a/usr.sbin/fwget/pci/pci_video_amd b/usr.sbin/fwget/pci/pci_video_amd new file mode 100644 index 000000000000..79f79d4958db --- /dev/null +++ b/usr.sbin/fwget/pci/pci_video_amd @@ -0,0 +1,139 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright 2023 Beckhoff Automation GmbH & Co. KG +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted providing that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +pci_video_amd() +{ + case "$1" in + 0x678*|0x679*) + echo "gpu-firmware-amd-kmod-tahiti" + ;; + 0x680*|0x681*) + echo "gpu-firmware-amd-kmod-pitcairn" + ;; + 0x660*|0x661*|0x662*|0x663*) + echo "gpu-firmware-amd-kmod-oland" + ;; + 0x682*|0x683*) + echo "gpu-firmware-amd-kmod-verde gpu-firmware-amd-kmod-si58" + ;; + 0x666*) + echo "gpu-firmware-amd-kmod-hainan" + ;; + 0x13*) + echo "gpu-firmware-amd-kmod-kaveri" + ;; + 0x664*|0x664*) + echo "gpu-firmware-amd-kmod-bonaire" + ;; + 0x67a*|0x67b*) + echo "gpu-firmware-amd-kmod-hawaii" + ;; + 0x983*) + echo "gpu-firmware-amd-kmod-kabini" + ;; + 0x985*) + echo "gpu-firmware-amd-kmod-mullins" + ;; + 0x690*) + echo "gpu-firmware-amd-kmod-topaz" + ;; + 0x692*|0x693*) + echo "gpu-firmware-amd-kmod-tonga" + ;; + 0x730*) + echo "gpu-firmware-amd-kmod-fiji" + ;; + 0x987*) + echo "gpu-firmware-amd-kmod-carrizo" + ;; + 0x98e4*) + echo "gpu-firmware-amd-kmod-stoney" + ;; + 0x67e*|0x67ff) + echo "gpu-firmware-amd-kmod-polaris11" + ;; + 0x67c*|0x67d*|0x6fdf) + echo "gpu-firmware-amd-kmod-polaris10" + ;; + 0x698*|0x699*) + echo "gpu-firmware-amd-kmod-polaris12" + ;; + 0x694*) + echo "gpu-firmware-amd-kmod-vegam" + ;; + 0x686*|0x687*) + echo "gpu-firmware-amd-kmod-vega10" + ;; + 0x69a*) + echo "gpu-firmware-amd-kmod-vega12" + ;; + 0x66a*) + echo "gpu-firmware-amd-kmod-vega20" + ;; + 0x15d*) + echo "gpu-firmware-amd-kmod-raven" + ;; + 0x738*|0x739*) + echo "gpu-firmware-amd-kmod-arcturus" + ;; + 0x731*) + echo "gpu-firmware-amd-kmod-navi10" + ;; + 0x734*) + echo "gpu-firmware-amd-kmod-navi14" + ;; + 0x15e7|0x1636|0x1638|0x164c) + echo "gpu-firmware-amd-kmod-renoir" + ;; + 0x736*) + echo "gpu-firmware-amd-kmod-navi12" + ;; + 0x73a*|0x73b*) + echo "gpu-firmware-amd-kmod-sienna-cichlid" + ;; + 0x163f) + echo "gpu-firmware-amd-kmod-vangogh" + ;; + 0x164d|0x1681) + echo "gpu-firmware-amd-kmod-yellow-carp" + ;; + 0x73c*|0x73d*) + echo "gpu-firmware-amd-kmod-navy-flounder" + ;; + 0x73e*|0x73f*) + echo "gpu-firmware-amd-kmod-dimgrey-cavefish" + ;; + 0x740*|0x741*) + echo "gpu-firmware-amd-kmod-aldebaran" + ;; + 0x13fe) + echo "gpu-firmware-amd-kmod-cyan-skillfish2" + ;; + 0x742*|0x743*) + echo "gpu-firmware-amd-kmod-beige-goby" + ;; + esac +} diff --git a/usr.sbin/fwget/pci/pci_video_intel b/usr.sbin/fwget/pci/pci_video_intel new file mode 100644 index 000000000000..9a20abcdb17a --- /dev/null +++ b/usr.sbin/fwget/pci/pci_video_intel @@ -0,0 +1,78 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright 2023 Beckhoff Automation GmbH & Co. KG +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted providing that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +pci_video_intel() +{ + case "$1" in + # Skylake + 0x19*) + echo "gpu-firmware-intel-kmod-skylake" + ;; + # Broxton + 0x0a*|0x1a*|0x5a84|0x5a85) + echo "gpu-firmware-intel-kmod-broxton" + ;; + # Geminilake + 0x318*) + echo "gpu-firmware-intel-kmod-geminilake" + ;; + # Kabylake, Coffeelake and Cometlake + 0x59*|0x87*|0x9b*|0x3e*) + echo "gpu-firmware-intel-kmod-kabylake" + ;; + # Cannonlake + 0x5a*) + echo "gpu-firmware-intel-cannonlake" + ;; + # Icelake + 0x8a*) + echo "gpu-firmware-intel-icelake" + ;; + # Elkhartlake/Jasperlake + 0x45*|0x4e*) + echo "gpu-firmware-intel-elkhartlake" + ;; + # Tigerlake + 0x9a*) + echo "gpu-firmware-intel-tigerlake" + ;; + # Rocketlake (Uses tigerlake GuC/HuC firmware) + 0x4c*) + echo "gpu-firmware-intel-rocketlake gpu-firmware-intel-tigerlake" + ;; + # DG1 + 0x49*) + echo "gpu-firmware-intel-dg1" + ;; + # Alderlake (Uses tigerlake GuC/HuC firmware) + 0x46*) + echo "gpu-firmware-intel-alderlake gpu-firmware-intel-tigerlake" + ;; + *) + log "No package found for device $1" + ;; + esac +}