Commit 1aa2d074a7acda61eb43e654ced21c139703633c

Authored by Eric Nelson
Committed by Tom Rini
1 parent f8a3df0fbc

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>

Showing 2 changed files with 7 additions and 2 deletions Side-by-side Diff

drivers/mmc/mmc_write.c
... ... @@ -51,7 +51,7 @@
51 51 goto err_out;
52 52  
53 53 cmd.cmdidx = MMC_CMD_ERASE;
54   - cmd.cmdarg = SECURE_ERASE;
  54 + cmd.cmdarg = MMC_ERASE_ARG;
55 55 cmd.resp_type = MMC_RSP_R1b;
56 56  
57 57 err = mmc_send_cmd(mmc, &cmd, NULL);
... ... @@ -121,7 +121,12 @@
121 121 #define OCR_VOLTAGE_MASK 0x007FFF80
122 122 #define OCR_ACCESS_MODE 0x60000000
123 123  
124   -#define SECURE_ERASE 0x80000000
  124 +#define MMC_ERASE_ARG 0x00000000
  125 +#define MMC_SECURE_ERASE_ARG 0x80000000
  126 +#define MMC_TRIM_ARG 0x00000001
  127 +#define MMC_DISCARD_ARG 0x00000003
  128 +#define MMC_SECURE_TRIM1_ARG 0x80000001
  129 +#define MMC_SECURE_TRIM2_ARG 0x80008000
125 130  
126 131 #define MMC_STATUS_MASK (~0x0206BF7F)
127 132 #define MMC_STATUS_SWITCH_ERROR (1 << 7)