Samsung Galaxy S5 (samsung-klte)
![]() Samsung Galaxy S5 | |
Manufacturer | Samsung |
---|---|
Name | Galaxy S5 |
Codename | samsung-klte |
Released | 2014 |
Hardware | |
Chipset | Qualcomm MSM8974PRO-AC Snapdragon 801 |
CPU | Quad-core 2.5 GHz Krait 400 |
GPU | Adreno 330 |
Display | 1080 x 1920 AMOLED |
Storage | 16/32 GB |
Memory | 2 GB |
Architecture | armv7 |
Software | |
Original software | Android 4.4.2 (KitKat) |
postmarketOS | |
Category | testing |
Pre-built images | no |
Mainline | yes |
postmarketOS kernel | 5.12.13 |
Unixbench Whet/Dhry score | 884.3 |
Flashing |
Works |
---|---|
USB Networking |
Partial |
Internal storage |
No data |
SD card |
No data |
Battery |
Partial |
Screen |
Partial |
Touchscreen |
Works |
Multimedia | |
3D Acceleration |
Partial |
Audio |
Broken |
Camera |
Broken |
Camera Flash |
No data |
Connectivity | |
WiFi |
Works |
Bluetooth |
Works |
GPS |
Broken |
NFC |
No data |
Modem | |
Calls |
Broken |
SMS |
Partial |
Mobile data |
Partial |
Miscellaneous | |
FDE |
No data |
USB OTG |
No data |
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
Maintainer(s)
Users owning this device
- Alexeymin (Notes: Test subject #last. Old phone in good shape with new battery)
- Bastindo (Notes: 1x white, 1x black)
- BenWolsieffer
- CalcProgrammer1
- Casept (Notes: x2)
- Chmod-rwx (Notes: Dead battery)
- Drebrez (Notes: Power IC dead)
- EnderNightLord (Notes: great condition)
- Ethical haquer (Notes: AT&T variant (G900A))
- Hisssy (Notes: kltechn (China))
- Icenowy (Notes: kltechnduo)
- Ichernev (Notes: Working on mainline kernel support)
- Maccraft123 (Notes: i also got a bunch of random parts)
- Magic RB
- Manty (Notes: Android development)
- Minecrell (Notes: SM-G900F with fa2 panel)
- Mossroy (Notes: unused, with a screen that has brightness issues)
- Nobodywasishere
- Nspire
- Oliver193 (Notes: SM-G900F Vodafone model unlocked)
- Rongrong (Notes:
kltechnduo
(G9006W
). WLAN vanished (nothing relevant indmesg
), SMS (w/ofono
.modemmanager
is broken) works; SIM1 works, SIM2 was not tested. WARNING: DO NOT TRY TO FLASHlk2nd
TOkltechnduo
. IT CANNOT BOOT AT ALL!) - Segfault
- Selfisekai
- SnappedAll (Notes: lineageos 18.1, daily driver)
- TPJS (Notes: 6x (all have no screen; two are running PMOS and one is probably dead))
- Unrznbl (Notes: 2022-09-21 heimdall fails to flash)
- V6lhost (Notes: Works fine until I disassembled it)
- Vaulster
- Wurzel3
- Xtex (Notes:
kltechnduo
(G9008W
)) - Yifei (Notes: new battery)
Status table explanation
This explains more in detail why some features are marked as partial (P): Short comparison of major features:
Component | Status | notes |
---|---|---|
USB Networking | P | Only first cable attach works, doesn't work after detaching (missing cable detection support) |
Display | P | Full panel driver with brightness control and power off is not yet merged in pmaports |
3D Accel (GPU) | P | GPU works for simple use cases, but can't render complex GUIs/shaders. If you run Phosh or Plasma Mobile, you'll "crash" the display. Phosh works more steadily though. The phone continues to work, so this shouldn't be too hard to figure out. This is most likely due to lack of GPU IOMMU support or bugs in mesa/freedreno.
SXMO may be more wise UI choice for now. |
Battery | P | Percentage reporting works; no charging status reported, but charges fine |
Mobile data | P | Not yet merged in pmaports |
SMS | P | Not yet merged in pmaports |
How to enter flash mode
Press and hold
+ + simultaneously. Then click to confirm.How to enter recovery mode
Press and hold
+ + simultaneously.Installation
First, install pmbootstrap.
Setup device to be used:
$ pmbootstrap init
...
Vendor [samsung]: samsung <- enter this
Device codename [i9100]: klte <- enter this
Kernel [downstream]: mainline <- mainline is now preferred one
User interface [sxmo]: <- choose any UI by your preference. fbkeyboard and sxmo work well :)
...
Build the rootfs image:
$ pmbootstrap install
Then in order to flash it put your device in download mode, and plug it in USB. Then do:
$ pmbootstrap flasher flash_rootfs
Hold "Volume down" + "Home" buttons at the end of the process,
so that when phone reboots put it in flashing mode again
$ pmbootstrap flasher flash_kernel
This time, don't hold any button, let it reboot to Linux!
Mainlining Notes
Power IC
The phone uses max77804k MFD (Multi Function Device) IC to handle charging, extcon (cable detect), vibrator, flash led. This device is not in mainline, but it is very similar (i.e the same) to max77693 in register layout. In the next paragraph I'll refer to max77804k code as downstream and max77693 code as upstream.
- Charging : downstream charging code is scary. Mainline code only reads info, and doesn't charge, so a brave soul might be able to figure out a minimal setup that does charge the phone.
- Extcon : downstream extcon is not too bad, and it is trivial to follow the basic use cases and ensure they are ported correctly. Mainline code is different and writes different values for diffrent use cases, but following a similar structure it can be made to behave.
- Flash Leds : these are pretty straight forward, the existing mainline code is a bit weird, but I wrote a port of downstream and it does work for the most part.
- Vibrator : the mainline code is for a different kind of vibrator. It shouldn't be too hard to port the downstream code.
USB
At the moment usb-networking works only the first time it is plugged, and only if the (experimental) max77804k is not enabled.
There are 2 different blocks for USB on the klte. One has a good driver, and manages the somewhat working usb networking -- let's call it simple. But if the max77804k driver is enabled, it switches to the other IP block which does not have mainline drivers -- let's call it complex. Downstream only has code for the complex block.
Drivers for the complex block are present on newer SoCs from qualcomm, but at least to me, they look different than the downstream code (downstream doesn't have the notion of phy's, and this is a pretty big deal). So this could be a simple fix, but likely isn't.
Another possible approach will be to somehow let the simple block handle all the USB, but without documentation on max77804k/usb blocks this is pretty hard.
Graphics/Display
There is mainline support for the GPU with 3D Acceleration. kmscube works.
If you run Phosh or Plasma Mobile, you'll "crash" the display. Phosh works more steadily though. The phone continues to work, so this shouldn't be too hard to figure out. This is most likely due to lack of GPU IOMMU support or bugs in mesa/freedreno.
SXMO may be more wise UI choice for now.
Parts Bin code
max77693 to max77804k port (incl some usb work): https://gitlab.com/ichernev/linux-postmarketos/-/tree/max77693-update
max77804k with leds only: https://gitlab.com/ichernev/linux-postmarketos/-/tree/max77804k
Running on pure mainline
At the moment (5.6) (this is still needed in 5.13-rc), if you want to use real mainline (from torvalds tree), you'd need this patch:
Patch:
I won't be surprised if more issues pop up in the future, as nobody is really testing for regressions on phones.
Getting early kernel logs using UART
Read help for CONFIG_DEBUG_QCOM_UARTDM kernel konfig. Enable CONFIG_DEBUG_LL
+ CONFIG_DEBUG_QCOM_UARTDM
+ correct addresses for CONFIG_DEBUG_UART_PHYS
and CONFIG_DEBUG_UART_VIRT
. The ones listed in a help for CONFIG_DEBUG_QCOM_UARTDM
option for MSM8974 work fine:
CONFIG_DEBUG_LL=y CONFIG_DEBUG_QCOM_UARTDM=y CONFIG_DEBUG_UART_PHYS=0xf991e000 CONFIG_DEBUG_UART_VIRT=0xfa71e000 CONFIG_EARLY_PRINTK=y
And add earlyprintk
to kernel command line. This allows to receive debug messages from such early stages so you can even debug kernel self-decompressor.
If the phone becomes too hot
Use this to check temperatures:
$ for i in $(ls --color=never /sys/devices/virtual/thermal/); do cat /sys/devices/virtual/thermal/$i/type /sys/devices/virtual/thermal/$i/temp; done
Example output:
Partition layout
Partition layout:
Component support table
Component | Codename | Mainline kernel | Since when | Downstream 3.4 kernel |
---|---|---|---|---|
Debug serial | msm_serial /dev/ttyMSM0 | Working | v4.17-rc1 | yes, /dev/ttyHSL0 |
Volume & home buttons | gpio-keys | Working | 5.8 | yes |
Regulator nodes | pma8084, Maxim max77826 | Working | 5.8 | yes |
Internal storage | sdhci-msm | Working | 5.8 | yes |
SD card storage | sdhci-msm | Working | 5.11-rc1 | yes |
USB Networking | usb_dwc3_qcom | Working | 5.8 | yes |
Display subsystem | MSM MDSS MDP5 | Working | Since forever; mdp5 appeared in kernel in 3.14-rc1, mdp4 was there even before that | yes |
Panel 1 | Samsung S6E3FA2 AMOLED cmd mode panel | Working | In pmOS kernel fork, as panel-simple | yes |
Panel 2 | MagnaChip(?) EA8064G AMOLED cmd mode panel | Working | In pmOS kernel fork, as panel-simple | yes |
Touchscreen | synaptics rmi4-i2c | Working | 5.11-rc1 | yes |
Touchkeys | Cypress tm2-touchkey | Working | 5.11-rc1 | yes |
Vibration motor | max77804k-vibrator | Not working | yes | |
Notification LED | Panasonic AN30259A | Working | 5.11-rc1 | yes |
WiFi | Broadcom BCM4354 (brcmfmac) + PCAL6416A GPIO Expander | Working | 5.11-rc1 | yes |
Bluetooth | Broadcom BCM4354 (hci_uart_bcm), needs GPIO expander too | Working | will be in 5.13 | no |
USB OTG | Maxim max77804k-extcon | Not working | yes | |
Battery charger | Maxim max77804k-charger | Not working | yes | |
Battery fuelgauge | Maxim max17048 | Working | 5.11-rc1 | yes |
GPU | drm_msm | Working | 5.12 | works with libhybris (test_hwcomposer_7_1_caf) |
HDMI out | Silicon Image Sil8240 MHL | Not working | no | |
Audio | WCD9320 (+Audience eS704 voice) Audio Codecs | Not working | with libhybris (pulseaudio-modules-droid) | |
Modem | qcom-q6v5-mss | Not working | powers up with libhybris | |
Accelerometer, Gyroscope | Invensense MP65M (mpu6500) 6-axis gyro/accel | Has mainline driver, CONFIG_INV_MPU6050_IIO | yes (libhybris's test_sensors) | |
Magnetometer | Asahi Kasei Microdevices AK09911C 3-axis compass | Has mainline driver, CONFIG_AK09911 | yes (libhybris's test_sensors) | |
Ambient light / Proximity | AMS TMG399X Optical Sensor | Not working | yes (libhybris's test_sensors) | |
Sensor HUB | STM32 A5006V0 hub Seamless Sensor Platform (SSP) | Not working | yes (libhybris's test_sensors) | |
NFC | NXP pn547 | Has mainline driver, CONFIG_NFC_NXP_NCI | ?? | |
Cameras | s5k2p2xx, s5k8b1yx | Not working | no |
Links
postmarketOS packages:
Mainline kernel patches:
- initial dts https://patchwork.kernel.org/patch/10150807/
- usb-net, storage, hwkeys dts https://lore.kernel.org/patchwork/project/lkml/list/?series=438265
- max77826 driver https://lore.kernel.org/patchwork/project/lkml/list/?series=438450
- max17048 fuelgauge driver https://lore.kernel.org/patchwork/project/lkml/list/?series=447534
Extra:
- Full phone specifications
- Samsung Galaxy S5 Teardown
- UART guide
- Deviceinfo HW page
- Demo of Samsung klte running Plasma Mobile
- Plasma Mobile Kirigami Gallery demo on samsung-klte
Photos
-
Weston
-
Xfce4 UI
-
UART debugging
-
klte x2
-
phosh - about
-
phosh lockscreen
-
phosh, neofetch
-
full size screenshot
-
Bluetooth working in phosh
-
Sxmo on klte 01
-
Sxmo on klte 02