aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@mailbox.org>2023-06-20 00:38:23 +0200
committerJaehoon Chung <jh80.chung@samsung.com>2023-07-18 09:17:07 +0900
commit41a1285c1c31080661fce8de782d8ee4a57014a9 (patch)
treea48bcd3a79ea9caa72799b7741d6ab327734e182
parent13aa090b87a0fbdfe690011669b9fdb96bb1ccc7 (diff)
downloadu-boot-41a1285c1c31080661fce8de782d8ee4a57014a9.zip
u-boot-41a1285c1c31080661fce8de782d8ee4a57014a9.tar.gz
u-boot-41a1285c1c31080661fce8de782d8ee4a57014a9.tar.bz2
mmc: Fix MMC_CMD_STOP_TRANSMISSION response type and add comment
For MMC/eMMC, the MMC_CMD_STOP_TRANSMISSION response is R1 for read transfers and R1b for write transfers per JEDEC Standard No. 84-B51 Page 126 . The response is R1b unconditionally per Physical Layer Simplified Specification Version 9.00. Correct the response type and add a comment about it. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Peng Fan <peng.fan@nxp.com>
-rw-r--r--drivers/mmc/mmc.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 72c1076..5417813 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -427,7 +427,16 @@ static int mmc_read_blocks(struct mmc *mmc, void *dst, lbaint_t start,
if (blkcnt > 1) {
cmd.cmdidx = MMC_CMD_STOP_TRANSMISSION;
cmd.cmdarg = 0;
- cmd.resp_type = MMC_RSP_R1b;
+ /*
+ * JEDEC Standard No. 84-B51 Page 126
+ * CMD12 STOP_TRANSMISSION R1/R1b[3]
+ * NOTE 3 R1 for read cases and R1b for write cases.
+ *
+ * Physical Layer Simplified Specification Version 9.00
+ * 7.3.1.3 Detailed Command Description
+ * CMD12 R1b
+ */
+ cmd.resp_type = IS_SD(mmc) ? MMC_RSP_R1b : MMC_RSP_R1;
if (mmc_send_cmd(mmc, &cmd, NULL)) {
#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
pr_err("mmc fail to send stop cmd\n");