From cbf9ace0e61475c19166e72627409eb64769dcc6 Mon Sep 17 00:00:00 2001 From: Jens Reidel Date: Mon, 23 Jun 2025 04:13:46 +0200 Subject: [PATCH] device-qcom-sm7150: overhaul and use packaged firmware Signed-off-by: Jens Reidel Part-of: --- .../30-initramfs-firmware.files | 2 - device/community/device-qcom-sm7150/APKBUILD | 26 ++------ .../community/device-qcom-sm7150/deviceinfo | 6 +- .../device-qcom-sm7150/initfs-hook.sh | 61 ------------------- 4 files changed, 8 insertions(+), 87 deletions(-) delete mode 100644 device/community/device-qcom-sm7150/30-initramfs-firmware.files delete mode 100644 device/community/device-qcom-sm7150/initfs-hook.sh diff --git a/device/community/device-qcom-sm7150/30-initramfs-firmware.files b/device/community/device-qcom-sm7150/30-initramfs-firmware.files deleted file mode 100644 index 6b02ab74d..000000000 --- a/device/community/device-qcom-sm7150/30-initramfs-firmware.files +++ /dev/null @@ -1,2 +0,0 @@ -/lib/firmware/qcom/a630_sqe.fw -/lib/firmware/qcom/a630_gmu.bin diff --git a/device/community/device-qcom-sm7150/APKBUILD b/device/community/device-qcom-sm7150/APKBUILD index 7ebb89295..dff73df04 100644 --- a/device/community/device-qcom-sm7150/APKBUILD +++ b/device/community/device-qcom-sm7150/APKBUILD @@ -6,7 +6,7 @@ pkgname=device-qcom-sm7150 pkgdesc="Generic device package for Qualcomm SM7150 devices" -pkgver=3 +pkgver=4 pkgrel=0 url="https://postmarketos.org" license="MIT" @@ -14,22 +14,15 @@ arch="aarch64" options="!check !archcheck" depends=" alsa-ucm-conf-qcom-sm7150 - bootmac - hexagonfs-firmware-loader + firmware-qcom-sm7150 hexagonrpcd - linux-firmware-ath10k - linux-firmware-qca - linux-firmware-qcom linux-postmarketos-qcom-sm7150 make-dynpart-mappings - msm-firmware-loader - msm-modem - msm-modem-uim-selection postmarketos-base - qbootctl - swclock-offset + soc-qcom + soc-qcom-modem + soc-qcom-qbootctl systemd-boot - tqftpserv unl0kr-fbforcerefresh " makedepends="devicepkg-dev" @@ -38,10 +31,8 @@ subpackages=" " source=" - 30-initramfs-firmware.files 81-libssc-180-degrees.rules deviceinfo - initfs-hook.sh " build() { @@ -51,9 +42,6 @@ build() { package() { devicepkg_package $startdir $pkgname - install -Dm644 "$srcdir"/30-initramfs-firmware.files -t \ - "$pkgdir"/usr/share/mkinitfs/files - install -Dm644 "$srcdir"/81-libssc-180-degrees.rules -t \ "$pkgdir"/usr/lib/udev/rules.d } @@ -72,8 +60,6 @@ openrc() { } sha512sums=" -73438ceec8ca76dec24a92718d456d17b01a23510ee0b0e6c1263e3f6c2ca82263a3e41298c0a8ebf3dd8439da354fc1c914fd475ad1cf5c669c200770df62fa 30-initramfs-firmware.files 2c16ba75e0077b2b1eaefa4c73b287475505a1aeb291ec29316d41cc094277320f9d2aaabfd91eb1dc0f488ab2d61a94faef16e7afe0f1e226779113761b9a37 81-libssc-180-degrees.rules -f38e438c79dadda0eef3abe5c55ad69f8947bf39e5c57e03b7cba7a60b09091e326c525e2451de446ab6de9e92a6d4e39da32ef854cc285bde2e7d56f7b7d10d deviceinfo -8cfd961424d97242f8be42750377315825039891362bf5fbead7de9cbaaf50be34fd35e9c3ac2f981c7c3138243544f162182020b8a5a56779474476d84a7775 initfs-hook.sh +38b30ae76411656821a262a4c990bb530906c0ab7da45b70d6ff38c58ee3cc54120c5c22a21bc9e58d025ec7ab4a88fcca780bcc2c12b86803c9b4a1cdaed144 deviceinfo " diff --git a/device/community/device-qcom-sm7150/deviceinfo b/device/community/device-qcom-sm7150/deviceinfo index bc508cbbf..167a52df9 100644 --- a/device/community/device-qcom-sm7150/deviceinfo +++ b/device/community/device-qcom-sm7150/deviceinfo @@ -10,17 +10,15 @@ deviceinfo_year="2019" deviceinfo_arch="aarch64" # Device related -deviceinfo_gpu_accelerated="true" +deviceinfo_drm="true" deviceinfo_chassis="handset" -deviceinfo_keyboard="false" deviceinfo_external_storage="true" # Bootloader related deviceinfo_flash_method="fastboot-bootpart" # Where to flash boot.img, or in our case where to flash the pmOS boot partition. # This is a bit confusing. -deviceinfo_flash_fastboot_partition_kernel="cache" -deviceinfo_flash_fastboot_partition_system="userdata" +deviceinfo_flash_fastboot_partition_kernel="super" deviceinfo_kernel_cmdline="quiet loglevel=2" deviceinfo_getty="ttyMSM0;115200" deviceinfo_generate_systemd_boot="true" diff --git a/device/community/device-qcom-sm7150/initfs-hook.sh b/device/community/device-qcom-sm7150/initfs-hook.sh deleted file mode 100644 index 923406897..000000000 --- a/device/community/device-qcom-sm7150/initfs-hook.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh - -# Some devices (xiaomi-surya) ship with a touchscreen that has no persistent -# firmware storage. That is unfortunate and means we need to provide firmware -# from the initramfs for FDE to work. -# This is only the case for the novatek touchscreens. Their firmware resides -# in /vendor/firmware. Let's copy it over. -# The file names are novatek_ts_huaxing_fw.bin and novatek_ts_tianma_fw.bin, -# for both panels respectively. - -for input in /sys/class/input/input*/uevent -do - if grep -q "NT36XXX" "$input" - then - echo "nt36xxx is loaded, mounting firmware for it!" - - mkdir /firmware-mnt - - for part in /sys/block/sd*/sd* - do - DEVNAME="$(grep DEVNAME "$part"/uevent | sed 's/DEVNAME=//g')" - PARTNAME="$(grep PARTNAME "$part"/uevent | sed 's/PARTNAME=//g')" - - # Could be vendor_a or vendor_b - if [[ "$PARTNAME" == "vendor"* ]] - then - mount -o ro,nodev,noexec,nosuid \ - "/dev/$DEVNAME" /firmware-mnt - break - # Super partition with vendor on a subpartition, system if retrofit - elif [[ "$PARTNAME" == "super" ]] || [[ "$PARTNAME" == "system" ]] - then - if ! make-dynpart-mappings "/dev/$DEVNAME"; then continue; fi; - - for dynpart in /dev/mapper/* - do - if [[ "$dynpart" == *"vendor"* ]] - then - mount -o ro,nodev,noexec,nosuid \ - "$dynpart" /firmware-mnt - break 2 - fi - done - fi - done - - if [ -d /firmware-mnt/firmware ] - then - for firmware_file in /firmware-mnt/firmware/novatek_ts_*_fw.bin - do - echo "Found novatek firmware file at $firmware_file" - - cp $firmware_file /lib/firmware/ - done - - umount /firmware-mnt - fi - - break - fi -done