Skip to content

device/main/{device-pine64-pinephone,u-boot-pinephone}: boot using original FDT (decompile version)

Arnav Singh requested to merge Arnavion/pmaports:u-boot-2 into master

This change does two things:

  1. u-boot-pinephone is patched to embed the DTBs from the linux-postmarketos-pinephone kernel package instead of building its own DTBs using its own DTSs. Specifically it does this by converting the kernel DTBs back to DTS using dtc and overwriting the DTS that ship with u-boot.

  2. device-pine64-pinephone's boot.scr is modified to pass the FDT built into u-boot to the kernel instead of loading the kernel package one from the boot device.

The reason to do this is that the FDT built into u-boot is modified by TF-A to add CPU idle states definitions durimg boot, and giving this FDT to the kernel instead of the kernel package one allows the CPU idle states to work.

Previously an attempt had been made in ae74e116 to achieve this by encoding those idle states as an FDT patch and applying that patch in boot.scr. However this doesn't actually work; the states are defined but the CPU never enters them. The approach of this commit does work; the states are defined and the CPU is able to enter them.

One complication is that u-boot's source is written such that mmc0 is the SD card and mmc1 is the eMMC even though the hardware enumerates the eMMC as mmc2. The original sunxi-u-boot.dtsi thus aliases mmc1 to mmc2 and lets boot refer to mmc1 as the boot device. Since the kernel DTB does not do this, there is a new u-boot patch to change references to mmc1 to mmc2. Also, since decompiling the DTB using dtc strips all aliases, the aliases defined in sunxi-u-boot.dtsi are now dangling and prevent recompiling the DTS, so the patch removes them.

Fixes #1946 (closed)

Merge request reports