|
@ -1,7 +1,7 @@ |
|
|
From 5425e4e96559b29b36459080190e8bcc1c92f7c2 Mon Sep 17 00:00:00 2001 |
|
|
|
|
|
|
|
|
From f54f401085e011e6f9c7b120aa1794b19c32b493 Mon Sep 17 00:00:00 2001 |
|
|
From: "Shivamurthy Shastri (sshivamurthy)" <sshivamurthy@micron.com> |
|
|
From: "Shivamurthy Shastri (sshivamurthy)" <sshivamurthy@micron.com> |
|
|
Date: Wed, 10 Apr 2019 13:38:08 +0000 |
|
|
Date: Wed, 10 Apr 2019 13:38:08 +0000 |
|
|
Subject: [PATCH 9/9] mmc-utils: let FFU mode use CMD23 and CMD25 |
|
|
|
|
|
|
|
|
Subject: [PATCH] mmc-utils: let FFU mode use CMD23 and CMD25 |
|
|
|
|
|
|
|
|
As per specification, the host can use either CMD24 or CMD25 in |
|
|
As per specification, the host can use either CMD24 or CMD25 in |
|
|
closed-ended or open-ended way. |
|
|
closed-ended or open-ended way. |
|
@ -15,7 +15,7 @@ Reviewed-by: Avri Altman <avri.altman@wdc.com> |
|
|
2 files changed, 41 insertions(+), 31 deletions(-) |
|
|
2 files changed, 41 insertions(+), 31 deletions(-) |
|
|
|
|
|
|
|
|
diff --git a/mmc.h b/mmc.h
|
|
|
diff --git a/mmc.h b/mmc.h
|
|
|
index 285c1f1..a4cbba4 100644
|
|
|
|
|
|
|
|
|
index 648fb26..d648f68 100644
|
|
|
--- a/mmc.h
|
|
|
--- a/mmc.h
|
|
|
+++ b/mmc.h
|
|
|
+++ b/mmc.h
|
|
|
@@ -25,10 +25,12 @@
|
|
|
@@ -25,10 +25,12 @@
|
|
@ -32,10 +32,10 @@ index 285c1f1..a4cbba4 100644 |
|
|
#define MMC_WRITE_MULTIPLE_BLOCK 25 /* adtc R1 */ |
|
|
#define MMC_WRITE_MULTIPLE_BLOCK 25 /* adtc R1 */ |
|
|
#define MMC_SET_WRITE_PROT 28 /* ac [31:0] data addr R1b */ |
|
|
#define MMC_SET_WRITE_PROT 28 /* ac [31:0] data addr R1b */ |
|
|
diff --git a/mmc_cmds.c b/mmc_cmds.c
|
|
|
diff --git a/mmc_cmds.c b/mmc_cmds.c
|
|
|
index 9402112..0a3788a 100644
|
|
|
|
|
|
|
|
|
index 8f4a476..c006ef2 100644
|
|
|
--- a/mmc_cmds.c
|
|
|
--- a/mmc_cmds.c
|
|
|
+++ b/mmc_cmds.c
|
|
|
+++ b/mmc_cmds.c
|
|
|
@@ -2424,12 +2424,13 @@ int do_ffu(int nargs, char **argv)
|
|
|
|
|
|
|
|
|
@@ -2456,12 +2456,13 @@ int do_ffu(int nargs, char **argv)
|
|
|
int sect_done = 0, retry = 3, ret = -EINVAL; |
|
|
int sect_done = 0, retry = 3, ret = -EINVAL; |
|
|
unsigned int sect_size; |
|
|
unsigned int sect_size; |
|
|
__u8 ext_csd[512]; |
|
|
__u8 ext_csd[512]; |
|
@ -51,7 +51,7 @@ index 9402112..0a3788a 100644 |
|
|
|
|
|
|
|
|
if (nargs != 3) { |
|
|
if (nargs != 3) { |
|
|
fprintf(stderr, "Usage: ffu <image name> </path/to/mmcblkX> \n"); |
|
|
fprintf(stderr, "Usage: ffu <image name> </path/to/mmcblkX> \n"); |
|
|
@@ -2449,14 +2450,6 @@ int do_ffu(int nargs, char **argv)
|
|
|
|
|
|
|
|
|
@@ -2481,14 +2482,6 @@ int do_ffu(int nargs, char **argv)
|
|
|
exit(1); |
|
|
exit(1); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -66,7 +66,7 @@ index 9402112..0a3788a 100644 |
|
|
ret = read_extcsd(dev_fd, ext_csd); |
|
|
ret = read_extcsd(dev_fd, ext_csd); |
|
|
if (ret) { |
|
|
if (ret) { |
|
|
fprintf(stderr, "Could not read EXT_CSD from %s\n", device); |
|
|
fprintf(stderr, "Could not read EXT_CSD from %s\n", device); |
|
|
@@ -2481,9 +2474,17 @@ int do_ffu(int nargs, char **argv)
|
|
|
|
|
|
|
|
|
@@ -2513,9 +2506,17 @@ int do_ffu(int nargs, char **argv)
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
fw_size = lseek(img_fd, 0, SEEK_END); |
|
|
fw_size = lseek(img_fd, 0, SEEK_END); |
|
@ -86,7 +86,7 @@ index 9402112..0a3788a 100644 |
|
|
goto out; |
|
|
goto out; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@@ -2493,14 +2494,19 @@ int do_ffu(int nargs, char **argv)
|
|
|
|
|
|
|
|
|
@@ -2525,14 +2526,19 @@ int do_ffu(int nargs, char **argv)
|
|
|
goto out; |
|
|
goto out; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -107,7 +107,7 @@ index 9402112..0a3788a 100644 |
|
|
|
|
|
|
|
|
/* put device into ffu mode */ |
|
|
/* put device into ffu mode */ |
|
|
multi_cmd->cmds[0].opcode = MMC_SWITCH; |
|
|
multi_cmd->cmds[0].opcode = MMC_SWITCH; |
|
|
@@ -2511,37 +2517,42 @@ int do_ffu(int nargs, char **argv)
|
|
|
|
|
|
|
|
|
@@ -2543,37 +2549,42 @@ int do_ffu(int nargs, char **argv)
|
|
|
multi_cmd->cmds[0].flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC; |
|
|
multi_cmd->cmds[0].flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC; |
|
|
multi_cmd->cmds[0].write_flag = 1; |
|
|
multi_cmd->cmds[0].write_flag = 1; |
|
|
|
|
|
|
|
@ -164,7 +164,7 @@ index 9402112..0a3788a 100644 |
|
|
goto out; |
|
|
goto out; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@@ -2568,9 +2579,6 @@ do_retry:
|
|
|
|
|
|
|
|
|
@@ -2600,9 +2611,6 @@ do_retry:
|
|
|
} else { |
|
|
} else { |
|
|
fprintf(stderr, "Programmed %d/%jd bytes\r", sect_done * sect_size, (intmax_t)fw_size); |
|
|
fprintf(stderr, "Programmed %d/%jd bytes\r", sect_done * sect_size, (intmax_t)fw_size); |
|
|
} |
|
|
} |
|
@ -174,7 +174,7 @@ index 9402112..0a3788a 100644 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if ((sect_done * sect_size) == fw_size) { |
|
|
if ((sect_done * sect_size) == fw_size) { |
|
|
@@ -2607,7 +2615,7 @@ do_retry:
|
|
|
|
|
|
|
|
|
@@ -2639,7 +2647,7 @@ do_retry:
|
|
|
if (ret) { |
|
|
if (ret) { |
|
|
perror("Multi-cmd ioctl failed setting install mode"); |
|
|
perror("Multi-cmd ioctl failed setting install mode"); |
|
|
/* In case multi-cmd ioctl failed before exiting from ffu mode */ |
|
|
/* In case multi-cmd ioctl failed before exiting from ffu mode */ |
|
|