summaryrefslogtreecommitdiff
path: root/include/mmc.h
diff options
context:
space:
mode:
authorLei Wen <leiwen@marvell.com>2011-05-02 16:26:26 +0000
committerAndy Fleming <afleming@freescale.com>2011-05-18 14:37:03 -0500
commitbc897b1d4d86597311430dbe7b3e6c807c8c53e5 (patch)
treedc5136100f1b0a873dd8bc90708286215335f559 /include/mmc.h
parentea6ebe21772568ee97fb5c23c01e993140f0e0e6 (diff)
downloadu-boot-imx-bc897b1d4d86597311430dbe7b3e6c807c8c53e5.zip
u-boot-imx-bc897b1d4d86597311430dbe7b3e6c807c8c53e5.tar.gz
u-boot-imx-bc897b1d4d86597311430dbe7b3e6c807c8c53e5.tar.bz2
mmc: enable partition switch function for emmc
For emmc, it may have up to 7 partitions: two boot partitions, one user partition, one RPMB partition and four general purpose partitions. (Refer to JESD84-A44.pdf/page 154) As bootloader may need to read out or reflashing images on those different partitions, it is better to enable the partition switch with console command support. Also for partition would be restore to user partition(part 0) when CMD0 is used, so change mmc_init routine to perform normal initialization only once for each slot, unless use the rescan command to force init again. Signed-off-by: Lei Wen <leiwen@marvell.com> Acked-by: Andy Fleming <afleming@freescale.com>
Diffstat (limited to 'include/mmc.h')
-rw-r--r--include/mmc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/mmc.h b/include/mmc.h
index 5501f55..aeacdee 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -138,6 +138,7 @@
* EXT_CSD fields
*/
+#define EXT_CSD_PART_CONF 179 /* R/W */
#define EXT_CSD_BUS_WIDTH 183 /* R/W */
#define EXT_CSD_HS_TIMING 185 /* R/W */
#define EXT_CSD_CARD_TYPE 196 /* RO */
@@ -179,6 +180,9 @@
#define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
#define MMC_RSP_R7 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
+#define MMCPART_NOAVAILABLE (0xff)
+#define PART_ACCESS_MASK (0x7)
+#define PART_SUPPORT (0x1)
struct mmc_cid {
unsigned long psn;
@@ -263,6 +267,7 @@ struct mmc {
void *priv;
uint voltages;
uint version;
+ uint has_init;
uint f_min;
uint f_max;
int high_capacity;
@@ -275,6 +280,8 @@ struct mmc {
uint csd[4];
uint cid[4];
ushort rca;
+ char part_config;
+ char part_num;
uint tran_speed;
uint read_bl_len;
uint write_bl_len;
@@ -297,6 +304,7 @@ int mmc_set_dev(int dev_num);
void print_mmc_devices(char separator);
int get_mmc_num(void);
int board_mmc_getcd(u8 *cd, struct mmc *mmc);
+int mmc_switch_part(int dev_num, unsigned int part_num);
#ifdef CONFIG_GENERIC_MMC
int atmel_mci_init(void *regs);