Xiaomi Mi A2 Lite (xiaomi-daisy)

From postmarketOS Wiki
Xiaomi Mi A2 Lite
Xiaomi-daisy Booting
Xiaomi-daisy Booting
Manufacturer Xiaomi
Name Mi A2 Lite
Codename xiaomi-daisy
Released 2018
Type handset
Hardware
Chipset Qualcomm Snapdragon 625 (MSM8953)
CPU 2 GHz 8 Core Cortex-A53
GPU Adreno 506
Display 1080 x 2280 IPS
Storage 32/64 GB
Memory 3/4 GB
Architecture aarch64
Software
Original software Android (MIUI)
Original version 8.1
postmarketOS
Category community
Pre-built images yes
postmarketOS kernel 6.8.2
Features
Flashing
Works
USB Networking
Works
Internal storage
Works
SD card
Battery
Works
Screen
Works
Touchscreen
Works
Multimedia
3D Acceleration
Works
Audio
Works
Camera
Partial
Camera Flash
Connectivity
WiFi
Works
Bluetooth
Works
GPS
Partial
Modem
Calls
Partial
SMS
Works
Mobile data
Partial
Miscellaneous
FDE
Works
USB OTG
Works
HDMI/DP
Sensors
Accelerometer
Works
Magnetometer
Ambient Light
Proximity
Hall Effect
Haptics
Barometer


This device is also known as Xiaomi Redmi 6 Pro (sakura). The only difference is that sakura has MIUI preinstalled instead of stock Android One.

Contributors

  • Ash
  • Alikates

Users owning this device


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

Build the image

$ pmbootstrap init # choose Vendor: qcom Device codename: msm8953
$ pmbootstrap install

Install the image

$ pmbootstrap flasher flash_lk2nd
$ pmbootstrap flasher flash_rootfs

Install to xiaomi-sakura

xiaomi-sakura has rollback protection, some manually steps are needed.

$ fastboot boot lk2nd.img
$ fastboot flash lk2nd lk2nd.img
$ pmbootstrap flasher flash_rootfs
Note If you want to install pmOS to an SD card instead of internal storage, you need to add --sdcard <device path> at the end of the install command.
I.e. (using lk2nd): pmbootstrap install --add msm8953-lkn2d --sdcard /dev/<your_sdcard>

Mainline Kernel

To use it select mainline kernel when running pmbootstrap init

Flashing lk2nd is needed. ([2]).

Feature table

Parts Status Notes
Modem Partial It works with ipa-lite on 6.7.0/main branch.
WiFi Works
Sensors Partial Working with i2c-gpio from here. WIP SSC driver here.
GPU Works
Audio Works Everything works. Speaker works since version 6.4.7. Needs alsa UCM config from this package.
Touchscreen Works Both touchscreen variant are supported.
Charger Works Driver added in 6.1
Panel Partial Only supported hx8933, ili8707 and otm1911 models (not sure if there are any other panels)
GPS Partial Driver added in 6.8.2
Camera Partial ov5675 front camera was enabled in 6.7.2 and in megapixels 1.8.2.

There are variants with different i2c address 0x10.

Modem

Firmware loads and modem boots. It detects SIM card and can be unlocked and configured with qmicli.

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

Mobile data

Mobile data works with ipa-lite on 6.7.0/main branch.

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.

GPS

Qualcomm_Snapdragon_450/625/626/632_(MSM8953)#GPS

Touchscreen

Both goodix and edt touchscreens are supported.

However, touchscreen selection is binded to the display panel, and sometimes the same panel comes with a different touchscreen. As a result, you might need to manually override it in lk2nd.

To do so, you will need to edit and compile lk2nd yourself. First, clone msm8916-mainline/lk2nd.

Edit touchscreen-compatible

Next, edit the following parts of the DTS file corresponding to your device.

sakura lk2nd/device/dts/msm8953/msm8953-xiaomi-common.dts#L48-L59
daisy lk2nd/device/dts/msm8953/msm8953-xiaomi-daisy.dts#L23-L34

Play with the displays' touchscreen-compatible value. This value should be either of:

  • "goodix,gt917d"
  • "edt,edt-ft5406"

For example, if your touchscreen does not work, change every goodix to edt and vice-versa.

Build lk2nd

After that, you need to build the lk2nd image. Run the following command from the repository's root directory:

$ make TOOLCHAIN_PREFIX=arm-none-eabi- lk2nd-msm8953

See msm8916-mainline/lk2nd/README.md#building for more details on the building process.

The resulting image will be in the build-lk2nd-msm8953 folder as lk2nd.img.

Flash lk2nd

To flash lk2nd.img, run the following commands:

$ fastboot boot lk2nd.img
$ fastboot flash lk2nd lk2nd.img

Finally, you can run:

$ pmbootstrap flasher flash_rootfs

And reboot your device.

Goodix touch display calibration

Install device-xiaomi-daisy-fake-goodixPMOS if your replacement display with goodix touch controller is not calibrated well.

Images

Daisy-pcb-testpoints.png

Note 1: Tx, 2: GND, 3: EDL test-points

Daisy-phosh-about.png

See also