]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
rockchip: back-to-bootrom: allow passing a cmd to the bootrom
authorPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tue, 10 Oct 2017 14:21:16 +0000 (16:21 +0200)
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tue, 21 Nov 2017 22:57:22 +0000 (23:57 +0100)
The BROM supports forcing it to enter download-mode, if an appropriate
result/cmd-word is returned to it.  There already is a series to
support this in review, so this prepares the (newly C-version) of the
back-to-bootrom code to accept a cmd to passed on to the BROM.

All the existing call-sites are adjusted to match the changed function
signature.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tested-by: Andy Yan <andy.yan@rock-chips.com>
arch/arm/include/asm/arch-rockchip/bootrom.h
arch/arm/mach-rockchip/bootrom.c
arch/arm/mach-rockchip/rk3036-board-spl.c
arch/arm/mach-rockchip/rk3188-board-spl.c
arch/arm/mach-rockchip/rk322x-board-spl.c
arch/arm/mach-rockchip/rk3288-board-spl.c
arch/arm/mach-rockchip/rk3288-board-tpl.c
arch/arm/mach-rockchip/rk3368-board-tpl.c
arch/arm/mach-rockchip/rk3399-board-spl.c

index 2f61a338116bded179bd78975edac573349d4c5e..103b7995939620c07c1fca00fdc0c8f4dc0c1af7 100644 (file)
@@ -24,6 +24,9 @@ extern u32 SAVE_SP_ADDR;
  * download mode, ...).
  *
  * This function does not return.
+ *
+ * @brom_cmd: indicates how the bootrom should continue the boot
+ *            sequence (e.g. load the next stage)
  */
 enum rockchip_bootrom_cmd {
        /*
@@ -35,7 +38,7 @@ enum rockchip_bootrom_cmd {
        BROM_BOOT_ENTER_DNL,      /* have BROM enter download-mode */
 };
 
-void back_to_bootrom(void);
+void back_to_bootrom(enum rockchip_bootrom_cmd brom_cmd);
 
 /**
  * Boot-device identifiers as used by the BROM
index 7b9b307a89c403d662264d99ff1fdce1b6ee0c90..e369fdc25a88e90131d80fb2cba2644e34f8d430 100644 (file)
  */
 static jmp_buf brom_ctx __section(".data");
 
-void back_to_bootrom(void)
+void back_to_bootrom(enum rockchip_bootrom_cmd brom_cmd)
 {
 #if CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)
        puts("Returning to boot ROM...\n");
 #endif
-       longjmp(brom_ctx, BROM_BOOT_NEXTSTAGE);
+       longjmp(brom_ctx, brom_cmd);
 }
 
 /*
index 9458201bd395a9899935e46401a15b662f564539..550e3a1521424ccbb15b5d344c0dd069245f8dc1 100644 (file)
@@ -40,7 +40,7 @@ void board_init_f(ulong dummy)
        sdram_init();
 
        /* return to maskrom */
-       back_to_bootrom();
+       back_to_bootrom(BROM_BOOT_NEXTSTAGE);
 }
 
 /* Place Holders */
index 05d4ae682f7ced0c0727d335010c5b1e153a6c68..8e3b8ae3bafdc5df540f81855ff853b1d8a12103 100644 (file)
@@ -158,7 +158,7 @@ void board_init_f(ulong dummy)
 
        setup_arm_clock();
 #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)
-       back_to_bootrom();
+       back_to_bootrom(BROM_BOOT_NEXTSTAGE);
 #endif
 }
 
@@ -219,7 +219,7 @@ void spl_board_init(void)
 
        preloader_console_init();
 #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)
-       back_to_bootrom();
+       back_to_bootrom(BROM_BOOT_NEXTSTAGE);
 #endif
        return;
 
index 4ddb8ba065f86828992783fdc5e31bb9e8505038..35f4f978c4e37dfbf57ef4d78b43047aec3d0c63 100644 (file)
@@ -76,6 +76,6 @@ void board_init_f(ulong dummy)
        /* Disable the ddr secure region setting to make it non-secure */
        rk_clrreg(SGRF_DDR_CON0, 0x4000);
 #if defined(CONFIG_ROCKCHIP_SPL_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)
-       back_to_bootrom();
+       back_to_bootrom(BROM_BOOT_NEXTSTAGE);
 #endif
 }
index 7b7fd5a6f1a03692f19dc9f21c191a1aa637b013..f64a54843f722594e2692c004a390687b9aa7103 100644 (file)
@@ -216,7 +216,7 @@ void board_init_f(ulong dummy)
 #endif
 
 #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM) && !defined(CONFIG_SPL_BOARD_INIT)
-       back_to_bootrom();
+       back_to_bootrom(BROM_BOOT_NEXTSTAGE);
 #endif
 }
 
@@ -283,7 +283,7 @@ void spl_board_init(void)
 
        preloader_console_init();
 #if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)
-       back_to_bootrom();
+       back_to_bootrom(BROM_BOOT_NEXTSTAGE);
 #endif
        return;
 err:
index 3d08b5b6d8dc2ddb8e9a65b1dc6b0a6919631075..150beea02e1c1a04fef035050b3ee66c979d0894 100644 (file)
@@ -69,7 +69,7 @@ void board_init_f(ulong dummy)
 
 void board_return_to_bootrom(void)
 {
-       back_to_bootrom();
+       back_to_bootrom(BROM_BOOT_NEXTSTAGE);
 }
 
 u32 spl_boot_device(void)
index b3e6ffa781b0e92a3ec304bd9a8e09a797c7980d..60d5aeade99e586301bb9e89ff120e79776bf610 100644 (file)
@@ -148,7 +148,7 @@ void board_init_f(ulong dummy)
 
 void board_return_to_bootrom(void)
 {
-       back_to_bootrom();
+       back_to_bootrom(BROM_BOOT_NEXTSTAGE);
 }
 
 u32 spl_boot_device(void)
index 9c20f56dc949c468bab0589f06f480988d59ecef..b96903e70fa8c40fd465b080ceb92c2007cd04c4 100644 (file)
@@ -23,7 +23,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 void board_return_to_bootrom(void)
 {
-       back_to_bootrom();
+       back_to_bootrom(BROM_BOOT_NEXTSTAGE);
 }
 
 static const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {