[U-Boot] [PATCH] fastboot: Add USB cable detect check
Steve Rae
srae at broadcom.com
Thu Jan 29 23:49:43 CET 2015
On 15-01-26 01:14 PM, Rob Herring wrote:
> Add a check for USB cable attached and only enter fastboot when a cable
> is attached.
>
> Signed-off-by: Rob Herring <robh at kernel.org>
> ---
> common/cmd_fastboot.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> 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;
>
(question: the leading "\r" ?!?!)
Reviewed-by: Steve Rae <srae at broadcom.com>
Thanks, Steve
More information about the U-Boot
mailing list