summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorƁukasz Majewski <l.majewski@samsung.com>2011-07-05 02:19:44 +0000
committerSimon Glass <sjg@chromium.org>2011-09-15 12:07:50 -0700
commita5a2071c81923f55614e15d0fdaeeca91b09a64c (patch)
tree9190fe45447aa9015bb349e5f76290c095fede13 /drivers
parent8592bbc15418ea17ee9f12c4fbb1849cf22dcb2d (diff)
cherry-pick: mmc: 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. Change-Id: I043cbddecbfd046888f715837df50f5440a0d3ca Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Andy Fleming <afleming@freescale.com> Reviewed-on: http://gerrit.chromium.org/gerrit/7791 Reviewed-by: Anton Staaf <robotboy@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/mmc.c6
-rw-r--r--drivers/mmc/s5p_mmc.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 28ec16719f..6499836ea2 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -463,6 +463,10 @@ int mmc_send_op_cond(struct mmc *mmc)
(cmd.response[0] & OCR_VOLTAGE_MASK)) |
(cmd.response[0] & OCR_ACCESS_MODE));
#endif
+
+ if (mmc->host_caps & MMC_MODE_HC)
+ cmd.cmdarg |= OCR_HCS;
+
cmd.flags = 0;
err = mmc_send_cmd(mmc, &cmd, NULL);
@@ -952,7 +956,7 @@ int mmc_startup(struct mmc *mmc)
capacity = ext_csd[212] << 0 | ext_csd[213] << 8 |
ext_csd[214] << 16 | ext_csd[215] << 24;
capacity *= 512;
- if (capacity > 2 * 1024 * 1024 * 1024)
+ if ((capacity >> 20) > 2 * 1024)
mmc->capacity = capacity;
}
diff --git a/drivers/mmc/s5p_mmc.c b/drivers/mmc/s5p_mmc.c
index 280738fbf4..f1368132a3 100644
--- a/drivers/mmc/s5p_mmc.c
+++ b/drivers/mmc/s5p_mmc.c
@@ -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;