Xiaomi Mi A1 (xiaomi-tissot)

Xiaomi Mi A1 (xiaomi-tissot) is Xiaomi Mi 5X (xiaomi-tiffany), but with on board and  structure. On the Xiaomi Mi A1 (xiaomi-tissot), unlike the Xiaomi Mi 5X (xiaomi-tiffany), you do not need to link your Mi Account and wait 15 days (360 hours) to unlock the bootloader.

Contributors

 * JIaxyga
 * Jenneron

Installation

 * Follow the Installation guide


 * Use the  flag during   to get the lk2nd package.
 * Power off the device.
 * Start lk2nd Fastboot by powering on the device and, after it vibrates, holding

How to enter flash mode

 * Stock Fastboot: Power on the device with both and  buttons
 * lk2nd Fastboot: Power on the device. After it vibrates, hold


 * Recovery: Power on the device with both and  buttons

OEM unlock
First make sure to enable USB debugging and OEM unlock in Android. Then with device powered off, hold down and  buttons simultaneously for a few seconds, until Fastboot Mode screen appears. Plug in USB cable and do:

Wipes
Wipes work very strangely. Fastboot says that the wipes were successfully completed, but the partitions are not cleared. Therefore, the only way out is to make wipes from twrp or use formatting.

Dual booting
We can use the a/b markup feature for dual booting. In this case, we will have the kernel in the boot_a (or boot_b) section and the rootfs will be located in the same system_a (or system_b) slot. The opposite slot will use Android. The system partition severely limits the available space, so you can use an sd card for rootfs. To find out the active slot, run in fastboot: To switch a slot, run:

What works
Main: Other:
 * USB Networking
 * Flashing
 * Touchscreen - focaltech,ft5435 (edt-ft5x06)
 * Display - EBBG ili7807(ilitek) / tianma otm1911(focal) / EBBG ft8716(focal)
 * WiFi - WCN3680B (WCN36XX)
 * Xwayland
 * FDE
 * Bluetooth - WCN3680B (WCN36XX)
 * Hall Effect Sensor - BU52061NVX (gpio-keys)
 * Charger - qcom,smbcharger Works from here
 * Accelerometer - bosch,bmi120 (bosch,bmi160) Works from here
 * Magnetometer - AKM, AK09918 (asahi-kasei,ak8975)
 * Notification LED - awinic,aw2013

What works partially
Main:
 * Battery - qcom,fg
 * Audio - maxim,max98927 Everything except the speaker works

What does not work
Main: Other:
 * Proximity Sensor - LiteOn, LTR579 (liteon,ltr501?)
 * Ambient Light Sensor - LiteOn, LTR579 (liteon,ltr501?)
 * Camera - Front Cam: samsung_s5k5e8 Back Cam: ov_12a10 Back Sub Cam: ov_13880
 * OTG - Requires a couple of changes to dts and charger driver
 * GPS
 * Mobile data - Works with ipa patches. So far, not in the branch
 * SMS - Works with ipa patches. So far, not in the branch
 * Calls
 * Ir TX
 * TrustZone
 * Flashlight - qcom,spmi-flash Works from here
 * Keypad backlights
 * Haptics
 * Fingerprint - fpc,fpc1020 / goodix,gf3208

Downstream
There is an alternative device port using the downstream kernel,. It can be selected by entering the name in.

Serial debugging (UART)
See also: Serial debugging