summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2015-01-26 15:14:41 -0600
committerMarek Vasut <marex@denx.de>2015-02-25 17:47:02 +0100
commit7c23bcb93fd44026c737c0f102262f98b5a08ea9 (patch)
tree67ce6f4e08aa278611eede9fcedf611bd311851d
parent897923819cda6f26fe8a5921c595871526ab6a9c (diff)
downloadu-boot-imx-7c23bcb93fd44026c737c0f102262f98b5a08ea9.zip
u-boot-imx-7c23bcb93fd44026c737c0f102262f98b5a08ea9.tar.gz
u-boot-imx-7c23bcb93fd44026c737c0f102262f98b5a08ea9.tar.bz2
fastboot: Add USB cable detect check
Add a check for USB cable attached and only enter fastboot when a cable is attached. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Steve Rae <srae@broadcom.com> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
-rw-r--r--common/cmd_fastboot.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/cmd_fastboot.c b/common/cmd_fastboot.c
index b72f4f3..346ab80 100644
--- a/common/cmd_fastboot.c
+++ b/common/cmd_fastboot.c
@@ -20,6 +20,12 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
if (ret)
return ret;
+ if (!g_dnl_board_usb_cable_connected()) {
+ puts("\rUSB cable not detected.\n" \
+ "Command exit.\n");
+ return CMD_RET_FAILURE;
+ }
+
while (1) {
if (g_dnl_detach())
break;