[PATCH RFC 17/18] rockchip: rk356x-generic: Initialize SDRAM at TPL stage
Jonas Karlman
jonas at kwiboo.se
Sun May 17 23:06:06 CEST 2026
Hi Pavel,
On 5/17/2026 9:24 PM, Pavel Golikov wrote:
> Only LPDDR4 initialization is confirmed to be working for now.
>
> Signed-off-by: Pavel Golikov <paullo612 at ya.ru>
> ---
> arch/arm/mach-rockchip/Kconfig | 28 +++++++++++++++++++++++++++-
> arch/arm/mach-rockchip/rk3568/Kconfig | 16 ++++++++++++++++
> common/spl/Kconfig.tpl | 1 +
> configs/generic-rk3568_defconfig | 1 +
> 4 files changed, 45 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
> index 108713488af..9a6a580025e 100644
> --- a/arch/arm/mach-rockchip/Kconfig
> +++ b/arch/arm/mach-rockchip/Kconfig
> @@ -413,11 +413,15 @@ config ROCKCHIP_RK3528
> config ROCKCHIP_RK3568
> bool "Support Rockchip RK3568"
> select ARM64
> + select SUPPORT_TPL
> + select TPL_HAVE_INIT_STACK if TPL
> + select TPL_ROCKCHIP_BACK_TO_BROM if TPL
> select SUPPORT_SPL
> select SPL
> select CLK
> select PINCTRL
> select RAM
> + select ROCKCHIP_SDRAM_COMMON
> select REGMAP
> select SYSCON
> select BOARD_LATE_INIT
> @@ -433,10 +437,32 @@ config ROCKCHIP_RK3568
> imply RNG_ROCKCHIP
> imply ROCKCHIP_COMMON_BOARD
> imply ROCKCHIP_COMMON_STACK_ADDR
> - imply ROCKCHIP_EXTERNAL_TPL
Not until this has been proven to work for all current supported dram
types and configurations, please select TPL in board specific defconfigs.
> imply ROCKCHIP_OTP
> + imply ROCKCHIP_SERIAL if !ROCKCHIP_EXTERNAL_TPL
> imply SPL_ATF_NO_PLATFORM_PARAM if SPL_ATF
> imply SPL_MMC_HS200_SUPPORT if SPL_MMC && MMC_HS200_SUPPORT
> + imply TPL if !ROCKCHIP_EXTERNAL_TPL
> + imply TPL_CLK
> + imply TPL_DM
> + imply TPL_LIBCOMMON_SUPPORT
> + imply TPL_LIBGENERIC_SUPPORT
> + imply TPL_OF_CONTROL
> + imply TPL_OF_PLATDATA
> + imply TPL_RAM
> + imply TPL_ROCKCHIP_COMMON_BOARD
> + imply TPL_SERIAL
> + imply TPL_SYSCON
> + imply SPL_CLK
> + imply SPL_DM
> + imply SPL_DRIVERS_MISC
> + imply SPL_LIBCOMMON_SUPPORT
> + imply SPL_LIBGENERIC_SUPPORT
> + imply SPL_OF_CONTROL
> + imply SPL_RAM
> + imply SPL_REGMAP
> + imply SPL_ROCKCHIP_COMMON_BOARD
> + imply SPL_SERIAL
> + imply SPL_SYSCON
These should all be sorted alphanumerically, also this is adding SPL
related implys, probably something that should be in a separate patch?
> help
> The Rockchip RK3568 is a ARM-based SoC with quad-core Cortex-A55,
> including NEON and GPU, 512K L3 cache, Mali-G52 based graphics,
> diff --git a/arch/arm/mach-rockchip/rk3568/Kconfig b/arch/arm/mach-rockchip/rk3568/Kconfig
> index 2730220a18e..893185291d8 100644
> --- a/arch/arm/mach-rockchip/rk3568/Kconfig
> +++ b/arch/arm/mach-rockchip/rk3568/Kconfig
> @@ -61,6 +61,10 @@ config TARGET_ORANGEPI_3B_RK3566
>
> endchoice
>
> +config SOC_SPECIFIC_OPTIONS # dummy
> + def_bool y
> + select HAS_CUSTOM_SYS_INIT_SP_ADDR
> +
> config ROCKCHIP_BOOT_MODE_REG
> default 0xfdc20200
>
> @@ -70,6 +74,18 @@ config ROCKCHIP_STIMER_BASE
> config SYS_SOC
> default "rk3568"
>
> +config TPL_LDSCRIPT
> + default "arch/arm/mach-rockchip/u-boot-tpl-v8.lds"
> +
> +config TPL_STACK
> + default 0xfdcd8000
> +
> +config TPL_SYS_MALLOC_F_LEN
> + default 0x2000
> +
> +config TPL_TEXT_BASE
> + default 0xfdcc1000
> +
> source "board/rockchip/evb_rk3568/Kconfig"
> source "board/anbernic/rgxx3_rk3566/Kconfig"
> source "board/hardkernel/odroid_m1/Kconfig"
> diff --git a/common/spl/Kconfig.tpl b/common/spl/Kconfig.tpl
> index a535b61ecd3..e64316b8eb3 100644
> --- a/common/spl/Kconfig.tpl
> +++ b/common/spl/Kconfig.tpl
> @@ -127,6 +127,7 @@ config TPL_TEXT_BASE
> config TPL_MAX_SIZE
> hex "Maximum size (in bytes) for the TPL stage"
> default 0x2e000 if ROCKCHIP_RK3399
> + default 0xe800 if ROCKCHIP_RK3568
> default 0x8000 if ROCKCHIP_RK3288 || ROCKCHIP_RV1126
> default 0x7000 if ROCKCHIP_RK322X || ROCKCHIP_RK3328 || ROCKCHIP_RK3368
> default 0x2800 if ROCKCHIP_PX30
> diff --git a/configs/generic-rk3568_defconfig b/configs/generic-rk3568_defconfig
> index a33c3af9255..4510fa94775 100644
> --- a/configs/generic-rk3568_defconfig
> +++ b/configs/generic-rk3568_defconfig
> @@ -81,3 +81,4 @@ CONFIG_USB_GADGET=y
> CONFIG_USB_GADGET_DOWNLOAD=y
> CONFIG_USB_FUNCTION_ROCKUSB=y
> CONFIG_ERRNO_STR=y
> +CONFIG_RAM_ROCKCHIP_LPDDR4=y
This generic-rk3568 target is explicitly created to be generic with
dynamic DRAM type lookup. So we cannot add explicit DRAM type support
for this target.
Regards,
Jonas
More information about the U-Boot
mailing list