From c964a0dcae5c4af334881d7286ec0222640b6a17 Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Wed, 9 Aug 2017 19:28:03 +0800 Subject: [PATCH] rockchip: rk322x: enable fastboot to set boot mode tag To support fastboot "fastboot reboot-bootloader" cmd. Signed-off-by: Kever Yang Reviewed-by: Simon Glass Acked-by: Philipp Tomsich --- arch/arm/mach-rockchip/rk322x-board.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm/mach-rockchip/rk322x-board.c b/arch/arm/mach-rockchip/rk322x-board.c index c0ac2e9b56..63875557ec 100644 --- a/arch/arm/mach-rockchip/rk322x-board.c +++ b/arch/arm/mach-rockchip/rk322x-board.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -136,3 +137,17 @@ int board_usb_cleanup(int index, enum usb_init_type init) return 0; } #endif + +#if defined(CONFIG_USB_FUNCTION_FASTBOOT) +int fb_set_reboot_flag(void) +{ + struct rk322x_grf *grf; + + printf("Setting reboot to fastboot flag ...\n"); + grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF); + /* Set boot mode to fastboot */ + writel(BOOT_FASTBOOT, &grf->os_reg[0]); + + return 0; +} +#endif -- 2.39.5