Jump to content

OnePlus 5 (oneplus-cheeseburger): Difference between revisions

From postmarketOS Wiki
Deathmist (talk | contribs)
m OnePlus 5: Confirm BT as working in mainline kernel
Deathmist (talk | contribs)
m OnePlus 5: Touchscreen now works on mainline thanks to r0551, update wiki page device image
Line 3: Line 3:
| name =  5
| name =  5
| codename = oneplus-cheeseburger
| codename = oneplus-cheeseburger
| image = File:OnePlus-5-Weston.jpg
| image = File:OnePlus-5-GNOME-Mainline.jpg
| imagecaption =  
| imagecaption =  
| releaseyear = 2017
| releaseyear = 2017
Line 289: Line 289:
* Xorg & Wayland (tested with [https://i.imgur.com/VgsaOtY.jpg MATE] & [https://i.imgur.com/dLItMIm.jpg Weston] respectively)
* Xorg & Wayland (tested with [https://i.imgur.com/VgsaOtY.jpg MATE] & [https://i.imgur.com/dLItMIm.jpg Weston] respectively)
* Bluetooth (requires <code>crbtfw21.tlv</code> and <code>crnv21.bin</code> blobs from [https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/qca linux-firmware] + a <code>hciconfig hci0 up</code> in userspace)
* Bluetooth (requires <code>crbtfw21.tlv</code> and <code>crnv21.bin</code> blobs from [https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/qca linux-firmware] + a <code>hciconfig hci0 up</code> in userspace)
* Touchscreen (using mainline Synaptics RMI4 I2C driver)
* Power button (in [https://github.com/JamiKettunen/linux-mainline-cheeseburger/blob/device-oneplus-cheeseburger/arch/arm64/boot/dts/qcom/pm8998.dtsi#L41 DTS])
* Power button (in [https://github.com/JamiKettunen/linux-mainline-cheeseburger/blob/device-oneplus-cheeseburger/arch/arm64/boot/dts/qcom/pm8998.dtsi#L41 DTS])



Revision as of 13:38, 19 March 2020

OnePlus 5
Manufacturer OnePlus
Name 5
Codename oneplus-cheeseburger
Released 2017
Hardware
Chipset Qualcomm MSM8998 Snapdragon 835
CPU 4x 2.45 GHz Cortex-A73
4x 1.90 GHz Cortex-A53
GPU Adreno 540
Display 1080x1920 Optic AMOLED
Storage 64 or 128 GB UFS 2.1
Memory 6 or 8 GB LPDDR4X RAM
Architecture aarch64
Software
Android 7.1.1 (up to Android 9) on Linux 4.4
Android 7.1.1 (up to Android 9) on Linux 4.4
no
Device package device-oneplus-cheeseburger
Kernel package linux-oneplus-cheeseburger
Features
Works
Works
Broken
Works
Touchscreen
Works
Multimedia
3D Acceleration
Broken
Broken
Camera
Broken
Connectivity
WiFi
Broken
Bluetooth
Broken
GPS
Untested
Modem
Calls
Broken
SMS
Broken
Mobile data
Broken
Miscellaneous
Broken
Works
Sensors
Untested

Contributors

  • deathmist
  • R0551 (mainlining)

Maintainer(s)

deathmist

Users owning this device

Fastboot mode

The OnePlus 5 uses fastboot as its flashing protocol.

To enter fastboot mode, hold Volume Up while powering on the device. Release the button when FastBoot Mode can be seen on the display.

Installation

Unlocking the bootloader

If your bootloader is still locked at this point, you need to unlock it to proceed.

WARNING: Doing this WILL delete all your data on the device as a security precaution, so backup all your data before continuing!

There are plenty of guides online describing how to do this, but the run-down should be as follows:

  1. Enable Developer options by tapping the build number 7 times in Settings > About
  2. Go back and enter Developer options to enable both USB Debugging and OEM Unlocking
  3. Install the android-tools-fastboot or android-tools package depending on your machine's distro
  4. Power down your OnePlus 5 & enter fastboot mode using the instructions above this section
  5. Open a terminal window and verify your phone is displayed under fastboot devices to continue
  6. Run fastboot oem unlock and follow the instructions on screen. Navigate menus with Volume Up/Down and select an option with the Power button.
  7. Congrats, you should now have an unlocked bootloader on your device!

Setup build env & create flashables

Install pmbootstrap on your build machine and start following the steps below:

pmbootstrap init
pmbootstrap install

NOTICE: Both phosh and plasma-mobile are NOT working at all currently; this should be solved later by mainlining and using the freedreno DRM driver for graphics & mesa 3D acceleration.

Flashing the device

To begin the flashing process, boot your device to fastboot mode (if you haven't already). The standard flashing process goes as follows:

pmbootstrap flasher flash_rootfs
pmbootstrap flasher flash_kernel
sudo fastboot reboot

If you instead want to install the pmOS root filesystem on userdata partition (around 56 or 120 GB) instead of the system partition (3 GB), run the following instead as the flash_rootfs command:

pmbootstrap flasher flash_rootfs --partition userdata

During e.g. rapid kernel development you can simply boot the new image instead of always flashing to the device boot partition like so:

pmbootstrap flasher boot

LEDs

Currently you can control a whole bunch of the LEDs present on the device via sysfs by writing values to their brightness control files as root:

Screen brightness (0-255) can be adjusted: echo 255 > /sys/class/leds/lcd-backlight/brightness

The backlight for physical buttons can be enabled (1) or disabled (0): echo 1 > /sys/class/leds/button-backlight/brightness

Notification light color & brightness (0-255) are controllable:

  • Red: echo 255 > /sys/class/leds/red/brightness
  • Green: echo 255 > /sys/class/leds/green/brightness
  • Blue: echo 255 > /sys/class/leds/blue/brightness

Control of the rear camera flashlight (/sys/class/leds/torch-light*/brightness) seems to be broken via sysfs anyway right now.

Partition layout

oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sda

oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sdb

oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sdc

oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sdd

oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sde

oneplus5:~# fdisk -l -o Device,Start,End,Sectors,Size,Name /dev/sdf


Mainline kernel

This is heavily W.I.P currently but it does at least boot to the pmOS initramfs with functional simplefb graphics!

Here's a list of stuff that is currently (Linux 5.6-rc5) known to be working:

  • The kernel itself stays booted (i.e. no random panics) and is "stable"
  • UFS internal storage (CONFIG_PHY_QCOM_UFS=y)
  • Display (via simplefb & CONFIG_FB_SIMPLE=y)
  • Xorg & Wayland (tested with MATE & Weston respectively)
  • Bluetooth (requires crbtfw21.tlv and crnv21.bin blobs from linux-firmware + a hciconfig hci0 up in userspace)
  • Touchscreen (using mainline Synaptics RMI4 I2C driver)
  • Power button (in DTS)

And that's about it for now. Next up would be USB as I've been doing this blind and don't exactly have a great setup to debug stuff / get logs :p

Check the links below for source code.

Links