2019-06-20 21:05:55 +00:00
|
|
|
From 5a3ef17a66c43fc996d77d90f68f25af221c9b40 Mon Sep 17 00:00:00 2001
|
2019-02-09 18:46:43 +00:00
|
|
|
From: Dmitry Osipenko <digetx@gmail.com>
|
|
|
|
Date: Tue, 6 Oct 2015 19:27:48 +0300
|
2019-02-24 19:33:39 +00:00
|
|
|
Subject: [PATCH] mmc: core: Add a quirk for NVIDIA Tegra EMMC
|
2019-02-09 18:46:43 +00:00
|
|
|
|
|
|
|
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
|
|
|
|
(cherry picked from commit ab6cd574c16380931529501c367ae50a3ee96b3e)
|
|
|
|
Signed-off-by: Sergey Larin <cerg2010cerg2010@mail.ru>
|
|
|
|
---
|
|
|
|
drivers/mmc/core/mmc.c | 11 ++++++++++-
|
|
|
|
1 file changed, 10 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
|
2019-06-20 21:05:55 +00:00
|
|
|
index c8804895595f..d4c5592aa22b 100644
|
2019-02-09 18:46:43 +00:00
|
|
|
--- a/drivers/mmc/core/mmc.c
|
|
|
|
+++ b/drivers/mmc/core/mmc.c
|
2019-06-20 21:05:55 +00:00
|
|
|
@@ -405,8 +405,17 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd)
|
2019-02-09 18:46:43 +00:00
|
|
|
ext_csd[EXT_CSD_SEC_CNT + 3] << 24;
|
|
|
|
|
|
|
|
/* Cards with density > 2GiB are sector addressed */
|
|
|
|
- if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512)
|
|
|
|
+ if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512) {
|
|
|
|
+ if (card->host->caps & MMC_CAP_NONREMOVABLE) {
|
|
|
|
+ /*
|
|
|
|
+ * Size is in 256K chunks, i.e. 512 sectors each.
|
|
|
|
+ * This algorithm is defined and used by NVIDIA,
|
|
|
|
+ * according to eMMC 4.41, size is in 128K chunks.
|
|
|
|
+ */
|
|
|
|
+ card->ext_csd.sectors -= ext_csd[EXT_CSD_BOOT_MULT] * 512;
|
|
|
|
+ }
|
|
|
|
mmc_card_set_blockaddr(card);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
card->ext_csd.strobe_support = ext_csd[EXT_CSD_STROBE_SUPPORT];
|
|
|
|
--
|
2019-06-20 21:05:55 +00:00
|
|
|
2.22.0
|
2019-02-09 18:46:43 +00:00
|
|
|
|