From: Quentin Schulz Date: Tue, 28 Oct 2025 16:57:34 +0000 (+0100) Subject: rockchip: px30: use rockchip_stimer_init from spl_common.o for TPL X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ad3fb3808e59b3eab455bfa7fd4840e611df3204;p=thirdparty%2Fu-boot.git rockchip: px30: use rockchip_stimer_init from spl_common.o for TPL Instead of redefining what is essentially the same code in secure_timer_init, let's simply use rockchip_stimer_init from spl_common.o instead. This increases the size of the TPL by 16B, due to the added check of STIMER already being enabled. Experimentally, STIMER is not already enabled when in TPL. Signed-off-by: Quentin Schulz Reviewed-by: Kever Yang --- diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile index ae15a9f8a2d..4c424091585 100644 --- a/arch/arm/mach-rockchip/Makefile +++ b/arch/arm/mach-rockchip/Makefile @@ -11,7 +11,7 @@ obj-spl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o obj-spl-$(CONFIG_SPL_ROCKCHIP_COMMON_BOARD) += spl.o spl-boot-order.o spl_common.o obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o spl_common.o -obj-tpl-$(CONFIG_ROCKCHIP_PX30) += px30-board-tpl.o +obj-tpl-$(CONFIG_ROCKCHIP_PX30) += px30-board-tpl.o spl_common.o obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o diff --git a/arch/arm/mach-rockchip/px30-board-tpl.c b/arch/arm/mach-rockchip/px30-board-tpl.c index f0b3c5f83f4..2a3dcdac845 100644 --- a/arch/arm/mach-rockchip/px30-board-tpl.c +++ b/arch/arm/mach-rockchip/px30-board-tpl.c @@ -4,32 +4,9 @@ */ #include -#include -#include -#include -#include -#include #include #include - -#define TIMER_LOAD_COUNT0 0x00 -#define TIMER_LOAD_COUNT1 0x04 -#define TIMER_CUR_VALUE0 0x08 -#define TIMER_CUR_VALUE1 0x0c -#define TIMER_CONTROL_REG 0x10 - -#define TIMER_EN 0x1 -#define TIMER_FMODE (0 << 1) -#define TIMER_RMODE (1 << 1) - -void secure_timer_init(void) -{ - writel(0, CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG); - writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE + TIMER_LOAD_COUNT0); - writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE + TIMER_LOAD_COUNT1); - writel(TIMER_EN | TIMER_FMODE, - CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG); -} +#include void board_init_f(ulong dummy) { @@ -50,7 +27,8 @@ void board_init_f(ulong dummy) #endif #endif - secure_timer_init(); + rockchip_stimer_init(); + ret = sdram_init(); if (ret) printascii("sdram_init failed\n");