From 4fcacc18d02ac0cc9ef943eb722c4e8cf5a03077 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 8 Aug 2017 18:23:24 -0700 Subject: apalis_imx6: 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 Acked-by: Marcel Ziswiler --- board/toradex/apalis_imx6/apalis_imx6.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/board/toradex/apalis_imx6/apalis_imx6.c b/board/toradex/apalis_imx6/apalis_imx6.c index 0e64ae0a42..a98b8eee9a 100644 --- a/board/toradex/apalis_imx6/apalis_imx6.c +++ b/board/toradex/apalis_imx6/apalis_imx6.c @@ -837,6 +837,14 @@ int board_late_init(void) #endif /* CONFIG_TDX_APALIS_IMX6_V1_0 */ #endif /* CONFIG_REVISION_TAG */ +#ifdef CONFIG_CMD_USB_SDP + if (is_boot_from_usb()) { + printf("Serial Downloader recovery mode, using sdp command\n"); + setenv("bootdelay", "0"); + setenv("bootcmd", "sdp 0"); + } +#endif /* CONFIG_CMD_USB_SDP */ + return 0; } #endif /* CONFIG_BOARD_LATE_INIT */ -- cgit v1.2.3