]> git.ipfire.org Git - thirdparty/u-boot.git/blobdiff - arch/arm/mach-rockchip/rk3399-board-tpl.c
rockchip: rk3399: use common secure_timer_init() for spl/tpl
[thirdparty/u-boot.git] / arch / arm / mach-rockchip / rk3399-board-tpl.c
index 4a301249b499691f3660756ea37812032e7cc25a..740470de46019c9066aa84114d3ecb47d1b652f2 100644 (file)
 #include <asm/io.h>
 #include <asm/arch-rockchip/bootrom.h>
 
-#define TIMER_CHN10_BASE       0xff8680a0
-#define TIMER_END_COUNT_L      0x00
-#define TIMER_END_COUNT_H      0x04
-#define TIMER_INIT_COUNT_L     0x10
-#define TIMER_INIT_COUNT_H     0x14
-#define TIMER_CONTROL_REG      0x1c
-
-#define TIMER_EN       0x1
-#define        TIMER_FMODE     (0 << 1)
-#define        TIMER_RMODE     (1 << 1)
-
-void secure_timer_init(void)
+__weak void rockchip_stimer_init(void)
 {
-       writel(0xffffffff, TIMER_CHN10_BASE + TIMER_END_COUNT_L);
-       writel(0xffffffff, TIMER_CHN10_BASE + TIMER_END_COUNT_H);
-       writel(0, TIMER_CHN10_BASE + TIMER_INIT_COUNT_L);
-       writel(0, TIMER_CHN10_BASE + TIMER_INIT_COUNT_H);
-       writel(TIMER_EN | TIMER_FMODE, TIMER_CHN10_BASE + TIMER_CONTROL_REG);
 }
 
 void board_init_f(ulong dummy)
@@ -55,7 +39,7 @@ void board_init_f(ulong dummy)
                hang();
        }
 
-       secure_timer_init();
+       rockchip_stimer_init();
 
        ret = uclass_get_device(UCLASS_RAM, 0, &dev);
        if (ret) {