This series completes the work to enable VBE on a suitable board. Most of it is rockchip-specific patches to support the VPL phase, i.e. the one which decides which boot patch to take (A, B or recovery).
A good chunk of this series is adding an image for VBE, by creating a new Binman image. Future work in Binman may make this more automated / easier, but for now it is written out in full. The work is undertaken piecemeal so it is easier to review the steps. VBE allows similar boards to share firmware images, with perhaps just TPL (around 75K) being different for each board. Using a common image for VPL, SPL and U-Boot saves a lot of space in the image and makes builds easier. Of course, each board still needs a separate devicetree. Here is the layout of the image: Name Image-pos Size Entry-type Offset Uncomp-size ---------------------------------------------------------------------------------------------- image 0 1b960cf section 0 alternates-fdt 8000 31000 alternates-fdt 8000 mkimage 8000 31000 mkimage 0 u-boot-tpl 8048 12a11 u-boot-tpl 48 vpl 208000 16200 fit 208000 image-vpl 209400 a5a3 section 1400 section 209400 a5a3 section 0 u-boot-vpl-nodtb 10348 u-boot-vpl-nodtb 0 u-boot-vpl-bss-pad 20 u-boot-vpl-bss-pad 10348 @fdt-SEQ 0 0 section 0 vbe-a 800000 39b200 section 800000 spl-a 800000 100000 fit 0 spl 801400 10c97 section 1400 section 801400 10c97 section 0 u-boot-spl-nodtb 1a908 u-boot-spl-nodtb 0 u-boot-spl-bss-pad 1b0 u-boot-spl-bss-pad 1a908 @fdt-SEQ 0 0 section 0 u-boot-a 900000 29b200 fit 100000 spl 902400 10c97 section 2400 section 902400 10c97 section 0 u-boot-spl-nodtb 1a908 u-boot-spl-nodtb 0 u-boot-spl-bss-pad 1b0 u-boot-spl-bss-pad 1a908 u-boot 913200 e4250 section 13200 u-boot-nodtb 913200 e4250 u-boot-nodtb 0 @atf-SEQ 0 0 section 0 atf-bl31 0 0 atf-bl31 0 @tee-SEQ 0 0 section 0 tee-os 0 0 tee-os 0 @fdt-SEQ 0 0 section 0 vbe-b 1000000 39b200 section 1000000 spl-b 1000000 100000 fit 0 spl 1001400 10c97 section 1400 section 1001400 10c97 section 0 u-boot-spl-nodtb 1a908 u-boot-spl-nodtb 0 u-boot-spl-bss-pad 1b0 u-boot-spl-bss-pad 1a908 @fdt-SEQ 0 0 section 0 u-boot-b 1100000 29b200 fit 100000 spl 1102400 10c97 section 2400 section 1102400 10c97 section 0 u-boot-spl-nodtb 1a908 u-boot-spl-nodtb 0 u-boot-spl-bss-pad 1b0 u-boot-spl-bss-pad 1a908 u-boot 1113200 e4250 section 13200 u-boot-nodtb 1113200 e4250 u-boot-nodtb 0 @atf-SEQ 0 0 section 0 atf-bl31 0 0 atf-bl31 0 @tee-SEQ 0 0 section 0 tee-os 0 0 tee-os 0 @fdt-SEQ 0 0 section 0 vbe-recovery 1800000 39b200 section 1800000 spl-recovery 1800000 100000 fit 0 spl 1801400 10c97 section 1400 section 1801400 10c97 section 0 u-boot-spl-nodtb 1a908 u-boot-spl-nodtb 0 u-boot-spl-bss-pad 1b0 u-boot-spl-bss-pad 1a908 @fdt-SEQ 0 0 section 0 u-boot-recovery 1900000 29b200 fit 100000 spl 1902400 10c97 section 2400 section 1902400 10c97 section 0 u-boot-spl-nodtb 1a908 u-boot-spl-nodtb 0 u-boot-spl-bss-pad 1b0 u-boot-spl-bss-pad 1a908 u-boot 1913200 e4250 section 13200 u-boot-nodtb 1913200 e4250 u-boot-nodtb 0 @atf-SEQ 0 0 section 0 atf-bl31 0 0 atf-bl31 0 @tee-SEQ 0 0 section 0 tee-os 0 0 tee-os 0 @fdt-SEQ 0 0 section 0 fdtmap 1b9b200 2ecf fdtmap 1b9b200 Unfortunately I got a bit lost trying to figure out the bloblist code, despite my being the original author. So for now I have included a revert of a recent patch, so that the logic can be simplified and more in keeping with the original intent. We may in fact need a symbol which specifically says which phase creates the bloblist, but I'm not completely sure of what the reverted patch was trying to achieve. This is (mostly) the final VBE series, but there are a few loose ends to tidy up: - cache is disabled in SPL, which slows the boot a little - pinctrl init needs to be tidied up to avoid warnings Other things may become apparently after more usage / testing. Simon Glass (29): arm: Support a separate stack for VPL spl: Adjust xPL symbols spl: Allow VBE to handle xPL size vbe: Show the margin when using SPL_RELOC rockchip: Allow RAM init to happen in SPL on rk3399 rockchip: dts: Factor out arch and compression rockchip: Add an fdtmap rockchip: Add more space below the stack pointer with kevin rockchip: dts: Create a template for the FIT rockchip: dts: Un-indent the FIT template rockchip: dts: Correct the OS for U-Boot rockchip: Specify the phase in the image rockchip: Provide a bootstd configuration rockchip: Add SPL into the main FIT rockchip: Include a compatible string in each configuration rockchip: Set the skip-at-start property correctly rockchip: Add a template for SPL rockchip: Add a VPL image rockchip: Add TPL alternatives rockchip: Update rk3399 bootph-tags for VPL rockchip: Provide a VPL phase on rk3399 rockchip: Add symbols for spl_reloc rockchip: Adjust rk3399 TPL-stack to the same as SPL rockchip: Allow SPL to set up SDRAM rockchip: Add a generic rk3399 board rockchip: Add documentation for VBE gitlab: Add an VBE board to the sjg lab Revert "bloblist: Load the bloblist from the previous loader" bloblist: Allow relocation at the end of the SPL phase .gitlab-ci.yml | 6 + arch/arm/dts/rk3399-generic-u-boot.dtsi | 32 ++ arch/arm/dts/rk3399-generic.dts | 30 ++ arch/arm/dts/rk3399-u-boot.dtsi | 9 +- arch/arm/dts/rockchip-u-boot.dtsi | 455 +++++++++++++----- arch/arm/include/asm/spl.h | 1 + arch/arm/lib/crt0_64.S | 4 +- arch/arm/mach-rockchip/Kconfig | 25 +- arch/arm/mach-rockchip/Makefile | 6 +- arch/arm/mach-rockchip/rk3399/Kconfig | 11 +- arch/arm/mach-rockchip/spl-boot-order.c | 3 +- arch/arm/mach-rockchip/spl.c | 3 + arch/arm/mach-rockchip/tpl.c | 12 +- arch/arm/mach-rockchip/u-boot-tpl-v8.lds | 13 + arch/arm/mach-rockchip/u-boot-vpl-v8.lds | 107 ++++ arch/arm/mach-rockchip/vpl.c | 53 ++ board/rockchip/evb_rk3399/MAINTAINERS | 5 + cmd/vbe.c | 8 +- common/Kconfig | 20 + common/bloblist.c | 77 ++- common/spl/Kconfig | 1 + common/spl/Kconfig.vpl | 13 + common/spl/spl.c | 11 + common/spl/spl_reloc.c | 14 +- configs/anbernic-rgxx3-rk3566_defconfig | 2 +- configs/bpi-r2-pro-rk3568_defconfig | 2 +- configs/chromebit_mickey_defconfig | 2 +- configs/chromebook_bob_defconfig | 4 +- configs/chromebook_jerry_defconfig | 2 +- configs/chromebook_kevin_defconfig | 4 +- configs/chromebook_minnie_defconfig | 2 +- configs/chromebook_speedy_defconfig | 2 +- configs/cm3588-nas-rk3588_defconfig | 2 +- configs/coolpi-4b-rk3588s_defconfig | 2 +- configs/coolpi-cm5-evb-rk3588_defconfig | 2 +- configs/coolpi-cm5-genbook-rk3588_defconfig | 2 +- configs/eaidk-610-rk3399_defconfig | 2 +- configs/evb-px30_defconfig | 2 +- configs/evb-px5_defconfig | 2 +- configs/evb-rk3036_defconfig | 2 +- configs/evb-rk3229_defconfig | 2 +- configs/evb-rk3288_defconfig | 2 +- configs/evb-rk3308_defconfig | 2 +- configs/evb-rk3328_defconfig | 2 +- configs/evb-rk3399_defconfig | 2 +- configs/evb-rk3568_defconfig | 2 +- configs/evb-rk3588_defconfig | 2 +- configs/ficus-rk3399_defconfig | 2 +- configs/firefly-px30_defconfig | 2 +- configs/firefly-rk3288_defconfig | 2 +- configs/firefly-rk3399_defconfig | 2 +- configs/generic-rk3568_defconfig | 2 +- configs/generic-rk3588_defconfig | 2 +- configs/jaguar-rk3588_defconfig | 2 +- configs/khadas-edge-captain-rk3399_defconfig | 2 +- configs/khadas-edge-rk3399_defconfig | 2 +- configs/khadas-edge-v-rk3399_defconfig | 2 +- configs/kylin-rk3036_defconfig | 2 +- configs/leez-rk3399_defconfig | 2 +- configs/lubancat-2-rk3568_defconfig | 2 +- configs/miqi-rk3288_defconfig | 2 +- configs/mk808_defconfig | 2 +- configs/nanopc-t4-rk3399_defconfig | 2 +- configs/nanopc-t6-rk3588_defconfig | 2 +- configs/nanopi-m4-2gb-rk3399_defconfig | 2 +- configs/nanopi-m4-rk3399_defconfig | 2 +- configs/nanopi-m4b-rk3399_defconfig | 2 +- configs/nanopi-neo4-rk3399_defconfig | 2 +- configs/nanopi-r2c-plus-rk3328_defconfig | 2 +- configs/nanopi-r2c-rk3328_defconfig | 2 +- configs/nanopi-r2s-plus-rk3328_defconfig | 2 +- configs/nanopi-r2s-rk3328_defconfig | 2 +- configs/nanopi-r4s-rk3399_defconfig | 2 +- configs/nanopi-r5c-rk3568_defconfig | 2 +- configs/nanopi-r5s-rk3568_defconfig | 2 +- configs/nanopi-r6c-rk3588s_defconfig | 2 +- configs/nanopi-r6s-rk3588s_defconfig | 2 +- configs/neu2-io-rv1126_defconfig | 2 +- configs/neu6a-io-rk3588_defconfig | 2 +- configs/neu6b-io-rk3588_defconfig | 2 +- configs/nova-rk3588s_defconfig | 2 +- configs/odroid-go2_defconfig | 2 +- configs/odroid-m1-rk3568_defconfig | 2 +- configs/odroid-m1s-rk3566_defconfig | 2 +- configs/odroid-m2-rk3588s_defconfig | 2 +- configs/orangepi-3b-rk3566_defconfig | 2 +- configs/orangepi-5-plus-rk3588_defconfig | 2 +- configs/orangepi-5-rk3588s_defconfig | 2 +- configs/orangepi-r1-plus-lts-rk3328_defconfig | 2 +- configs/orangepi-r1-plus-rk3328_defconfig | 2 +- configs/orangepi-rk3399_defconfig | 2 +- configs/phycore-rk3288_defconfig | 2 +- configs/pinebook-pro-rk3399_defconfig | 2 +- configs/pinephone-pro-rk3399_defconfig | 2 +- configs/pinetab2-rk3566_defconfig | 2 +- configs/popmetal-rk3288_defconfig | 2 +- configs/powkiddy-x55-rk3566_defconfig | 2 +- configs/puma-rk3399_defconfig | 2 +- configs/px30-core-ctouch2-of10-px30_defconfig | 2 +- configs/px30-core-ctouch2-px30_defconfig | 2 +- configs/px30-core-edimm2.2-px30_defconfig | 2 +- configs/qnap-ts433-rk3568_defconfig | 2 +- configs/quartz64-a-rk3566_defconfig | 2 +- configs/quartz64-b-rk3566_defconfig | 2 +- configs/quartzpro64-rk3588_defconfig | 2 +- configs/radxa-cm3-io-rk3566_defconfig | 2 +- configs/radxa-e25-rk3568_defconfig | 2 +- configs/radxa-zero-3-rk3566_defconfig | 2 +- configs/rk3399-generic_defconfig | 133 +++++ configs/roc-cc-rk3308_defconfig | 2 +- configs/roc-cc-rk3328_defconfig | 2 +- configs/roc-pc-mezzanine-rk3399_defconfig | 2 +- configs/roc-pc-rk3399_defconfig | 2 +- configs/rock-3a-rk3568_defconfig | 2 +- configs/rock-3b-rk3568_defconfig | 2 +- configs/rock-3c-rk3566_defconfig | 2 +- configs/rock-4c-plus-rk3399_defconfig | 2 +- configs/rock-4se-rk3399_defconfig | 2 +- configs/rock-5-itx-rk3588_defconfig | 2 +- configs/rock-pi-4-rk3399_defconfig | 2 +- configs/rock-pi-4c-rk3399_defconfig | 2 +- configs/rock-pi-e-rk3328_defconfig | 2 +- configs/rock-pi-e-v3-rk3328_defconfig | 2 +- configs/rock-pi-n10-rk3399pro_defconfig | 2 +- configs/rock-pi-n8-rk3288_defconfig | 2 +- configs/rock-pi-s-rk3308_defconfig | 2 +- configs/rock-s0-rk3308_defconfig | 2 +- configs/rock2_defconfig | 2 +- configs/rock5a-rk3588s_defconfig | 2 +- configs/rock5b-rk3588_defconfig | 2 +- configs/rock64-rk3328_defconfig | 2 +- configs/rock960-rk3399_defconfig | 2 +- configs/rock_defconfig | 2 +- configs/rockpro64-rk3399_defconfig | 2 +- configs/sige7-rk3588_defconfig | 2 +- configs/sonoff-ihost-rv1126_defconfig | 2 +- configs/soquartz-blade-rk3566_defconfig | 2 +- configs/soquartz-cm4-rk3566_defconfig | 2 +- configs/soquartz-model-a-rk3566_defconfig | 2 +- configs/tiger-rk3588_defconfig | 2 +- configs/tinker-rk3288_defconfig | 2 +- configs/tinker-s-rk3288_defconfig | 2 +- configs/toybrick-rk3588_defconfig | 2 +- configs/turing-rk1-rk3588_defconfig | 2 +- configs/vyasa-rk3288_defconfig | 2 +- doc/board/rockchip/rockchip.rst | 13 + drivers/ram/rockchip/sdram_rk3399.c | 6 +- include/bloblist.h | 10 - include/vbe.h | 3 + 149 files changed, 1016 insertions(+), 312 deletions(-) create mode 100644 arch/arm/dts/rk3399-generic-u-boot.dtsi create mode 100644 arch/arm/dts/rk3399-generic.dts create mode 100644 arch/arm/mach-rockchip/u-boot-vpl-v8.lds create mode 100644 arch/arm/mach-rockchip/vpl.c create mode 100644 configs/rk3399-generic_defconfig -- 2.43.0