From: Quentin Schulz Date: Tue, 28 Oct 2025 16:57:35 +0000 (+0100) Subject: rockchip: rk3036: use rockchip_stimer_init from spl_common.o X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0d457380a02422e07833c3a0520516c358eeb9fa;p=thirdparty%2Fu-boot.git rockchip: rk3036: use rockchip_stimer_init from spl_common.o The only difference with the implementation in spl_common.c is that we check whether the timer has already been enabled. Considering this is running in SPL, the first stage on RK3036, I feel like it's guaranteed to not be enabled by default. No public TRM though and I don't have access to an RK3036 device so take this as a guess. Size of SPL binary increases by 8B for evb-rk3036. Signed-off-by: Quentin Schulz Reviewed-by: Kever Yang --- diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile index 4c424091585..06fb527b21a 100644 --- a/arch/arm/mach-rockchip/Makefile +++ b/arch/arm/mach-rockchip/Makefile @@ -13,7 +13,7 @@ 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 spl_common.o -obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o +obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o spl_common.o ifeq ($(CONFIG_XPL_BUILD)$(CONFIG_TPL_BUILD),) diff --git a/arch/arm/mach-rockchip/rk3036-board-spl.c b/arch/arm/mach-rockchip/rk3036-board-spl.c index 64e100172fa..d69139278a8 100644 --- a/arch/arm/mach-rockchip/rk3036-board-spl.c +++ b/arch/arm/mach-rockchip/rk3036-board-spl.c @@ -5,28 +5,9 @@ #include #include -#include #include #include - -#define TIMER_LOAD_COUNT_L 0x00 -#define TIMER_LOAD_COUNT_H 0x04 -#define TIMER_CONTROL_REG 0x10 -#define TIMER_EN 0x1 -#define TIMER_FMODE (0 << 1) -#define TIMER_RMODE (1 << 1) - -void rockchip_stimer_init(void) -{ - asm volatile("mcr p15, 0, %0, c14, c0, 0" - : : "r"(CONFIG_COUNTER_FREQUENCY)); - - writel(0, CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG); - writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE); - writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE + 4); - writel(TIMER_EN | TIMER_FMODE, CONFIG_ROCKCHIP_STIMER_BASE + - TIMER_CONTROL_REG); -} +#include void board_init_f(ulong dummy) {