From 210cb4e60abb8247ba50dc16b5662dc47fe635ac Mon Sep 17 00:00:00 2001 From: Danila Tikhonov Date: Sun, 10 Mar 2024 17:44:16 +0300 Subject: [PATCH] soc-qcom-sm7150: multiple improvements (MR 6195) Drop the signed A615 GPU ZAP firmware from soc-qcom-sm7150 due to compatibility issues causing crashes on Xiaomi (sweet/courbet) devices. This firmware will be re-added in device-specific firmware packages without being added to initramfs modules. Removing this firmware from initramfs modules will not impact FDE functionality, as it is not necessary for basic image display on panels. Removal from initramfs modules is due to a change in the path to the A615 GPU ZAP firmware, now device-specific. Depend on new alsa ucm config package. Add hexagonrpcd as a dependency and enable the hexagonrpcd-adsp-sensorspd service for SSC. Implement accel libssc_180_degrees mount matrix: Introduce new udev rules tailored for Xiaomi devices (surya/davinci) and potentially applicable to a broader range of sm7150 devices. These rules are added to the SoC package and will be set as dependencies in device packages for nonfree_firmware in subsequent commits. Drop userspace pd-mapper, we have switched to the in-kernel pd-mapper. Add bootmac to set bt mac address. Install nonfree firmware unconditionally. Co-developed-by: Danila Tikhonov Signed-off-by: Danila Tikhonov Co-developed-by: Jens Reidel Signed-off-by: Jens Reidel --- .../30-initramfs-firmware.files | 1 - .../81-libssc-180-degrees.rules | 3 + device/testing/soc-qcom-sm7150/APKBUILD | 67 +++++++++---------- ...m7150-nonfree-firmware-openrc.post-install | 3 - .../soc-qcom-sm7150-openrc.post-install | 3 + 5 files changed, 38 insertions(+), 39 deletions(-) create mode 100644 device/testing/soc-qcom-sm7150/81-libssc-180-degrees.rules delete mode 100644 device/testing/soc-qcom-sm7150/soc-qcom-sm7150-nonfree-firmware-openrc.post-install create mode 100644 device/testing/soc-qcom-sm7150/soc-qcom-sm7150-openrc.post-install diff --git a/device/testing/soc-qcom-sm7150/30-initramfs-firmware.files b/device/testing/soc-qcom-sm7150/30-initramfs-firmware.files index 5edc139a7..6b02ab74d 100644 --- a/device/testing/soc-qcom-sm7150/30-initramfs-firmware.files +++ b/device/testing/soc-qcom-sm7150/30-initramfs-firmware.files @@ -1,3 +1,2 @@ /lib/firmware/qcom/a630_sqe.fw /lib/firmware/qcom/a630_gmu.bin -/lib/firmware/qcom/a615_zap.mbn diff --git a/device/testing/soc-qcom-sm7150/81-libssc-180-degrees.rules b/device/testing/soc-qcom-sm7150/81-libssc-180-degrees.rules new file mode 100644 index 000000000..2bad47308 --- /dev/null +++ b/device/testing/soc-qcom-sm7150/81-libssc-180-degrees.rules @@ -0,0 +1,3 @@ +# iio-sensor-proxy with libssc: accelerometer mount matrix + +SUBSYSTEM=="misc", KERNEL=="fastrpc-*", ENV{ACCEL_MOUNT_MATRIX}+="-1, 0, 0; 0, -1, 0; 0, 0, -1" diff --git a/device/testing/soc-qcom-sm7150/APKBUILD b/device/testing/soc-qcom-sm7150/APKBUILD index 5d4efef21..d2ba0b004 100644 --- a/device/testing/soc-qcom-sm7150/APKBUILD +++ b/device/testing/soc-qcom-sm7150/APKBUILD @@ -3,62 +3,59 @@ pkgname=soc-qcom-sm7150 pkgdesc="Common package for Qualcomm SM7150 devices" -pkgver=1 -pkgrel=1 +pkgver=2 +pkgrel=0 url="https://postmarketos.org" license="BSD-3-Clause" arch="aarch64" -options="!check !strip !archcheck !tracedeps pmb:cross-native" +options="!check !strip !archcheck !tracedeps" depends=" + alsa-ucm-conf-qcom-sm7150 + bootmac + hexagonrpcd + linux-firmware-ath10k + linux-firmware-qca + linux-firmware-qcom + msm-modem + msm-modem-uim-selection swclock-offset + tqftpserv " subpackages=" - $pkgname-nonfree-firmware:nonfree_firmware - $pkgname-nonfree-firmware-openrc:nonfree_firmware_openrc + $pkgname-libssc-180-degrees:libssc_180_degrees + $pkgname-openrc $pkgname-unl0kr-quirk:unl0kr_quirk " -_gpufw_commit="bad0fd43728e8e2efd92e4b13f270bb27aa68272" source=" - $pkgname-$_gpufw_commit.tar.gz::https://github.com/sm7150-mainline/firmware-adreno-gpu/archive/$_gpufw_commit.tar.gz 10-unl0kr.conf 30-initramfs-firmware.files + 81-libssc-180-degrees.rules 90-feedbackd-aw8695.rules 90-feedbackd-pm6150.rules " package() { - install -Dm644 "$srcdir"/90-feedbackd-aw8695.rules \ - "$pkgdir"/usr/lib/udev/rules.d/90-feedbackd-aw8695.rules + install -Dm644 "$srcdir"/30-initramfs-firmware.files -t \ + "$pkgdir"/usr/share/mkinitfs/files - install -Dm644 "$srcdir"/90-feedbackd-pm6150.rules \ - "$pkgdir"/usr/lib/udev/rules.d/90-feedbackd-pm6150.rules + install -Dm644 "$srcdir"/90-feedbackd-aw8695.rules -t \ + "$pkgdir"/usr/lib/udev/rules.d + + install -Dm644 "$srcdir"/90-feedbackd-pm6150.rules -t \ + "$pkgdir"/usr/lib/udev/rules.d } -nonfree_firmware() { - depends=" - linux-firmware-ath10k - linux-firmware-qca - linux-firmware-qcom - pd-mapper - tqftpserv - msm-modem - msm-modem-uim-selection" - mkdir "$subpkgdir" - - # We will get all other Adreno GPU FWs from linux-firmware-qcom - install -Dm644 "$srcdir/firmware-adreno-gpu-$_gpufw_commit"/a615_zap.mbn -t \ - "$subpkgdir"/lib/firmware/qcom - - install -Dm644 "$srcdir/30-initramfs-firmware.files" -t \ - "$subpkgdir"/usr/share/mkinitfs/files +libssc_180_degrees() { + install -Dm644 "$srcdir"/81-libssc-180-degrees.rules -t \ + "$subpkgdir"/usr/lib/udev/rules.d } -nonfree_firmware_openrc() { - install_if="$pkgname-nonfree-firmware=$pkgver-r$pkgrel openrc" +openrc() { + install_if="$pkgname=$pkgver-r$pkgrel openrc" install="$subpkgname.post-install" depends=" - pd-mapper-openrc + hexagonrpcd-openrc tqftpserv-openrc " @@ -67,14 +64,14 @@ nonfree_firmware_openrc() { unl0kr_quirk() { # With fbdev emulation enabled, unl0kr needs to force refresh on some panels - install -Dm644 "$srcdir"/10-unl0kr.conf \ - "$subpkgdir"/etc/unl0kr.conf.d/10-unl0kr.conf + install -Dm644 "$srcdir"/10-unl0kr.conf -t \ + "$subpkgdir"/etc/unl0kr.conf.d } sha512sums=" -93a57ec896c35537587190e2da7c6e97025e8df90603b6bc5309d24404bf96cdf54187ebd53c6006d5772adf152a09e0e7c1b3481f5cfe48a0b6f1bfc8c0ac1a soc-qcom-sm7150-bad0fd43728e8e2efd92e4b13f270bb27aa68272.tar.gz f700af3145b79d1ef9edfb22982899b25cabfb212f9620dcbd3a2e6f44b5ad591e0a66056c6fcd66c3fde89a2b5f551e8a8fe2e65cf0e2a48adec57c027d7825 10-unl0kr.conf -389a4716a9f92871cb0ded771f27480a6657f26f6e5a6db7908e7cb26a36d5dcf60e3bfcbdb86c1a31d643016817798a5ca776e4cf564515336125a483cd07f5 30-initramfs-firmware.files +73438ceec8ca76dec24a92718d456d17b01a23510ee0b0e6c1263e3f6c2ca82263a3e41298c0a8ebf3dd8439da354fc1c914fd475ad1cf5c669c200770df62fa 30-initramfs-firmware.files +2c16ba75e0077b2b1eaefa4c73b287475505a1aeb291ec29316d41cc094277320f9d2aaabfd91eb1dc0f488ab2d61a94faef16e7afe0f1e226779113761b9a37 81-libssc-180-degrees.rules 2974ccc172bf1299daeb0bc746879b3a1db1fbc3a2b163a02a6554fed6ed9f733144bcf976cd2441c5664d496dcce3ae943f4314c653470dc07dda0de5ad632b 90-feedbackd-aw8695.rules 90fca4a3291a2c84c0b20e41308c4698374ba896e9365ca80dbfd0c0c4f7dc08317f3dd865a3c7f6707c81b02f5bb24136d1172253d2e4fdd50039bbbf02a178 90-feedbackd-pm6150.rules " diff --git a/device/testing/soc-qcom-sm7150/soc-qcom-sm7150-nonfree-firmware-openrc.post-install b/device/testing/soc-qcom-sm7150/soc-qcom-sm7150-nonfree-firmware-openrc.post-install deleted file mode 100644 index 70b9e0efe..000000000 --- a/device/testing/soc-qcom-sm7150/soc-qcom-sm7150-nonfree-firmware-openrc.post-install +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -rc-update add tqftpserv boot -rc-update add pd-mapper boot diff --git a/device/testing/soc-qcom-sm7150/soc-qcom-sm7150-openrc.post-install b/device/testing/soc-qcom-sm7150/soc-qcom-sm7150-openrc.post-install new file mode 100644 index 000000000..5b2ca5768 --- /dev/null +++ b/device/testing/soc-qcom-sm7150/soc-qcom-sm7150-openrc.post-install @@ -0,0 +1,3 @@ +#!/bin/sh +rc-update add hexagonrpcd-adsp-sensorspd +rc-update add tqftpserv boot