summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLei Wen <leiwen@marvell.com>2011-06-22 17:03:31 +0000
committerAndy Fleming <afleming@freescale.com>2011-07-15 20:29:17 -0500
commite6f99a5611e1ff59555f93de88e527070f8548af (patch)
tree77577e3a0f6db5f84f2d9d879e9abfc221685c69 /include
parent6be95ccf9ff52d629526d1c20c5343c2a91d9e72 (diff)
downloadu-boot-imx-e6f99a5611e1ff59555f93de88e527070f8548af.zip
u-boot-imx-e6f99a5611e1ff59555f93de88e527070f8548af.tar.gz
u-boot-imx-e6f99a5611e1ff59555f93de88e527070f8548af.tar.bz2
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')
-rw-r--r--include/mmc.h8
-rw-r--r--include/part.h3
2 files changed, 11 insertions, 0 deletions
diff --git a/include/mmc.h b/include/mmc.h
index aeacdee..1c8a360 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,
diff --git a/include/part.h b/include/part.h
index 3cdae02..5243511 100644
--- a/include/part.h
+++ b/include/part.h
@@ -49,6 +49,9 @@ typedef struct block_dev_desc {
unsigned long start,
lbaint_t blkcnt,
const void *buffer);
+ unsigned long (*block_erase)(int dev,
+ unsigned long start,
+ lbaint_t blkcnt);
void *priv; /* driver private struct pointer */
}block_dev_desc_t;