All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] rockchip: rk3399: spl: convert to using BOOT_DEVICE_BOOTROM
@ 2017-09-11 10:48 Philipp Tomsich
  2017-09-13  2:31 ` Simon Glass
  2017-09-27 22:41 ` [U-Boot] " Philipp Tomsich
  0 siblings, 2 replies; 3+ messages in thread
From: Philipp Tomsich @ 2017-09-11 10:48 UTC (permalink / raw)
  To: u-boot

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>
---

 arch/arm/mach-rockchip/rk3399-board-spl.c | 18 +++++++++++++-----
 1 file 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 3406156..1c39d9b 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);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] rockchip: rk3399: spl: convert to using BOOT_DEVICE_BOOTROM
  2017-09-11 10:48 [U-Boot] [PATCH] rockchip: rk3399: spl: convert to using BOOT_DEVICE_BOOTROM Philipp Tomsich
@ 2017-09-13  2:31 ` Simon Glass
  2017-09-27 22:41 ` [U-Boot] " Philipp Tomsich
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2017-09-13  2:31 UTC (permalink / raw)
  To: u-boot

On 11 September 2017 at 04:48, Philipp Tomsich
<philipp.tomsich@theobroma-systems.com> wrote:
> 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>
> ---
>
>  arch/arm/mach-rockchip/rk3399-board-spl.c | 18 +++++++++++++-----
>  1 file changed, 13 insertions(+), 5 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] rockchip: rk3399: spl: convert to using BOOT_DEVICE_BOOTROM
  2017-09-11 10:48 [U-Boot] [PATCH] rockchip: rk3399: spl: convert to using BOOT_DEVICE_BOOTROM Philipp Tomsich
  2017-09-13  2:31 ` Simon Glass
@ 2017-09-27 22:41 ` Philipp Tomsich
  1 sibling, 0 replies; 3+ messages in thread
From: Philipp Tomsich @ 2017-09-27 22:41 UTC (permalink / raw)
  To: u-boot

> 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>
> ---
> 
>  arch/arm/mach-rockchip/rk3399-board-spl.c | 18 +++++++++++++-----
>  1 file changed, 13 insertions(+), 5 deletions(-)
> 

Applied to u-boot-rockchip, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-27 22:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-11 10:48 [U-Boot] [PATCH] rockchip: rk3399: spl: convert to using BOOT_DEVICE_BOOTROM Philipp Tomsich
2017-09-13  2:31 ` Simon Glass
2017-09-27 22:41 ` [U-Boot] " Philipp Tomsich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.