cmd_fastboot.c 684 B

12345678910111213141516171819202122232425262728293031323334353637
  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. static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
  14. {
  15. int ret;
  16. ret = g_dnl_register("usb_dnl_fastboot");
  17. if (ret)
  18. return ret;
  19. while (1) {
  20. if (ctrlc())
  21. break;
  22. usb_gadget_handle_interrupts();
  23. }
  24. g_dnl_unregister();
  25. return CMD_RET_SUCCESS;
  26. }
  27. U_BOOT_CMD(
  28. fastboot, 1, 0, do_fastboot,
  29. "use USB Fastboot protocol",
  30. "\n"
  31. " - run as a fastboot usb device"
  32. );