]> git.sur5r.net Git - u-boot/blobdiff - drivers/usb/gadget/f_fastboot.c
Merge branch 'master' of git://www.denx.de/git/u-boot-imx
[u-boot] / drivers / usb / gadget / f_fastboot.c
index 751ec9e010795079a0d8c601026b0c7071f7a2fa..206b6d17aea610ccb8ef0b8cec6c66ed241b2d4d 100644 (file)
@@ -123,6 +123,7 @@ static struct usb_gadget_strings *fastboot_strings[] = {
 };
 
 static void rx_handler_command(struct usb_ep *ep, struct usb_request *req);
+static int strcmp_l1(const char *s1, const char *s2);
 
 static void fastboot_complete(struct usb_ep *ep, struct usb_request *req)
 {
@@ -326,8 +327,20 @@ static void compl_do_reset(struct usb_ep *ep, struct usb_request *req)
        do_reset(NULL, 0, 0, NULL);
 }
 
+int __weak fb_set_reboot_flag(void)
+{
+       return -ENOSYS;
+}
+
 static void cb_reboot(struct usb_ep *ep, struct usb_request *req)
 {
+       char *cmd = req->buf;
+       if (!strcmp_l1("reboot-bootloader", cmd)) {
+               if (fb_set_reboot_flag()) {
+                       fastboot_tx_write_str("FAILCannot set reboot flag");
+                       return;
+               }
+       }
        fastboot_func->in_req->complete = compl_do_reset;
        fastboot_tx_write_str("OKAY");
 }