diff options
| author | Quentin Schulz <[email protected]> | 2025-10-28 17:57:34 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-11-02 12:15:23 -0600 |
| commit | ad3fb3808e59b3eab455bfa7fd4840e611df3204 (patch) | |
| tree | 92ec4fa8aa8e1c12a8e614eabe924625272a6856 | |
| parent | 0940d65eaa6737aaf55494f28d9b641bdbec29f7 (diff) | |
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 <[email protected]>
Reviewed-by: Kever Yang <[email protected]>
| -rw-r--r-- | arch/arm/mach-rockchip/Makefile | 2 | ||||
| -rw-r--r-- | arch/arm/mach-rockchip/px30-board-tpl.c | 28 |
2 files changed, 4 insertions, 26 deletions
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 <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"); |
