* [PATCH v2 0/4] eMMC DDR support
@ 2011-05-13 5:47 Arindam Nath
2011-05-13 5:47 ` [PATCH v2 1/4] sdhci add hooks for UHS setting by platform specific code Arindam Nath
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Arindam Nath @ 2011-05-13 5:47 UTC (permalink / raw)
To: cjb; +Cc: linux-mmc, prakity, zhangfei.gao, Arindam Nath
V2
----
[PATCH 1/4]: Fixed tabbing for comment.
[PATCH 2/4]: Use switch-case instead of if-else.
[PATCH 3/4]: Use bool type for argument *cmd11* instead of int.
Philip Rakity (4):
[PATCH 1/4]: sdhci add hooks for UHS setting by platform specific code
[PATCH 2/4]: sdhci-pxa add platform specific code for UHS signaling
[PATCH 3/4]: mmc eMMC signal voltage does not use CMD11
[PATCH 4/4]: mmc add support for eMMC Dual Data Rate
drivers/mmc/core/core.c | 19 +++++--------------
drivers/mmc/core/core.h | 5 ++---
drivers/mmc/core/mmc.c | 35 ++++++++++++++++++++++++++++++-----
drivers/mmc/core/sd.c | 5 +++--
drivers/mmc/host/sdhci-pxa.c | 41 +++++++++++++++++++++++++++++++++++++++++
drivers/mmc/host/sdhci.c | 33 ++++++++++++++++++---------------
drivers/mmc/host/sdhci.h | 2 ++
include/linux/mmc/host.h | 1 +
8 files changed, 102 insertions(+), 39 deletions(-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/4] sdhci add hooks for UHS setting by platform specific code
2011-05-13 5:47 [PATCH v2 0/4] eMMC DDR support Arindam Nath
@ 2011-05-13 5:47 ` Arindam Nath
2011-05-13 5:47 ` [PATCH v2 2/4] sdhci pxa add platform specific code for UHS signaling Arindam Nath
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Arindam Nath @ 2011-05-13 5:47 UTC (permalink / raw)
To: cjb; +Cc: linux-mmc, prakity, zhangfei.gao, Arindam Nath
From: Philip Rakity <prakity@marvell.com>
Allow platform specific code to set UHS registers if
implementation requires speciial platform specific handling
Signed-off-by: Philip Rakity <prakity@marvell.com>
Reviewed-by: Arindam Nath <arindam.nath@amd.com>
---
drivers/mmc/host/sdhci.c | 33 ++++++++++++++++++---------------
drivers/mmc/host/sdhci.h | 2 ++
2 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index fa33016..cc63f5e 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1346,27 +1346,30 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
sdhci_set_clock(host, clock);
}
- ctrl_2 = sdhci_readw(host, SDHCI_HOST_CONTROL2);
-
- /* Select Bus Speed Mode for host */
- ctrl_2 &= ~SDHCI_CTRL_UHS_MASK;
- if (ios->timing == MMC_TIMING_UHS_SDR12)
- ctrl_2 |= SDHCI_CTRL_UHS_SDR12;
- else if (ios->timing == MMC_TIMING_UHS_SDR25)
- ctrl_2 |= SDHCI_CTRL_UHS_SDR25;
- else if (ios->timing == MMC_TIMING_UHS_SDR50)
- ctrl_2 |= SDHCI_CTRL_UHS_SDR50;
- else if (ios->timing == MMC_TIMING_UHS_SDR104)
- ctrl_2 |= SDHCI_CTRL_UHS_SDR104;
- else if (ios->timing == MMC_TIMING_UHS_DDR50)
- ctrl_2 |= SDHCI_CTRL_UHS_DDR50;
/* Reset SD Clock Enable */
clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
clk &= ~SDHCI_CLOCK_CARD_EN;
sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
- sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
+ if (host->ops->set_uhs_signaling)
+ host->ops->set_uhs_signaling(host, ios->timing);
+ else {
+ ctrl_2 = sdhci_readw(host, SDHCI_HOST_CONTROL2);
+ /* Select Bus Speed Mode for host */
+ ctrl_2 &= ~SDHCI_CTRL_UHS_MASK;
+ if (ios->timing == MMC_TIMING_UHS_SDR12)
+ ctrl_2 |= SDHCI_CTRL_UHS_SDR12;
+ else if (ios->timing == MMC_TIMING_UHS_SDR25)
+ ctrl_2 |= SDHCI_CTRL_UHS_SDR25;
+ else if (ios->timing == MMC_TIMING_UHS_SDR50)
+ ctrl_2 |= SDHCI_CTRL_UHS_SDR50;
+ else if (ios->timing == MMC_TIMING_UHS_SDR104)
+ ctrl_2 |= SDHCI_CTRL_UHS_SDR104;
+ else if (ios->timing == MMC_TIMING_UHS_DDR50)
+ ctrl_2 |= SDHCI_CTRL_UHS_DDR50;
+ sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
+ }
/* Re-enable SD Clock */
clock = host->clock;
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 8ea11b7..7e28eec 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -270,6 +270,8 @@ struct sdhci_ops {
unsigned int (*get_ro)(struct sdhci_host *host);
void (*platform_reset_enter)(struct sdhci_host *host, u8 mask);
void (*platform_reset_exit)(struct sdhci_host *host, u8 mask);
+ int (*set_uhs_signaling)(struct sdhci_host *host, unsigned int uhs);
+
};
#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/4] sdhci pxa add platform specific code for UHS signaling
2011-05-13 5:47 [PATCH v2 0/4] eMMC DDR support Arindam Nath
2011-05-13 5:47 ` [PATCH v2 1/4] sdhci add hooks for UHS setting by platform specific code Arindam Nath
@ 2011-05-13 5:47 ` Arindam Nath
2011-05-13 5:47 ` [PATCH v2 3/4] mmc eMMC signal voltage does not use CMD11 Arindam Nath
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Arindam Nath @ 2011-05-13 5:47 UTC (permalink / raw)
To: cjb; +Cc: linux-mmc, prakity, zhangfei.gao, Arindam Nath
From: Philip Rakity <prakity@marvell.com>
Marvell controller requires 1.8V bit in UHS control register 2
be set when doing UHS. eMMC does not require 1.8V for DDR.
add platform code to handle this.
Signed-off-by: Philip Rakity <prakity@marvell.com>
Reviewed-by: Arindam Nath <arindam.nath@amd.com>
---
drivers/mmc/host/sdhci-pxa.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/sdhci-pxa.c b/drivers/mmc/host/sdhci-pxa.c
index 5a61208..1dc9deb 100644
--- a/drivers/mmc/host/sdhci-pxa.c
+++ b/drivers/mmc/host/sdhci-pxa.c
@@ -69,7 +69,45 @@ static void set_clock(struct sdhci_host *host, unsigned int clock)
}
}
+static int set_uhs_signaling(struct sdhci_host *host, unsigned int uhs)
+{
+ u16 ctrl_2;
+
+ /*
+ * Set V18_EN -- UHS modes do not work without this.
+ * does not change signaling voltage
+ */
+ ctrl_2 = sdhci_readw(host, SDHCI_HOST_CONTROL2);
+
+ /* Select Bus Speed Mode for host */
+ ctrl_2 &= ~SDHCI_CTRL_UHS_MASK;
+ switch (uhs) {
+ case MMC_TIMING_UHS_SDR12:
+ ctrl_2 |= SDHCI_CTRL_UHS_SDR12;
+ break;
+ case MMC_TIMING_UHS_SDR25:
+ ctrl_2 |= SDHCI_CTRL_UHS_SDR25;
+ break;
+ case MMC_TIMING_UHS_SDR50:
+ ctrl_2 |= SDHCI_CTRL_UHS_SDR50 | SDHCI_CTRL_VDD_180;
+ break;
+ case MMC_TIMING_UHS_SDR104:
+ ctrl_2 |= SDHCI_CTRL_UHS_SDR104 | SDHCI_CTRL_VDD_180;
+ break;
+ case MMC_TIMING_UHS_DDR50:
+ ctrl_2 |= SDHCI_CTRL_UHS_DDR50 | SDHCI_CTRL_VDD_180;
+ break;
+ }
+
+ sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
+ pr_debug("%s:%s uhs = %d, ctrl_2 = %04X\n",
+ __func__, mmc_hostname(host->mmc), uhs, ctrl_2);
+
+ return 0;
+}
+
static struct sdhci_ops sdhci_pxa_ops = {
+ .set_uhs_signaling = set_uhs_signaling,
.set_clock = set_clock,
};
@@ -141,6 +179,9 @@ static int __devinit sdhci_pxa_probe(struct platform_device *pdev)
if (pdata->quirks)
host->quirks |= pdata->quirks;
+ /* enable 1/8V DDR capable */
+ host->mmc->caps |= MMC_CAP_1_8V_DDR;
+
/* If slot design supports 8 bit data, indicate this to MMC. */
if (pdata->flags & PXA_FLAG_SD_8_BIT_CAPABLE_SLOT)
host->mmc->caps |= MMC_CAP_8_BIT_DATA;
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 3/4] mmc eMMC signal voltage does not use CMD11
2011-05-13 5:47 [PATCH v2 0/4] eMMC DDR support Arindam Nath
2011-05-13 5:47 ` [PATCH v2 1/4] sdhci add hooks for UHS setting by platform specific code Arindam Nath
2011-05-13 5:47 ` [PATCH v2 2/4] sdhci pxa add platform specific code for UHS signaling Arindam Nath
@ 2011-05-13 5:47 ` Arindam Nath
2011-05-13 5:47 ` [PATCH v2 4/4] mmc add support for eMMC Dual Data Rate Arindam Nath
2011-05-13 13:32 ` [PATCH v2 0/4] eMMC DDR support Chris Ball
4 siblings, 0 replies; 7+ messages in thread
From: Arindam Nath @ 2011-05-13 5:47 UTC (permalink / raw)
To: cjb; +Cc: linux-mmc, prakity, zhangfei.gao, Arindam Nath
From: Philip Rakity <prakity@marvell.com>
eMMC chips do not use CMD11 when changing voltage. Add extra
argument to call to indicate if CMD11 needs to be sent.
Signed-off-by: Philip Rakity <prakity@marvell.com>
Reviewed-by: Arindam Nath <arindam.nath@amd.com>
---
drivers/mmc/core/core.c | 5 +++--
drivers/mmc/core/core.h | 3 ++-
drivers/mmc/core/sd.c | 5 +++--
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 72e113e..580fe82 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -942,7 +942,8 @@ u32 mmc_select_voltage(struct mmc_host *host, u32 ocr)
return ocr;
}
-int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage)
+int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage,
+ bool cmd11)
{
struct mmc_command cmd = {0};
int err = 0;
@@ -953,7 +954,7 @@ int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage)
* Send CMD11 only if the request is to switch the card to
* 1.8V signalling.
*/
- if (signal_voltage == MMC_SIGNAL_VOLTAGE_180) {
+ if ((signal_voltage != MMC_SIGNAL_VOLTAGE_330) && cmd11) {
cmd.opcode = SD_SWITCH_VOLTAGE;
cmd.arg = 0;
cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
index 93f3397..53d23c2 100644
--- a/drivers/mmc/core/core.h
+++ b/drivers/mmc/core/core.h
@@ -41,7 +41,8 @@ void mmc_set_bus_width(struct mmc_host *host, unsigned int width);
void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width,
unsigned int ddr);
u32 mmc_select_voltage(struct mmc_host *host, u32 ocr);
-int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage);
+int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage,
+ bool cmd11);
void mmc_set_timing(struct mmc_host *host, unsigned int timing);
void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type);
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index b461b29..b309a84 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -725,7 +725,8 @@ try_again:
*/
if (!mmc_host_is_spi(host) && rocr &&
((*rocr & 0x41000000) == 0x41000000)) {
- err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180);
+ err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180,
+ true);
if (err) {
ocr &= ~SD_OCR_S18R;
goto try_again;
@@ -1098,7 +1099,7 @@ int mmc_attach_sd(struct mmc_host *host)
WARN_ON(!host->claimed);
/* Make sure we are at 3.3V signalling voltage */
- err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330);
+ err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330, false);
if (err)
return err;
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 4/4] mmc add support for eMMC Dual Data Rate
2011-05-13 5:47 [PATCH v2 0/4] eMMC DDR support Arindam Nath
` (2 preceding siblings ...)
2011-05-13 5:47 ` [PATCH v2 3/4] mmc eMMC signal voltage does not use CMD11 Arindam Nath
@ 2011-05-13 5:47 ` Arindam Nath
2011-05-13 6:05 ` Sachin Nikam
2011-05-13 13:32 ` [PATCH v2 0/4] eMMC DDR support Chris Ball
4 siblings, 1 reply; 7+ messages in thread
From: Arindam Nath @ 2011-05-13 5:47 UTC (permalink / raw)
To: cjb; +Cc: linux-mmc, prakity, zhangfei.gao, Arindam Nath
From: Philip Rakity <prakity@marvell.com>
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>
---
drivers/mmc/core/core.c | 14 ++------------
drivers/mmc/core/core.h | 2 --
drivers/mmc/core/mmc.c | 35 ++++++++++++++++++++++++++++++-----
include/linux/mmc/host.h | 1 +
4 files changed, 33 insertions(+), 19 deletions(-)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 580fe82..43ca596 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -718,22 +718,12 @@ void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode)
}
/*
- * Change data bus width and DDR mode of a host.
- */
-void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width,
- unsigned int ddr)
-{
- host->ios.bus_width = width;
- host->ios.ddr = ddr;
- mmc_set_ios(host);
-}
-
-/*
* Change data bus width of a host.
*/
void mmc_set_bus_width(struct mmc_host *host, unsigned int width)
{
- mmc_set_bus_width_ddr(host, width, MMC_SDR_MODE);
+ host->ios.bus_width = width;
+ mmc_set_ios(host);
}
/**
diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
index 53d23c2..d9411ed 100644
--- a/drivers/mmc/core/core.h
+++ b/drivers/mmc/core/core.h
@@ -38,8 +38,6 @@ void mmc_ungate_clock(struct mmc_host *host);
void mmc_set_ungated(struct mmc_host *host);
void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode);
void mmc_set_bus_width(struct mmc_host *host, unsigned int width);
-void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width,
- unsigned int ddr);
u32 mmc_select_voltage(struct mmc_host *host, u32 ocr);
int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage,
bool cmd11);
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index a2c795e..0433fe6 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -20,6 +20,7 @@
#include "core.h"
#include "bus.h"
#include "mmc_ops.h"
+#include "sd_ops.h"
static const unsigned int tran_exp[] = {
10000, 100000, 1000000, 10000000,
@@ -633,10 +634,14 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
*/
if (mmc_card_highspeed(card)) {
if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_8V)
- && (host->caps & (MMC_CAP_1_8V_DDR)))
+ && ((host->caps & (MMC_CAP_1_8V_DDR |
+ MMC_CAP_UHS_DDR50))
+ == (MMC_CAP_1_8V_DDR | MMC_CAP_UHS_DDR50)))
ddr = MMC_1_8V_DDR_MODE;
else if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_2V)
- && (host->caps & (MMC_CAP_1_2V_DDR)))
+ && ((host->caps & (MMC_CAP_1_2V_DDR |
+ MMC_CAP_UHS_DDR50))
+ == (MMC_CAP_1_2V_DDR | MMC_CAP_UHS_DDR50)))
ddr = MMC_1_2V_DDR_MODE;
}
@@ -670,8 +675,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
ext_csd_bits[idx][0],
0);
if (!err) {
- mmc_set_bus_width_ddr(card->host,
- bus_width, MMC_SDR_MODE);
+ mmc_set_bus_width(card->host, bus_width);
/*
* If controller can't handle bus width test,
* use the highest bus width to maintain
@@ -697,8 +701,29 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
1 << bus_width, ddr);
goto free_card;
} else if (ddr) {
+ /*
+ * eMMC cards can support 3.3V to 1.2V i/o (vccq)
+ * signaling.
+ *
+ * EXT_CSD_CARD_TYPE_DDR_1_8V means 3.3V or 1.8V vccq.
+ *
+ * 1.8V vccq at 3.3V core voltage (vcc) is not required
+ * in the JEDEC spec for DDR.
+ *
+ * Do not force change in vccq since we are obviously
+ * working and no change to vccq is needed.
+ *
+ * WARNING: eMMC rules are NOT the same as SD DDR
+ */
+ if (ddr == EXT_CSD_CARD_TYPE_DDR_1_2V) {
+ err = mmc_set_signal_voltage(host,
+ MMC_SIGNAL_VOLTAGE_120, 0);
+ if (err)
+ goto err;
+ }
mmc_card_set_ddr_mode(card);
- mmc_set_bus_width_ddr(card->host, bus_width, ddr);
+ mmc_set_timing(card->host, MMC_TIMING_UHS_DDR50);
+ mmc_set_bus_width(card->host, bus_width);
}
}
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 6716bd1..de32e6a 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -66,6 +66,7 @@ struct mmc_ios {
#define MMC_SIGNAL_VOLTAGE_330 0
#define MMC_SIGNAL_VOLTAGE_180 1
+#define MMC_SIGNAL_VOLTAGE_120 2
unsigned char drv_type; /* driver type (A, B, C, D) */
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: [PATCH v2 4/4] mmc add support for eMMC Dual Data Rate
2011-05-13 5:47 ` [PATCH v2 4/4] mmc add support for eMMC Dual Data Rate Arindam Nath
@ 2011-05-13 6:05 ` Sachin Nikam
0 siblings, 0 replies; 7+ messages in thread
From: Sachin Nikam @ 2011-05-13 6:05 UTC (permalink / raw)
To: 'Arindam Nath', cjb@laptop.org
Cc: linux-mmc@vger.kernel.org, prakity@marvell.com,
zhangfei.gao@gmail.com
Hello Folks,
Sorry for interruption.
I wanted to know when and which version of kernel mmc driver will have SD 4.0(UHS-II) support?
Regards,
Sachin Nikam.
NVIDIA.
-----Original Message-----
From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-owner@vger.kernel.org] On Behalf Of Arindam Nath
Sent: Friday, May 13, 2011 11:17 AM
To: cjb@laptop.org
Cc: linux-mmc@vger.kernel.org; prakity@marvell.com; zhangfei.gao@gmail.com; Arindam Nath
Subject: [PATCH v2 4/4] mmc add support for eMMC Dual Data Rate
From: Philip Rakity <prakity@marvell.com>
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>
---
drivers/mmc/core/core.c | 14 ++------------
drivers/mmc/core/core.h | 2 --
drivers/mmc/core/mmc.c | 35 ++++++++++++++++++++++++++++++-----
include/linux/mmc/host.h | 1 +
4 files changed, 33 insertions(+), 19 deletions(-)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 580fe82..43ca596 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -718,22 +718,12 @@ void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode)
}
/*
- * Change data bus width and DDR mode of a host.
- */
-void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width,
- unsigned int ddr)
-{
- host->ios.bus_width = width;
- host->ios.ddr = ddr;
- mmc_set_ios(host);
-}
-
-/*
* Change data bus width of a host.
*/
void mmc_set_bus_width(struct mmc_host *host, unsigned int width)
{
- mmc_set_bus_width_ddr(host, width, MMC_SDR_MODE);
+ host->ios.bus_width = width;
+ mmc_set_ios(host);
}
/**
diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
index 53d23c2..d9411ed 100644
--- a/drivers/mmc/core/core.h
+++ b/drivers/mmc/core/core.h
@@ -38,8 +38,6 @@ void mmc_ungate_clock(struct mmc_host *host);
void mmc_set_ungated(struct mmc_host *host);
void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode);
void mmc_set_bus_width(struct mmc_host *host, unsigned int width);
-void mmc_set_bus_width_ddr(struct mmc_host *host, unsigned int width,
- unsigned int ddr);
u32 mmc_select_voltage(struct mmc_host *host, u32 ocr);
int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage,
bool cmd11);
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index a2c795e..0433fe6 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -20,6 +20,7 @@
#include "core.h"
#include "bus.h"
#include "mmc_ops.h"
+#include "sd_ops.h"
static const unsigned int tran_exp[] = {
10000, 100000, 1000000, 10000000,
@@ -633,10 +634,14 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
*/
if (mmc_card_highspeed(card)) {
if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_8V)
- && (host->caps & (MMC_CAP_1_8V_DDR)))
+ && ((host->caps & (MMC_CAP_1_8V_DDR |
+ MMC_CAP_UHS_DDR50))
+ == (MMC_CAP_1_8V_DDR | MMC_CAP_UHS_DDR50)))
ddr = MMC_1_8V_DDR_MODE;
else if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_2V)
- && (host->caps & (MMC_CAP_1_2V_DDR)))
+ && ((host->caps & (MMC_CAP_1_2V_DDR |
+ MMC_CAP_UHS_DDR50))
+ == (MMC_CAP_1_2V_DDR | MMC_CAP_UHS_DDR50)))
ddr = MMC_1_2V_DDR_MODE;
}
@@ -670,8 +675,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
ext_csd_bits[idx][0],
0);
if (!err) {
- mmc_set_bus_width_ddr(card->host,
- bus_width, MMC_SDR_MODE);
+ mmc_set_bus_width(card->host, bus_width);
/*
* If controller can't handle bus width test,
* use the highest bus width to maintain
@@ -697,8 +701,29 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
1 << bus_width, ddr);
goto free_card;
} else if (ddr) {
+ /*
+ * eMMC cards can support 3.3V to 1.2V i/o (vccq)
+ * signaling.
+ *
+ * EXT_CSD_CARD_TYPE_DDR_1_8V means 3.3V or 1.8V vccq.
+ *
+ * 1.8V vccq at 3.3V core voltage (vcc) is not required
+ * in the JEDEC spec for DDR.
+ *
+ * Do not force change in vccq since we are obviously
+ * working and no change to vccq is needed.
+ *
+ * WARNING: eMMC rules are NOT the same as SD DDR
+ */
+ if (ddr == EXT_CSD_CARD_TYPE_DDR_1_2V) {
+ err = mmc_set_signal_voltage(host,
+ MMC_SIGNAL_VOLTAGE_120, 0);
+ if (err)
+ goto err;
+ }
mmc_card_set_ddr_mode(card);
- mmc_set_bus_width_ddr(card->host, bus_width, ddr);
+ mmc_set_timing(card->host, MMC_TIMING_UHS_DDR50);
+ mmc_set_bus_width(card->host, bus_width);
}
}
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 6716bd1..de32e6a 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -66,6 +66,7 @@ struct mmc_ios {
#define MMC_SIGNAL_VOLTAGE_330 0
#define MMC_SIGNAL_VOLTAGE_180 1
+#define MMC_SIGNAL_VOLTAGE_120 2
unsigned char drv_type; /* driver type (A, B, C, D) */
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 0/4] eMMC DDR support
2011-05-13 5:47 [PATCH v2 0/4] eMMC DDR support Arindam Nath
` (3 preceding siblings ...)
2011-05-13 5:47 ` [PATCH v2 4/4] mmc add support for eMMC Dual Data Rate Arindam Nath
@ 2011-05-13 13:32 ` Chris Ball
4 siblings, 0 replies; 7+ messages in thread
From: Chris Ball @ 2011-05-13 13:32 UTC (permalink / raw)
To: Arindam Nath; +Cc: linux-mmc, prakity, zhangfei.gao
Hi Arindam,
On Fri, May 13 2011, Arindam Nath wrote:
> V2
> ----
> [PATCH 1/4]: Fixed tabbing for comment.
> [PATCH 2/4]: Use switch-case instead of if-else.
> [PATCH 3/4]: Use bool type for argument *cmd11* instead of int.
>
> Philip Rakity (4):
> [PATCH 1/4]: sdhci add hooks for UHS setting by platform specific code
> [PATCH 2/4]: sdhci-pxa add platform specific code for UHS signaling
> [PATCH 3/4]: mmc eMMC signal voltage does not use CMD11
> [PATCH 4/4]: mmc add support for eMMC Dual Data Rate
>
> drivers/mmc/core/core.c | 19 +++++--------------
> drivers/mmc/core/core.h | 5 ++---
> drivers/mmc/core/mmc.c | 35 ++++++++++++++++++++++++++++++-----
> drivers/mmc/core/sd.c | 5 +++--
> drivers/mmc/host/sdhci-pxa.c | 41 +++++++++++++++++++++++++++++++++++++++++
> drivers/mmc/host/sdhci.c | 33 ++++++++++++++++++---------------
> drivers/mmc/host/sdhci.h | 2 ++
> include/linux/mmc/host.h | 1 +
> 8 files changed, 102 insertions(+), 39 deletions(-)
Excellent, thanks -- pushed to mmc-next for .40.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-05-13 13:30 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-13 5:47 [PATCH v2 0/4] eMMC DDR support Arindam Nath
2011-05-13 5:47 ` [PATCH v2 1/4] sdhci add hooks for UHS setting by platform specific code Arindam Nath
2011-05-13 5:47 ` [PATCH v2 2/4] sdhci pxa add platform specific code for UHS signaling Arindam Nath
2011-05-13 5:47 ` [PATCH v2 3/4] mmc eMMC signal voltage does not use CMD11 Arindam Nath
2011-05-13 5:47 ` [PATCH v2 4/4] mmc add support for eMMC Dual Data Rate Arindam Nath
2011-05-13 6:05 ` Sachin Nikam
2011-05-13 13:32 ` [PATCH v2 0/4] eMMC DDR support Chris Ball
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).