With VBE, the TPL image must be built separately for each board we need to support. It is the only part of the VBE image which is board-specific.
This helps to save space and reduce the size of TPL, so that it can fit within the internal 192K IRAM of the RK3399 SoC. As with other phases, the TPL devicetree is run through fdtgrep to remove unwanted nodes and properties and reduce its size. Update the fdtmap so it is at the end of the image, since templates are added after existing nodes. Signed-off-by: Simon Glass <[email protected]> --- Changes in v5: - Drop removal of stray #ifdef - Mention VBE in the first paragraph of the commit message - Wrap the entire simple-bin node and add the properties to vpl Changes in v4: - Put the fdtmap at the end of the image - Update the comment at the end of the '#ifndef CONFIG_VPL' block Changes in v2: - Mention RK3399 with respect to the memory limit - Move VPL things into a separate file arch/arm/dts/rockchip-u-boot.dtsi | 2 ++ arch/arm/dts/rockchip-vpl-u-boot.dtsi | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi index f1e8f129cb4..7a60f6b4526 100644 --- a/arch/arm/dts/rockchip-u-boot.dtsi +++ b/arch/arm/dts/rockchip-u-boot.dtsi @@ -167,6 +167,7 @@ }; #endif /* HAS_FIT */ +#ifndef CONFIG_VPL simple-bin { filename = "u-boot-rockchip.bin"; pad-byte = <0xff>; @@ -200,6 +201,7 @@ fdtmap { }; }; +#endif /* !VPL */ #ifdef CONFIG_ROCKCHIP_SPI_IMAGE simple-bin-spi { diff --git a/arch/arm/dts/rockchip-vpl-u-boot.dtsi b/arch/arm/dts/rockchip-vpl-u-boot.dtsi index 0d767113408..ac67b29c57a 100644 --- a/arch/arm/dts/rockchip-vpl-u-boot.dtsi +++ b/arch/arm/dts/rockchip-vpl-u-boot.dtsi @@ -111,6 +111,25 @@ }; simple-bin { + filename = "u-boot-rockchip.bin"; + pad-byte = <0xff>; + + alternates-fdt { + fdt-list-dir = "dts/upstream/src/arm64/rockchip"; + filename-pattern = "alt-NAME.bin"; + fdt-phase = "tpl"; + + mkimage { + filename = "idbloader.img"; + args = "-n", CONFIG_SYS_SOC, "-T", "rksd"; + multiple-data-files; + + u-boot-tpl { + symbols-base = <0>; + }; + }; + }; + vpl { type = "fit"; offset = <(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 0x200 + 0x8000)>; @@ -199,5 +218,7 @@ insert-template = <&fit_template>; }; # endif /* VBE method */ + fdtmap { + }; }; }; -- 2.43.0

