]> git.ipfire.org Git - people/ms/u-boot.git/blame - common/cmd_fastboot.c
arc: introduce U-Boot port for ARCv2 ISA
[people/ms/u-boot.git] / common / cmd_fastboot.c
CommitLineData
3aab70af
SS
1/*
2 * Copyright 2008 - 2009 Windriver, <www.windriver.com>
3 * Author: Tom Rix <Tom.Rix@windriver.com>
4 *
5 * (C) Copyright 2014 Linaro, Ltd.
6 * Rob Herring <robh@kernel.org>
7 *
8 * SPDX-License-Identifier: GPL-2.0+
9 */
10#include <common.h>
11#include <command.h>
12#include <g_dnl.h>
13
14static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
15{
16 int ret;
17
267abc62 18 g_dnl_clear_detach();
3aab70af
SS
19 ret = g_dnl_register("usb_dnl_fastboot");
20 if (ret)
21 return ret;
22
23 while (1) {
267abc62
RH
24 if (g_dnl_detach())
25 break;
3aab70af
SS
26 if (ctrlc())
27 break;
28 usb_gadget_handle_interrupts();
29 }
30
31 g_dnl_unregister();
267abc62 32 g_dnl_clear_detach();
3aab70af
SS
33 return CMD_RET_SUCCESS;
34}
35
36U_BOOT_CMD(
593cbd93
SR
37 fastboot, 1, 0, do_fastboot,
38 "use USB Fastboot protocol",
39 "\n"
40 " - run as a fastboot usb device"
3aab70af 41);