OnePlus 9 & 9 Pro (oneplus-lemonade & oneplus-lemonadep)

From postmarketOS
Jump to navigation Jump to search
OnePlus 9 & 9 Pro
OnePlus 9 booting mainline with simple framebuffer.
OnePlus 9 booting mainline with simple framebuffer.
Manufacturer OnePlus
Name 9 & 9 Pro
Codename oneplus-lemonadep, oneplus-lemonade
Released 2021
Category testing
Original software Android 11 on Linux 5.4
Hardware
Chipset Qualcomm SM8350 Snapdragon 888
CPU Octa-core (1x2.84 GHz Kryo 680 & 3x2.42 GHz Kryo 680 & 4x1.80 GHz Kryo 680)
GPU Adreno 660
Display 1440x3216 120Hz AMOLED (9 pro), 1080x2400 120Hz AMOLED (9)
Storage 128/256 GiB
Memory 8/12 GiB
Architecture aarch64
Features
USB Networking
Works
Flashing
Partial
Touchscreen
Display
WiFi
Xwayland
FDE
Mainline
Works
Battery
3D Acceleration
Accelerometer
Audio
Bluetooth
Camera
GPS
Mobile data
SMS
Calls
USB OTG
NFC


Contributors

robbbbbb, aissa, paweier

Users owning this device


How to enter flash mode

TLDR:

1. Enable Developer Options: Settings -> About Phone -> Click on "Build number" 9 times
2. OEM unlocking: System -> Developer options -> Enable "OEM unlocking"
3. Unlock the bootloader: Unplug and turnoff the device -> Hold power with volume up and down simultaneously -> Fastboot logo should appear
4. Finally: open terminal -> fastboot oem unlock

Non-TLDR:

Unlocking and rooting the phone

Installation

BACKUP YOUR DEVICE FIRST especially (but not limited to) the dtbo, super, and boot partitions (Backing partitions with ADB).

You can try pulling original super.img to restore to Android later:

adb pull /dev/block/by-name/super super.img

Install pmbootstrap first (installation guide)

Currently need to update mkinitfs for pmbootstrap builds to boot. For now an option is to manually create a boot image which works:

pmbootstrap chroot -r
mkbootimg-osm0sis \
   --header_version 2 \
   --pagesize 4096 \
   --base 0x00000000 \
   --kernel_offset 0x00008000 \
   --ramdisk_offset 0x01000000 \
   --tags_offset 0x00000100 \
   --dtb_offset 0x0000000001f00000 \
   --cmdline 'fw_devlink=permissive clk_ignore_unused PMOS_NO_OUTPUT_REDIRECT' \
   --kernel /boot/vmlinuz-oneplus-lemonade \
   --ramdisk /boot/initramfs-oneplus-lemonade \
   --dtb /usr/share/dtb/qcom/sm8350-oneplus-lemonade.dtb \
   --output /boot/boot.img
exit
cd ~/.local/var/pmbootstrap/chroot_rootfs_oneplus-lemonade/boot/
fastboot flash dtbo dtbo.img
fastboot boot boot.img

Support for the new "super" partition is currently being worked on. For now if you want to boot to rootfs, you can run `pmbootstrap flasher flash_rootfs --partition super`. As above backup first, or you will have a fun time trying to restore Android.

See also

pmaports!2459 Initial merge request

Matrix room: sm8350 mainlining