From 0eabfc2d532d8d8147e6618ef5ef7ea6664e6469 Mon Sep 17 00:00:00 2001 From: Leandro Friedrich Date: Mon, 22 Aug 2022 22:17:45 +0200 Subject: [PATCH] soc-qcom-sm7125: new aport (MR 3379) --- .../soc-qcom-sm7125/30-gpu-firmware.files | 6 ++ device/testing/soc-qcom-sm7125/APKBUILD | 39 ++++++++ device/testing/soc-qcom-sm7125/UPower.conf | 94 +++++++++++++++++++ ...-qcom-sm7125-nonfree-firmware.post-install | 3 + 4 files changed, 142 insertions(+) create mode 100644 device/testing/soc-qcom-sm7125/30-gpu-firmware.files create mode 100644 device/testing/soc-qcom-sm7125/APKBUILD create mode 100644 device/testing/soc-qcom-sm7125/UPower.conf create mode 100644 device/testing/soc-qcom-sm7125/soc-qcom-sm7125-nonfree-firmware.post-install diff --git a/device/testing/soc-qcom-sm7125/30-gpu-firmware.files b/device/testing/soc-qcom-sm7125/30-gpu-firmware.files new file mode 100644 index 000000000..6a9d56665 --- /dev/null +++ b/device/testing/soc-qcom-sm7125/30-gpu-firmware.files @@ -0,0 +1,6 @@ +/lib/firmware/qcom/a630_sqe.fw +/lib/firmware/qcom/a630_gmu.bin +/lib/firmware/qcom/a615_zap.mdt +/lib/firmware/qcom/a615_zap.b00 +/lib/firmware/qcom/a615_zap.b01 +/lib/firmware/qcom/a615_zap.b02 diff --git a/device/testing/soc-qcom-sm7125/APKBUILD b/device/testing/soc-qcom-sm7125/APKBUILD new file mode 100644 index 000000000..7f8c5535d --- /dev/null +++ b/device/testing/soc-qcom-sm7125/APKBUILD @@ -0,0 +1,39 @@ +# Maintainer: Leandro Friedrich +# Co-Maintainer: map220v +pkgname=soc-qcom-sm7125 +pkgver=1.0 +pkgrel=0 +pkgdesc="Common package for Qualcomm SM7125 devices" +url="https://postmarketos.org" +license="BSD-3-Clause" +arch="aarch64" +options="!check !archcheck !tracedeps" +depends=" + msm-modem-uim-selection + bootmac +" +replaces="upower" +subpackages="$pkgname-nonfree-firmware:nonfree_firmware" +source=" + 30-gpu-firmware.files + UPower.conf +" + +package() { + # Shutdown when battery is critical instead of sleep + install -Dm644 "$srcdir"/UPower.conf \ + "$pkgdir"/etc/UPower/UPower.conf +} + +nonfree_firmware() { + pkgdesc="Modem, WiFi and GPU Firmware" + depends="msm-modem pd-mapper tqftpserv" + install -Dm644 "$srcdir/30-gpu-firmware.files" \ + "$subpkgdir/etc/postmarketos-mkinitfs/files/30-gpu-firmware.files" + install="$subpkgname.post-install" +} + +sha512sums=" +9d455b56558d453d501a1ad869ffa79f9952ed43485a9847d506db6a78bfcd9f9c9d855660ee1d368eb74f4429385ec166addc30d802261c75562e785fe84c52 UPower.conf +fa300fb92e3b375cd802a6243510d2a092d75ced7f62d044485566f4b76240259426eed6be91028c80e3a7f6894492f748a1dfd7122f90dc84253deb063338de 30-gpu-firmware.files +" diff --git a/device/testing/soc-qcom-sm7125/UPower.conf b/device/testing/soc-qcom-sm7125/UPower.conf new file mode 100644 index 000000000..a9bea9c14 --- /dev/null +++ b/device/testing/soc-qcom-sm7125/UPower.conf @@ -0,0 +1,94 @@ +# Only the system vendor should modify this file, ordinary users +# should not have to change anything. + +[UPower] + +# Enable the Watts Up Pro device. +# +# The Watts Up Pro contains a generic FTDI USB device without a specific +# vendor and product ID. When we probe for WUP devices, we can cause +# the user to get a perplexing "Device or resource busy" error when +# attempting to use their non-WUP device. +# +# The generic FTDI device is known to also be used on: +# +# - Sparkfun FT232 breakout board +# - Parallax Propeller +# +# default=false +EnableWattsUpPro=false + +# Don't poll the kernel for battery level changes. +# +# Some hardware will send us battery level changes through +# events, rather than us having to poll for it. This option +# allows disabling polling for hardware that sends out events. +# +# default=false +NoPollBatteries=false + +# Do we ignore the lid state +# +# Some laptops are broken. The lid state is either inverted, or stuck +# on or off. We can't do much to fix these problems, but this is a way +# for users to make the laptop panel vanish, a state that might be used +# by a couple of user-space daemons. On Linux systems, see also +# logind.conf(5). +# +# default=false +IgnoreLid=false + +# Policy for warnings and action based on battery levels +# +# Whether battery percentage based policy should be used. The default +# is to use the time left, change to true to use the percentage, which +# should work around broken firmwares. It is also more reliable than +# the time left (frantically saving all your files is going to use more +# battery than letting it rest for example). +# default=true +UsePercentageForPolicy=true + +# When UsePercentageForPolicy is true, the levels at which UPower will +# consider the battery low, critical, or take action for the critical +# battery level. +# +# This will also be used for batteries which don't have time information +# such as that of peripherals. +# +# If any value is invalid, or not in descending order, the defaults +# will be used. +# +# Defaults: +# PercentageLow=20 +# PercentageCritical=5 +# PercentageAction=2 +PercentageLow=10 +PercentageCritical=5 +PercentageAction=3 + +# When UsePercentageForPolicy is false, the time remaining in seconds at +# which UPower will consider the battery low, critical, or take action for +# the critical battery level. +# +# If any value is invalid, or not in descending order, the defaults +# will be used. +# +# Defaults: +# TimeLow=1200 +# TimeCritical=300 +# TimeAction=120 +TimeLow=1200 +TimeCritical=300 +TimeAction=120 + +# The action to take when "TimeAction" or "PercentageAction" above has been +# reached for the batteries (UPS or laptop batteries) supplying the computer +# +# Possible values are: +# PowerOff +# Hibernate +# HybridSleep +# +# If HybridSleep isn't available, Hibernate will be used +# If Hibernate isn't available, PowerOff will be used +CriticalPowerAction=PowerOff diff --git a/device/testing/soc-qcom-sm7125/soc-qcom-sm7125-nonfree-firmware.post-install b/device/testing/soc-qcom-sm7125/soc-qcom-sm7125-nonfree-firmware.post-install new file mode 100644 index 000000000..70b9e0efe --- /dev/null +++ b/device/testing/soc-qcom-sm7125/soc-qcom-sm7125-nonfree-firmware.post-install @@ -0,0 +1,3 @@ +#!/bin/sh +rc-update add tqftpserv boot +rc-update add pd-mapper boot