Jump to content

Google Nexus 5X (lg-bullhead): Difference between revisions

From postmarketOS Wiki
Pevik (talk | contribs)
See also: Add link to close to mainline https://gitlab.com/postmarketOS/pmaports/-/merge_requests/2654
Knuxify (talk | contribs)
m gitlab.com -> gitlab.postmarketos.org (bot edit)
 
(37 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{Infobox device
{{Infobox device
| name = Nexus 5X
| name = Nexus 5X
| manufacturer = LG
| manufacturer = Google (LG)
| codename = lg-bullhead
| codename = lg-bullhead
| image = File:Lg-bullhead_mate.jpg
| image = File:Lg-bullhead_mate.jpg
| imagecaption = Nexus 5x
| imagecaption = Nexus 5x
| releaseyear = 2015
| releaseyear = 2015
| originalsoftware = Android 6.0 on Linux 3.10
| originalsoftware = Android
| chipset = Qualcomm MSM8992 Snapdragon 808
| originalversion = 6.0 (Linux 3.10)
| chipset = Qualcomm Snapdragon 808 (MSM8992)
| cpu = 4x1.4 GHz Cortex-A53 & 2x1.8 GHz Cortex-A57
| cpu = 4x1.4 GHz Cortex-A53 & 2x1.8 GHz Cortex-A57
| gpu = Adreno 418
| gpu = Adreno 418
Line 14: Line 15:
| memory = 2 GB
| memory = 2 GB
| architecture = aarch64
| architecture = aarch64
| type = Handset
| status_usbnet = Y
| status_usbnet = Y
| status_flashing = Y
| status_flashing = Y
Line 36: Line 38:
| whet_dhry = 1273.5
| whet_dhry = 1273.5
}}
}}
__FORCETOC__


== Contributors ==
== Contributors ==
Line 55: Line 59:
== No RPMB ==
== No RPMB ==


If your device says "SECURE BOOT: ENABLED (NO RPMB)" in the fastboot screen that means that the mainboard in your Nexus 5X is missing an image required by secureboot to function properly.
If your device says <code>SECURE BOOT: ENABLED (NO RPMB)</code> in the fastboot screen that means that the mainboard in your Nexus 5X is missing an image required by secureboot to function properly.
If this is missing then oem-unlocking won't work on the device. It will re-lock every reboot.  
If this is missing then oem-unlocking won't work on the device. It will re-lock every reboot.  


No fix is available yet for this.
No fix is available yet, but '''[https://web.archive.org/web/20220513194000/https://teddit.net/r/nexus5x/comments/5hj0r0/bootloop_after_lg_replaced_mainboard_bootloader/ there is way to at least install LineageOS to gain root for adb]''' (phone reset persists, but it allows to read various proc/sysfs files which contain hardware info which are readable only for root - useful for mainlining).
 
NOTE: modified boot.img from XDA thread has been '''[https://forum.xda-developers.com/t/modified-boot-imgs-nougat-oreo-disable-forced-encryption-dm-verity-1-7-18.3495169/page-9#post-78329695 moved]''', also '''[https://twrp.me/lg/lgnexus5x.html TWRP]'''.
 
=== Modify <code>boot.img</code> ===
 
When trying to workaround the issue it's probably better to modify your <code>boot.img</code> yourself ('''[https://android.googlesource.com/platform/system/core/+/47878de7d12c7e438fcc584183b44893e91b4a28/fs_mgr/fs_mgr_fstab.cpp source code for mount flags description]''').
 
Official images can be downloaded from https://developers.google.com/android/images#bullhead.
 
<syntaxhighlight lang="shell-session">
$ wget -c https://dl.google.com/dl/android/aosp/bullhead-opm7.181205.001-factory-5f189d84.zip
$ unzip bullhead-opm7.181205.001-factory-5f189d84.zip && cd bullhead-opm7.181205.001/
$ unzip image-bullhead-opm7.181205.001.zip
$ abootimg -x boot.img
$ mkdir initrd && cd initrd
$ zcat ../initrd.img | cpio -idmv --no-absolute-filenames
$ vi fstab.bullhead
</syntaxhighlight>
 
To disable [https://source.android.com/security/verifiedboot/dm-verity dm-verity] remove <code>verify=</code> parameter in <code>/system</code> and <code>/vendor</code>:
 
<syntaxhighlight lang="diff">
-/dev/block/platform/soc.0/f9824900.sdhci/by-name/system  /system  ext4    ro,barrier=1,inode_readahead_blks=8    wait,verify=/dev/block/platform/soc.0/f9824900.sdhci/by-name/metadata
-/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor  /vendor  ext4    ro,barrier=1,inode_readahead_blks=8    wait,verify=/dev/block/platform/soc.0/f9824900.sdhci/by-name/metadata
+/dev/block/platform/soc.0/f9824900.sdhci/by-name/system  /system  ext4    ro,barrier=1,inode_readahead_blks=8    wait,
+/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor  /vendor  ext4    ro,barrier=1,inode_readahead_blks=8    wait,
</syntaxhighlight>
 
To disable forced encryption change <code>forcefdeorfbe=</code> to <code>encryptable=</code> ([https://jsteward.moe/analysis-of-android-cryptfs.html source]):
<syntaxhighlight lang="diff">
-/dev/block/platform/soc.0/f9824900.sdhci/by-name/userdata    /data          ext4    noatime,nosuid,nodev,barrier=1,data=ordered,nomblk_io_submit,noauto_da_alloc,errors=panic,inode_readahead_blks=8 wait,check,forcefdeorfbe=/dev/block/platform/soc.0/f9824900.sdhci/by-name/metadata
+/dev/block/platform/soc.0/f9824900.sdhci/by-name/userdata    /data          ext4    noatime,nosuid,nodev,barrier=1,data=ordered,nomblk_io_submit,noauto_da_alloc,errors=panic,inode_readahead_blks=8 wait,check,encryptable=/dev/block/platform/soc.0/f9824900.sdhci/by-name/metadata
</syntaxhighlight>
 
Repack boot.img (and continue according to the article):
<syntaxhighlight lang="shell-session">
$ find . | cpio -o -H newc | gzip > ../initrd.img # repack intird.img after edit
$ cd ..
$ abootimg --create boot.img -f bootimg.cfg -k zImage -r initrd.img # if "too big for the Boot Image" add: -c "bootsize=size-in-error-bootsize"
</syntaxhighlight>


== Special key combos ==
== Special key combos ==
Boot to bootloader: hold Volume Vown + Power button until the screen turns on.
Boot to bootloader: hold {{button|Volume Down}} + {{button|Power}} until the screen turns on.


Launch recovery: first boot to the bootloader, press the Volume Down button twice and press the Power button to select
Launch recovery: first boot to the bootloader, press the {{button|Volume Down}} button twice and press the {{button|Power}} button to select


== Install postmarketOS ==
== Install postmarketOS ==
Go to bootloader then connect the device to the PC then run this commands one by one.
Go to bootloader then connect the device to the PC then run this commands one by one.
<syntaxhighlight lang="shell-session">
<syntaxhighlight lang="shell-session">
$./pmbootstrap.py init
$ pmbootstrap init
$./pmbootstrap.py -t 30000 install --no-fde
$ pmbootstrap install
$./pmbootstrap.py flasher flash_rootfs --partition userdata
$ pmbootstrap flasher flash_rootfs --partition userdata
$./pmbootstrap.py flasher flash_kernel
$ pmbootstrap flasher flash_kernel
</syntaxhighlight>
</syntaxhighlight>


Now select start from the menu in the bootloader screen. Reboot again if you don't see anything in the screen after postmarketOS logo
Now select start from the menu in the bootloader screen. Reboot again if you don't see anything in the screen after postmarketOS logo
== Get your hardware revision ==
Retrieve it from a running system by running:
<pre>
$ xxd /sys/firmware/devicetree/base/qcom,board-id
# Output e.g.: 00000000: 0000 0b64 0000 0000                      ...d....
</pre>
Compare the identifier with the ones listed in [https://android.googlesource.com/kernel/msm.git/+/android-msm-bullhead-3.10-n-preview-1/arch/arm64/boot/dts/lge?autodive=0%2F%2F%2F%2F%2F msm8992-bullhead-rev-X.dts] and find which one matched your number to retrieve your hardware revision. The example output would match revision 1.01.
Note: the above information is ambiguous.  On an unmodified device, try fastboot:
<pre>
$ fastboot getvar version-hardware
#Output, e.g.: version-hardware: rev_1.0
</pre>
Alternatively, in <code>fastboot</code> mode, just check the device console:
<code> hw version rev_1.0</code>.
This device (final build number, OPM07) is apparently revision 1.0, but via <code>adb shell</code> the output matches that given above (note the different target file, as the sys entry above does not exist),
<pre>
$ xxd /proc/device-tree/qcom,board-id
# Output e.g.: 00000000: 0000 0b64 0000 0000                      ...d....
</pre>


== Mainline Kernel Status ==
== Mainline Kernel Status ==


The current mainline sources of Linux only support rev 1.01 of the Nexus 5X. This is due to the hardcoded logic board identifier in the devicetree, and should be fixed in the future.
The current mainline Linux only supports Nexus 5X rev '''1.01''', but upcoming 5.18 will contain also rev '''1.0''' – [https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git/commit/?id=cd4bd4704ec8cff3d045493e2130c7095bbabf78 cd4bd4704ec8 ("arm64: dts: qcom: msm8992-lg-bullhead: Add support for LG Bullhead rev 1.0")].


{|class="wikitable feature-colors"
{|class="wikitable feature-colors"
Line 87: Line 153:
| Y
| Y
|Power Management
|Power Management
|Uses Qualcomm's PM8994 controller, works since 4.11
|Uses Qualcomm's PM8994 controller, works since 4.11 ([https://developer.qualcomm.com/qfile/35467/lm80-nt441-15_c.pdf doc])
|-
|-
|  
|  
Line 101: Line 167:
| No DT binding.
| No DT binding.
|-
|-
|
|Y
|SDHCI
|SDHCI
| Mainline driver since 4.17, but not working at the moment.
| Mainline driver since 4.17, properly enabled since 5.9 – [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c83e0951bcad645df15b348ebb43e34b687baf78 c83e0951bcad ("arm64: dts: qcom: msm8992: Fix SDHCI1")]
|-
|-
|  
|  
Line 152: Line 218:
== Mainlining ==
== Mainlining ==


The Linux mainline kernel has very basic support for this phone since November 2016 (one cpu and uart). In January 2017 support for the onboard SDHCI was added and since March 2018 pstore-ramoops. Both should be included in 4.19.
The Linux mainline kernel has very basic support for this phone since November 2016 (one cpu and uart). In kernel 4.18 was added support for SDHCI1 and pstore-ramoops. Further fixes has been added later (in SDHC1, PSCI and cleanup in 5.9, overlay msm8994 as hardware is very similar and update regulator config in 5.12, overlay and PSCI broke booting, which got fixed in 5.14. Upcoming 5.18 will add rev 1.0 support (currently is supported only 1.01).
 
To boot it using pmbootstrap follow the mainlining guide but note that it has a 64 Bit kernel. Also, compared to downstream "device-lg-bullhead" you need to change the debug tty to /dev/ttyMSM0 in the deviceinfo file.
 
Change deviceinfo (aports/device/device-lg-bullhead/deviceinfo)


  deviceinfo_kernel_cmdline="console=ttyMSM0,115200,n8 androidboot.hardware=bullhead boot_cpus=0-5 lpm_levels.sleep_disabled=1 msm_poweroff.download_mode=0 buildvariant=userdebug PMOS_NO_OUTPUT_REDIRECT"
Currently it's possible to use mainline kernel via close to mainline kernel [https://gitlab.postmarketos.org/postmarketOS/pmaports/-/tree/master/device/testing/linux-postmarketos-qcom-msm8994/ linux-postmarketos-qcom-msm8994] package (added in {{MR|2654|pmaports}}) – alternative to downstream kernel (only basic hardware support).  


ttyMSM0 tells the kernel to write debug output to the debugger cable, PMOS_NO_OUTPUT_REDIRECT tells the initramfs script from pmOS to write there as well instead of to a (temporary) log file
For further hacking on mainline kernel compiling with [https://wiki.postmarketos.org/wiki/Compiling_kernels_with_envkernel.sh envkernel.sh] is recommended.


Increase the pkgrel in the APKBUILD and rebuild the boot.img
To see serial console output add kernel parameter <code>console=ttyMSM0,115200,n8</code>.
<syntaxhighlight lang="shell-session">
$ pmbootstrap checksum device-lg-bullhead
$ pmbootstrap export
</syntaxhighlight>
Build your kernel as described in mainlining guide


Update the boot.img to include your local kernel
Update the boot.img to include your local kernel
Line 177: Line 234:
$ pmbootstrap flasher list_devices
$ pmbootstrap flasher list_devices
</syntaxhighlight>
</syntaxhighlight>
You can communicate with the device using <code>screen</code> (or other software), so in a separate terminal start it:
 
You can communicate with the device using <code>screen</code> (or other software, e.g. <code>minicom</code>), so in a separate terminal start it:
<syntaxhighlight lang="shell-session">
<syntaxhighlight lang="shell-session">
$ screen /dev/ttyUSB0 115200
$ screen /dev/ttyUSB0 115200
Line 187: Line 245:
$ pmbootstrap chroot -- fastboot boot /tmp/mainline/boot.img
$ pmbootstrap chroot -- fastboot boot /tmp/mainline/boot.img
</syntaxhighlight>
</syntaxhighlight>
==Hardware status / details (downstream kernel, SKU LGH790, rev_1.0)==
Note that xfce4 ui on this device boots to black screen, but usb networking is available.
Output of <code>sensors</code> (lm-sensors package):
<div class="toccolours mw-collapsible mw-collapsed" style="width:600px; overflow:auto;">
sensors output
<div class="mw-collapsible-content">
<pre>
bms-virtual-0
Adapter: Virtual device
temp1:        +28.7 C 
battery-virtual-0
Adapter: Virtual device
temp1:        +28.7 C 
tsens_tz_sensor0-virtual-0
Adapter: Virtual device
temp1:        +0.0 C 
tsens_tz_sensor1-virtual-0
Adapter: Virtual device
temp1:        +0.0 C 
tsens_tz_sensor2-virtual-0
Adapter: Virtual device
temp1:        +0.0 C 
tsens_tz_sensor3-virtual-0
Adapter: Virtual device
temp1:        +0.0 C 
tsens_tz_sensor4-virtual-0
Adapter: Virtual device
temp1:        +0.0 C 
tsens_tz_sensor5-virtual-0
Adapter: Virtual device
temp1:        +0.0 C 
tsens_tz_sensor7-virtual-0
Adapter: Virtual device
temp1:        +0.0 C 
tsens_tz_sensor9-virtual-0
Adapter: Virtual device
temp1:        +0.1 C 
tsens_tz_sensor10-virtual-0
Adapter: Virtual device
temp1:        +0.1 C 
tsens_tz_sensor11-virtual-0
Adapter: Virtual device
temp1:        +0.0 C 
tsens_tz_sensor12-virtual-0
Adapter: Virtual device
temp1:        +0.0 C 
tsens_tz_sensor13-virtual-0
Adapter: Virtual device
temp1:        +0.0 C 
tsens_tz_sensor14-virtual-0
Adapter: Virtual device
temp1:        +0.0 C 
pm8994_tz-virtual-0
Adapter: Virtual device
temp1:        +36.5 C  (crit = +145.0 C)
msm_therm-virtual-0
Adapter: Virtual device
temp1:        -0.0 C 
emmc_therm-virtual-0
Adapter: Virtual device
temp1:        -0.0 C 
pa_therm0-virtual-0
Adapter: Virtual device
temp1:        +0.0 C 
THRM_57-0-virtual-0
Adapter: Virtual device
temp1:        +0.0 C 
THRM_57-1-virtual-0
Adapter: Virtual device
temp1:        +0.0 C 
THRM_53-0-virtual-0
Adapter: Virtual device
temp1:        +0.0 C 
THRM_53-1-virtual-0
Adapter: Virtual device
temp1:        +0.0 C 
THRM_53-2-virtual-0
Adapter: Virtual device
temp1:        +0.0 C 
THRM_53-3-virtual-0
Adapter: Virtual device
temp1:        +0.0 C 
</pre> 
</div>
</div>
===CPU tuning===
The default deviceinfo defines <code>boot_cpus=0-3 maxcpus=4</code>, forcing the 2xA57 cores offline.  A naive tuning attempt based on [[OnePlus_Two_(oneplus-oneplus2)#cpu_tuning|oneplus-oneplus2]] seems to bring the A57 cores online - but unused. <code>ubench</code> still only recognizes "4 CPUs", and scores are unchanged (compare with much higher MSM8992 [[Xiaomi_Mi_4c_(xiaomi-libra)|xiaomi-libra]] [[Unixbench|scores]]).
Monitor temperatures via <code>sensors</code> or <code>sys-tool</code> (lm-sensors package), (though most values may be null / disabled / 0); <code>systool -v -c [hwmon|thermal]</code> may be more complete.
When mainline is available, try <code>tmon</code> (linux-tools-tmon).


== Photos ==
== Photos ==
Line 199: Line 375:
<div style="clear:left"></div>
<div style="clear:left"></div>


== See also ==
== Links ==
* {{Device package|lg-bullhead}}
* {{Device package|lg-bullhead}}
* {{Kernel package|lg-bullhead}}
* {{kernel package|lg-bullhead}} (downstream)
* {{kernel package|postmarketos-qcom-msm8994}} (close to mainline kernel – alternative to downstream kernel, only basic hardware support), added in {{MR|2654|pmaports}}
* {{MR|1222}} initial MR
* {{MR|1222}} initial MR
* {{MR|2654|pmaports}} – use main/linux-postmarketos-qcom-msm8994 (close to mainline kernel – alternative to downstream kernel, only basic hardware support)
* {{issue|1703}} showing black screen after pmos logo in xfce DE
* {{issue|1703}} showing black screen after pmos logo in xfce DE
* [https://www.youtube.com/watch?v=77tuFtM4gjA Intial porting for the Nexus 5X]
* [https://www.youtube.com/watch?v=77tuFtM4gjA Intial porting for the Nexus 5X]
* [https://www.ifixit.com/Teardown/Nexus+5X+Teardown/51318 Device Teardown]
* [https://www.ifixit.com/Teardown/Nexus+5X+Teardown/51318 Device Teardown]
* [https://github.com/franciscofranco/bullhead/blob/oreo-mr1/arch/arm/boot/dts/qcom/msm8992.dtsi Downstream dts]
* [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/qcom/msm8992-lg-bullhead-rev-10.dts Mainline DTS – msm8992-lg-bullhead-rev-10.dts]
* [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/qcom/msm8992-lg-bullhead-rev-101.dts Mainline DTS – msm8992-lg-bullhead-rev-101.dts]
* [https://github.com/franciscofranco/bullhead/blob/oreo-mr1/arch/arm/boot/dts/qcom/msm8992.dtsi Downstream DTS]
* [[Google Nexus 6P (huawei-angler)]] – similar device

Latest revision as of 13:30, 4 November 2024

Google (LG) Nexus 5X
Nexus 5x
Nexus 5x
Manufacturer Google (LG)
Name Nexus 5X
Codename lg-bullhead
Released 2015
Type handset
Hardware
Chipset Qualcomm Snapdragon 808 (MSM8992)
CPU 4x1.4 GHz Cortex-A53 & 2x1.8 GHz Cortex-A57
GPU Adreno 418
Display 1080x1920 IPS
Storage 16/32 GB
Memory 2 GB
Architecture aarch64
Software
Original software Android
Original version 6.0 (Linux 3.10)
postmarketOS
Category testing
Pre-built images no
Mainline partial
Unixbench Whet/Dhry score 1273.5
Features
Flashing
Works
USB Networking
Works
Internal storage
No data
SD card
No data
Battery
Works
Screen
Works
Touchscreen
Works
Multimedia
3D Acceleration
No data
Audio
No data
Camera
No data
Camera Flash
No data
Connectivity
WiFi
No data
Bluetooth
No data
GPS
No data
NFC
No data
Modem
Calls
No data
SMS
No data
Mobile data
No data
Miscellaneous
FDE
No data
USB OTG
Works
HDMI/DP
No data
Sensors
Accelerometer
No data
Magnetometer
No data
Ambient Light
No data
Proximity
No data
Hall Effect
No data
Haptics
No data
Barometer
No data



Contributors

Users owning this device


Unlocking

In android go to SettingsSystemAbout Phone and tap the build number 7 times. Then go to SettingsSystemDeveloper Options and enable OEM unlocking

Reboot to the bootloader and run "fastboot oem unlock" Now select Yes on the phone screen with the volume button and use the power button to accept.

No RPMB

If your device says SECURE BOOT: ENABLED (NO RPMB) in the fastboot screen that means that the mainboard in your Nexus 5X is missing an image required by secureboot to function properly. If this is missing then oem-unlocking won't work on the device. It will re-lock every reboot.

No fix is available yet, but there is way to at least install LineageOS to gain root for adb (phone reset persists, but it allows to read various proc/sysfs files which contain hardware info which are readable only for root - useful for mainlining).

NOTE: modified boot.img from XDA thread has been moved, also TWRP.

Modify boot.img

When trying to workaround the issue it's probably better to modify your boot.img yourself (source code for mount flags description).

Official images can be downloaded from https://developers.google.com/android/images#bullhead.

$ wget -c https://dl.google.com/dl/android/aosp/bullhead-opm7.181205.001-factory-5f189d84.zip
$ unzip bullhead-opm7.181205.001-factory-5f189d84.zip && cd bullhead-opm7.181205.001/
$ unzip image-bullhead-opm7.181205.001.zip
$ abootimg -x boot.img
$ mkdir initrd && cd initrd
$ zcat ../initrd.img | cpio -idmv --no-absolute-filenames
$ vi fstab.bullhead

To disable dm-verity remove verify= parameter in /system and /vendor:

-/dev/block/platform/soc.0/f9824900.sdhci/by-name/system  /system  ext4    ro,barrier=1,inode_readahead_blks=8    wait,verify=/dev/block/platform/soc.0/f9824900.sdhci/by-name/metadata
-/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor  /vendor  ext4    ro,barrier=1,inode_readahead_blks=8    wait,verify=/dev/block/platform/soc.0/f9824900.sdhci/by-name/metadata
+/dev/block/platform/soc.0/f9824900.sdhci/by-name/system  /system  ext4    ro,barrier=1,inode_readahead_blks=8    wait,
+/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor  /vendor  ext4    ro,barrier=1,inode_readahead_blks=8    wait,

To disable forced encryption change forcefdeorfbe= to encryptable= (source):

-/dev/block/platform/soc.0/f9824900.sdhci/by-name/userdata     /data           ext4    noatime,nosuid,nodev,barrier=1,data=ordered,nomblk_io_submit,noauto_da_alloc,errors=panic,inode_readahead_blks=8 wait,check,forcefdeorfbe=/dev/block/platform/soc.0/f9824900.sdhci/by-name/metadata
+/dev/block/platform/soc.0/f9824900.sdhci/by-name/userdata     /data           ext4    noatime,nosuid,nodev,barrier=1,data=ordered,nomblk_io_submit,noauto_da_alloc,errors=panic,inode_readahead_blks=8 wait,check,encryptable=/dev/block/platform/soc.0/f9824900.sdhci/by-name/metadata

Repack boot.img (and continue according to the article):

$ find . | cpio -o -H newc | gzip > ../initrd.img # repack intird.img after edit
$ cd ..
$ abootimg --create boot.img -f bootimg.cfg -k zImage -r initrd.img # if "too big for the Boot Image" add: -c "bootsize=size-in-error-bootsize"

Special key combos

Boot to bootloader: hold Volume Down + Power until the screen turns on.

Launch recovery: first boot to the bootloader, press the Volume Down button twice and press the Power button to select

Install postmarketOS

Go to bootloader then connect the device to the PC then run this commands one by one.

$ pmbootstrap init
$ pmbootstrap install
$ pmbootstrap flasher flash_rootfs --partition userdata
$ pmbootstrap flasher flash_kernel

Now select start from the menu in the bootloader screen. Reboot again if you don't see anything in the screen after postmarketOS logo

Get your hardware revision

Retrieve it from a running system by running:

$ xxd /sys/firmware/devicetree/base/qcom,board-id
# Output e.g.: 00000000: 0000 0b64 0000 0000                      ...d....

Compare the identifier with the ones listed in msm8992-bullhead-rev-X.dts and find which one matched your number to retrieve your hardware revision. The example output would match revision 1.01.

Note: the above information is ambiguous. On an unmodified device, try fastboot:

$ fastboot getvar version-hardware
#Output, e.g.: version-hardware: rev_1.0

Alternatively, in fastboot mode, just check the device console: hw version rev_1.0.

This device (final build number, OPM07) is apparently revision 1.0, but via adb shell the output matches that given above (note the different target file, as the sys entry above does not exist),

$ xxd /proc/device-tree/qcom,board-id
# Output e.g.: 00000000: 0000 0b64 0000 0000                      ...d....

Mainline Kernel Status

The current mainline Linux only supports Nexus 5X rev 1.01, but upcoming 5.18 will contain also rev 1.0cd4bd4704ec8 ("arm64: dts: qcom: msm8992-lg-bullhead: Add support for LG Bullhead rev 1.0").

Status Hardware Info
Y Power Management Uses Qualcomm's PM8994 controller, works since 4.11 (doc)
Touch Screen No driver in mainline tree.
DSI Panel Out-of-tree driver[1] generated using linux-mdss-dsi-panel-driver-generator. Untested
USB Gadget/OTG No DT binding.
Y SDHCI Mainline driver since 4.17, properly enabled since 5.9 – c83e0951bcad ("arm64: dts: qcom: msm8992: Fix SDHCI1")
Wi-Fi Qualcomm QCA6174. Driver exists in mainline.
Y GPIO keys No DT bindings.
Bluetooth Qualcomm QCA6174. Driver exists in mainline.
Sound Qualcomm WCD9330, no driver in mainline.
Light Sensor Rohm RPR0521. Driver exists in mainline.
Sixaxis Bosch BMI160. Driver exists in mainline.
Camera Sony IMX377. No driver in mainline.
GPU Qualcomm Adreno 418, needs DT bindings.
Modem Qualcomm WTR3925. No driver in mainline.
Fingerprint FPC1020, supported by this driver:https://github.com/SanniZ/fpc1020-driver. Needs DT bindings.

Firmware

Here is the official Google page to download GPS, Audio, Camera, Gestures, Graphics, DRM, Video, Sensors firware blob. /developers.google

Mainlining

The Linux mainline kernel has very basic support for this phone since November 2016 (one cpu and uart). In kernel 4.18 was added support for SDHCI1 and pstore-ramoops. Further fixes has been added later (in SDHC1, PSCI and cleanup in 5.9, overlay msm8994 as hardware is very similar and update regulator config in 5.12, overlay and PSCI broke booting, which got fixed in 5.14. Upcoming 5.18 will add rev 1.0 support (currently is supported only 1.01).

Currently it's possible to use mainline kernel via close to mainline kernel linux-postmarketos-qcom-msm8994 package (added in pmaports!2654) – alternative to downstream kernel (only basic hardware support).

For further hacking on mainline kernel compiling with envkernel.sh is recommended.

To see serial console output add kernel parameter console=ttyMSM0,115200,n8.

Update the boot.img to include your local kernel

$ cp "/tmp/postmarketOS-export/boot.img-lg-bullhead" "$TEMP/boot.img"
$ cd .output/arch/arm64/boot/
$ cat Image.gz dts/qcom/msm8992-bullhead-rev-101.dtb > "$TEMP/zImage-dtb"
$ pmbootstrap chroot -- abootimg -u /tmp/mainline/boot.img  -k /tmp/mainline/zImage-dtb
$ pmbootstrap flasher list_devices

You can communicate with the device using screen (or other software, e.g. minicom), so in a separate terminal start it:

$ screen /dev/ttyUSB0 115200

Boot your mobile to the bootloader (power + vol down) and you should see some debug output on the screen.

Boot the kernel using fastboot

$ pmbootstrap chroot -- fastboot boot /tmp/mainline/boot.img

Hardware status / details (downstream kernel, SKU LGH790, rev_1.0)

Note that xfce4 ui on this device boots to black screen, but usb networking is available.

Output of sensors (lm-sensors package):

sensors output

CPU tuning

The default deviceinfo defines boot_cpus=0-3 maxcpus=4, forcing the 2xA57 cores offline. A naive tuning attempt based on oneplus-oneplus2 seems to bring the A57 cores online - but unused. ubench still only recognizes "4 CPUs", and scores are unchanged (compare with much higher MSM8992 xiaomi-libra scores).

Monitor temperatures via sensors or sys-tool (lm-sensors package), (though most values may be null / disabled / 0); systool -v -c [hwmon|thermal] may be more complete. When mainline is available, try tmon (linux-tools-tmon).

Photos

Links