diff options
author | Philip Rakity <prakity@marvell.com> | 2011-05-13 01:47:18 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-05-24 23:53:58 -0400 |
commit | 4c4cb171054230c2e58ed6574d7faa1871c75bbe (patch) | |
tree | 8ba336234def08a99ae98d29047da69de41cdcb0 /drivers/mmc/core/mmc.c | |
parent | 261bbd463a091b939770255d559bbc89b1bad568 (diff) |
mmc: core: add support for eMMC Dual Data Rate
eMMC voltage change not required for 1.8V. 3.3V and 1.8V vcc
are capable of doing DDR. vccq of 1.8v is not required.
Signed-off-by: Philip Rakity <prakity@marvell.com>
Reviewed-by: Arindam Nath <arindam.nath@amd.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core/mmc.c')
-rw-r--r-- | drivers/mmc/core/mmc.c | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index a2c795e8f9dd..0433fe66cbad 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include "core.h" | 20 | #include "core.h" |
21 | #include "bus.h" | 21 | #include "bus.h" |
22 | #include "mmc_ops.h" | 22 | #include "mmc_ops.h" |
23 | #include "sd_ops.h" | ||
23 | 24 | ||
24 | static const unsigned int tran_exp[] = { | 25 | static const unsigned int tran_exp[] = { |
25 | 10000, 100000, 1000000, 10000000, | 26 | 10000, 100000, 1000000, 10000000, |
@@ -633,10 +634,14 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, | |||
633 | */ | 634 | */ |
634 | if (mmc_card_highspeed(card)) { | 635 | if (mmc_card_highspeed(card)) { |
635 | if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_8V) | 636 | if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_8V) |
636 | && (host->caps & (MMC_CAP_1_8V_DDR))) | 637 | && ((host->caps & (MMC_CAP_1_8V_DDR | |
638 | MMC_CAP_UHS_DDR50)) | ||
639 | == (MMC_CAP_1_8V_DDR | MMC_CAP_UHS_DDR50))) | ||
637 | ddr = MMC_1_8V_DDR_MODE; | 640 | ddr = MMC_1_8V_DDR_MODE; |
638 | else if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_2V) | 641 | else if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_2V) |
639 | && (host->caps & (MMC_CAP_1_2V_DDR))) | 642 | && ((host->caps & (MMC_CAP_1_2V_DDR | |
643 | MMC_CAP_UHS_DDR50)) | ||
644 | == (MMC_CAP_1_2V_DDR | MMC_CAP_UHS_DDR50))) | ||
640 | ddr = MMC_1_2V_DDR_MODE; | 645 | ddr = MMC_1_2V_DDR_MODE; |
641 | } | 646 | } |
642 | 647 | ||
@@ -670,8 +675,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, | |||
670 | ext_csd_bits[idx][0], | 675 | ext_csd_bits[idx][0], |
671 | 0); | 676 | 0); |
672 | if (!err) { | 677 | if (!err) { |
673 | mmc_set_bus_width_ddr(card->host, | 678 | mmc_set_bus_width(card->host, bus_width); |
674 | bus_width, MMC_SDR_MODE); | ||
675 | /* | 679 | /* |
676 | * If controller can't handle bus width test, | 680 | * If controller can't handle bus width test, |
677 | * use the highest bus width to maintain | 681 | * use the highest bus width to maintain |
@@ -697,8 +701,29 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, | |||
697 | 1 << bus_width, ddr); | 701 | 1 << bus_width, ddr); |
698 | goto free_card; | 702 | goto free_card; |
699 | } else if (ddr) { | 703 | } else if (ddr) { |
704 | /* | ||
705 | * eMMC cards can support 3.3V to 1.2V i/o (vccq) | ||
706 | * signaling. | ||
707 | * | ||
708 | * EXT_CSD_CARD_TYPE_DDR_1_8V means 3.3V or 1.8V vccq. | ||
709 | * | ||
710 | * 1.8V vccq at 3.3V core voltage (vcc) is not required | ||
711 | * in the JEDEC spec for DDR. | ||
712 | * | ||
713 | * Do not force change in vccq since we are obviously | ||
714 | * working and no change to vccq is needed. | ||
715 | * | ||
716 | * WARNING: eMMC rules are NOT the same as SD DDR | ||
717 | */ | ||
718 | if (ddr == EXT_CSD_CARD_TYPE_DDR_1_2V) { | ||
719 | err = mmc_set_signal_voltage(host, | ||
720 | MMC_SIGNAL_VOLTAGE_120, 0); | ||
721 | if (err) | ||
722 | goto err; | ||
723 | } | ||
700 | mmc_card_set_ddr_mode(card); | 724 | mmc_card_set_ddr_mode(card); |
701 | mmc_set_bus_width_ddr(card->host, bus_width, ddr); | 725 | mmc_set_timing(card->host, MMC_TIMING_UHS_DDR50); |
726 | mmc_set_bus_width(card->host, bus_width); | ||
702 | } | 727 | } |
703 | } | 728 | } |
704 | 729 | ||