[PATCH v3 19/31] rockchip: Provide a VPL phase on rk3399

Simon Glass sjg at chromium.org
Sat Mar 29 00:41:06 CET 2025


Hi Peter,

On Fri, 28 Mar 2025 at 10:51, Peter Robinson <pbrobinson at gmail.com> wrote:
>
> Hi Simon,
>
> On Fri, 28 Mar 2025 at 15:38, Simon Glass <sjg at chromium.org> wrote:
>>
>> Add support for this new phase, which runs after TPL. It determines the
>> state of the machine, then selects which SPL image to use. SDRAM init is
>> then done in SPL, so that it is updatable.
>>
>> Signed-off-by: Simon Glass <sjg at chromium.org>
>> ---
>>
>> (no changes since v2)
>>
>> Changes in v2:
>> - Rewrite help for VPL_ROCKCHIP_COMMON_BOARD
>> - Skip spl-boot-order.c for VPL (rather than modifying it)
>>
>>  arch/arm/include/asm/spl.h               |   1 +
>>  arch/arm/mach-rockchip/Kconfig           |  25 +++++-
>>  arch/arm/mach-rockchip/Makefile          |  11 ++-
>>  arch/arm/mach-rockchip/rk3399/Kconfig    |   9 ++
>>  arch/arm/mach-rockchip/spl.c             |   3 +
>>  arch/arm/mach-rockchip/tpl.c             |   2 +-
>>  arch/arm/mach-rockchip/u-boot-vpl-v8.lds | 107 +++++++++++++++++++++++
>>  arch/arm/mach-rockchip/vpl.c             |  53 +++++++++++
>>  common/spl/Kconfig                       |   1 +
>>  9 files changed, 205 insertions(+), 7 deletions(-)
>>  create mode 100644 arch/arm/mach-rockchip/u-boot-vpl-v8.lds
>>  create mode 100644 arch/arm/mach-rockchip/vpl.c
>>
>> diff --git a/arch/arm/include/asm/spl.h b/arch/arm/include/asm/spl.h
>> index ee79a19c05c..62844d64cab 100644
>> --- a/arch/arm/include/asm/spl.h
>> +++ b/arch/arm/include/asm/spl.h
>> @@ -30,6 +30,7 @@ enum {
>>         BOOT_DEVICE_XIP,
>>         BOOT_DEVICE_BOOTROM,
>>         BOOT_DEVICE_SMH,
>> +       BOOT_DEVICE_VBE,
>>         BOOT_DEVICE_NONE
>>  };
>>  #endif
>> diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
>> index 4c515593718..58ba0e0468f 100644
>> --- a/arch/arm/mach-rockchip/Kconfig
>> +++ b/arch/arm/mach-rockchip/Kconfig
>> @@ -252,13 +252,15 @@ config ROCKCHIP_RK3399
>>         select SPL_ATF
>>         select SPL_BOARD_INIT if SPL
>>         select SPL_LOAD_FIT
>> -       select SPL_CLK if SPL
>> +       select SPL_CLK if SPL && !VPL
>>         select SPL_PINCTRL if SPL
>>         select SPL_RAM if SPL
>>         select SPL_REGMAP if SPL
>>         select SPL_SYSCON if SPL
>>         select TPL_HAVE_INIT_STACK if TPL
>> -       select SPL_SEPARATE_BSS
>> +       select VPL_HAVE_INIT_STACK if VPL
>> +       select SPL_SEPARATE_BSS if !VPL
>> +       select SPL_RAW_IMAGE_SUPPORT if VPL
>>         select CLK
>>         select FIT
>>         select PINCTRL
>> @@ -268,6 +270,7 @@ config ROCKCHIP_RK3399
>>         select DM_PMIC
>>         select DM_REGULATOR_FIXED
>>         select BOARD_LATE_INIT
>> +       select SUPPORT_VPL
>>         imply ARMV8_CRYPTO
>>         imply ARMV8_SET_SMPEN
>>         imply BOOTSTD_FULL
>> @@ -296,13 +299,14 @@ config ROCKCHIP_RK3399
>>         imply TPL_LIBCOMMON_SUPPORT
>>         imply TPL_LIBGENERIC_SUPPORT
>>         imply TPL_OF_CONTROL
>> -       imply TPL_RAM
>> +       imply TPL_RAM if !VPL
>>         imply TPL_REGMAP
>>         imply TPL_ROCKCHIP_COMMON_BOARD
>>         imply TPL_SERIAL
>>         imply TPL_SYS_MALLOC_SIMPLE
>>         imply TPL_SYSCON
>>         imply TPL_TINY_MEMSET
>> +       imply TPL_DM_MMC if VPL
>>         help
>>           The Rockchip RK3399 is a ARM-based SoC with a dual-core Cortex-A72
>>           and quad-core Cortex-A53.
>> @@ -457,7 +461,7 @@ config SPL_ROCKCHIP_BACK_TO_BROM
>>
>>  config TPL_ROCKCHIP_BACK_TO_BROM
>>         bool "TPL returns to bootrom"
>> -       default y
>> +       default y if !VPL
>>         select ROCKCHIP_BROM_HELPER if !ROCKCHIP_RK3066
>>         select TPL_BOOTROM_SUPPORT
>>         depends on TPL
>> @@ -498,6 +502,16 @@ config ROCKCHIP_EXTERNAL_TPL
>>           Enable this option and build with ROCKCHIP_TPL=/path/to/ddr.bin to
>>           include the external TPL in the image built by binman.
>>
>> +config VPL_ROCKCHIP_COMMON_BOARD
>> +       bool "Rockchip VPL common board file"
>> +       depends on VPL
>> +       default y
>
>
> This should be optional and opt in, at least to begin with.

Yes, agreed. In this case, it depends on VPL, which is only enabled
for the new board being added here.

> I honestly don't see what value VBE provides, and I've not seen you describe your vision for it anyway.

Some docs:

https://docs.u-boot.org/en/latest/develop/vbe.html

Talk at osfc: https://elinux.org/Boot_Loaders#U-Boot

Alex Graf was kind enough to do another one at Embedded World 2022 but
I don't have a link.

If you are using UEFI, it won't provide any benefits.

Regards,
Simon


More information about the U-Boot mailing list