[U-Boot] [PATCH 2/3] rockchip: rk3399: enable fastboot to set boot mode tag

Kever Yang kever.yang at rock-chips.com
Wed Aug 9 10:18:58 UTC 2017


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.yang at 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



More information about the U-Boot mailing list