Merge pull request #955 from OLIMEX/emmc5_support

Enable support for eMMC v5
This commit is contained in:
Igor Pečovnik 2018-05-10 07:14:36 +02:00 committed by GitHub
commit 535253215a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 31 deletions

View File

@ -665,7 +665,7 @@ sdc_isio = 0
sdc_regulator = "none"
[mmc2_para]
sdc_used = 0
sdc_used = 1
sdc_detmode = 3
sdc_buswidth = 4
sdc_cmd = port:PC06<3><1><2><default>

View File

@ -1,21 +0,0 @@
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 5352cd7..2690b64 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -481,6 +481,8 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
if (card->ext_csd.rev >= 5) {
/* check whether the eMMC card supports HPI */
+#if 0
+// comment for emmc HPI patch
if (ext_csd[EXT_CSD_HPI_FEATURES] & 0x1) {
card->ext_csd.hpi = 1;
if (ext_csd[EXT_CSD_HPI_FEATURES] & 0x2)
@@ -495,6 +497,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
ext_csd[EXT_CSD_OUT_OF_INTERRUPT_TIME] * 10;
}
+#endif
card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM];
card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION];
}

View File

@ -0,0 +1,42 @@
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 5352cd7..4bd64db 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -262,12 +262,6 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
}
card->ext_csd.rev = ext_csd[EXT_CSD_REV];
- if (card->ext_csd.rev > 6) {
- pr_err("%s: unrecognised EXT_CSD revision %d\n",
- mmc_hostname(card->host), card->ext_csd.rev);
- err = -EINVAL;
- goto out;
- }
card->ext_csd.raw_sectors[0] = ext_csd[EXT_CSD_SEC_CNT + 0];
card->ext_csd.raw_sectors[1] = ext_csd[EXT_CSD_SEC_CNT + 1];
@@ -534,7 +528,6 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
card->ext_csd.data_tag_unit_size = 0;
}
}
-
out:
return err;
}
diff --git a/drivers/mmc/host/sunxi-mci.c b/drivers/mmc/host/sunxi-mci.c
index fec9b7f..a5251b0 100644
--- a/drivers/mmc/host/sunxi-mci.c
+++ b/drivers/mmc/host/sunxi-mci.c
@@ -2011,10 +2011,9 @@ static struct sunxi_mmc_platform_data sw_mci_pdata[4] = {
#endif
| MMC_CAP_SDIO_IRQ
| MMC_CAP_SET_XPC_330 | MMC_CAP_DRIVER_TYPE_A,
- .caps2 = MMC_CAP2_HS200_1_8V_SDR,
.f_min = 400000,
- .f_max = 120000000,
- .f_ddr_max = 50000000,
+ .f_max = 50000000,
+ .f_ddr_max = 47000000,
.dma_tl= 0x20070008,
},
[3] = {

View File

@ -24,12 +24,3 @@ index 5352cd7..0004b8f 100644
card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM];
card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION];
}
@@ -1026,7 +1011,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
err = 0;
if (card->ext_csd.hs_max_dtr > 52000000 &&
host->caps2 & MMC_CAP2_HS200)
- err = mmc_select_hs200(card);
+ err = -EBADMSG;
else if (host->caps & MMC_CAP_MMC_HIGHSPEED)
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
EXT_CSD_HS_TIMING, 1,