Xiaomi MI A2 Lite (xiaomi-daisy)

From postmarketOS
Jump to navigation Jump to search
Xiaomi MI A2 Lite
Xiaomi-daisy Booting
Xiaomi-daisy Booting
Manufacturer Xiaomi
Name MI A2 Lite
Codename xiaomi-daisy
Released 2018
Category testing
Original software Android 8.1
postmarketOS kernel 5.13-rc6
Hardware
Chipset Qualcomm MSM8953 Snapdragon 625
CPU 2 GHz 8 Core Cortex-A53
GPU Adreno 506
Display 1080 x 2280 IPS
Storage 32 GB
Memory 3/4 GB
Architecture aarch64
Features
USB Networking
Works
Flashing
Works
Touchscreen
Works
Display
Works
WiFi
Partial
Xwayland
FDE
Partial
Mainline
Partial
Battery
Works
3D Acceleration
Partial
Accelerometer
Broken
Audio
Partial
Bluetooth
Partial
Camera
GPS
Mobile data
Works
SMS
Works
Calls
Works
USB OTG
NFC



Contributors

  • Ash
  • Alikates

Users owning this device

  • Alikates (Notes: Two devices, one with android and the other with pmOS)
  • Ash (Notes: Broken part of screen)


Installation

Fastboot Mode

First make sure to enable USB debugging in Android ([1]) Then with device powered off, hold the Volume Down and Power buttons simultaneously for a few seconds, until Fastboot Mode screen appears.

OEM Unlock

Get device into Fastboot Mode, plug in USB cable, then:

$ sudo fastboot oem unlock

When prompted on device, use Volume-Up/Down buttons to highlight choice, then Power button to select it. The Fastboot Mode screen will appear again, and a message saying that the device isn't secure will appear briefly.

Installation

First build the image:

$ pmbootstrap init
$ pmbootstrap install

Then in order to flash it put your device in fastboot mode, and plug it in USB. Then do:

$ pmbootstrap flasher flash_rootfs --partition userdata
$ sudo fastboot format system
$ pmbootstrap flasher flash_kernel

Mainline Kernel

To use it select mainline kernel when running pmbootstrap init

Device tree and panel driver support added on msm8953-mainline ([2]). Flashing lk2nd is needed. ([3]). A prebuilt image can be found here [4].

Flash it with fastboot flash boot lk2nd.img

Reboot device and hold vol. down button after the device unlock warning. Then the lk2nd interface should show up. From there, follow the normal installation steps.

Modem

Firmware loads and modem boots. It detects SIM card and can be unlocked and configured with qmicli. Need to test Ofono with patches for QRTR support.

Calls and SMS work on Phosh by using a modified device-xiaomi-daisy and ModemManager version 1.17.900. The changes for those packages can be found here.

Because audio needs more work i couldn't test audio quality on calls but with q6voiced it should work.

Mobile data

Mobile data works now. On kernel version >= 5.14 the following steps are not needed because the port data can be read from sysfs by ModemManger

Note This can crash the system and make it totally unresponsive,

The patches from pmaports!2496 merge request are needed.

To get mobile data working an interface must be enabled to send packets to the modem.

The parameters for it are found in the downstream kernel. They are IPA_CLIENT_APPS_LAN_WAN_PROD=4 and IPA_CLIENT_APPS_WAN_CONS=5.

To get it working:

  • Run: # qmicli -d qrtr://0 -p --dpm-open-port="hw-data-ep-type=embedded,hw-data-ep-iface-number=1,hw-data-rx-id=4,hw-data-tx-id=5"
  • Restart ModemManager: # killall ModemManager


To configure the mobile network settings, use NetworkManger (mobile network menu on phosh settings) so it sets up the network interface and IP routing.

After that, two new network interfaces should appear. The rmnet one is the connection to the modem, and the other one is virtual and the one that is used to transmit mobile data.

Wifi

Driver spams dmesg with wcn36xx: WARNING Bad TX complete indication and there are some crashes

GPU

Works fine but there may be a problem with the governor. It's a bit slow when waking up or when screen changes from idle to active graphics but a few seconds after it stabilizes.

Audio

Earpiece and headphones work almost with the default msm8916 UCM config fork. Speaker still not working.

Touchscreen

It works, but with the focaltech variant there seems to be a bug where the chip firmware is erased if not powered off properly and the touchscreen stops working.

Mainline driver lacks support for reflashing the firmware so it is needed to flash stock android to fix it.

FDE

FDE works fine, but the touchscreen does not work with the packaged kernel as the driver is enabled as a module.

Sensors

The sensors are managed by the DSP and configuration is made with QMI. Support must be added to libqmi.

Charger

Fuel gauge is working on msm8953-mainline. The charger on PMI8950 is really similar to PMI8994, a proper driver could be written to support both PMICs. Work will be uploaded here.

Images

Daisy-pcb-testpoints.png Daisy-phosh-about.png

See also