Jump to content

OnePlus Two (oneplus-oneplus2): Difference between revisions

From postmarketOS Wiki
IdanHoro (talk | contribs)
m --no-fde removed (deprecated)
Susurrus (talk | contribs)
m Replace deprecated <source> tags with <syntaxhighlight>
 
(29 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{Infobox device
{{Infobox device
| name = OnePlus Two
| name = Two
| manufacturer = OnePlus
| manufacturer = OnePlus
| codename = oneplus-oneplus2
| codename = oneplus-oneplus2
Line 6: Line 6:
| imagecaption = OnePlus Two running Weston
| imagecaption = OnePlus Two running Weston
| releaseyear = 2015
| releaseyear = 2015
| originalsoftware = Android 5.1.1
| originalsoftware = Android
| chipset = Qualcomm Snapdragon 810
| originalversion = 5.1.1
| cpu = Octa-core 64-bit Quad-core 1.77 GHz Cortex-A57
| chipset = Qualcomm Snapdragon 810 (MSM8994)
| cpu = 4x 1.7 GHz A57 + 4x 1.5 GHz A53
| gpu = Adreno 430 650 MHz
| gpu = Adreno 430 650 MHz
| display = 1080x1920 Full HD IPS LCD In-Cell
| display = 1080x1920 Full HD IPS LCD In-Cell
Line 14: Line 15:
| memory = 3 or 4 GB LPDDR4 RAM
| memory = 3 or 4 GB LPDDR4 RAM
| architecture = aarch64
| architecture = aarch64
| type = handset
| status_usbnet = Y
| 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 = N
| status_xwayland = Y  
| status_xwayland = Y  
| status_fde =  
| status_fde =  
| status_mainline =  
| status_mainline = N
| status_battery =
| status_battery = Y
| status_3d =  
| status_3d = N
| status_accel =  
| status_accel = N
| status_audio =  
| status_audio =  
| status_bluetooth =
| status_bluetooth = N
| status_camera =
| status_camera = N
| status_gps =  
| status_gps = N
| status_mobiledata =  
| status_mobiledata = N
| status_sms =  
| status_sms = N
| status_calls =  
| status_calls = N
| booting = yes
| booting = yes
| pmoskernel = 3.10.108
| whet_dhry = 1409.9
}}
}}


== Contributors ==
== Development status ==
* NotKit
* [https://github.com/lduboeuf lduboeuf]


== Maintainer(s) ==
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 ==


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


== What does not work ==
'''What does NOT work:'''
* Wi-Fi (blob needed)
* Direct Rendering Manager (DRM)
** phosh
** plasma-mobile
* Weston boots to blank screen (no available [[Weston#Troubleshooting|back-end]])
* Default deviceinfo uses only 4 of available 8 cpu cores ([[#CPU tuning]])
 
== 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
 
<pre>
VOLUME_DOWN + POWER
</pre>
 
=== 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
 
<pre>
VOLUME_UP + POWER
</pre>
 
== 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.
 
=== Preparation ===
 
==== pmbootstrap ====
 
To install PostmarketOS you need a <code>pmbootstrap</code>, see https://wiki.postmarketos.org/wiki/Installing_pmbootstrap for more informations
 
Once you've installed it, follow-up with <code>pmbootstrap init</code> and go through the Terminal interface selecting Vendor `oneplus` and `oneplus2`. If the vendor is not available you might need to use and <code>edge</code> 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:
 
<pre>
[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
</pre>
 
Verify using <code>dmesg -w</code> to ensure that your cable has data pin linked and that it's working without issues for example:
 
<pre>
[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
</pre>
 
=== Installation ===
 
==== flashable zip method ====
 
Flashable zip files can be installed using:
A. Recovery mode
B. ADB sideloading
 
To get a flashable zip invoke:
<pre>pmbootstrap install --android-recovery-zip</pre>
 
To export it in a default path <code>/tmp/postmarketOS-export/pmos-oneplus-oneplus2.zip</code> use:
<pre>pmbootstrap export</pre>
 
==== fastboot method ====
 
Put the device in a "fastboot mode" and invoke: <pre>pmbootstrap flasher flash_kernel</pre>
 
== Hardware details / status ==


* Wi-Fi (blob needed)
<div class="toccolours mw-collapsible mw-collapsed">
* Hardware-accelerated graphics
<code>hwtest</code> output
* ...
<div class="mw-collapsible-content">
{| class="wikitable feature-colors"
! style="text-align:left;"| Category
! style="text-align:left;"| Model
! style="text-align:left;"| Path
! style="text-align:left;"| Status
! style="text-align:left;"| Value
|-
|framebuffer
|mdssfb_90000
|/sys/class/graphics/fb0
| class="feature-yes"| Working
|U:1080x1920p-360
|-
|framebuffer
|mdssfb_a0000
|/sys/class/graphics/fb1
| class="feature-yes"| Working
|
|-
|input
|gpio-keys
|/dev/input/event6
| class="feature-yes"| Working
|
|-
|input
|synaptics
|/dev/input/event5
| class="feature-yes"| Working
|
|-
|input
|synaptics
|/dev/input/event4
| class="feature-yes"| Working
|
|-
|input
|qpnp_pon
|/dev/input/event3
| class="feature-yes"| Working
|
|-
|input
|STM VL6180 proximity sensor
|/dev/input/event2
| class="feature-yes"| Working
|
|-
|input
|fpc1020
|/dev/input/event1
| class="feature-yes"| Working
|
|-
|input
|tri-state-key
|/dev/input/event0
| class="feature-yes"| Working
|
|}
 
See also <code>/sys/project_info/component_info/</code>
</div>
</div>


== How to enter flash mode ==
=== CPU tuning ===


From a power off state, hold the '''volume up''' and '''power''' buttons until the device vibrates. The display should then light up and say "Fastboot Mode".
The default <code>deviceinfo</code> defines <code>boot_cpus=0-3</code>.  This boots only the 4x 1.56 GHz A53 cores. This can be shown via <code>cpufreq-info</code> (package cpufrequtils), or <code>htop</code>.  The [[Unixbench|unixbench]] result for this configuration is 1409.9, similar to other quadcore A53 devices.
The default governor is ''battery-draining'' "performance".


== Installation ==
To utilize all cores, extract and edit (or update) <code>bootimg.cfg</code> from <code>boot.img</code> to use <code>boot_cpus=0-7</code>.  Boot the new image via <code>fastboot boot boot.img</code>.  Alternatively, edit <code>deviceinfo</code> and repeat <code>pmbootstrap install</code>.  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|unixbench]] result for this configuration is 2702.1. (Note at present the only other MSM8994 device in the benchmark table, [[Sony_Xperia_Z5_(sony-sumire)|sony-sumire]], for unknown reasons uses <code>boot_cpus=0-5</code>, and thus has a lower score).


I ran into networking issues with default installation procedure ( install-> flash_rootfs -> flash_kernel)
The governor for each quad is assigned separately:
Get it working by installing recovery with TWRP:
<syntaxhighlight lang="shell">
<pre>pmbootstrap install --android-recovery-zip</pre>  
$ sudo cpufreq-set -c 0 -r -g ondemand
$ sudo cpufreq-set -c 4 -r -g ondemand
</syntaxhighlight>
This change does not persist across reboots.  For a persistent change uniform across all cores, confirm that the governor listed in <code>/etc/conf.d/cpufrequtils</code> is acceptable, then install the service as:
<syntaxhighlight lang="shell">
$ sudo rc-update add cpufrequtils boot
</syntaxhighlight>
Alternatively, reconfigure the kernel (CPU Frequency scaling section).


next copy zip file to device and install it using twrp
== Affiliates ==


in fastboot mode : <pre>pmbootstrap flasher flash_kernel</pre>
Maintainer(s):
- None


Contributor(s):
* [https://github.com/KREYREN KREYREN]
* NotKit
* [https://github.com/lduboeuf lduboeuf]


== Links ==
== References ==


* [https://github.com/postmarketOS/pmbootstrap/tree/master/aports/device/device-oneplus-oneplus2 Device package]
# {{Device package|oneplus-oneplus2}}
* [https://github.com/postmarketOS/pmbootstrap/tree/master/aports/device/linux-oneplus-oneplus2 Kernel package]
# {{Kernel package|oneplus-oneplus2}}
# [https://github.com/mukul2259/stealth_oneplus2 3rd party kernel used in AOSP Extended]
# {{wikipedia|OnePlus_2|Wiki page of the device}}

Latest revision as of 20:36, 13 April 2024

OnePlus Two
OnePlus Two running Weston
OnePlus Two running Weston
Manufacturer OnePlus
Name Two
Codename oneplus-oneplus2
Released 2015
Type handset
Hardware
Chipset Qualcomm Snapdragon 810 (MSM8994)
CPU 4x 1.7 GHz A57 + 4x 1.5 GHz A53
GPU Adreno 430 650 MHz
Display 1080x1920 Full HD IPS LCD In-Cell
Storage 16 or 64 GB eMMC v5.0
Memory 3 or 4 GB LPDDR4 RAM
Architecture aarch64
Software
Original software Android
Original version 5.1.1
postmarketOS
Category testing
Pre-built images no
Mainline no
postmarketOS kernel 3.10.108
Unixbench Whet/Dhry score 1409.9
Features
Flashing
Works
USB Networking
Works
Internal storage
No data
SD card
No data
Battery
Works
Screen
Works
Touchscreen
Works
Multimedia
3D Acceleration
Broken
Audio
No data
Camera
Broken
Camera Flash
No data
Connectivity
WiFi
Broken
Bluetooth
Broken
GPS
Broken
NFC
No data
Modem
Calls
Broken
SMS
Broken
Mobile data
Broken
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


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 (#CPU tuning)

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.

Preparation

pmbootstrap

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

Once you've installed it, follow-up with pmbootstrap init and go through the Terminal interface selecting Vendor `oneplus` and `oneplus2`. If the vendor is not available you might need to use and edge 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 dmesg -w 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

Installation

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 /tmp/postmarketOS-export/pmos-oneplus-oneplus2.zip use:

pmbootstrap export

fastboot method

Put the device in a "fastboot mode" and invoke:

pmbootstrap flasher flash_kernel

Hardware details / status

hwtest output

Category Model Path Status Value
framebuffer mdssfb_90000 /sys/class/graphics/fb0 Working U:1080x1920p-360
framebuffer mdssfb_a0000 /sys/class/graphics/fb1 Working
input gpio-keys /dev/input/event6 Working
input synaptics /dev/input/event5 Working
input synaptics /dev/input/event4 Working
input qpnp_pon /dev/input/event3 Working
input STM VL6180 proximity sensor /dev/input/event2 Working
input fpc1020 /dev/input/event1 Working
input tri-state-key /dev/input/event0 Working

See also /sys/project_info/component_info/

CPU tuning

The default deviceinfo defines boot_cpus=0-3. This boots only the 4x 1.56 GHz A53 cores. This can be shown via cpufreq-info (package cpufrequtils), or htop. 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) bootimg.cfg from boot.img to use boot_cpus=0-7. Boot the new image via fastboot boot boot.img. Alternatively, edit deviceinfo and repeat pmbootstrap install. 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 boot_cpus=0-5, and thus has a lower score).

The governor for each quad is assigned separately:

$ sudo cpufreq-set -c 0 -r -g ondemand
$ sudo cpufreq-set -c 4 -r -g ondemand

This change does not persist across reboots. For a persistent change uniform across all cores, confirm that the governor listed in /etc/conf.d/cpufrequtils is acceptable, then install the service as:

$ sudo rc-update add cpufrequtils boot

Alternatively, reconfigure the kernel (CPU Frequency scaling section).

Affiliates

Maintainer(s): - None

Contributor(s):

References

  1. Device package
  2. Kernel package
  3. 3rd party kernel used in AOSP Extended
  4. Wiki page of the device