Xiaomi Mi 9T / Redmi K20 (xiaomi-davinci)

From postmarketOS
Xiaomi Mi 9T /
Redmi K20
Xiaomi Mi 9T / Redmi K20
Xiaomi Mi 9T / Redmi K20
Manufacturer Xiaomi
Name Mi 9T /
Redmi K20
Codename xiaomi-davinci
Model
  • Mi 9T: M1903F10G
  • Redmi K20: M1903F10A
  • Redmi K20 Chinese Carrier Version: M1903F10C
Released 2019
Category testing
Original software Android (MIUI)
Original version 9 (MIUI 10) (Linux kernel 4.14.83)
Extended version 11 (MIUI 12) (Linux kernel 4.14.180)
postmarketOS kernel Mainline 6.7.4
Hardware
Chipset Qualcomm Snapdragon 730 (SM7150-AA)
CPU Octa-core (2x 2.2 GHz Kryo 470 Gold & 6x 1.8 GHz Kryo 470 Silver)
GPU Adreno 618
Display 1080 x 2340 AMOLED
Storage 64/128/256 GB
Memory 6 GB
Architecture AArch64
Type handset
Unixbench Whet/Dhry score 5923.2
Features
USB Networking
Works
Flashing
Works
Touchscreen
Works
Display
Works
WiFi
Works
FDE
Works
Mainline
Works
Battery
Broken
3D Acceleration
Works
Audio
Partial
Bluetooth
Works
Camera
Broken
GPS
Mobile data
Works
Internal storage
Works
SMS
Works
Calls
Works
USB OTG
Broken
NFC
Works
Sensors
Accelerometer
Broken
Magnetometer
Broken
Ambient Light
Broken
Proximity
Broken
Misc
Camera Flash
Works
Haptics
Works
FOSS bootloader
Broken
This device is based on the Snapdragon 730.
See the SoC page for common tips, guides and troubleshooting steps

Maintainer(s)

Users owning this device

  • Adrian (Notes: Mostly mainlined except ADSP crashes)
  • ArianK16a (Notes: M1903F10G, 6/128, LineageOS 21)
  • MaryJohanna420 (Notes: backup/development device)


How to enter flash mode

  • Bootloader: Power on the device with both Power and Volume Down buttons.
  • Recovery: Power on the device with both Power and Volume Up buttons.
  • Fastbootd: Reboot into bootloader mode first and then run fastboot reboot fastboot from a computer.

Installation

  1. Make sure pmbootstrap is installed and your bootloader is unlocked
  2. Run through pmbootstrap init and select xiaomi as the vendor and davinci as the device.
  3. Generate the rootfs
    • For netbooting pmOS without flashing the phone, run pmbootstrap --extra-space 1000 install --no-sparse and pmbootstrap initfs hook_add netboot
    • If you want to flash pmOS to the phone, run pmbootstrap install
  4. Backup and erase the dtbo partition
    To boot Linux, you'll have to erase the dtbo partition. It is recommended to back it up first if you want to boot Android again
    1. Run dd if=/dev/block/by-name/dtbo of=/sdcard/dtbo.img from a rooted shell on your phone and pull it with adb pull /sdcard/dtbo.img to your computer.
    2. Boot into bootloader mode
    3. Erase the dtbo partition with fastboot erase dtbo
    To restore the partition flash it with fastboot flash dtbo dtbo.img
  5. Flash the rootfs
    • If you decided to go with netbooting, start the server with pmbootstrap netboot serve
    • If you want to install pmOS to the phones internal storage, run pmbootstrap flasher flash_rootfs --partition userdata (you can use --partition system if you want to keep the Android userdata and are fine with ~6GB of storage)
  6. Boot the kernel
    • To boot temporarily, without flashing run pmbootstrap flasher boot
    • To flash the kernel to the boot partition, run pmbootstrap flasher flash_kernel and reboot with fastboot reboot

After successfully following this guide, your phone should boot postmarketOS! If you have problems installing, feel free to ask in #sm7150-mainline:matrix.org

Mainline

A work in progress mainline kernel is being developed here.

See also