1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2019 Rockchip Electronics Co., Ltd
7 #include <debug_uart.h>
13 #include <asm/arch-rockchip/bootrom.h>
14 #include <asm/arch-rockchip/sdram_px30.h>
16 #define TIMER_LOAD_COUNT0 0x00
17 #define TIMER_LOAD_COUNT1 0x04
18 #define TIMER_CUR_VALUE0 0x08
19 #define TIMER_CUR_VALUE1 0x0c
20 #define TIMER_CONTROL_REG 0x10
23 #define TIMER_FMODE (0 << 1)
24 #define TIMER_RMODE (1 << 1)
26 void secure_timer_init(void)
28 writel(0, CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG);
29 writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE + TIMER_LOAD_COUNT0);
30 writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE + TIMER_LOAD_COUNT1);
31 writel(TIMER_EN | TIMER_FMODE,
32 CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG);
35 void board_init_f(ulong dummy)
39 #ifdef CONFIG_DEBUG_UART
42 * Debug UART can be used from here if required:
47 * printascii("string");
49 printascii("U-Boot TPL board init\n");
55 printascii("sdram_init failed\n");
57 /* return to maskrom */
58 back_to_bootrom(BROM_BOOT_NEXTSTAGE);