summaryrefslogtreecommitdiff
path: root/include/mmc.h
diff options
context:
space:
mode:
authorAmar <amarendra.xt@samsung.com>2013-04-27 11:42:58 +0530
committerMinkyu Kang <mk7.kang@samsung.com>2013-06-13 17:35:14 +0900
commit3690d6d66b8f2d33402ce7c0f0478c8075885291 (patch)
treece5d4866524c36c641be5d256f39d822b1c0a45d /include/mmc.h
parent752f4c4a9c232bba6f27a70db587aebd3dd6bb3f (diff)
downloadu-boot-imx-3690d6d66b8f2d33402ce7c0f0478c8075885291.zip
u-boot-imx-3690d6d66b8f2d33402ce7c0f0478c8075885291.tar.gz
u-boot-imx-3690d6d66b8f2d33402ce7c0f0478c8075885291.tar.bz2
MMC: APIs to support resize of EMMC boot partition
This patch adds APIs to access(open / close) and to resize boot partiton of EMMC. Signed-off-by: Amar <amarendra.xt@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'include/mmc.h')
-rw-r--r--include/mmc.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/mmc.h b/include/mmc.h
index 8bbc6b6..21d0937 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -92,6 +92,11 @@
#define MMC_CMD_APP_CMD 55
#define MMC_CMD_SPI_READ_OCR 58
#define MMC_CMD_SPI_CRC_ON_OFF 59
+#define MMC_CMD_RES_MAN 62
+
+#define MMC_CMD62_ARG1 0xefac62ec
+#define MMC_CMD62_ARG2 0xcbaea7
+
#define SD_CMD_SEND_RELATIVE_ADDR 3
#define SD_CMD_SWITCH_FUNC 6
@@ -159,6 +164,7 @@
*/
#define EXT_CSD_PARTITIONING_SUPPORT 160 /* RO */
#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */
+#define EXT_CSD_BOOT_BUS_WIDTH 177
#define EXT_CSD_PART_CONF 179 /* R/W */
#define EXT_CSD_BUS_WIDTH 183 /* R/W */
#define EXT_CSD_HS_TIMING 185 /* R/W */
@@ -183,6 +189,16 @@
#define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */
#define EXT_CSD_BUS_WIDTH_8 2 /* Card is in 8 bit mode */
+#define EXT_CSD_BOOT_ACK_ENABLE (1 << 6)
+#define EXT_CSD_BOOT_PARTITION_ENABLE (1 << 3)
+#define EXT_CSD_PARTITION_ACCESS_ENABLE (1 << 0)
+#define EXT_CSD_PARTITION_ACCESS_DISABLE (0 << 0)
+
+#define EXT_CSD_BOOT_ACK(x) (x << 6)
+#define EXT_CSD_BOOT_PART_NUM(x) (x << 3)
+#define EXT_CSD_PARTITION_ACCESS(x) (x << 0)
+
+
#define R1_ILLEGAL_COMMAND (1 << 22)
#define R1_APP_CMD (1 << 5)
@@ -210,6 +226,11 @@
/* Maximum block size for MMC */
#define MMC_MAX_BLOCK_LEN 512
+/* The number of MMC physical partitions. These consist of:
+ * boot partitions (2), general purpose partitions (4) in MMC v4.4.
+ */
+#define MMC_NUM_BOOT_PARTITION 2
+
struct mmc_cid {
unsigned long psn;
unsigned short oid;
@@ -286,6 +307,11 @@ int mmc_switch_part(int dev_num, unsigned int part_num);
int mmc_getcd(struct mmc *mmc);
int mmc_getwp(struct mmc *mmc);
void spl_mmc_load(void) __noreturn;
+/* Function to change the size of boot partition and rpmb partitions */
+int mmc_boot_partition_size_change(struct mmc *mmc, unsigned long bootsize,
+ unsigned long rpmbsize);
+/* Function to send commands to open/close the specified boot partition */
+int mmc_boot_part_access(struct mmc *mmc, u8 ack, u8 part_num, u8 access);
#ifdef CONFIG_GENERIC_MMC
#define mmc_host_is_spi(mmc) ((mmc)->host_caps & MMC_MODE_SPI)