Xiaomi Mi Note 2 (xiaomi-scorpio)

From postmarketOS Wiki
(Redirected from Xiaomi-scorpio)
Xiaomi Mi Note 2
Xiaomi Mi Note 2 running Phosh
Xiaomi Mi Note 2 running Phosh
Manufacturer Xiaomi
Name Mi Note 2
Codename xiaomi-scorpio
Released 2016
Type handset
Hardware
Chipset Qualcomm Snapdragon 821 (MSM8996Pro)
CPU 2x 2.34 GHz Kryo & 2x 2.19 GHz Kryo
GPU Adreno 530
Display 1080x1920 OLED
Storage UFS 2.0 64/128GB
Memory 4/6 GB
Architecture aarch64
Software
Original software Android (MIUI)
Original version 6.0 (MIUI 8.2)
Extended version 8.0
postmarketOS
Category community
Pre-built images yes
Unixbench Whet/Dhry score 2636.3
Features
Flashing
Works
USB Networking
Works
Internal storage
SD card
Battery
Partial
Screen
Works
Touchscreen
Works
Multimedia
3D Acceleration
Works
Audio
Partial
Camera
Partial
Camera Flash
Broken
IR TX
Works
Connectivity
WiFi
Works
Bluetooth
Works
GPS
Broken
NFC
Works
Modem
Calls
Broken
SMS
Partial
Mobile data
Broken
Miscellaneous
FDE
Partial
USB OTG
Works
Sensors
Accelerometer
Broken
Magnetometer
Broken
Ambient Light
Broken
Proximity
Broken
Hall Effect
Broken
Haptics
Works
Barometer
Broken
This device is based on the Snapdragon 821.
See the SoC page for common tips, guides and troubleshooting steps

Contributors

  • Tooniis

Maintainer(s)

  • Tooniis

Users owning this device

  • Pairman (Notes: 4+64GB, postmarketOS)
  • Tooniis (Notes: 64GB Storage, 4GB Memory)


How to enter flash mode

Hold Power + Volume Down while the phone is turned off. This will make the phone boot into fastboot mode

Installation

You will need to unlock the bootloader in order to be able to flash anything onto the phone.

Installing TWRP before doing anything else is recommended, as it makes dealing with the phone easier later on, and allows for quick restoration by taking backups of /system and /boot, then flashing them back in order to restore the device to its original state. Note that this method has only been tested with LineageOS, and running its installation ZIP in TWRP after restoring the backup was necessary to get it to boot, otherwise it would just keep loading forever.

Note NOTE: Flashing to the system and boot partitions will wipe the Android core but will leave all apps and user files. If you want to be able to easily restore Android, it is recommended to backup both partitions using the method above.
Icon WARNING: Flashing to the data partition will erase all user data! Make sure all important files are backed up before flashing.

Pre-built Images

Follow the installation article to download image files.

Note Replace <image> with the name of your image where necessary.

Once downloaded, decompress the images with xz:

$ xz -d <image>-xiaomi-scorpio.img.xz
$ xz -d <image>-xiaomi-scorpio-boot.img.xz

Once decompressed, you may flash the main image to either:

  • /system: ~3.2 GB. Will allow you to keep the main part of your existing Android installation as well as your data.
$ fastboot flash system <image>-xiaomi-scorpio.img
  • /userdata: Extends close to the remaining size of your storage. Will wipe your Android installation along with your data.
$ fastboot flash userdata <image>-xiaomi-scorpio.img

Then you may either flash the boot image:

$ fastboot flash boot <image>-xiaomi-scorpio-boot.img

or boot it directly without flashing:

$ fastboot boot <image>-xiaomi-scorpio-boot.img

Manual Build

To build your own image, follow the pmbootstrap article.

Once you reach the flashing step:

  • Flash the rootfs:
$ pmbootstrap flasher flash_rootfs
Note NOTE: If you need more space in the rootfs, you can also flash to the data partition by appending --partition data to this command. More information about the partitions can be found in the prebuilt images section above.
  • Flash the kernel and initramfs to the boot partition:
$ pmbootstrap flasher flash_kernel

You can also avoid flashing them and instead, boot the kernel directly:

$ pmbootstrap flasher boot

Mainline

MSM8996 common mainline kernel fork

Feature Components Status
USB TI TUSB320L (extcon)

PMI8996 SMBCharger (OTG supply)

Y SMBCharger OTG VBUS driver not upstream.
UFS Samsung KLUCG4J1CB-B0B1 (64GB variant) Y
Display MDSS1,2

LG Display SW43101

Y Panel driver not upstream yet.
GPU Adreno 5301 Y
WiFi QCA6174a Y
Bluetooth Y
Modem MSS1 P Sending and receiving SMS works.

Mobile data will require a driver for IPA.

Calls have not been tested, and while it might be technically possible to make and receive calls, it will not be of much use since modem audio routing hasn't been managed yet.

GNSS N requires PDS support in gpsd
NFC NXP PN548 Y
IR Transmitter PM8994 LPG2 Y
Audio Codec WCD9335 (Headphones, earpiece, microphones)

TAS2555 (Speaker)

P Speaker codec will require a driver.
Video Codec Venus1 Y Tested with gst-launch-1.0 videotestsrc ! videoconvert ! v4l2vp8enc ! queue ! v4l2vp8dec ! xvimagesink
Battery PMI8996 SMBCharger/Fuel gauge2

SMB13512

P Fuel gauge works. Charger can reach its maximum current at 5V. Faster charging (9V) will require extra handling in the PMI8996 SMBCharger driver, and for better efficiency (and possibly even faster charging) a new driver for SMB1351.
Rear Camera Sensor: Sony IMX318

Lens Actuator: Asahi Kasei Microelectronics AK7375

P Sensor has a basic driver with support for 3 modes and analogue gain control.
Front Camera Sensor: Sony IMX268 N Needs a driver.
Sensors SLPI/SSC1,2

Gyroscope/Accelerometer: LSM6DSM

Magnetometer: AK09915

Pressure: BMP280

Proximity + Light: CM36686

N Work in progress SSC driver.
Touchscreen Atmel MaxTouch Y
Touchkeys Cypress StreetFighter Y
Fingerprint Reader FPC1020 N Work in progress fingerprint subsystem and driver.

Currently not supported by libfprint due to its small resolution of 192x56. The new sigfm algorithm implementation may change this, however.

Buttons TLMM1,2/PM8996 GPIO2 (Home, Volume Up)

PM8994 PON/RESIN2 (Power, Volume Down)

Y
Haptics PMI8996 Haptics2 Y Driver not upstream yet.
LEDs PM8994 LPG2 (Keypad backlights)

PMI8996 LPG/Flash2 (Status light, Flash)

P Will require a driver for flash.

1: Internal component

2: Driver of component

Known issues:

  • The display comes up blue after initialization sometimes. Rebooting makes it work usually. This issue has not appeared since MSM DRM was set to be compiled as a module. Should be completely resolved with the addition of an interconnect driver.
  • System locks up when accessing memory intensively. This might be caused by writing to a protected area of memory. Adding this reserved memory region fixed it.
  • System crashes when modem and ADSP get powered up at the same time. Fixed temporarily through pmaports!2283.
  • USB VBUS turns off instantly when a USB device is plugged into an already plugged in OTG adapter. For now the OTG adapter must be plugged into the phone with the USB device plugged into it already. Fixed.
  • WiFi range is bad. This is due to lack of board firmware. Supplying board firmware made from the vendor firmware for the downstream QCA_CLD driver makes it lose all APs in a scan as soon as an attempt is made to connect to one of them, which means it is impossible to connect. Fixed in pmaports!3271.

See also