From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukasz Majewski Date: Tue, 24 Feb 2015 11:07:22 +0100 Subject: [U-Boot] [PATCH] fastboot: Add USB cable detect check In-Reply-To: References: <1422306881-22087-1-git-send-email-robh@kernel.org> <54CAB907.3080809@broadcom.com> Message-ID: <20150224110722.61541199@amdc2363> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Rob, > On Thu, Jan 29, 2015 at 4:49 PM, Steve Rae wrote: > > > > > > 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 > >> --- > >> 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" ?!?!) > > Humm, good question. It's copy and paste from USB MS implementation. > > Rob > > > Reviewed-by: Steve Rae > > > > Thanks, Steve Queued for u-boot-dfu branch. Thanks for development and sorry for delay. -- Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group