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 <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
This commit is contained in:
Quentin Schulz
2025-11-02 12:15:23 -06:00
committed by Tom Rini
parent 0940d65eaa
commit ad3fb3808e
2 changed files with 4 additions and 26 deletions
+1 -1
View File
@@ -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
+3 -25
View File
@@ -4,32 +4,9 @@
*/
#include <debug_uart.h>
#include <dm.h>
#include <init.h>
#include <ram.h>
#include <spl.h>
#include <asm/io.h>
#include <asm/arch-rockchip/bootrom.h>
#include <asm/arch-rockchip/sdram_px30.h>
#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 <asm/arch-rockchip/timer.h>
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");