Jump to content

Xiaomi Mi A2 Lite (xiaomi-daisy): Difference between revisions

From postmarketOS Wiki
Bczeman (talk | contribs)
mNo edit summary
Donihalim (talk | contribs)
mNo edit summary
 
(46 intermediate revisions by 8 users not shown)
Line 6: Line 6:
| imagecaption = Xiaomi-daisy Booting  
| imagecaption = Xiaomi-daisy Booting  
| releaseyear = 2018
| releaseyear = 2018
| originalsoftware = Android 8.1
| originalsoftware = Android (MIUI)
| pmoskernel = 6.1.0
| originalversion = 8.1
| pmoskernel = 6.12.0
| chipset = Qualcomm Snapdragon 625 (MSM8953)
| chipset = Qualcomm Snapdragon 625 (MSM8953)
| cpu = 2 GHz 8 Core Cortex-A53  
| cpu = 2 GHz 8 Core Cortex-A53  
| category = community
| gpu = Adreno 506
| gpu = Adreno 506
| storage = 32 GB
| storage = 32/64 GB
| display = 1080 x 2280 IPS
| display = 1080 x 2280 IPS
| memory = 3/4 GB
| memory = 3/4 GB
| architecture = aarch64
| architecture = aarch64
| type = Handset
<!-- the following status_* questions should be answered with Y - yes, P - partial, N - no, or left blank (for untested or unknown) -->
<!-- the following status_* questions should be answered with Y - yes, P - partial, N - no, or left blank (for untested or unknown) -->
| status_usbnet = Y
| status_usbnet = Y
Line 27: Line 30:
| status_3d = Y
| status_3d = Y
| status_accel = Y
| status_accel = Y
| status_audio = P
| status_audio = Y
| status_bluetooth = P
| status_bluetooth = Y
| status_camera = N
| status_camera = P
| status_gps = N
| status_gps = P
| status_mobiledata = N
| status_mobiledata = P
| status_sms = N
| status_sms = Y
| status_calls = N
| status_emmc = Y
| status =  
| status_sdcard = Y
| status_calls = P
| status_nfc=-
| booting = Yes
| booting = Yes
| status_otg = Y
| whet_dhry = 4173.5


<!-- you can also use these lines if you need to:
<!-- you can also use these lines if you need to:
see Unixbench page on wiki
see Unixbench page on wiki
| whet_dhry = 0.0
Is OTG available, not used in wiki
Is OTG available, not used in wiki
| status_otg = -
-->
-->
}}
}}
Line 57: Line 62:
=== Fastboot Mode ===
=== Fastboot Mode ===


First make sure to enable USB debugging in Android ([https://technowikis.com/4732/how-to-activate-debug-mode-xiaomi-mi-a2-lite])
First make sure to enable USB debugging in Android ([https://technowikis.com/4732/how-to-activate-debug-mode-xiaomi-mi-a2-lite]).
Then with device powered off, hold the {{button|Volume Down}} and {{button|Power}} buttons simultaneously for a few seconds, until Fastboot Mode screen appears.
Then with device powered off, hold the {{button|Volume Down}} and {{button|Power}} buttons simultaneously for a few seconds, until Fastboot Mode screen appears.


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


<source lang="shell-session">
<syntaxhighlight lang="shell-session">
$ sudo fastboot oem unlock
$ sudo fastboot oem unlock
</source>
</syntaxhighlight>


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.
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.
Line 73: Line 78:


==== Build the image ====
==== Build the image ====
<source lang="shell-session">
<syntaxhighlight lang="shell-session">
$ pmbootstrap init
$ pmbootstrap init # choose Vendor: qcom Device codename: msm8953
$ pmbootstrap install
$ pmbootstrap install
</source>
</syntaxhighlight>


==== Mi A2 Lite (xiaomi-daisy) ====
==== Install the image ====
In order to use the daisy, installing lk2nd is needed. The package <code>lk2nd-msm8953</code> provides a prebuilt version ready to flash to the device.
<syntaxhighlight lang="shell-session">
 
To use it, add it in the init step or instead of running <code>pmbootstrap install</code>, add the package like this: <code>pmbootstrap install --add lk2nd-msm8953</code>
 
Then put the device in fastboot mode and run:
<source lang="shell-session">
$ pmbootstrap flasher flash_lk2nd
$ pmbootstrap flasher flash_lk2nd
</source>
$ pmbootstrap flasher flash_rootfs
Then reboot the device and press the {{button|Volume Down}} just after the Android logo shows up and hold until the device vibrates and shows <code>START</code> in green at the top left corner of the screen.
</syntaxhighlight>
 
==== Redmi 6 Pro (Sakura) ====


In order to use the daisy, installing lk2nd is needed. There is no prebuilt lk2nd version for sakura you need to build yourself.
==== Install to xiaomi-sakura ====
Redmi 6 Pro has rollback protection for lk2nd installation first you need
xiaomi-sakura has rollback protection, some manually steps are needed.
<source lang="shell-session">
<syntaxhighlight lang="shell-session">
$ fastboot boot lk2nd.img
$ fastboot boot lk2nd.img
</source>
then
<source lang="shell-session">
$ fastboot flash lk2nd lk2nd.img
$ fastboot flash lk2nd lk2nd.img
</source>
$ pmbootstrap flasher flash_rootfs
 
</syntaxhighlight>
==== Install the image ====
To proceed with the installation to internal storage of pmOS, plug the device to the computer with an USB cable and run:
<source lang="shell-session">
$ pmbootstrap flasher flash_rootfs --partition userdata
$ sudo fastboot format system
</source>
{{Note|
{{Note|
If you want to install pmOS to an SD card instead of internal storage, you need to add <code>--sdcard <device path></code> at the end of the install command.<br>
If you want to install pmOS to an SD card instead of internal storage, you need to add <code>--sdcard <device path></code> at the end of the install command.<br>
I.e. (using lk2nd): <code>pmbootstrap install --add msm8953-lkn2d --sdcard /dev/<your_sdcard></code>
I.e.: <code>pmbootstrap install --sdcard /dev/<your_sdcard></code>. You can use <code>lsblk</code> to find your sdcard.
}}
}}


== Mainline Kernel ==
== Mainline Kernel ==
To use it select mainline kernel when running <code>pmbootstrap init</code>
Flashing lk2nd is needed. ([https://github.com/msm8953-mainline/lk2nd]).
=== Feature table ===
=== Feature table ===


Line 127: Line 112:
| scope="row"| Modem
| scope="row"| Modem
| class="feature feature-partial" | Partial
| class="feature feature-partial" | Partial
| Should work with WIP IPA patches, not in msm8953-mainline master branch
| It works with ipa-lite since 6.7.0.
|-
|-
| scope="row"| WiFi
| scope="row"| WiFi
Line 135: Line 120:
| scope="row"| Sensors
| scope="row"| Sensors
| class="feature feature-partial" | Partial
| class="feature feature-partial" | Partial
| Working with i2c-gpio from [https://github.com/alikates/linux/commit/d497e6461a09d4cc0d260c8defbc3edd701ece5c here], still missing a proper SSC driver
| Working with i2c-gpio from [https://github.com/alikates/linux/commit/d497e6461a09d4cc0d260c8defbc3edd701ece5c here]. WIP SSC driver [https://github.com/msm8953-mainline/linux/tree/alikates/6.4.7/sensors here].
|-
|-
| scope="row"| GPU
| scope="row"| GPU
Line 142: Line 127:
|-
|-
| scope="row"| Audio
| scope="row"| Audio
| class="feature feature-partial" | Partial
| class="feature feature-yes" | Works
| Works with minimal changes to motorola-ocean UCM config. Still not packaged. Speaker does not work
| Everything works. Speaker works since version 6.4.7. Needs alsa UCM config from [https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/4268 this package].
|-
|-
| scope="row"| Touchscreen
| scope="row"| Touchscreen
| class="feature feature-partial" | Partial
| class="feature feature-yes" | Works
| Only Focaltech models supported. Models with Goodix GT917D chip [https://github.com/msm8953-mainline/linux/issues/33 not working yet].
| Both touchscreen variant are supported.
|-
|-
| scope="row"| Charger
| scope="row"| Charger
| class="feature feature-yes" | Works
| class="feature feature-yes" | Works
| Driver added in 6.1
| Driver added in 6.1
|
|-
|-
| scope="row"| Panel
| scope="row"| Panel
| class="feature feature-partial" | Partial
| class="feature feature-yes" | Partial
| Only supported hx8933 and ili8707 models
| Only supported hx8933, ili8707 and otm1911 models (not sure if there are any other panels)
|-
| scope="row"| GPS
| class="feature feature-yes" | Partial
| Driver added in 6.8.2
|-
| scope="row"| Camera
| class="feature feature-yes" | Partial
| ov5675 front camera was enabled in 6.7.2 and in megapixels 1.8.2.
There are variants with different i2c address 0x10.
|}
|}


Line 167: Line 160:
==== Mobile data ====
==== Mobile data ====


{{Note| Mobile data is not working in kernel version 5.15 and later. There's an ongoing effort to upstream the driver needed for mobile data to work. A testing branch can be found [https://github.com/msm8953-mainline/linux/tree/ipa-v2-5.15 here].
Mobile data works since 6.7.0.
}}
 
<del>Mobile data works now.</del>


To configure the mobile network settings, use NetworkManger (mobile network menu on phosh settings) so it sets up the network interface and IP routing.
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.
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 [https://github.com/msm8916-mainline/lk2nd msm8916-mainline/lk2nd].
==== Edit touchscreen-compatible ====
Next, edit the following parts of the DTS file corresponding to your device.
{| class="wikitable"
|-
| '''sakura''' || [https://github.com/msm8916-mainline/lk2nd/blob/main/lk2nd/device/dts/msm8953/msm8953-xiaomi-common.dts#L48-L59 lk2nd/device/dts/msm8953/msm8953-xiaomi-common.dts#L48-L59]
|-
| '''daisy''' || [https://github.com/msm8916-mainline/lk2nd/blob/main/lk2nd/device/dts/msm8953/msm8953-xiaomi-daisy.dts#L23-L34 lk2nd/device/dts/msm8953/msm8953-xiaomi-daisy.dts#L23-L34]
|}
Play with the displays' <code>touchscreen-compatible</code> value. This value should be either of:
* <code>"goodix,gt917d"</code>
* <code>"edt,edt-ft5406"</code>
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:
<syntaxhighlight lang="shell-session">
$ make TOOLCHAIN_PREFIX=arm-none-eabi- lk2nd-msm8953
</syntaxhighlight>
See [https://github.com/msm8916-mainline/lk2nd/blob/main/README.md#building msm8916-mainline/lk2nd/README.md#building] for more details on the building process.
The resulting image will be in the <code>build-lk2nd-msm8953</code> folder as <code>lk2nd.img</code>.
==== Flash lk2nd ====
To flash <code>lk2nd.img</code>, run the following commands:
<syntaxhighlight lang="shell-session">
$ fastboot boot lk2nd.img
$ fastboot flash lk2nd lk2nd.img
</syntaxhighlight>
Finally, you can run:
<syntaxhighlight lang="shell-session">
$ pmbootstrap flasher flash_rootfs
</syntaxhighlight>
And reboot your device.
==== Goodix touch display calibration ====
Install {{pmaport|device-xiaomi-daisy-fake-goodix}} if your replacement display with goodix touch controller is not calibrated well.


== Images ==
== Images ==
Line 185: Line 238:
* {{MR|1687|pmaports}} Initial merge request
* {{MR|1687|pmaports}} Initial merge request
* {{MR|2225|pmaports}} Mainline merge request
* {{MR|2225|pmaports}} Mainline merge request
* {{Device package|xiaomi-daisy}}
* {{Device package|qcom-msm8953|community}}
* {{Kernel package|postmarketos-qcom-msm8953}}
* {{Kernel package|postmarketos-qcom-msm8953|community}}
* {{Firmware package|qcom-msm8953|community}}
* [https://github.com/msm8953-mainline/linux Mainline kernel]
* [https://github.com/msm8953-mainline/linux Mainline kernel]
* [https://github.com/msm8953-mainline/lk2nd lk2nd]
* [https://github.com/msm8916-mainline/lk2nd lk2nd]
* [https://github.com/alikates/linux/tree/smbcharger Charger driver fork]
* [https://github.com/alikates/linux/tree/smbcharger Charger driver fork]

Latest revision as of 06:08, 29 March 2025

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.12.0
Unixbench Whet/Dhry score 4173.5
Features
Flashing
Works
USB Networking
Works
Internal storage
Works
SD card
Works
Battery
Works
Screen
Works
Touchscreen
Works
Multimedia
3D Acceleration
Works
Audio
Works
Camera
Partial
Camera Flash
No data
Connectivity
WiFi
Works
Bluetooth
Works
GPS
Partial
Modem
Calls
Partial
SMS
Works
Mobile data
Partial
Miscellaneous
FDE
Works
USB OTG
Works
HDMI/DP
No data
Sensors
Accelerometer
Works
Magnetometer
No data
Ambient Light
No data
Proximity
No data
Hall Effect
No data
Haptics
No data
Barometer
No data


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.: pmbootstrap install --sdcard /dev/<your_sdcard>. You can use lsblk to find your sdcard.

Mainline Kernel

Feature table

Parts Status Notes
Modem Partial It works with ipa-lite since 6.7.0.
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 since 6.7.0.

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

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

See also