Sebastian Siewior | 3aab70a | 2014-05-05 15:08:10 -0500 | [diff] [blame] | 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 | |
| 14 | static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) |
| 15 | { |
| 16 | int ret; |
| 17 | |
| 18 | ret = g_dnl_register("usb_dnl_fastboot"); |
| 19 | if (ret) |
| 20 | return ret; |
| 21 | |
| 22 | while (1) { |
| 23 | if (ctrlc()) |
| 24 | break; |
| 25 | usb_gadget_handle_interrupts(); |
| 26 | } |
| 27 | |
| 28 | g_dnl_unregister(); |
| 29 | return CMD_RET_SUCCESS; |
| 30 | } |
| 31 | |
| 32 | U_BOOT_CMD( |
Steve Rae | 593cbd9 | 2014-08-26 11:47:29 -0700 | [diff] [blame] | 33 | fastboot, 1, 0, do_fastboot, |
| 34 | "use USB Fastboot protocol", |
| 35 | "\n" |
| 36 | " - run as a fastboot usb device" |
Sebastian Siewior | 3aab70a | 2014-05-05 15:08:10 -0500 | [diff] [blame] | 37 | ); |