mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-22 05:23:01 -04:00
dev-libs/xdna-driver: add 2.21.75, drop 202610.2.21.21
* Unfortunate "downgrade" due to versioning scheme change in upstream * New ebuild is in sync with live ebuild now Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
DIST 886e89-1502_00__npu.dev.sbin 248592 BLAKE2B c7388450f546a69ffbd363f4fd1a6f415f8faa7b4badd9c2656707cfbacc6bf07e67fe605f6cb8670ea79ed3ade20021ea9a26979fbd55fc9bfbc15137cd13bf SHA512 fa49ab6bbbb23479d6493d85a6372cac84e3a3edb93bc82c63ce95c30d6e1e3d0fe304ea134734f052d37d86e19d26085a672b340858e9ab1fd8b093b76633cf
|
||||
DIST 886e89-17f0_00__npu.dev.sbin 287712 BLAKE2B ae2ce2b54dfd86b02288a41ace66d08d8ac614dcfde4ce8537204613fb57e677b495ef37eaa6e435a53ffad7fac6fe3126c89132ed6df7a53b2011b5e84c79aa SHA512 888a4fbcd932978ad9c77f3c2e9c42de5c2f9a09ae76db2791dc0dea22b08de823917a79974a4660eec6d5c9fe5aed6f1f77123cb11e4574b45c8131934ecf96
|
||||
DIST 886e89-17f0_10__npu.dev.sbin 492720 BLAKE2B 477bc7004ce13e2ad13a6bb214cd75438255f6f863c3e0bd261e6b3f26c42f88aa649fc5ec9273b032cf644a097bfcc8dcc9fdc7770647a4863e94bed6d19ec8 SHA512 6eded0563b4a247e32a8e21e8cb1d45233660586ea78dabdb3a0e8ec0871290df6c72ea2bf9348abb5022008d926642b53e10691d88fa500d0ce8a9d81867961
|
||||
DIST 886e89-17f0_11__npu.dev.sbin 492720 BLAKE2B a26fefad6c8e87be947abca416b8be03668bca214f8cb14ff91cc47c9386060815d46edb8673cbc18138d78f4c445990a4d2115f2ef76f9acdf379ed2f0aab07 SHA512 30d227e3d77c9f28aed8ef98d0438b00be9bc186bb93b1b589cffd66c7e310913ff330a6907cdd47958fc8c16482b9a69996d3c04584ebe3a55ae3b3195da76b
|
||||
DIST xdna-driver-202610.2.21.21.tar.gz 15179727 BLAKE2B 418bd96a507256d5d3891d79125a12d06f825e5b13a3ba5b9612766c6b00abd88ebdd685d35bffc706728a2660c684456c18863b6d7d8897e6af1a865fc44ead SHA512 6212c83d391949e590fb5f372fd805cbde22845c0210f8417c7b3269040b1ea2ff30bbde9e21cd22cdf585d4bdb7b36e5607e0228747845cc1c0da204e0c9532
|
||||
DIST 9c532b-1502_00__npu.dev.sbin 248592 BLAKE2B c7388450f546a69ffbd363f4fd1a6f415f8faa7b4badd9c2656707cfbacc6bf07e67fe605f6cb8670ea79ed3ade20021ea9a26979fbd55fc9bfbc15137cd13bf SHA512 fa49ab6bbbb23479d6493d85a6372cac84e3a3edb93bc82c63ce95c30d6e1e3d0fe304ea134734f052d37d86e19d26085a672b340858e9ab1fd8b093b76633cf
|
||||
DIST 9c532b-17f0_00__npu.dev.sbin 287712 BLAKE2B ae2ce2b54dfd86b02288a41ace66d08d8ac614dcfde4ce8537204613fb57e677b495ef37eaa6e435a53ffad7fac6fe3126c89132ed6df7a53b2011b5e84c79aa SHA512 888a4fbcd932978ad9c77f3c2e9c42de5c2f9a09ae76db2791dc0dea22b08de823917a79974a4660eec6d5c9fe5aed6f1f77123cb11e4574b45c8131934ecf96
|
||||
DIST 9c532b-17f0_10__npu.dev.sbin 429680 BLAKE2B d1b22ead06bfa25c3b5deca4e076ee058262c99972c4892f265c6701f192abc53663e4ad820f8298d0c29e226bab2609c6859e07c05568d98f5ada39eee3ef62 SHA512 ec8ec3d708146105057bf4f87f925ee610b29cd5022f14d8e5ce553f694222f9e876329a8cde5c3be980ad4250eda28f840716cd0a3225a7010b3ea51b78c7db
|
||||
DIST 9c532b-17f0_11__npu.dev.sbin 429680 BLAKE2B 4f752366c2d6572aeb09a4eee895524f6b475d00a600d3501b373da51441c32e4113f5f302390f90fe452bbd6af2028cc4648fa011491b9d45cd9064e31f6f5f SHA512 4caee01fd77fe292905fadae049015c55de6251f01dbfffbfcfc4a9f27354cb05665b2150e4e5d0e396ee897755d54d4199e7e7c0598705cf779c7ae27f931d2
|
||||
DIST xdna-driver-2.21.75.tar.gz 9323317 BLAKE2B e48861eb407604f944bd1fd627d486da24bd0f5839c4e75e488f7a75305e840b4ff0fd301c4e1e8cc238f50fcd2d278b97ad0b3e51601dc5f16e28b312211c65 SHA512 d138630f191496c5e7d24fda47f357e4690a9ea65408e3e8dd246dd471de4b02912ef90ae666c3074fa3753d85aa811d1b9de78bd4eba80b7f400c29633ddfc4
|
||||
|
||||
133
dev-libs/xdna-driver/xdna-driver-2.21.75.ebuild
Normal file
133
dev-libs/xdna-driver/xdna-driver-2.21.75.ebuild
Normal file
@@ -0,0 +1,133 @@
|
||||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit linux-mod-r1 toolchain-funcs
|
||||
|
||||
DESCRIPTION="AMD XDNA Driver"
|
||||
HOMEPAGE="https://github.com/amd/xdna-driver"
|
||||
|
||||
if [[ ${PV} == 999999 ]] ; then
|
||||
EGIT_REPO_URI="https://github.com/amd/xdna-driver.git"
|
||||
EGIT_SUBMODULES=()
|
||||
inherit git-r3
|
||||
|
||||
BDEPEND="
|
||||
app-misc/jq
|
||||
net-misc/wget
|
||||
"
|
||||
else
|
||||
SRC_URI="https://github.com/amd/xdna-driver/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
|
||||
KEYWORDS="~amd64"
|
||||
|
||||
# For live ebuild firmware is fetched from amd-ipu-staging branch of https://gitlab.com/kernel-firmware/drm-firmware.
|
||||
# For release commit, see https://github.com/amd/xdna-driver/issues/1236
|
||||
# (requires manual date-based commit selection)
|
||||
FW_COMMIT=9c532be0fe8d6ac30e8a5e1c0b54a88ae94f50b6
|
||||
|
||||
# To regenerate, run:
|
||||
# ebuild xdna-driver-<version>.ebuild info
|
||||
declare -A FIRMWARES=(
|
||||
[1502_00/npu.sbin.1.5.5.391]=npu.dev.sbin
|
||||
[17f0_00/npu.sbin.0.7.22.185]=npu.dev.sbin
|
||||
[17f0_10/1.7_npu.sbin.1.1.2.64]=npu.dev.sbin
|
||||
[17f0_11/1.7_npu.sbin.1.1.2.65]=npu.dev.sbin
|
||||
)
|
||||
|
||||
FW_URI_PREFIX=https://gitlab.com/kernel-firmware/drm-firmware/-/raw/${FW_COMMIT}/amdnpu
|
||||
|
||||
SRC_URI+=" firmware? ( "
|
||||
for fw in "${!FIRMWARES[@]}"; do
|
||||
SRC_URI+="${FW_URI_PREFIX}/${fw} -> ${FW_COMMIT:0:6}-${fw%%/*}__${FIRMWARES[${fw}]} "
|
||||
done
|
||||
SRC_URI+=")"
|
||||
fi
|
||||
|
||||
S="${WORKDIR}/${P}/src/driver/amdxdna"
|
||||
LICENSE="GPL-2 firmware? ( linux-fw-redistributable )"
|
||||
SLOT="0"
|
||||
IUSE="+firmware"
|
||||
|
||||
pkg_info() {
|
||||
if [[ ${PV} != 999999 ]] ; then
|
||||
local INFO_FILE="https://raw.githubusercontent.com/amd/xdna-driver/${PV}/tools/info.json"
|
||||
local COMMON_PREFIX=https://gitlab.com/kernel-firmware/drm-firmware/-/raw/amd-ipu-staging/amdnpu/
|
||||
# shellcheck disable=SC2016
|
||||
local JQ_EXPR='.firmwares[] | (.url | sub($prefix; "")) as $p | " [" + $p + "]=" + .fw_name'
|
||||
|
||||
echo 'declare -A FIRMWARES=('
|
||||
curl -s "$INFO_FILE" | jq -r --arg prefix "$COMMON_PREFIX" "$JQ_EXPR"
|
||||
echo ')'
|
||||
fi
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
local firmware_dir="${WORKDIR}/${P}/amdxdna_bins/firmware"
|
||||
|
||||
if [[ ${PV} == 999999 ]] ; then
|
||||
git-r3_src_unpack
|
||||
|
||||
while IFS=$'\t' read -r device pci_dev_id pci_rev_id fw_name url; do
|
||||
outdir="${firmware_dir}/${pci_dev_id}_${pci_rev_id}"
|
||||
mkdir -p "${outdir}" || die
|
||||
wget -O "${outdir}/${fw_name}" "${url}" || die
|
||||
done < <(
|
||||
jq -r '.firmwares[] |
|
||||
[.device, .pci_device_id, .pci_revision_id, .fw_name, .url]
|
||||
| @tsv' "${WORKDIR}/${P}/tools/info.json" || die
|
||||
) || die
|
||||
else
|
||||
default
|
||||
|
||||
mkdir -p "${firmware_dir}" || die
|
||||
for fw in "${!FIRMWARES[@]}"; do
|
||||
local dir="${fw%%/*}"
|
||||
local src_filename="${FW_COMMIT:0:6}-${dir}__${FIRMWARES[${fw}]}"
|
||||
mkdir -p "${firmware_dir}/${dir}" || die
|
||||
cp "${DISTDIR}/${src_filename}" "${firmware_dir}/${dir}/${FIRMWARES[${fw}]}" || die
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
sed -e "s/-Werror//" -i Kbuild || die
|
||||
|
||||
# Forward clang compiler, otherwise fails when kernel is compiled with clang cflags
|
||||
# shellcheck disable=SC2016
|
||||
sed -e 's/make -s /make -s CC="${CC}" /' \
|
||||
-e 's:>/dev/null 2>&1::' \
|
||||
-i "${WORKDIR}/${P}"/src/driver/tools/configure_kernel.sh || die
|
||||
|
||||
default
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
cd "${WORKDIR}/${P}/src" || die
|
||||
KERNEL_SRC="${KERNEL_DIR}" ARCH=$(tc-arch-kernel) \
|
||||
./driver/tools/configure_kernel.sh || die
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
local modlist=( amdxdna )
|
||||
local modargs=( KERNEL_VER="${KV_FULL}" )
|
||||
|
||||
linux-mod-r1_src_compile
|
||||
}
|
||||
|
||||
src_install() {
|
||||
insinto /lib/firmware/amdnpu
|
||||
doins -r "${WORKDIR}/${P}/amdxdna_bins/firmware"/*
|
||||
|
||||
insinto /usr/lib/modules-load.d
|
||||
newins - amdxdna.conf <<-EOF
|
||||
amdxdna
|
||||
EOF
|
||||
|
||||
insinto /etc/modprobe.d
|
||||
newins - amdxdna.conf <<-EOF
|
||||
install amdxdna /sbin/insmod /lib/modules/\$(uname -r)/extra/amdxdna.ko \$CMDLINE_OPTS
|
||||
EOF
|
||||
|
||||
linux-mod-r1_src_install
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
inherit linux-mod-r1
|
||||
|
||||
# FWAPI=https://gitlab.com/api/v4/projects/kernel-firmware%2Fdrm-firmware/repository/branches/amd-ipu-staging
|
||||
# curl -s "$FWAPI" | jq -r '.commit.id'
|
||||
FW_COMMIT=886e8948d60c354b488ad8d10c56763b81597093
|
||||
|
||||
DESCRIPTION="AMD XDNA Driver"
|
||||
HOMEPAGE="https://github.com/amd/xdna-driver"
|
||||
|
||||
if [[ ${PV} == 999999 ]] ; then
|
||||
EGIT_REPO_URI="https://github.com/amd/xdna-driver.git"
|
||||
EGIT_SUBMODULES=()
|
||||
inherit git-r3
|
||||
else
|
||||
SRC_URI="https://github.com/amd/xdna-driver/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
|
||||
KEYWORDS="~amd64"
|
||||
fi
|
||||
|
||||
# INFO_FILE=https://raw.githubusercontent.com/amd/xdna-driver/202610.2.21.21/tools/info.json
|
||||
# COMMON_PREFIX=https://gitlab.com/kernel-firmware/drm-firmware/-/raw/amd-ipu-staging/amdnpu/
|
||||
# curl -s "$INFO_FILE" | jq -r ".firmwares[] | .url | sub(\"${COMMON_PREFIX}\"; \"\")"
|
||||
FIRMWARES=(
|
||||
1502_00/npu.sbin.1.5.5.391
|
||||
17f0_00/npu.sbin.0.7.22.185
|
||||
17f0_10/npu.sbin.255.0.5.35
|
||||
17f0_11/npu.sbin.255.0.5.35
|
||||
)
|
||||
|
||||
FW_URI_PREFIX=https://gitlab.com/kernel-firmware/drm-firmware/-/raw/${FW_COMMIT}/amdnpu
|
||||
|
||||
SRC_URI+=" firmware? ( "
|
||||
for fw in "${FIRMWARES[@]}"; do
|
||||
SRC_URI+="${FW_URI_PREFIX}/${fw} -> ${FW_COMMIT:0:6}-${fw%%/*}__npu.dev.sbin "
|
||||
done
|
||||
SRC_URI+=")"
|
||||
|
||||
S="${WORKDIR}/${P}/src/driver/amdxdna"
|
||||
LICENSE="GPL-2 firmware? ( linux-fw-redistributable )"
|
||||
SLOT="0"
|
||||
IUSE="+firmware"
|
||||
|
||||
src_prepare() {
|
||||
sed -e "s/-Werror//" -i Kbuild || die
|
||||
default
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
local modlist=( amdxdna )
|
||||
local modargs=( KERNEL_VER="${KV_FULL}" )
|
||||
|
||||
linux-mod-r1_src_compile
|
||||
}
|
||||
|
||||
src_install() {
|
||||
for fw in "${FIRMWARES[@]}"; do
|
||||
local dir="${fw%%/*}"
|
||||
local src_filename="${FW_COMMIT:0:6}-${dir}__npu.dev.sbin"
|
||||
insinto "/lib/firmware/amdnpu/${dir}"
|
||||
newins "${DISTDIR}/${src_filename}" npu.dev.sbin
|
||||
done
|
||||
|
||||
insinto /usr/lib/modules-load.d
|
||||
newins - amdxdna.conf <<-EOF
|
||||
amdxdna
|
||||
EOF
|
||||
|
||||
insinto /etc/modprobe.d
|
||||
newins - amdxdna.conf <<-EOF
|
||||
install amdxdna /sbin/insmod /lib/modules/\$(uname -r)/extra/amdxdna.ko \$CMDLINE_OPTS
|
||||
EOF
|
||||
|
||||
linux-mod-r1_src_install
|
||||
}
|
||||
Reference in New Issue
Block a user