summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2017-09-11 12:48:12 +0200
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2017-10-01 00:33:32 +0200
commitcbe18f10e6943db628e779da03dad97a93c627f3 (patch)
tree2f75ff8a1afd2904d77cf7f981df3560a1711d99
parent8d35f3694f89244c546ea0909e85cc2ec8a1e87e (diff)
rockchip: rk3399: spl: convert to using BOOT_DEVICE_BOOTROM
Instead of directly calling into the back-to-bootrom code, the RK3399 common SPL implementation now uses BOOT_DEVICE_BOOTROM to trigger a transfer back into the bootrom. With this factored out, the spl_board_init function can not be customised for each RK3399 board. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--arch/arm/mach-rockchip/rk3399-board-spl.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c
index 3406156447..1c39d9b04b 100644
--- a/arch/arm/mach-rockchip/rk3399-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
@@ -1,10 +1,12 @@
/*
* (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
+#include <asm/arch/bootrom.h>
#include <asm/arch/clock.h>
#include <asm/arch/grf_rk3399.h>
#include <asm/arch/hardware.h>
@@ -19,9 +21,19 @@
DECLARE_GLOBAL_DATA_PTR;
+void board_return_to_bootrom(void)
+{
+ back_to_bootrom();
+}
+
u32 spl_boot_device(void)
{
- return BOOT_DEVICE_MMC1;
+ u32 boot_device = BOOT_DEVICE_MMC1;
+
+ if (CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM))
+ return BOOT_DEVICE_BOOTROM;
+
+ return boot_device;
}
u32 spl_boot_mode(const u32 boot_device)
@@ -156,10 +168,6 @@ void spl_board_init(void)
}
preloader_console_init();
-#if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)
- back_to_bootrom();
-#endif
-
return;
err:
printf("spl_board_init: Error %d\n", ret);