OnePlus Two (oneplus-oneplus2)

Development status
As of 23/05/2021 this device is not recommended to be used for mission critical tasks as it's not possible to connect to the Wi-Fi nor broadband and it's lacking implementation of Direct Rendering Manager (DRM) in linux kernel makes it impossible to use graphical interfaces such as phosh and plasma-mobile.

What works:
 * Kernel compilation
 * Flashing system (including recovery mode flashable zip)
 * Booting kernel via fastboot
 * initramfs boot
 * Flashing kernel
 * USB network
 * SSH connectivity (using USB network only)
 * sxmo
 * Touchscreen

What does NOT work:
 * Wi-Fi (blob needed)
 * Direct Rendering Manager (DRM)
 * phosh
 * plasma-mobile
 * Weston boots to blank screen (no available back-end)
 * Default deviceinfo uses only 4 of available 8 cpu cores

BIOS built-in signals
Majority of all android devices have three signals accessible by pressing physical buttons depending on the runtime state of a device.

Hard shutdown
Pressing and holding POWER button for +- 20 seconds will force device shutdown allowing you to access recovery and fastboot mode.

Recovery
is used to recover a device which Operating System is unable to boot. To access this mode press and hold when the device is turned off

VOLUME_DOWN + POWER

Fastboot
is mainly used during the device production for manufacturer to load the required software onto the device. This mode can also be used to flash 3rd party recovery.

To access it press and hold while device is turned off

VOLUME_UP + POWER

Deployment of pmos on the device
This section covers recommended steps to deploy PostmarketOS on Oneplus2, these steps are made for a reference and should be used with a causion.

pmbootstrap
To install PostmarketOS you need a, see https://wiki.postmarketos.org/wiki/Installing_pmbootstrap for more informations

Once you've installed it, follow-up with  and go through the Terminal interface selecting Vendor `oneplus` and `oneplus2`. If the vendor is not available you might need to use and  channel.

USB-C cable
Lot of USB-C cables are crappy which causes the insulation to get brutal and chip off causing short in-between pins

TODO(Krey): Photo

resulting in a bad connecting and failure to enumerate (identify the USB device for the system) in dmesg seen as:

[535470.046440] usb 2-1: new full-speed USB device number 76 using xhci_hcd [535470.186582] usb 2-1: device descriptor read/64, error -71 [535470.434567] usb 2-1: device descriptor read/64, error -71

Verify using  to ensure that your cable has data pin linked and that it's working without issues for example:

[536030.265487] usb 2-1: new high-speed USB device number 87 using xhci_hcd [536030.421932] usb 2-1: New USB device found, idVendor=18d1, idProduct=4ee2, bcdDevice= 3.10 [536030.421944] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [536030.421948] usb 2-1: Product: Android [536030.421952] usb 2-1: Manufacturer: OnePlus [536030.421956] usb 2-1: SerialNumber: REDACTED [536031.780781] usb 2-1: USB disconnect, device number 87

flashable zip method
Flashable zip files can be installed using: A. Recovery mode B. ADB sideloading

To get a flashable zip invoke: pmbootstrap install --android-recovery-zip

To export it in a default path  use: pmbootstrap export

fastboot method
Put the device in a "fastboot mode" and invoke: pmbootstrap flasher flash_kernel

Hardware details / status
output

See also

CPU tuning
The default  defines. This boots only the 4x 1.56 GHz A53 cores. This can be shown via  (package cpufrequtils), or. The unixbench result for this configuration is 1409.9, similar to other quadcore A53 devices. The default governor is battery-draining "performance".

To utilize all cores, extract and edit (or update)  from   to use. Boot the new image via. Alternatively, edit  and repeat. This configuration will boot the 4x 1.56 GHz A53 cores as cpus 0-3 and the 4x 1.77 GHz A57 cores as cpus 4-7. The unixbench result for this configuration is 2702.1. (Note at present the only other MSM8994 device in the benchmark table, sony-sumire, for unknown reasons uses, and thus has a lower score).

The governor for each quad is assigned separately: This change does not persist across reboots. For a persistent change uniform across all cores, confirm that the governor listed in  is acceptable, then install the service as: Alternatively, reconfigure the kernel (CPU Frequency scaling section).

Affiliates
Maintainer(s): - None

Contributor(s):
 * KREYREN
 * NotKit
 * lduboeuf