From: Stefan Agner Date: Fri, 23 Jul 2021 06:39:45 +0000 (+0300) Subject: board: colibri_imx7: use SDP if USB serial downloader has been used X-Git-Tag: v2021.10~59^2~78 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=46307ef01e083e3bbbad62f6b75107201e0c6184;p=platform%2Fkernel%2Fu-boot.git board: colibri_imx7: use SDP if USB serial downloader has been used In case USB serial downloader has been used to load U-Boot start the serial download protocol (SDP) emulation. This allows to download complete images such as Toradex Easy Installer over USB SDP as well. This code uses the boot ROM provided boot information to reliably detect USB serial downloader. Signed-off-by: Stefan Agner Signed-off-by: Oleksandr Suvorov --- diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c index 301b07d..6822102 100644 --- a/board/toradex/colibri_imx7/colibri_imx7.c +++ b/board/toradex/colibri_imx7/colibri_imx7.c @@ -355,12 +355,22 @@ int board_usb_phy_mode(int port) } } +#if defined(CONFIG_BOARD_LATE_INIT) int board_late_init(void) { #if defined(CONFIG_DM_VIDEO) setup_lcd(); #endif + +#if defined(CONFIG_CMD_USB_SDP) + if (is_boot_from_usb()) { + printf("Serial Downloader recovery mode, using sdp command\n"); + env_set("bootdelay", "0"); + env_set("bootcmd", "sdp 0"); + } +#endif return 0; } +#endif /* CONFIG_BOARD_LATE_INIT */ #endif