summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko@sntech.de>2019-08-12 16:58:34 +0200
committerHeiko Stuebner <heiko@sntech.de>2019-08-12 16:58:34 +0200
commitaeeadbb4d72475822daecf09ddf2245bf1e7453e (patch)
treec162f48b61c0878ac55578dc68545cf61034c1ef
parent4c33ba24fec2697d3672ab439635b32b19cd8da0 (diff)
fixup px30-core arch to use common boards where possible
-rw-r--r--arch/arm/mach-rockchip/Kconfig4
-rw-r--r--arch/arm/mach-rockchip/Makefile1
-rw-r--r--arch/arm/mach-rockchip/px30-board-spl.c67
-rw-r--r--arch/arm/mach-rockchip/px30-board-tpl.c38
-rw-r--r--include/configs/px30_common.h10
5 files changed, 14 insertions, 106 deletions
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 8ac5fe74e1..6c16d67361 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -11,9 +11,11 @@ config ROCKCHIP_PX30
select TPL_NEEDS_SEPARATE_TEXT_BASE if SPL
select TPL_NEEDS_SEPARATE_STACK if TPL
imply SPL_SEPARATE_BSS
- imply SPL_SERIAL_SUPPORT
+ select SPL_SERIAL_SUPPORT
select TPL_SERIAL_SUPPORT
select DEBUG_UART_BOARD_INIT
+ imply ROCKCHIP_COMMON_BOARD
+ imply SPL_ROCKCHIP_COMMON_BOARD
help
The Rockchip PX30 is a ARM-based SoC with a quad-core Cortex-A35
including NEON and GPU, Mali-400 graphics, several DDR3 options
diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
index d3c7e9c049..3f9b2c99f7 100644
--- a/arch/arm/mach-rockchip/Makefile
+++ b/arch/arm/mach-rockchip/Makefile
@@ -12,7 +12,6 @@ obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o
obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o
obj-tpl-$(CONFIG_ROCKCHIP_PX30) += px30-board-tpl.o
-obj-spl-$(CONFIG_ROCKCHIP_PX30) += px30-board-spl.o spl-boot-order.o
obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o
ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),)
diff --git a/arch/arm/mach-rockchip/px30-board-spl.c b/arch/arm/mach-rockchip/px30-board-spl.c
deleted file mode 100644
index c3cfd6e391..0000000000
--- a/arch/arm/mach-rockchip/px30-board-spl.c
+++ /dev/null
@@ -1,67 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
- */
-
-#include <common.h>
-#include <debug_uart.h>
-#include <dm.h>
-#include <ram.h>
-#include <spl.h>
-#include <asm/io.h>
-#include <asm/arch-rockchip/periph.h>
-
-#include <asm/arch/grf_px30.h>
-
-void board_init_f(ulong dummy)
-{
- struct udevice *dev;
- 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 SPL board init\n");
-#endif
-
- ret = spl_early_init();
- if (ret) {
- debug("spl_early_init() failed: %d\n", ret);
- hang();
- }
-
- preloader_console_init();
-
- ret = uclass_get_device(UCLASS_RAM, 0, &dev);
- if (ret) {
- debug("DRAM init failed: %d\n", ret);
- return;
- }
-}
-
-u32 spl_boot_device(void)
-{
- return BOOT_DEVICE_MMC1;
-}
-
-void spl_board_init(void)
-{
- return;
-}
-
-#ifdef CONFIG_SPL_LOAD_FIT
-int board_fit_config_name_match(const char *name)
-{
- /* Just empty function now - can't decide what to choose */
- debug("%s: %s\n", __func__, name);
-
- return 0;
-}
-#endif
diff --git a/arch/arm/mach-rockchip/px30-board-tpl.c b/arch/arm/mach-rockchip/px30-board-tpl.c
index ff7086ecfe..8c61f9066f 100644
--- a/arch/arm/mach-rockchip/px30-board-tpl.c
+++ b/arch/arm/mach-rockchip/px30-board-tpl.c
@@ -12,8 +12,6 @@
#include <asm/io.h>
#include <asm/arch-rockchip/bootrom.h>
-
-#define TIMER_BASE 0xff220020
#define TIMER_LOAD_COUNT0 0x00
#define TIMER_LOAD_COUNT1 0x04
#define TIMER_CUR_VALUE0 0x08
@@ -26,9 +24,11 @@
void secure_timer_init(void)
{
- writel(0xffffffff, TIMER_BASE + TIMER_LOAD_COUNT0);
- writel(0xffffffff, TIMER_BASE + TIMER_LOAD_COUNT1);
- writel(1, TIMER_BASE + TIMER_CONTROL_REG);
+ 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)
@@ -56,31 +56,3 @@ void board_init_f(ulong dummy)
/* return to maskrom */
back_to_bootrom(BROM_BOOT_NEXTSTAGE);
}
-
-#if 0
-void board_return_to_bootrom(void)
-{
- back_to_bootrom(BROM_BOOT_NEXTSTAGE);
-}
-
-u32 spl_boot_device(void)
-{
- return BOOT_DEVICE_BOOTROM;
-}
-
-void spl_board_init(void)
-{
- puts("\nU-Boot TPL " PLAIN_VERSION " (" U_BOOT_DATE " - "
- U_BOOT_TIME " " U_BOOT_TZ ")\n");
-}
-
-#ifdef CONFIG_SPL_LOAD_FIT
-int board_fit_config_name_match(const char *name)
-{
- /* Just empty function now - can't decide what to choose */
- debug("%s: %s\n", __func__, name);
-
- return 0;
-}
-#endif
-#endif
diff --git a/include/configs/px30_common.h b/include/configs/px30_common.h
index 1c2c9e0ab8..c02bb93592 100644
--- a/include/configs/px30_common.h
+++ b/include/configs/px30_common.h
@@ -13,10 +13,14 @@
#define CONFIG_SYS_CBSIZE 1024
#define CONFIG_SKIP_LOWLEVEL_INIT
-//#define CONFIG_SPL_FRAMEWORK
-
#define CONFIG_SYS_NS16550_MEM32
+#define CONFIG_ROCKCHIP_STIMER_BASE 0xff220020
+#define COUNTER_FREQUENCY 24000000
+
+/* FIXME: ff020000 is pmu_mem (10k), while ff0e0000 is regular int_mem */
+#define CONFIG_IRAM_BASE 0xff020000
+
#define CONFIG_SYS_INIT_SP_ADDR 0x00400000
#define CONFIG_SYS_LOAD_ADDR 0x00800800
#define CONFIG_SPL_STACK 0x00400000
@@ -25,8 +29,6 @@
#define CONFIG_SPL_BSS_MAX_SIZE 0x4000
#define CONFIG_SYS_BOOTM_LEN (64 << 20) /* 64M */
-#define COUNTER_FREQUENCY 24000000
-
#define GICD_BASE 0xff131000
#define GICC_BASE 0xff132000