diff options
| author | Lei Wen <leiwen@marvell.com> | 2011-06-22 17:03:31 +0000 | 
|---|---|---|
| committer | Andy Fleming <afleming@freescale.com> | 2011-07-15 20:29:17 -0500 | 
| commit | e6f99a5611e1ff59555f93de88e527070f8548af (patch) | |
| tree | 77577e3a0f6db5f84f2d9d879e9abfc221685c69 /include/mmc.h | |
| parent | 6be95ccf9ff52d629526d1c20c5343c2a91d9e72 (diff) | |
| download | olio-uboot-2014.01-e6f99a5611e1ff59555f93de88e527070f8548af.tar.xz olio-uboot-2014.01-e6f99a5611e1ff59555f93de88e527070f8548af.zip | |
MMC: add erase function to both mmc and sd
Erase is a very basic function since the begin of sd specification is
announced. Although we could write a bulk of full 0xff memory to the
range to take place of erase, it is more convenient and safe to
implement the erase function itself.
Signed-off-by: Lei Wen <leiwen@marvell.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'include/mmc.h')
| -rw-r--r-- | include/mmc.h | 8 | 
1 files changed, 8 insertions, 0 deletions
| diff --git a/include/mmc.h b/include/mmc.h index aeacdee30..1c8a36071 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -75,6 +75,9 @@  #define MMC_CMD_READ_MULTIPLE_BLOCK	18  #define MMC_CMD_WRITE_SINGLE_BLOCK	24  #define MMC_CMD_WRITE_MULTIPLE_BLOCK	25 +#define MMC_CMD_ERASE_GROUP_START	35 +#define MMC_CMD_ERASE_GROUP_END		36 +#define MMC_CMD_ERASE			38  #define MMC_CMD_APP_CMD			55  #define MMC_CMD_SPI_READ_OCR		58  #define MMC_CMD_SPI_CRC_ON_OFF		59 @@ -84,6 +87,8 @@  #define SD_CMD_SEND_IF_COND		8  #define SD_CMD_APP_SET_BUS_WIDTH	6 +#define SD_CMD_ERASE_WR_BLK_START	32 +#define SD_CMD_ERASE_WR_BLK_END		33  #define SD_CMD_APP_SEND_OP_COND		41  #define SD_CMD_APP_SEND_SCR		51 @@ -99,6 +104,8 @@  #define OCR_VOLTAGE_MASK	0x007FFF80  #define OCR_ACCESS_MODE		0x60000000 +#define SECURE_ERASE		0x80000000 +  #define MMC_STATUS_MASK		(~0x0206BF7F)  #define MMC_STATUS_RDY_FOR_DATA (1 << 8)  #define MMC_STATUS_CURR_STATE	(0xf << 9) @@ -285,6 +292,7 @@ struct mmc {  	uint tran_speed;  	uint read_bl_len;  	uint write_bl_len; +	uint erase_grp_size;  	u64 capacity;  	block_dev_desc_t block_dev;  	int (*send_cmd)(struct mmc *mmc, |