1 // SPDX-License-Identifier: GPL-2.0+
3 * cmd_sdp.c -- sdp command
5 * Copyright (C) 2016 Toradex
6 * Author: Stefan Agner <stefan.agner@toradex.com>
13 #include <linux/printk.h>
15 static int do_sdp(struct cmd_tbl
*cmdtp
, int flag
, int argc
, char *const argv
[])
24 controller_index
= simple_strtoul(argv
[1], NULL
, 0);
25 ret
= udc_device_get_by_index(controller_index
, &udc
);
30 ret
= g_dnl_register("usb_dnl_sdp");
32 pr_err("SDP dnl register failed: %d\n", ret
);
38 pr_err("SDP init failed: %d\n", ret
);
42 /* This command typically does not return but jumps to an image */
44 pr_err("SDP ended\n");
51 return CMD_RET_FAILURE
;
54 U_BOOT_CMD(sdp
, 2, 1, do_sdp
,
55 "Serial Downloader Protocol",
57 " - serial downloader protocol via <USB_controller>\n"