LG K40 AT&T (lg-mmh4x)
Appearance
(Redirected from LG K40 (lg-mmh4x))
This device runs a Downstream kernel. Some UIs will not work, and most features (3D acceleration, audio, etc.) may be broken. |
![]() LG K40 running postmarketOS with Xfce4 | |
Manufacturer | LG |
---|---|
Name | K40 (AT&T) |
Codename | lg-mmh4x |
Released | 2019 |
Type | handset |
Hardware | |
Chipset | MediaTek MT6765 |
CPU |
4x 2.0 GHz 4x 1.5 GHz |
GPU | PowerVR Rogue GE8320 |
Display | 720x1440 IPS |
Storage | 32 GB |
Memory | 2 GB |
Architecture | armv7 |
Software | |
Original software The software and version the device was shipped with. |
Android 9 |
Extended version The most recent supported version from the manufacturer. |
Android |
FOSS bootloader | no |
postmarketOS | |
Category | downstream |
Mainline Instead of a Linux kernel fork, it is possible to run (Close to) Mainline. |
no |
pmOS kernel The kernel version that runs on the device's port. |
4.9.190 |
Unixbench score Unixbench Whetstone/Dhrystone score. See Unixbench. |
3140.0 |
Device package |
![]() |
Kernel package |
![]() |
Flashing It is possible to flash the device with pmbootstrap flasher . |
Works
|
---|---|
USB Networking After connecting the device with USB to your PC, you can connect to it via telnet (initramfs) or SSH (booted system). |
Works
|
Battery Charging and battery level reporting works |
Broken
|
Screen Display works. Ideally with sleep mode and brightness control. |
Works
|
Touchscreen |
Works
|
Multimedia | |
3D Acceleration |
Broken
|
Audio Audio playback, microphone, headset and buttons. |
Untested
|
Camera |
Broken
|
Connectivity | |
WiFi |
Untested
|
Bluetooth |
Broken
|
GPS |
Untested
|
NFC Near Field Communication |
Untested
|
Modem | |
Calls |
Untested
|
SMS |
Untested
|
Mobile data |
Untested
|
Miscellaneous | |
FDE Full disk encryption and unlocking with unl0kr. |
Broken
|
USB OTG USB On-The-Go or USB-C Role switching |
Works
|
Sensors | |
Accelerometer Auto screen rotation works in desktops e.g. Phosh or Plasma Mobile |
Broken
|
Magnetometer Sensor to measure magnetism |
Broken
|
Ambient Light |
Untested
|
Proximity |
Untested
|
Barometer Sensor to measure air pressure |
Untested
|
Power Sensor Sensor to monitor current, voltage and power. Not fuel gauge! |
Untested
|
Contributors
- BenTheTechGuy
Users owning this device
- BenTheTechGuy (Notes: Researching mainline)
How to enter flash mode
The LG K40 doesn't have a useful recovery mode (it's just a factory reset button), and fastboot doesn't exist at all on the device; the only useful mode is Download Mode, but that requires a signed image to flash.
Luckily, the mtkclient tool can make use of vulnerabilities in the MediaTek SoC itself in order to unlock the bootloader and flash images. In the below examples, the command mtk
is used, but if you installed from source, you'll need to run python mtk
inside the repo.
To enter into a mode that mtkclient can be used in, follow these steps:
- Power off the device.
- Run an mtkclient command, like
mtk printgpt
. - While mtkclient waits for the device, hold and plug it into the computer.
- mtkclient should output a lot of text at this point. The button can be released.
- As long as mtkclient did its job properly, the command will succeed. Now, other commands can be run with mtkclient.
Unlocking the bootloader
- Enable developer options, and OEM Unlocking from there.
- Follow the steps in #How to enter flash mode.
- Erase the userdata partition:
mtk e metadata,userdata,md_udc
- Unlock the bootloader:
mtk da seccfg unlock
- Reset mtkclient:
mtk reset
- The bootloader should now be unlocked. From here, the device can be unplugged and powered on to go through setup.
Installation
- Run
pmbootstrap init
. DRM is not supported yet, so Xfce4 is the best graphical option for now. - Run
pmbootstrap install
. - Follow the steps in #How to enter flash mode.
- Run
pmbootstrap flasher flash_kernel
. - Run
pmbootstrap flasher flash_rootfs
.
Status
What doesn't work:
- WiFi: Haven't attempted to figure out how MTK's proprietary WiFi setup works on MT6765. Hoping the mainline effort gets there first.
- Modem: Same
- FDE: osk-sdl crashes with the following message and the device reboots:
ERROR: Mode 720 x 1440 not available: f
(!!!) *** UNIMPLEMENTED [fusion_get_fusionee_pid] *** [fusion.c:4147]
(*) FBDev/Mode: Setting 720x1440 RGB32
When set to use a 16 bit pixel format, osk-sdl hangs before it can reach this point, and the screen shows a corrupted version of its previous contents. The device reboots shortly after. - Battery: Always reports 0; the device will reboot after a short time if not plugged in, even if the battery is full.
- Sensors: Not detected and don't know where to start getting it working.
See also
- pmaports!3231 Initial merge request
- Device Info