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>
15 #define TIMER_CHN10_BASE 0xff8680a0
16 #define TIMER_END_COUNT_L 0x00
17 #define TIMER_END_COUNT_H 0x04
18 #define TIMER_INIT_COUNT_L 0x10
19 #define TIMER_INIT_COUNT_H 0x14
20 #define TIMER_CONTROL_REG 0x1c
23 #define TIMER_FMODE (0 << 1)
24 #define TIMER_RMODE (1 << 1)
26 void secure_timer_init(void)
28 writel(0xffffffff, TIMER_CHN10_BASE + TIMER_END_COUNT_L);
29 writel(0xffffffff, TIMER_CHN10_BASE + TIMER_END_COUNT_H);
30 writel(0, TIMER_CHN10_BASE + TIMER_INIT_COUNT_L);
31 writel(0, TIMER_CHN10_BASE + TIMER_INIT_COUNT_H);
32 writel(TIMER_EN | TIMER_FMODE, TIMER_CHN10_BASE + TIMER_CONTROL_REG);
35 void board_init_f(ulong dummy)
40 #ifdef CONFIG_DEBUG_UART
43 * Debug UART can be used from here if required:
48 * printascii("string");
50 printascii("U-Boot TPL board init\n");
52 ret = spl_early_init();
54 debug("spl_early_init() failed: %d\n", ret);
60 ret = uclass_get_device(UCLASS_RAM, 0, &dev);
62 pr_err("DRAM init failed: %d\n", ret);
67 void board_return_to_bootrom(void)
69 back_to_bootrom(BROM_BOOT_NEXTSTAGE);
72 u32 spl_boot_device(void)
74 return BOOT_DEVICE_BOOTROM;
77 void spl_board_init(void)
79 puts("\nU-Boot TPL " PLAIN_VERSION " (" U_BOOT_DATE " - "
80 U_BOOT_TIME " " U_BOOT_TZ ")\n");
83 #ifdef CONFIG_SPL_LOAD_FIT
84 int board_fit_config_name_match(const char *name)
86 /* Just empty function now - can't decide what to choose */
87 debug("%s: %s\n", __func__, name);