[PATCH v7 13/22] rockchip: Provide a VPL phase on rk3399
Pavel Golikov
paullo612 at ya.ru
Sun May 31 22:37:51 CEST 2026
Hi Simon
On Thu, May 28, 2026 at 11:10:20AM -0600, Simon Glass wrote:
> Add support for this new phase, related to VBE, 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 (rather than TPL as normal for
> Rockchip), so that VBE can update the SDRAM-intit code in the field.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
> (no changes since v5)
>
> Changes in v5:
> - Expand commit message to mention VBE
> - Move SUPPORT_VPL next to other SUPPORT_xxx options
> - Put TPL_DM_MMC in alpha order
> - Move VPL_ROCKCHIP_COMMON_BOARD up a bit
> - Move VPL_LDSCRIPT up a bit
> - Drop config SPL_STACK_R_ADDR
> - Use if() instead of ? in spl_boot_device()
> - Drop mention of SPL_RAW_IMAGE_SUPPORT since it is already the default
> - Drop mention of SPL_SEPARATE_BSS since VPL doesn't need it
>
> Changes in v4:
> - Add a value for SPL_STACK_R_ADDR
>
> 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 | 23 ++++-
> 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 | 3 +
> 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(+), 6 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/mach-rockchip/vpl.c b/arch/arm/mach-rockchip/vpl.c
> new file mode 100644
> index 00000000000..55a8dabc2da
> --- /dev/null
> +++ b/arch/arm/mach-rockchip/vpl.c
> @@ -0,0 +1,53 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * (C) Copyright 2019 Rockchip Electronics Co., Ltd
> + */
> +
> +#include <bootstage.h>
> +#include <debug_uart.h>
> +#include <dm.h>
> +#include <hang.h>
> +#include <init.h>
> +#include <log.h>
> +#include <ram.h>
> +#include <spl.h>
> +#include <version.h>
> +#include <asm/io.h>
> +#include <asm/arch-rockchip/bootrom.h>
> +#include <linux/bitops.h>
> +
> +#if CONFIG_IS_ENABLED(BANNER_PRINT)
> +#include <timestamp.h>
> +#endif
> +
> +void board_init_f(ulong dummy)
> +{
> + int ret;
> +
> +#if defined(CONFIG_DEBUG_UART) && defined(CONFIG_VPL_SERIAL)
> + /*
> + * Debug UART can be used from here if required:
> + *
> + * debug_uart_init();
> + * printch('a');
> + * printhex8(0x1234);
> + * printascii("string");
> + */
> + debug_uart_init();
Looks like you're initializing debug UART for the second time. debug_uart_init
is already called in _main in crt0.S/crt_64.S. Jonas has corresponding fix for
TPL in his ci branch [1].
> +#ifdef CONFIG_VPL_BANNER_PRINT
> + printascii("\nU-Boot VPL " PLAIN_VERSION " (" U_BOOT_DATE " - "
> + U_BOOT_TIME ")\n");
> +#endif
> +#endif
> +
> + ret = spl_early_init();
> + if (ret) {
> + debug("spl_early_init() failed: %d\n", ret);
> + hang();
> + }
> +}
> +
> +u32 spl_boot_device(void)
> +{
> + return BOOT_DEVICE_VBE;
> +}
> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> index 5fa94098e49..4b256abe6af 100644
> --- a/common/spl/Kconfig
> +++ b/common/spl/Kconfig
> @@ -587,6 +587,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
> default 0x200 if ARCH_SOCFPGA_GEN5 || ARCH_AT91
> default 0x300 if ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || \
> OMAP54XX || AM33XX || AM43XX || ARCH_K3
> + default 0x800 if ARCH_ROCKCHIP && VPL
> default 0x4000 if ARCH_ROCKCHIP
> default 0x822 if TARGET_SIFIVE_UNLEASHED || TARGET_SIFIVE_UNMATCHED
> help
> --
> 2.43.0
>
[1] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commit/ca73bffba06734f73a2e8d6f0665a1e774ac4f94
Regards,
Pavel
More information about the U-Boot
mailing list