@@ -195,6 +195,9 @@ if [\fIchunk\-bytes\fR] is omitted, mmc-utils will try to run ffu using the larg
.BI ffu2 " \fIimage\-file\-name\fR " " \fIdevice\fR " " [\fIchunk\-bytes\fR]
Same as 'ffu1', but uses CMD23+CMD25 for repeated downloads and remains in FFU mode until completion.
.TP
+.BI ffu3 " \fIimage\-file\-name\fR " " \fIdevice\fR " " [\fIchunk\-bytes\fR]
+Same as 'ffu1', but uses CMD25+CMD12 Open-ended Multiple-block write to download and remains in FFU mode until completion.
+.TP
.BI erase " " \fItype\fR " " \fIstart-address\fR " " \fIend\-address\fR " " \fIdevice\fR
Send Erase CMD38 with specific argument to the device.
.br
@@ -239,6 +239,11 @@ static struct Command commands[] = {
"Same as 'ffu1', but uses CMD23+CMD25 for repeated downloads and remains in FFU mode until completion.\n",
NULL
},
+ { do_ffu3, -2,
+ "ffu3", "<image name> <device> [chunk-bytes]\n"
+ "Same as 'ffu', but uses CMD25+CMD12 Open-ended Multiple-block write to download and remains in FFU mode until completion.\n",
+ NULL
+ },
{ do_erase, -4,
"erase", "<type> " "<start address> " "<end address> " "<device>\n"
"Send Erase CMD38 with specific argument to the <device>\n\n"
@@ -27,6 +27,7 @@
#define MMC_BOOT_INITIATION_ARG 0xFFFFFFFA
#define MMC_SWITCH 6 /* ac [31:0] See below R1b */
#define MMC_SEND_EXT_CSD 8 /* adtc R1 */
+#define MMC_STOP_TRANSMISSION 12 /* ac R1b */
#define MMC_SEND_STATUS 13 /* ac [31:16] RCA R1 */
#define R1_SWITCH_ERROR (1 << 7) /* sx, c */
#define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */
@@ -2846,6 +2846,12 @@ static void set_ffu_download_cmd(struct mmc_ioc_multi_cmd *multi_cmd,
multi_cmd->cmds[0].flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC;
set_single_cmd(&multi_cmd->cmds[1], MMC_WRITE_MULTIPLE_BLOCK, 1, bytes / 512, arg);
mmc_ioc_cmd_set_data(multi_cmd->cmds[1], buf + offset);
+ } else if (ffu_mode == 3) {
+ set_single_cmd(&multi_cmd->cmds[0], MMC_WRITE_MULTIPLE_BLOCK, 1, bytes / 512, arg);
+ multi_cmd->cmds[0].flags = MMC_RSP_R1 | MMC_CMD_ADTC;
+ mmc_ioc_cmd_set_data(multi_cmd->cmds[0], buf + offset);
+ set_single_cmd(&multi_cmd->cmds[1], MMC_STOP_TRANSMISSION, 0, 0, 0);
+ multi_cmd->cmds[1].flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC;
}
}
@@ -3197,6 +3203,11 @@ int do_ffu2(int nargs, char **argv)
return __do_ffu(nargs, argv, 2);
}
+int do_ffu3(int nargs, char **argv)
+{
+ return __do_ffu(nargs, argv, 3);
+}
+
int do_general_cmd_read(int nargs, char **argv)
{
int dev_fd;
@@ -43,6 +43,7 @@ int do_cache_en(int nargs, char **argv);
int do_cache_dis(int nargs, char **argv);
int do_ffu1(int nargs, char **argv);
int do_ffu2(int nargs, char **argv);
+int do_ffu3(int nargs, char **argv);
int do_read_scr(int argc, char **argv);
int do_read_cid(int argc, char **argv);
int do_read_csd(int argc, char **argv);