Skip to contentSkip to conversation

Access mode validation for eMMC cards > 2 GiB

RFC PATCH New Lukasz Majewski 1 participant 1 message Jun 30, 2011 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 Access mode validation for eMMC cards > 2 GiB

This patch provides handling of the two way handshake when SEND_OP_COND (CMD1) is send to mmc card. It is necessary to inform eMMC card if the host can work with high capacity cards (Jedec JESD84-A441, point 7.4.3).

The extra flag MMC_MODE_HC (high capacity) is added to indicate if the host is capable of handling the high capacity eMMC cards.

Since this change is added to the generic mmc framework, then it requires other boards to indicate if their mmc controllers can handle high capacity cards. As it is now - the old behaviour of the framework is preserved.

---
 drivers/mmc/mmc.c     |    4 ++++
 drivers/mmc/s5p_mmc.c |    2 +-
 include/mmc.h         |    1 +
 3 files changed, 6 insertions(+), 1 deletions(-)
drivers/mmc/mmc.c +4 -0
index 21aedba..ac05536 100644
@@ -449,6 +449,10 @@ int mmc_send_op_cond(struct mmc *mmc)
 				(mmc->voltages &
 				(cmd.response[0] & OCR_VOLTAGE_MASK)) |
 				(cmd.response[0] & OCR_ACCESS_MODE));
+
+		if (mmc->host_caps & MMC_MODE_HC)
+			cmd.cmdarg |= OCR_HCS;
+
 		cmd.flags = 0;
 
 		err = mmc_send_cmd(mmc, &cmd, NULL);
drivers/mmc/s5p_mmc.c +1 -1
index 280738f..f136813 100644
@@ -462,7 +462,7 @@ static int s5p_mmc_initialize(int dev_index, int bus_width)
 		mmc->host_caps = MMC_MODE_8BIT;
 	else
 		mmc->host_caps = MMC_MODE_4BIT;
-	mmc->host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS;
+	mmc->host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS | MMC_MODE_HC;
 
 	mmc->f_min = 400000;
 	mmc->f_max = 52000000;
include/mmc.h +1 -0
index aeacdee..aaf75d1 100644
@@ -45,6 +45,7 @@
 #define MMC_MODE_4BIT		0x100
 #define MMC_MODE_8BIT		0x200
 #define MMC_MODE_SPI		0x400
+#define MMC_MODE_HC		0x800
 
 #define SD_DATA_4BIT	0x00040000
 
Signature · 1 line
1.7.2.3