xiaomi-sagit: new device (Xiaomi Mi6) (MR 3134)

Device uses mainline kernel. What works:
- boots
- display
- touchscreen
- wifi

Also add firmware package

[ci:skip-build]: already built successfully in CI
This commit is contained in:
Dzmitry Sankouski 2022-05-14 11:11:43 +03:00 committed by Oliver Smith
parent db00e85baf
commit 341e959e45
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
8 changed files with 160 additions and 0 deletions

View file

@ -17,6 +17,7 @@ def test_aports_firmware(args):
excluded = [
"firmware-motorola-potter", # Depends on soc-qcom-msm8916-ucm
"firmware-oneplus-msm8998", # Depends on soc-qcom-sdm845-nonfree-firmware
"firmware-xiaomi-sagit", # Depends on soc-qcom-sdm845-nonfree-firmware
"firmware-samsung-baffinlite", # Depends on firmware-aosp-broadcom-wlan
"firmware-samsung-crespo", # Depends on firmware-aosp-broadcom-wlan
"firmware-samsung-maguro", # Depends on firmware-aosp-broadcom-wlan

View file

@ -0,0 +1,50 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-xiaomi-sagit
pkgdesc="Xiaomi Mi 6"
pkgver=1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
mkbootimg
postmarketos-base
postmarketos-update-kernel
linux-postmarketos-qcom-msm8998
soc-qcom-sdm845
"
makedepends="devicepkg-dev"
source="
deviceinfo
phoc.ini
"
subpackages="
$pkgname-nonfree-firmware:nonfree_firmware
$pkgname-phosh
"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
nonfree_firmware() {
pkgdesc="Firmware for GPU, Wi-Fi, Bluetooth etc. (mainline only, also needed for osk-sdl)"
depends="firmware-xiaomi-sagit"
mkdir "$subpkgdir"
}
phosh() {
install_if="$pkgname postmarketos-ui-phosh"
install -Dm644 "$srcdir"/phoc.ini \
"$subpkgdir"/etc/phosh/phoc.ini
}
sha512sums="
fba74ec902c86909221e28c02f712fc177199da747fe11a812f591720fcc046c0064de4e3cace500fc5022f09dda277ac75ce3b001523e75d28dd880f12b57db deviceinfo
2288f08a44aae5136c0c0c846501c2bd4bcb10f05454b40c6e4490d398385b8a7129216047b5eb7982ca6d62d3aa71f3e18bfb8661d0cd32c8a600685ca0da48 phoc.ini
"

View file

@ -0,0 +1,42 @@
# 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 Mi 6"
deviceinfo_manufacturer="Xiaomi"
deviceinfo_codename="xiaomi-sagit"
deviceinfo_year="2017"
deviceinfo_arch="aarch64"
# Device related
deviceinfo_gpu_accelerated="true"
deviceinfo_chassis="handset"
deviceinfo_keyboard="false"
deviceinfo_external_storage="false"
deviceinfo_screen_width="1080"
deviceinfo_screen_height="1920"
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="clk_ignore_unused console=tty1"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_offset_base="0x00000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_flash_pagesize="4096"
deviceinfo_flash_sparse="true"
# Kernel options
deviceinfo_dtb="qcom/msm8998-xiaomi-sagit"
deviceinfo_append_dtb="true"
deviceinfo_flash_kernel_on_update="true"
# Initramfs
deviceinfo_modules_initfs_mainline="panel-jdi-fhd-r63452 msm i2c-qup rmi_i2c qcom_spmi_fg qcom_spmi_haptics"
deviceinfo_mesa_driver="msm"
# Required for devices using UFS as storage (instead of e.g. eMMC)
deviceinfo_rootfs_image_sector_size="4096"

View file

@ -0,0 +1,5 @@
# /etc/phosh/phoc.ini
# Overwrites defaults in /usr/share/phosh/phoc.ini
[output:DSI-1]
scale = 2.5

View file

@ -0,0 +1,4 @@
/lib/firmware/qcom/a530_pfp.fw
/lib/firmware/qcom/a530_pm4.fw
/lib/firmware/qcom/a540_gpmu.fw2
/lib/firmware/qcom/msm8998/xiaomi/a540_zap.mbn

View file

@ -0,0 +1,42 @@
# Maintainer: Dzmitry Sankouski <dsankouski@gmail.com>
# Based on firmware-oneplus-msm8998 package
pkgname=firmware-xiaomi-sagit
pkgver=1
pkgrel=0
_commit="d7e0c59ed28700a8662c6a364d99740c26ebf58a"
pkgdesc="Firmware for Xiaomi Mi 6"
url="https://github.com/dsankouski/firmware-mainline-xiaomi-mi6.git"
replaces="linux-firmware-ath10k"
arch="aarch64"
depends="firmware-qcom-adreno-a530 linux-firmware-qca soc-qcom-msm8998-nonfree-firmware"
install="$pkgname.post-install"
license="proprietary"
options="!check !archcheck !strip !tracedeps"
source="
$pkgname-$_commit.tar.gz::https://github.com/dsankouski/firmware-mainline-xiaomi-mi6/archive/$_commit.tar.gz
30-gpu-firmware.files
firmware.files
"
subpackages="$pkgname-initramfs:firmware_initramfs"
builddir="$srcdir/firmware-mainline-xiaomi-mi6-$_commit"
package() {
while IFS="" read -r fw; do
install -Dm644 "$fw" "$pkgdir/lib/firmware/$fw"
done < "$srcdir"/firmware.files
}
firmware_initramfs() {
pkgdesc="Files to be included in the initramfs to support osk-sdl"
depends="$pkgname mesa-egl mesa-gbm"
install_if="$pkgname"
install -Dm644 "$srcdir"/30-gpu-firmware.files \
"$subpkgdir"/etc/postmarketos-mkinitfs/files/30-gpu-firmware.files
}
sha512sums="
a6576fd2d3849c139809d9cfe8987e16790f36443bb6f6c3427d883c6f9fc3ab5a5500d6d323a30b5d430bfa2aabcedb16ed9a99a6c609d07bce992ca52f1e64 firmware-xiaomi-sagit-d7e0c59ed28700a8662c6a364d99740c26ebf58a.tar.gz
ede0bdec767249ac2f252fb6da7ad8b0c7a44f73c4482211f105ca5e08686598051e09b467bcf0641793d3ea3bcc64386ab628dac87227dc48e6054cc7ca558f 30-gpu-firmware.files
55418aeb509328bed592c09a9798f3f5a6bd69c833ebf4f0f611d5afcaf1bf424c3be2016bf34638f55b5978c7e7fb50759b39db69bc887c7dce79efa7920707 firmware.files
"

View file

@ -0,0 +1,3 @@
#!/bin/sh
# The Wi-Fi firmware will keep crashing if diag-router isn't running
rc-update add diag-router boot

View file

@ -0,0 +1,13 @@
ath10k/WCN3990/hw1.0/board-2.bin
ath10k/WCN3990/hw1.0/firmware-5.bin
qcom/a540_gpmu.fw2
qcom/msm8998/xiaomi/a540_zap.mbn
qcom/msm8998/xiaomi/adsp.mbn
qcom/msm8998/xiaomi/adspua.jsn
qcom/msm8998/xiaomi/ipa_fws.mbn
qcom/msm8998/xiaomi/mba.mbn
qcom/msm8998/xiaomi/modem.mbn
qcom/msm8998/xiaomi/modemuw.jsn
qcom/msm8998/xiaomi/slpi_v2.mbn
qcom/msm8998/xiaomi/slpius.jsn
qcom/msm8998/xiaomi/wlanmdsp.mbn