xiaomi-surya: new device (MR 3706)

Add support for the Xiaomi POCO X3 NFC.

[ci:skip-build] already built successfully in CI
This commit is contained in:
David Wronek 2022-12-10 11:18:13 +01:00 committed by Clayton Craft
parent 00bd9b7525
commit d91cf7fdf4
No known key found for this signature in database
GPG key ID: 4A4CED6D7EDF950A
4 changed files with 173 additions and 0 deletions

View file

@ -0,0 +1,59 @@
# Maintainer: David Wronek <w.david0@protonmail.com>
# Co-Maintainer: Danila Tikhonov <JIaxyga@protonmail.com>
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-xiaomi-surya
pkgdesc="Xiaomi POCO X3 NFC"
pkgver=1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
linux-postmarketos-qcom-sm7150
make-dynpart-mappings
mkbootimg
postmarketos-base
postmarketos-update-kernel
"
makedepends="devicepkg-dev"
source="
deviceinfo
"
subpackages="
$pkgname-nonfree-firmware:nonfree_firmware
"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
nonfree_firmware() {
pkgdesc="Firmware for Modem, WiFi, Touchscreen, etc."
depends="
firmware-xiaomi-surya-adsp
firmware-xiaomi-surya-cdsp
firmware-xiaomi-surya-ipa
firmware-xiaomi-surya-modem
firmware-xiaomi-surya-touchscreen
firmware-xiaomi-surya-wlan
linux-firmware-ath10k
linux-firmware-qca
msm-modem
msm-modem-uim-selection
pd-mapper
tqftpserv
"
install="$subpkgname.post-install"
mkdir "$subpkgdir"
}
sha512sums="
8fb0c1f3dbad1003b108bd7748a839f002c9c8caa3125148fb8818f5df540da81615428cbc5dfc28738d38460f3f1b4ec977c9f194447c0bc508bcd6a42f4276 deviceinfo
"

View file

@ -0,0 +1,3 @@
#!/bin/sh
rc-update add tqftpserv boot
rc-update add pd-mapper boot

View file

@ -0,0 +1,37 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell
# scripts.
deviceinfo_format_version="0"
deviceinfo_name="Xiaomi POCO X3 NFC"
deviceinfo_manufacturer="Xiaomi"
deviceinfo_codename="xiaomi-surya"
deviceinfo_year="2020"
deviceinfo_dtb="qcom/sm7150-xiaomi-surya"
deviceinfo_append_dtb="true"
deviceinfo_arch="aarch64"
deviceinfo_flash_kernel_on_update="true"
# Device related
deviceinfo_gpu_accelerated="true"
deviceinfo_chassis="handset"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="1080"
deviceinfo_screen_height="2400"
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="PMOS_NO_OUTPUT_REDIRECT"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_bootimg_mtk_mkimage="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_pagesize="4096"
deviceinfo_flash_offset_base="0x00000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00000000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_rootfs_image_sector_size="4096"
deviceinfo_super_partitions="/dev/sda15"

View file

@ -0,0 +1,74 @@
pkgname=firmware-xiaomi-surya
pkgver=1
pkgrel=0
pkgdesc="Firmware for Xiaomi POCO X3 NFC"
subpackages="
$pkgname-adsp
$pkgname-cdsp
$pkgname-ipa
$pkgname-modem
$pkgname-touchscreen
$pkgname-wlan
"
url="https://github.com/sm7150-mainline/firmware-xiaomi-surya"
arch="aarch64"
license="proprietary"
options="!check !strip !archcheck !tracedeps pmb:cross-native"
_commit="47ee12fa953d87d10f61f67b51addd8e26d17899"
source="$pkgname-$_commit.tar.gz::$url/archive/$_commit/$pkgname-$_commit.tar.gz"
builddir="$srcdir/$pkgname-$_commit"
package() {
# parent package is empty
mkdir -p "$pkgdir"
}
adsp() {
pkgdesc="Xiaomi POCO X3 NFC adsp firmware"
install -Dm644 "$builddir"/adsp* -t \
"$subpkgdir/lib/firmware/qcom/sm7150/surya"
}
cdsp() {
pkgdesc="Xiaomi POCO X3 NFC cdsp firmware"
install -Dm644 "$builddir"/cdsp* -t \
"$subpkgdir/lib/firmware/qcom/sm7150/surya"
}
ipa() {
pkgdesc="Xiaomi POCO X3 NFC ipa firmware"
install -Dm644 "$builddir"/ipa_fws.* -t \
"$subpkgdir/lib/firmware/qcom/sm7150/surya"
}
modem() {
pkgdesc="Xiaomi POCO X3 NFC modem firmware"
# cp because of the modem_pr directory
mkdir -p "$subpkgdir/lib/firmware/qcom/sm7150/surya"
cp -r "$builddir"/modem* \
"$subpkgdir/lib/firmware/qcom/sm7150/surya"
find "$subpkgdir/lib/firmware/qcom/sm7150/surya" \
-type f -exec chmod 0644 {} \;
}
touchscreen() {
pkgdesc="Xiaomi POCO X3 NFC touchscreen firmware"
install -Dm644 "$builddir"/novatek_ts_huaxing_fw.bin -t \
"$subpkgdir/lib/firmware"
}
wlan() {
pkgdesc="Xiaomi POCO X3 NFC wlan firmware"
install -Dm644 "$builddir"/wlanmdsp.mbn -t \
"$subpkgdir/lib/firmware/qcom/sm7150/surya"
}
sha512sums="
cb540920f977a519e696009c62dbc70c12587d0523c57b5e0fa44432e391dadbc8b08d269ef4ab06f420a892dc98fd42900b8745b683824b91b86b4b483526b0 firmware-xiaomi-surya-47ee12fa953d87d10f61f67b51addd8e26d17899.tar.gz
"