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

Kever Yang kever.yang at rock-chips.com
Tue Aug 22 08:57:20 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>
Reviewed-by: Simon Glass <sjg at chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich at theobroma-systems.com>
---

Changes in v2: None

 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 3a5e4f9..3135b65 100644
--- a/arch/arm/mach-rockchip/rk3399/rk3399.c
+++ b/arch/arm/mach-rockchip/rk3399/rk3399.c
@@ -95,3 +95,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