megi's PinePhone Development Log RSS


2023–05–27: Implementing display support in U-Boot for Pinephone Pro

Chris Morgan recently added a Rockchip MIPI DSI video bridge driver to U-Boot, for RK3366, in order to detect LCD panels used on Anbernic RGXX3 devices by querying them for their ID and modifying device tree in U-Boot so that Linux sees correctly configured LCD panel in the device tree.

Anyway, this driver is one small part of the puzzle to make display output work in U-Boot on Pinephone Pro.

I decided to finish my work on display support in U-Boot from November 2022, based on this new driver and some other recent video cleanups done in the upstream early this year.

After playing with U-Boot video code for a bit, I managed to come up with some upstreamable approach and patches, that work. I've already started sending out some of them that are ready to be upstreamed:

I haven't upstreamed much code to U-Boot, yet, so I wonder how the process will go.

All of these patches, and the rest that are needed are in my U-Boot Pinephone Pro branch along with a working U-Boot configuration. You can build this U-Boot according to the rough guide from the previous post.

Next steps

U-Boot is not great at UI or non-keyboard input, let alone a combination of it. It actually quite sucks at it. So this display support will mostly only add visual feedback to the boot process, until that time when U-Boot gets an improved UI.

It's still also slow as molasses, taking ages to go past the first few boot stages (especially with the Rockchip blobs), to the last one where the display output is implemented. So this is not as joyful as p-boot bootloader that I implemented for original Pinephone.

Nevertheless, I've also enabled input from volume keys and power key, so nothing prevents some form of UI to be adapted to this limited set of keys. If you can manage with Up/Down Arrows and Return key in your boot script, you can certainly use this new code to make a compelling GUI boot menu via a boot script and some BMP bitmaps.

Other than that, default bootmenu functionality provided by bootflow or bootmenu command seems to suck ass currently, and doesn't seem to be usable at all with the volume and power buttons. All this just means you'll get no usable boot menu from a standard distro boot config.

You can still do as you please if you write a custom script for your particular U-Boot installation. What's currently implemented is good enough to create similar UI to p-boot. You'll just need to get your hands dirty writing a boot script that will put bitmaps in the right place overlay text on them, process input, etc.

At some point, after Goodix touchscreen driver is also ported to U-Boot, U-Boot on Pinephone Pro may be able to support touch based menus like the ones I implemented many years ago for older version of U-Boot on another portable device:

Hapy hacking! ;)