]>
git.ipfire.org Git - people/ms/u-boot.git/blob - cmd/usb_gadget_sdp.c
2 * cmd_sdp.c -- sdp command
4 * Copyright (C) 2016 Toradex
5 * Author: Stefan Agner <stefan.agner@toradex.com>
7 * SPDX-License-Identifier: GPL-2.0+
15 static int do_sdp(cmd_tbl_t
*cmdtp
, int flag
, int argc
, char * const argv
[])
17 int ret
= CMD_RET_FAILURE
;
22 char *usb_controller
= argv
[1];
23 int controller_index
= simple_strtoul(usb_controller
, NULL
, 0);
24 board_usb_init(controller_index
, USB_INIT_DEVICE
);
27 g_dnl_register("usb_dnl_sdp");
29 ret
= sdp_init(controller_index
);
31 error("SDP init failed: %d", ret
);
35 /* This command typically does not return but jumps to an image */
36 sdp_handle(controller_index
);
41 board_usb_cleanup(controller_index
, USB_INIT_DEVICE
);
46 U_BOOT_CMD(sdp
, 2, 1, do_sdp
,
47 "Serial Downloader Protocol",
49 " - serial downloader protocol via <USB_controller>\n"