the downloaded image to a non-volatile storage device. Define
this to enable the "fastboot flash" command.
+config FASTBOOT_UUU_SUPPORT
+ bool "Enable FASTBOOT i.MX UUU special command"
+ default n
+ help
+ The fastboot protocol includes "UCmd" and "ACmd" command.
+ Be aware that you provide full access to any U-Boot command,
+ including working with memory and may open a huge backdoor,
+ when enabling this option.
+
choice
prompt "Flash provider for FASTBOOT"
depends on FASTBOOT_FLASH
static void oem_bootbus(char *, char *);
#endif
+#if CONFIG_IS_ENABLED(FASTBOOT_UUU_SUPPORT)
+static void run_ucmd(char *, char *);
+static void run_acmd(char *, char *);
+#endif
+
static const struct {
const char *command;
void (*dispatch)(char *cmd_parameter, char *response);
.dispatch = oem_bootbus,
},
#endif
+#if CONFIG_IS_ENABLED(FASTBOOT_UUU_SUPPORT)
+ [FASTBOOT_COMMAND_UCMD] = {
+ .command = "UCmd",
+ .dispatch = run_ucmd,
+ },
+ [FASTBOOT_COMMAND_ACMD] = {
+ .command = "ACmd",
+ .dispatch = run_acmd,
+ },
+#endif
};
/**
}
#endif
+#if CONFIG_IS_ENABLED(FASTBOOT_UUU_SUPPORT)
+/**
+ * run_ucmd() - Execute the UCmd command
+ *
+ * @cmd_parameter: Pointer to command parameter
+ * @response: Pointer to fastboot response buffer
+ */
+static void run_ucmd(char *cmd_parameter, char *response)
+{
+ if (!cmd_parameter) {
+ pr_err("missing slot suffix\n");
+ fastboot_fail("missing command", response);
+ return;
+ }
+
+ if (run_command(cmd_parameter, 0))
+ fastboot_fail("", response);
+ else
+ fastboot_okay(NULL, response);
+}
+
+static char g_a_cmd_buff[64];
+
+void fastboot_acmd_complete(void)
+{
+ run_command(g_a_cmd_buff, 0);
+}
+
+/**
+ * run_acmd() - Execute the ACmd command
+ *
+ * @cmd_parameter: Pointer to command parameter
+ * @response: Pointer to fastboot response buffer
+ */
+static void run_acmd(char *cmd_parameter, char *response)
+{
+ if (!cmd_parameter) {
+ pr_err("missing slot suffix\n");
+ fastboot_fail("missing command", response);
+ return;
+ }
+
+ if (strlen(cmd_parameter) > sizeof(g_a_cmd_buff)) {
+ pr_err("too long command\n");
+ fastboot_fail("too long command", response);
+ return;
+ }
+
+ strcpy(g_a_cmd_buff, cmd_parameter);
+ fastboot_okay(NULL, response);
+}
+#endif
+
/**
* reboot_bootloader() - Sets reboot bootloader flag.
*
do_exit_on_complete(ep, req);
}
+#if CONFIG_IS_ENABLED(FASTBOOT_UUU_SUPPORT)
+static void do_acmd_complete(struct usb_ep *ep, struct usb_request *req)
+{
+ /* When usb dequeue complete will be called
+ * Need status value before call run_command.
+ * otherwise, host can't get last message.
+ */
+ if (req->status == 0)
+ fastboot_acmd_complete();
+}
+#endif
+
static void rx_handler_command(struct usb_ep *ep, struct usb_request *req)
{
char *cmdbuf = req->buf;
case FASTBOOT_COMMAND_REBOOT_RECOVERY:
fastboot_func->in_req->complete = compl_do_reset;
break;
+#if CONFIG_IS_ENABLED(FASTBOOT_UUU_SUPPORT)
+ case FASTBOOT_COMMAND_ACMD:
+ fastboot_func->in_req->complete = do_acmd_complete;
+ break;
+#endif
}
}
#if CONFIG_IS_ENABLED(FASTBOOT_CMD_OEM_BOOTBUS)
FASTBOOT_COMMAND_OEM_BOOTBUS,
#endif
+#if CONFIG_IS_ENABLED(FASTBOOT_UUU_SUPPORT)
+ FASTBOOT_COMMAND_ACMD,
+ FASTBOOT_COMMAND_UCMD,
+#endif
FASTBOOT_COMMAND_COUNT
};
*/
void fastboot_data_complete(char *response);
+#if CONFIG_IS_ENABLED(FASTBOOT_UUU_SUPPORT)
+void fastboot_acmd_complete(void);
+#endif
#endif /* _FASTBOOT_H_ */