cmd_fastboot.c 762 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. g_dnl_clear_detach();
  17. ret = g_dnl_register("usb_dnl_fastboot");
  18. if (ret)
  19. return ret;
  20. while (1) {
  21. if (g_dnl_detach())
  22. break;
  23. if (ctrlc())
  24. break;
  25. usb_gadget_handle_interrupts();
  26. }
  27. g_dnl_unregister();
  28. g_dnl_clear_detach();
  29. return CMD_RET_SUCCESS;
  30. }
  31. U_BOOT_CMD(
  32. fastboot, 1, 0, do_fastboot,
  33. "use USB Fastboot protocol",
  34. "\n"
  35. " - run as a fastboot usb device"
  36. );