From: Kever Yang Date: Wed, 9 Aug 2017 11:28:03 +0000 (+0800) Subject: rockchip: rk322x: enable fastboot to set boot mode tag X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=c964a0dcae5c4af334881d7286ec0222640b6a17;p=u-boot.git 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 --- 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