diff options
author | Heiko Stuebner <heiko.stuebner@theobroma-systems.com> | 2019-07-16 22:18:21 +0200 |
---|---|---|
committer | Kever Yang <kever.yang@rock-chips.com> | 2019-11-17 17:23:24 +0800 |
commit | e9ccb2f526edab7626abb69b2a6aadcb52510889 (patch) | |
tree | a2b7ee767417f55dd6594341f8addce0d6ad1ddc /arch/arm/mach-rockchip/px30-board-tpl.c | |
parent | 537b1a277479a6dc89e58cce6dfb5966c64f799d (diff) |
rockchip: add px30 architecture core
Add core architecture code to support the px30 soc.
This includes a separate tpl board file due to very limited
sram size as well as a non-dm sdram driver, as this also has
to fit into the tiny sram.
Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Diffstat (limited to 'arch/arm/mach-rockchip/px30-board-tpl.c')
-rw-r--r-- | arch/arm/mach-rockchip/px30-board-tpl.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/arch/arm/mach-rockchip/px30-board-tpl.c b/arch/arm/mach-rockchip/px30-board-tpl.c new file mode 100644 index 0000000000..8c8976f61c --- /dev/null +++ b/arch/arm/mach-rockchip/px30-board-tpl.c @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * (C) Copyright 2019 Rockchip Electronics Co., Ltd + */ + +#include <common.h> +#include <debug_uart.h> +#include <dm.h> +#include <ram.h> +#include <spl.h> +#include <version.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); +} + +void board_init_f(ulong dummy) +{ + int ret; + +#ifdef CONFIG_DEBUG_UART + debug_uart_init(); + /* + * Debug UART can be used from here if required: + * + * debug_uart_init(); + * printch('a'); + * printhex8(0x1234); + * printascii("string"); + */ + printascii("U-Boot TPL board init\n"); +#endif + + secure_timer_init(); + ret = sdram_init(); + if (ret) + printascii("sdram_init failed\n"); + + /* return to maskrom */ + back_to_bootrom(BROM_BOOT_NEXTSTAGE); +} |