fastboot have a command "reboot-bootloader" which require the boot
loader to reboot and get into fastboot mode again.

Signed-off-by: Kever Yang <kever.y...@rock-chips.com>
---

 arch/arm/mach-rockchip/rk3399/rk3399.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c 
b/arch/arm/mach-rockchip/rk3399/rk3399.c
index d7a8aa6..729e876 100644
--- a/arch/arm/mach-rockchip/rk3399/rk3399.c
+++ b/arch/arm/mach-rockchip/rk3399/rk3399.c
@@ -93,3 +93,17 @@ int board_late_init(void)
 
        return 0;
 }
+
+#if defined(CONFIG_USB_FUNCTION_FASTBOOT)
+int fb_set_reboot_flag(void)
+{
+       struct rk3399_pmugrf_regs *pmugrf;
+
+       printf("Setting reboot to fastboot flag ...\n");
+       pmugrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF);
+       /* Clear boot mode */
+       writel(BOOT_FASTBOOT, &pmugrf->os_reg0);
+
+       return 0;
+}
+#endif
-- 
1.9.1

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to