[PATCH 2/3] rockchip: Require an external TPL binary when TPL is missing

Jonas Karlman jonas at kwiboo.se
Sun Feb 5 21:34:39 CET 2023


Hi Jagan,

On 2023-02-05 21:28, Jagan Teki wrote:
> On Mon, Feb 6, 2023 at 1:52 AM Jonas Karlman <jonas at kwiboo.se> wrote:
>>
>> Rockchip SoCs typically use U-Boot TPL to initialize DRAM, then jumps
>> back to boot-rom to load the next stage of the boot flow, U-Boot SPL.
>>
>> For RK356x there is currently no support to initialize DRAM using U-Boot
>> TPL and instead an external TPL binary must be used to generate a
>> working u-boot-rockchip.bin image.
>>
>> Use the new external-tpl entry unless CONFIG_TPL=y to indicate that an
>> external TPL binary must be provided to generate a working firmware.
>>
>> Signed-off-by: Jonas Karlman <jonas at kwiboo.se>
>> ---
>>  Makefile                          |  1 +
>>  arch/arm/dts/rockchip-u-boot.dtsi | 16 ++++++++++++----
>>  tools/binman/missing-blob-help    |  5 +++++
>>  3 files changed, 18 insertions(+), 4 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 7eaf45496c1c..7e9272be937f 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -1332,6 +1332,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \
>>                 -a opensbi-path=${OPENSBI} \
>>                 -a default-dt=$(default_dt) \
>>                 -a scp-path=$(SCP) \
>> +               -a external-tpl-path=$(EXTERNAL_TPL) \
>>                 -a spl-bss-pad=$(if $(CONFIG_SPL_SEPARATE_BSS),,1) \
>>                 -a tpl-bss-pad=$(if $(CONFIG_TPL_SEPARATE_BSS),,1) \
>>                 -a spl-dtb=$(CONFIG_SPL_OF_REAL) \
>> diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
>> index 6c662a72d4f9..bc3bc9bc3e37 100644
>> --- a/arch/arm/dts/rockchip-u-boot.dtsi
>> +++ b/arch/arm/dts/rockchip-u-boot.dtsi
>> @@ -20,12 +20,16 @@
>>                 mkimage {
>>                         filename = "idbloader.img";
>>                         args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
>> -#ifdef CONFIG_TPL
>>                         multiple-data-files;
>>
>> +#ifdef CONFIG_TPL
>>                         u-boot-tpl {
>> -                       };
>> +#else
>> +                       external-tpl {
>> +                               filename = "ddr.bin";
>> +                               missing-msg = "external-tpl-rockchip";
>>  #endif
>> +                       };
>>                         u-boot-spl {
>>                         };
>>                 };
>> @@ -134,12 +138,16 @@
>>                 mkimage {
>>                         filename = "idbloader-spi.img";
>>                         args = "-n", CONFIG_SYS_SOC, "-T", "rkspi";
>> -#ifdef CONFIG_TPL
>>                         multiple-data-files;
>>
>> +#ifdef CONFIG_TPL
>>                         u-boot-tpl {
>> -                       };
>> +#else
>> +                       external-tpl {
>> +                               filename = "ddr.bin";
>> +                               missing-msg = "external-tpl-rockchip";
>>  #endif
>> +                       };
>>                         u-boot-spl {
>>                         };
>>                 };
>> diff --git a/tools/binman/missing-blob-help b/tools/binman/missing-blob-help
>> index c61ca02a35ee..e850824032dd 100644
>> --- a/tools/binman/missing-blob-help
>> +++ b/tools/binman/missing-blob-help
>> @@ -14,6 +14,11 @@ atf-bl31-sunxi:
>>  Please read the section on ARM Trusted Firmware (ATF) in
>>  board/sunxi/README.sunxi64
>>
>> +external-tpl-rockchip:
>> +External TPL is required to initialize DRAM. Get external TPL binary and
>> +build with EXTERNAL_TPL=/path/to/ddr.bin. One possible source for
> 
> Look like this requires DDR bin renaming every time, Is there any
> possibility to use a direct ddr bin name instead of ddr.bin as we did
> for BL31 elf?
> $ export EXTERNAL_TPL=rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v1.08.bin

By default it will look for a ddr.bin in the binman include folders, or
it should be possible to use export EXTERNAL_TPL= in the same way you
can use export BL31=.

Regards,
Jonas

> 
> Jagan.



More information about the U-Boot mailing list