2021–10–21:
Pinephone Pro – levinboot payload selection
I've extended Levinboot
with support for chosing which payload to boot based on status of volume keys.
Levinboot will also report which payload was booted using LED color. Ordering of
payloads is based on physical location of volume keys, thus:
- Just power key press: payload A, red LED (on my setup this is the kernel
version that is actively under development and possibly broken/may fail
to boot)
- Power key + volume down: payload B, blue LED (second testing kernel, less
debug output)
- Power key + volume down: payload C, green LED (failsafe, known to work
kernel)
Here's a little demo:
With this setup it's easy to quickly try new kernel changes without any
worry, and without having to swap uSD cards or open the phone ever again. The
feeback cycle from code change to a booted kernel can be as fast as 10s, which
makes for very pleasant development experience.
5.15 kernel fixed
I've managed to identify the cause for boot hangs on 5.15 kernel. The hang
happens in of_platform_default_populate
when processing the newly
added debug@fe610000
(arm coresight) DT nodes (specifically the
ones for the big ARM cores).
Precise reason is unknown to me, but I can live without the coresight
support, so I commented those nodes out, and the 5.15 kernel now
boots fine.
This allowed me to start playing with camera sensors support. I tried to add
as much necessary support for the cameras as possible, and found a few issues in
the process:
- IMX258 device tree bindings had some documented properties that were
nevertheless not implemented by the driver. I've added support for those to the
driver.
- IMX258 driver is made to only work with 19.2 Mhz clock which the rk3399
can't provide precisely. So I've made the driver accept somewhat unprecise
frequency that rk3399 can generate.
- Making rk3399 generate the proper frequency on the
CIF_OUT
pin
required changing parent of the cif_out
clock to something else
than the default 24 MHz
oscillator. I had to patch the rk3399
driver to export the cif_out_src
clock to allow configuring the
parent via assigned-clock-parents
DT property.
I've pushed my changes to my kernel tree to
various branches. I've added DT
changes that should match the hardware, but for some reason cameras don't
work yet and will need more debugging.
I've also found out that SD card power supply was wrongly defined in the DT.
Interestingly a lot of regulators in the phone are enabled automatically by
chaining output of one regulator to the enable pin of the dependent regulator.
This was the case with SD card regulator, too.