allwinner: Find DTB in BL33 image
The initial PMIC setup for the Allwinner platform is quite board
specific, and used to be guarded by reading the .dtb stub *name* from the
SPL image in the legacy ATF port. This doesn't scale particularly well,
and requires constant maintainance.
Instead having the actual .dtb available would be much better, as the PMIC
setup requirements could be read from there directly.
The only available BL33 for Allwinner platforms so far is U-Boot, and
fortunately U-Boot comes with the full featured .dtb, appended to the
end of the U-Boot image.

Introduce some code that scans the beginning of the BL33 image to look
for the load address, which is followed by the image size. Adding those
two values together gives us the end of the image and thus the .dtb
address. Verify that this heuristic is valid by sanitising some values
and checking the DTB magic.

Print out the DTB address and the model name, if specified in the root
node.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
1 parent eae5fe7 commit 41538930555182e4c36f44677e5df2b97d266350
@Andre Przywara Andre Przywara authored on 15 Sep 2018
Showing 3 changed files
View
plat/allwinner/common/allwinner-common.mk
View
plat/allwinner/common/include/platform_def.h
View
plat/allwinner/common/sunxi_bl31_setup.c