Jump to content

Xiaomi Mi 10T 5G (xiaomi-apollo)

From postmarketOS Wiki
Xiaomi Mi 10T 5G
[[
|200px|alt=Xiaomi Mi 10T 5G running postmarketOS]]
Xiaomi Mi 10T 5G running postmarketOS
Manufacturer Xiaomi
Name Mi 10T 5G
Codename xiaomi-apollo
Released 2020
Type handset
Hardware
Chipset Qualcomm Snapdragon 865 5G (SM8250)
CPU Octa-core (1x 2.84 GHz Kryo 585
3x 2.42 GHz Kryo 585
4x 1.80 GHz Kryo 585)
GPU Adreno 650
Display 1080x2400 LCD
Storage 128/256 GB
Memory 6/8 GB
Architecture aarch64
Software
Original software
The software and version the device was shipped with.
Android 10
Extended version
The most recent supported version from the manufacturer.
Android 12 (MIUI 14)
FOSS bootloader no
postmarketOS
Mainline
Instead of a Linux kernel fork, it is possible to run (Close to) Mainline.
no
pmOS kernel
The kernel version that runs on the device's port.
7.1.0
Features
Flashing
Whether it is possible to flash the device with pmbootstrap flasher.
Works
USB Networking
After connecting the device with USB to your PC, you can connect to it via telnet (initramfs) or SSH (booted system).
Works
Battery
Whether charging and battery level reporting work.
Works
Screen
Whether the display works; ideally with sleep mode and brightness control.
Works
Touchscreen
Works
Multimedia
3D Acceleration
Works
Audio
Audio playback, microphone, headset and buttons.
Works
Camera
Broken
Camera Flash
Broken
IR TX
Untested
IR RX
Untested
Connectivity
WiFi
Works
Bluetooth
Works
GPS
Broken
NFC
Near Field Communication
Untested
Modem
Calls
Works
SMS
Works
Mobile data
Works
Miscellaneous
FDE
Full disk encryption and unlocking with unl0kr.
Untested
USB OTG
USB On-The-Go or USB-C Role switching.
Works
HDMI/DP
Video and audio output with HDMI or DisplayPort.
Untested
Sensors
Accelerometer
Handles automatic screen rotation in many interfaces.
Works
Magnetometer
Sensor to measure the Earth's magnetism
Untested
Ambient Light
Measures the light level; used for automatic screen dimming in many interfaces.
Untested
Proximity
Untested
Hall Effect
Measures magnetic fields; usually used as a flip cover sensor
Untested
Haptics
Untested
Barometer
Sensor to measure air pressure
Untested
Power Sensor
Sensor to monitor current, voltage and power. Not fuel gauge!
Untested

Contributors

Users owning this device

  • Adam (Notes: got basic mainline booting here but burned out a little)
  • PiotrZPL (Notes: Ported SuperiorOS, AwakenOS and DerpFest Android 14 ROMs, but struggle to boot postmarketOS.)

How to enter flash mode

Power off, then hold Volume Down+Power until the fastboot screen appears.

Installation

The device package, the kernel and the supporting packages are not upstream yet. pmbootstrap manages its own pmaports checkout, so point it at the fork:

# 1. Clone the fork and point pmbootstrap at it
git clone https://gitlab.postmarketos.org/royka1/pmaports.git ~/pmaports-apollo

# 2. git -C ~/pmaports-apollo remote add upstream \
    https://gitlab.postmarketos.org/postmarketOS/pmaports.git
git -C ~/pmaports-apollo fetch upstream

# 3. Run init:
pmbootstrap init
Choose pmaports path: ~/pmaports-apollo
choose Vendor: xiaomi, Device: apollo

# 4. Build and flash
pmbootstrap install
pmbootstrap flasher flash_kernel
pmbootstrap flasher flash_rootfs

Erase the dtbo partition once, before the first boot:

fastboot erase dtbo

To go back to stock pmaports:

pmbootstrap config aports ~/.local/var/pmbootstrap/cache_git/pmaports

Repositories

After installing

Pin the locally built packages so apk upgrade cannot replace them:

apollo-pin-packages

This matters. The custom kernel shares its package name with the one in the repositories, and when the repository version wins, apk removes /lib/modules/<ver>/ while boot-deploy fails (the repository package has no apollo DTB) — so the phone boots the old image with an empty module tree and WiFi, audio and the modem all stop at once. ModemManager is pinned for the same reason: it carries two out-of-tree patches needed for mobile data.

Current status

The device boots mainline and is usable as a phone. Display, touchscreen, audio, Wi-Fi, Bluetooth and cellular (LTE/5G, mobile data and SMS) all work.

The device and kernel packages are not in pmaports yet — they live in the forks linked under #Installation.

What works

  • Display and touchscreen
  • Audio: speaker, earpiece, microphones and headset
  • WiFi and Bluetooth (QCA6390)
  • All four remote processors: modem (SDX55), ADSP, CDSP, SLPI
  • Cellular: registers on LTE/5G, mobile data and SMS
  • Accelerometer (automatic screen rotation)
  • GPU (Adreno 650), hardware accelerated

What does not work

  • GPS: the modem's LOC service never answers. Its QMI requests time out, and because ModemManager drops a modem after 10 consecutive port timeouts, this can make the modem disappear entirely on some boots.
  • Camera
  • Fingerprint reader

The SDX55 modem

Unlike most SM8250 phones, the Mi 10T has no on-die modem. The SD865 ships without an MPSS; cellular comes from a separate Qualcomm SDX55 attached over PCIe and driven with MHI. That changes what userspace has to provide.

Three things are required, all handled by the packages below:

  1. A TFTP/RFS server on QRTR: The modem reads its configuration from the AP over QRTR (service 4096). Upstream tqftpserv publishes instance 1, but a PCIe-attached SDX55 looks up instance 3, so it never resolves and every read times out. It also needs a send-retry fix: at the modem's negotiated 7680x10 window, the QRTR socket buffer runs out and blocks are silently dropped, after which the modem ERRFATALs.
  2. The Peripheral Manager and ESOC helpers provided by Android (pm_service_native, mdm_helper_native).
  3. The device's own modem NV. (see below)

Put the SIM in physical slot 1

With the SIM in slot 2, nothing addresses the card by default: the modem does not create a provisioning session, and both qmicli and ModemManager target card-slot-1. The result is Application state: 'detected' forever and ModemManager reporting sim-missing. A PIN verify against the wrong session fails with QMI error Internal without consuming a retry, which is a useful tell.

--uim-switch-slot does not help: it works at runtime but does not survive a reboot, because the modem's EFS is re-seeded from static images on every boot.

Modem NV (EFS)

The modem needs efs1/2/3.bin, which hold the IMEI, the RF calibration and the subscriber state. They are unique to each handset, so they are not shipped in any package and must never be published.

apollo-modem-support installs apollo-efs-extract, which copies them out of the phone's own mdm1m9kefs1/2/3 partitions on first boot. The modem reads NV very early, so cellular starts working on the second boot after a fresh install. Without them, the SDX55 boots and then ERRFATALs about 15s into mission mode.

Serial UART

UART pin location (right of the display connector, below the shielding, left of the antenna connectors)

There are two pads in the bottom right corner of the phone's mainboard which might be the serial UART port of the device. The left pad is pulled high to 1.8V, whereas the right pad always stays at 0V (relative to the shielding) which might indicate the left pad being the phones TX and the right pad being the phones RX pads. If these assumptions are correct, the TX pad must be connected to the RX pin of a 1.8V compatible serial adapter, e.g. for debugging mainline builds or other startup-related problems.

See also