Jump to content

Xiaomi Redmi 4X (xiaomi-santoni): Difference between revisions

From postmarketOS Wiki
Pinoaffe (talk | contribs)
No edit summary
Bczeman (talk | contribs)
m Set camera flash to partial. (no v4l control for flash)
 
(59 intermediate revisions by 16 users not shown)
Line 4: Line 4:
| codename = xiaomi-santoni
| codename = xiaomi-santoni
| image = File:xiaomi-santoni.jpg
| image = File:xiaomi-santoni.jpg
| imagecaption = xiaomi-santoni running pmos
| imagecaption = xiaomi-santoni running pmOS demos
| releaseyear = 2017
| releaseyear = 2017
| originalsoftware = Android
| originalsoftware = Android (MIUI)
| chipset = Qualcomm MSM8940 Snapdragon 435
| originalversion = 6.0
| extendedversion = 7.1
| chipset = Qualcomm Snapdragon 435 (MSM8940)
| cpu = Octa-core 1.4 GHz Cortex-A53
| cpu = Octa-core 1.4 GHz Cortex-A53
| gpu = Adreno 505
| gpu = Adreno 505
Line 14: Line 16:
| memory = 2 GB / 3 GB / 4 GB
| memory = 2 GB / 3 GB / 4 GB
| architecture = aarch64
| architecture = aarch64
| type = Handset
| status_usbnet = Y
| status_usbnet = Y
| status_flashing = Y
| status_flashing = Y
Line 20: Line 23:
| status_wifi = Y
| status_wifi = Y
| status_xwayland = Y
| status_xwayland = Y
| status_fde =  
| status_fde = Y
| status_mainline =  
| status_mainline = Y
| status_battery =
| status_battery = Y
| status_3d =  
| status_3d = Y
| status_accel =  
| status_accel = N
| status_audio = Y
| status_audio = Y
| status_bluetooth =
| status_bluetooth = Y
| status_camera =
| status_camera = N
| status_gps =  
| status_cameraflash = P
| status_mobiledata =  
| status_gps = N
| status_sms =  
| status_mobiledata = N
| status_calls =  
| status_sms = N
| status_calls = N
| status_otg = Y
| status_otg = Y
| status_sdcard = Y
| status_emmc = Y
| pmoskernel = 6.13
| genericdevice = Generic MSM89x7 (qcom-msm89x7)
| optionalgenericdevice = no
| whet_dhry = 1526.7
| booting = yes
| booting = yes
}}
}}{{Based on SoC|Qualcomm_Snapdragon_425/427/430/435_(MSM8917/MSM8920/MSM8937/MSM8940)|Snapdragon 435}}


== Contributors ==
== Contributors ==
* pinoaffe
* pinoaffe
* asriel-danctnix
* Danct12
* Danct12


== Maintainer(s) ==
== Maintainer(s) ==
* pinoaffe (old Xiaomi kernel)
* Danct12
* Danct12 (upstreamed msm-3.18 kernel)
 
== What works ==
* Install to SD Card
* Boots
* Flashing
* Touch
* Wayland
* XWayland
* USB Ethernet/Internet
* WiFi (WCNSS Prima, blobs are needed)
* Vibrator
* Audio (extra steps required)
* USB OTG


== What does not work ==
== Users owning this device ==
* Camera (Detected as /dev/video32 and /dev/video33, but accessing them will result in a kernel lock)
{{Device owners}}
* GPS
* Mobile Data
* SMS
* Calls
* Accelerometers
* Bluetooth
* 3D Acceleration (will never happen due to downstream kernel)
* Backlight stays on when the phone goes into "sleep" because of a lack of user interaction


== Extra steps to get things working ==
== Components ==
=== Audio ===
TO-DO


=== Wi-Fi ===
{| class="wikitable"
TO-DO, again.
|-
! scope="col"| Parts
! scope="col"| Components
! scope="col"| In Torvalds tree?
|-
| scope="row"| Chipset
| MSM8940
| No
|-
| scope="row"| GPU
| Adreno 505
| Yes ([https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/msm/adreno/a5xx_gpu.c a5xx_gpu.c])
|-
| scope="row"| Touch Screen
| FT5X06
| Yes ([https://github.com/torvalds/linux/blob/master/drivers/input/touchscreen/edt-ft5x06.c edt-ft5x06.c])
|-
| scope="row"| Fingerprint Sensor
| FPC1020/Goodix
| No
|-
| scope="row"| Accelerometer + Gyroscope
| ICM20607/BMI120
| No/Yes ([https://github.com/torvalds/linux/blob/master/drivers/iio/imu/bmi160/bmi160_i2c.c bmi160_i2c.c])
|-
| scope="row"| ALSPS
| STK3X1X
| Yes ([https://github.com/torvalds/linux/blob/master/drivers/iio/light/stk3310.c stk3310.c])
|-
| scope="row"| Magnetometer
| YAS537
| Yes ([https://github.com/torvalds/linux/blob/master/drivers/iio/magnetometer/yamaha-yas530.c yamaha-yas530.c])
|-
| scope="row"| Sound
| AW87319
| No
|-
| scope="row"| Notifications LED
| AW2013
| Yes ([https://github.com/torvalds/linux/blob/master/drivers/leds/leds-aw2013.c leds-aw2013.c])
|-
| scope="row"| Front Camera
| OV5675
| Yes ([https://github.com/torvalds/linux/blob/master/drivers/media/i2c/ov5675.c ov5675.c])
|-
| scope="row"| Back Camera
| S5K3L8
| No
|}


== Bootloader Unlocking ==
== Bootloader Unlocking ==
Like other Xiaomi devices, the user will have to acquire the bootloader unlock key: https://en.miui.com/unlock
Like other Xiaomi devices, the user will have to acquire the bootloader unlock key: https://en.miui.com/unlock


The device will not unlock if the device isn't 7 days old (from the time when your device connects to internet and turned on)
The device will not unlock if the device isn't 7 days old (from the time when your device connects to internet and powered on)


Unlocking bootloaders on Xiaomi devices will '''void''' your warranty, except for the Pocophone.
If unlock fails at "Can't get info", start unlock process, disconnect USB and reconnect it once the counter hits 99%.


== Key combinations for entering Recovery/Fastboot ==
== Key combinations for entering Recovery/Fastboot ==
=== Recovery ===
=== Recovery ===
* Turn the device off (or restart also works)
* Turn the device off (or restart also works)
* Hold both volume buttons (+ and -) before the device vibrates (Power On Self Test)
* Hold both volume buttons (+ and -) and power button
* Keep holding until you got to recovery.
* Keep holding until you got to recovery.


Line 92: Line 127:


== Installation ==
== Installation ==
Installation over fastboot works, Android recovery zip installation is untested.
* Follow the [[Installation guide]]
{{Note|'''Warning:''' Flashing [[lk2nd]] is '''required''', as it is a hard dependency.}}
<syntaxhighlight lang="shell-session">
$ pmbootstrap init # choose Vendor: qcom Device codename: msm89x7
$ pmbootstrap install
$ pmbootstrap flasher flash_lk2nd
$ pmbootstrap flasher flash_rootfs
</syntaxhighlight>
 
== Serial Connection (UART)==
The Serial Connection of the santoni has been tested only on reception mode, with 3.3v TTL to USB FT232RL. [https://pastebin.com/hpFCKtjA This example] is an output when starting to fastboot.
 
Warning: the test point is very small, try to solder only if you're an expert on soldering or you may break the motherboard wirings.
 
Wiring: (Santoni TX --> FT232RL RX) and (Santoni GND --> FT232RL GND)
 
<gallery>
File:santoni-uart-1.png|frame|left|UART connected to GPIO 4,5
File:santoni-uart-2.png|frame|left|UART connected to GPIO 4,5
File:santoni-uart-3.png|frame|left|UART connected to TP29 (TX) and TP30 (RX)
File:santoni-uart-4.png|frame|left|Location of TP29 on front side of motherboard
File:santoni-uart-5.png|frame|left|Location of TP30 on front side of motherboard
File:santoni-uart-6.jpg|frame|left|Location of TP29 and GND
File:santoni-uart-7.jpg|frame|left|Example of connection, in this case RX is not used.
File:santoni-uart-8.jpg|frame|left|All the wiring done.
</gallery>
 
== Photos ==
<gallery>
File:Pmos_msm-318_santoni.png|thumb|left|Weston with msm-3.18 upstream kernel
File:Santoni-chargingsdl.png|thumb|left|charging-sdl on Xiaomi Redmi 4X
File:Youtube-santoni.jpg|thumb|left|YouTube on Redmi 4X
File:Santoni_mainline_boot_log.jpg|thumb|left|Redmi 4X booting mainline kernel
</gallery>


== See also ==
== See also ==
* [https://www.gsmarena.com/xiaomi_redmi_4_(4x)-8608.php gsmarena page]
* [https://www.gsmarena.com/xiaomi_redmi_4_(4x)-8608.php GSMArena page]
* [https://twrp.me/xiaomi/xiaomiredmi4x.html twrp page]
* [https://twrp.me/xiaomi/xiaomiredmi4x.html Official TWRP image for Redmi 4X (santoni)]
* [https://github.com/MiCode/Xiaomi_Kernel_OpenSource/tree/santoni-n-oss Xiaomi Redmi 4X Official Kernel Source]
* [https://github.com/MiCode/Xiaomi_Kernel_OpenSource/tree/santoni-n-oss Xiaomi Redmi 4X Official Kernel Source]
* [https://github.com/Danct12/msm-3.18/tree/rel/msm-3.18-archlinux msm-3.18 upstreamed kernel for santoni]
* [https://gitlab.postmarketos.org/postmarketOS/pmaports/merge_requests/335 Pull request !335 for osk-sdl]
* [https://gitlab.com/postmarketOS/pmaports/merge_requests/288 Pull request for msm-3.18 upstreamed kernel]
* [https://github.com/dreemurrs-embedded/arch-linux-santoni Arch Linux on Santoni] with 3.18 kernel (historic)
 
[[Category:Devices with known UART pinout]]

Latest revision as of 23:06, 16 March 2025

Note This device is supported as part of a generic port. Refer to Generic MSM89x7 (qcom-msm89x7) for installation instructions and more information.
Xiaomi Redmi 4x
xiaomi-santoni running pmOS demos
xiaomi-santoni running pmOS demos
Manufacturer Xiaomi
Name Redmi 4x
Codename xiaomi-santoni
Released 2017
Type handset
Hardware
Chipset Qualcomm Snapdragon 435 (MSM8940)
CPU Octa-core 1.4 GHz Cortex-A53
GPU Adreno 505
Display 720x1280
Storage 16 GB / 32 GB / 64GB
Memory 2 GB / 3 GB / 4 GB
Architecture aarch64
Software
Original software Android (MIUI)
Original version 6.0
Extended version 7.1
postmarketOS
Category testing
Pre-built images no
Mainline yes
postmarketOS kernel 6.13
Unixbench Whet/Dhry score 1526.7
Generic port Generic MSM89x7 (qcom-msm89x7)
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
Broken
Camera Flash
Partial
Connectivity
WiFi
Works
Bluetooth
Works
GPS
Broken
NFC
No data
Modem
Calls
Broken
SMS
Broken
Mobile data
Broken
Miscellaneous
FDE
Works
USB OTG
Works
HDMI/DP
No data
Sensors
Accelerometer
Broken
Magnetometer
No data
Ambient Light
No data
Proximity
No data
Hall Effect
No data
Haptics
No data
Barometer
No data

Contributors

  • pinoaffe
  • asriel-danctnix
  • Danct12

Maintainer(s)

  • Danct12

Users owning this device


Components

Parts Components In Torvalds tree?
Chipset MSM8940 No
GPU Adreno 505 Yes (a5xx_gpu.c)
Touch Screen FT5X06 Yes (edt-ft5x06.c)
Fingerprint Sensor FPC1020/Goodix No
Accelerometer + Gyroscope ICM20607/BMI120 No/Yes (bmi160_i2c.c)
ALSPS STK3X1X Yes (stk3310.c)
Magnetometer YAS537 Yes (yamaha-yas530.c)
Sound AW87319 No
Notifications LED AW2013 Yes (leds-aw2013.c)
Front Camera OV5675 Yes (ov5675.c)
Back Camera S5K3L8 No

Bootloader Unlocking

Like other Xiaomi devices, the user will have to acquire the bootloader unlock key: https://en.miui.com/unlock

The device will not unlock if the device isn't 7 days old (from the time when your device connects to internet and powered on)

If unlock fails at "Can't get info", start unlock process, disconnect USB and reconnect it once the counter hits 99%.

Key combinations for entering Recovery/Fastboot

Recovery

  • Turn the device off (or restart also works)
  • Hold both volume buttons (+ and -) and power button
  • Keep holding until you got to recovery.

Fastboot

  • Same as recovery, but this time hold the volume down key instead of both keys.

Installation

Note Warning: Flashing lk2nd is required, as it is a hard dependency.
$ pmbootstrap init # choose Vendor: qcom Device codename: msm89x7
$ pmbootstrap install
$ pmbootstrap flasher flash_lk2nd
$ pmbootstrap flasher flash_rootfs

Serial Connection (UART)

The Serial Connection of the santoni has been tested only on reception mode, with 3.3v TTL to USB FT232RL. This example is an output when starting to fastboot.

Warning: the test point is very small, try to solder only if you're an expert on soldering or you may break the motherboard wirings.

Wiring: (Santoni TX --> FT232RL RX) and (Santoni GND --> FT232RL GND)

Photos

See also