mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-08-19 08:28:51 +09:00
![Tom Rini](/assets/img/avatar_default.png)
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
57 lines
1.1 KiB
C
57 lines
1.1 KiB
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* (C) Copyright 2016
|
|
* Texas Instruments, <www.ti.com>
|
|
*
|
|
* Ravi B <ravibabu@ti.com>
|
|
*/
|
|
#include <common.h>
|
|
#include <spl.h>
|
|
#include <linux/compiler.h>
|
|
#include <errno.h>
|
|
#include <watchdog.h>
|
|
#include <console.h>
|
|
#include <g_dnl.h>
|
|
#include <usb.h>
|
|
#include <dfu.h>
|
|
#include <environment.h>
|
|
|
|
static int run_dfu(int usb_index, char *interface, char *devstring)
|
|
{
|
|
int ret;
|
|
|
|
ret = dfu_init_env_entities(interface, devstring);
|
|
if (ret) {
|
|
dfu_free_entities();
|
|
goto exit;
|
|
}
|
|
|
|
run_usb_dnl_gadget(usb_index, "usb_dnl_dfu");
|
|
exit:
|
|
dfu_free_entities();
|
|
return ret;
|
|
}
|
|
|
|
int spl_dfu_cmd(int usbctrl, char *dfu_alt_info, char *interface, char *devstr)
|
|
{
|
|
char *str_env;
|
|
int ret;
|
|
|
|
/* set default environment */
|
|
set_default_env(0);
|
|
str_env = env_get(dfu_alt_info);
|
|
if (!str_env) {
|
|
pr_err("\"dfu_alt_info\" env variable not defined!\n");
|
|
return -EINVAL;
|
|
}
|
|
|
|
ret = env_set("dfu_alt_info", str_env);
|
|
if (ret) {
|
|
pr_err("unable to set env variable \"dfu_alt_info\"!\n");
|
|
return -EINVAL;
|
|
}
|
|
|
|
/* invoke dfu command */
|
|
return run_dfu(usbctrl, interface, devstr);
|
|
}
|