1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2019 Rockchip Electronics Co., Ltd
7 #include <debug_uart.h>
12 #include <asm/arch-rockchip/bootrom.h>
14 #define TIMER_CHN10_BASE 0xff8680a0
15 #define TIMER_END_COUNT_L 0x00
16 #define TIMER_END_COUNT_H 0x04
17 #define TIMER_INIT_COUNT_L 0x10
18 #define TIMER_INIT_COUNT_H 0x14
19 #define TIMER_CONTROL_REG 0x1c
22 #define TIMER_FMODE (0 << 1)
23 #define TIMER_RMODE (1 << 1)
25 void secure_timer_init(void)
27 writel(0xffffffff, TIMER_CHN10_BASE + TIMER_END_COUNT_L);
28 writel(0xffffffff, TIMER_CHN10_BASE + TIMER_END_COUNT_H);
29 writel(0, TIMER_CHN10_BASE + TIMER_INIT_COUNT_L);
30 writel(0, TIMER_CHN10_BASE + TIMER_INIT_COUNT_H);
31 writel(TIMER_EN | TIMER_FMODE, TIMER_CHN10_BASE + TIMER_CONTROL_REG);
34 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");
51 ret = spl_early_init();
53 debug("spl_early_init() failed: %d\n", ret);
59 ret = uclass_get_device(UCLASS_RAM, 0, &dev);
61 pr_err("DRAM init failed: %d\n", ret);
66 void board_return_to_bootrom(void)
68 back_to_bootrom(BROM_BOOT_NEXTSTAGE);
71 u32 spl_boot_device(void)
73 return BOOT_DEVICE_BOOTROM;
76 #ifdef CONFIG_SPL_LOAD_FIT
77 int board_fit_config_name_match(const char *name)
79 /* Just empty function now - can't decide what to choose */
80 debug("%s: %s\n", __func__, name);