Jump to content

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

From postmarketOS Wiki
Pinoaffe (talk | contribs)
Bczeman (talk | contribs)
m Set camera flash to partial. (no v4l control for flash)
 
(62 intermediate revisions by 17 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
| status_usbnet =  
| type = Handset
| status_usbnet = Y
| status_flashing = Y
| status_flashing = Y
| status_touch = Y
| status_touch = Y
| status_screen = Y
| status_screen = Y
| status_wifi =  
| status_wifi = Y
| status_xwayland =  
| 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 =  
| 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_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


== Maintainer(s) ==
== Maintainer(s) ==
* noone (pinoaffe lost his RedMi 4x)
* Danct12


== What works ==
== Users owning this device ==
* Boots
{{Device owners}}
* Screen
* Touch
* Flashing
* Battery
* USB host mode
* HID buttons (KEY_POWER, KEY_VOLUMEDOWN and KEY_VOLUMEUP)
== What does not work ==
* USB Networking
** In /sys/devices/soc/78db000.usb/msm_hsusb/ there are two files (is_peripheral and is_otg) that might have to do with switching device-type, but they're both 0 and writing 1 to either results in I/O errors
* USB device mode
* Wireless LAN
* Audio
* Mainline
* Camera
* GPS
* Mobile Data
* SMS
* Calls
* Accelerometers
* Bluetooth
* Accelerated 3D graphics
* Backlight stays on when the phone goes into "sleep" because of a lack of user interaction


== How to enter flash mode ==
== Components ==
Turn the phone off and press and hold both the power and volume button at the same time.
 
Keep holding those buttons untill a picture of the Xiaomi bunny appears.
{| class="wikitable"
|-
! 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 ==
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 ==
== Installation ==
Installation over fastboot works,  
* Follow the [[Installation guide]]
android recovery zip installation is untested.
{{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 recently released official kernel sources]
* [https://github.com/MiCode/Xiaomi_Kernel_OpenSource/tree/santoni-n-oss Xiaomi Redmi 4X Official Kernel Source]
* [https://gitlab.postmarketos.org/postmarketOS/pmaports/merge_requests/335 Pull request !335 for osk-sdl]
* [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