summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Nelson <eric@nelint.com>2015-12-07 07:50:01 -0700
committerTom Rini <trini@konsulko.com>2016-01-04 11:17:43 -0500
commit1aa2d074a7acda61eb43e654ced21c139703633c (patch)
treec9e5751b43d4234b24b484d9867a9ec137527ee1
parentf8a3df0fbc31e7f0f0a5359d505c07fd99b2dab3 (diff)
downloadblackbird-obmc-uboot-1aa2d074a7acda61eb43e654ced21c139703633c.tar.gz
blackbird-obmc-uboot-1aa2d074a7acda61eb43e654ced21c139703633c.zip
mmc: update MMC_ERASE argument to match Linux kernel.
Table 41 of the JEDEC standard for eMMC says that bit 31 of the command argument is obsolete when issuing the ERASE command (CMD38) on page 115 of this document: http://www.jedec.org/sites/default/files/docs/jesd84-B45.pdf The SD Card Association Physical Layer Simplified Specification also makes no mention of the use of bit 31. https://www.sdcard.org/downloads/pls/part1_410.pdf The Linux kernel distinguishes between secure (bit 31 set) and non-secure erase, and this patch copies the macro names from include/linux/mmc/core.h. Tested-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Eric Nelson <eric@nelint.com> Tested-by: Hector Palacios <hector.palacios@digi.com>
-rw-r--r--drivers/mmc/mmc_write.c2
-rw-r--r--include/mmc.h7
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/mmc/mmc_write.c b/drivers/mmc/mmc_write.c
index 7aea7e943b..221bf306cc 100644
--- a/drivers/mmc/mmc_write.c
+++ b/drivers/mmc/mmc_write.c
@@ -51,7 +51,7 @@ static ulong mmc_erase_t(struct mmc *mmc, ulong start, lbaint_t blkcnt)
goto err_out;
cmd.cmdidx = MMC_CMD_ERASE;
- cmd.cmdarg = SECURE_ERASE;
+ cmd.cmdarg = MMC_ERASE_ARG;
cmd.resp_type = MMC_RSP_R1b;
err = mmc_send_cmd(mmc, &cmd, NULL);
diff --git a/include/mmc.h b/include/mmc.h
index cda9a19ce0..b89962a562 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -121,7 +121,12 @@
#define OCR_VOLTAGE_MASK 0x007FFF80
#define OCR_ACCESS_MODE 0x60000000
-#define SECURE_ERASE 0x80000000
+#define MMC_ERASE_ARG 0x00000000
+#define MMC_SECURE_ERASE_ARG 0x80000000
+#define MMC_TRIM_ARG 0x00000001
+#define MMC_DISCARD_ARG 0x00000003
+#define MMC_SECURE_TRIM1_ARG 0x80000001
+#define MMC_SECURE_TRIM2_ARG 0x80008000
#define MMC_STATUS_MASK (~0x0206BF7F)
#define MMC_STATUS_SWITCH_ERROR (1 << 7)
OpenPOWER on IntegriCloud