1 // SPDX-License-Identifier: GPL-2.0+
4 * Texas Instruments, <www.ti.com>
6 * Ravi B <ravibabu@ti.com>
10 #include <linux/compiler.h>
17 #include <environment.h>
19 static int run_dfu(int usb_index, char *interface, char *devstring)
23 ret = dfu_init_env_entities(interface, devstring);
29 run_usb_dnl_gadget(usb_index, "usb_dnl_dfu");
35 int spl_dfu_cmd(int usbctrl, char *dfu_alt_info, char *interface, char *devstr)
40 /* set default environment */
41 set_default_env(NULL, 0);
42 str_env = env_get(dfu_alt_info);
44 pr_err("\"dfu_alt_info\" env variable not defined!\n");
48 ret = env_set("dfu_alt_info", str_env);
50 pr_err("unable to set env variable \"dfu_alt_info\"!\n");
54 /* invoke dfu command */
55 return run_dfu(usbctrl, interface, devstr);