Skip to content

oneplus-onyx: move to armv7, port redone from scratch

This Merge request replaces the old and unmaintained port of oneplus-onyx with a new port done from scratch, with armv7 arch and able to boot the phone.

Prequel

Before this change the oneplus-onyx kernel did not boot if compiled with pmbootstrap, but apparently did boot when compiled with LineageOS toolchain, details on this old issue on the wiki page.

Work done

The oneplus-onyx port looked very old and not uniform to other devices so I ended up redoing the port from scratch.
This new port kernel compiles without needing a lot of patches that were applied in the old port, so I removed them.

With some advice by @afontain and other I managed to make the pmos build kernel boot (with GCC4)

Building with GCC4 required adding CONFIG_NO_ERROR_ON_MISMATCH=y to the gcc options to disable some scary warnings that require more effort to fix properly and I don't know if it's worth it on a downstream kernel.

Display bug

Compiling an image for oneplus-onyx (with this MR included) results in a booting kernel, with a black screen. Adding msm-fb-refresher to the device-oneplus-onyx depends: results in the PostmarketOS logo being shown at boot, after which the phone ends up in some Qualcomm recovery mode, in which the whole eMMC can be mounted from a Linux PC over USB.
I think this is due to a bug in the display driver, that causes the phone to reboot in the Qualcomm recovery mode.
Looking at the kernel config, the CONFIG_MSM_DLOAD_MODE=y seems to be related to the recovery mode I have seen.

I will open an issue dedicated to the display bug but I don't plan on trying to solve this since I only borrowed the phone and my goal was to forward port it from armhf to armv7, referring to #599

Edited by Federico Amedeo Izzo

Merge request reports