* [PATCH] mmc: core: use 1.8v signling in ddr mode for some special host
@ 2014-08-01 6:08 Chuanxiao Dong
2014-08-12 13:21 ` Ulf Hansson
0 siblings, 1 reply; 3+ messages in thread
From: Chuanxiao Dong @ 2014-08-01 6:08 UTC (permalink / raw)
To: linux-mmc, chris, ulf.hansson; +Cc: yunpeng.gao
Even eMMC card can support 3.3v to 1.2v vccq in DDR, but not all
host controller can support this, like some of the SDHCI host
which connect to an eMMC device. Some of these host controller
still needs to use 1.8v vccq for supporting DDR mode.
If a host controller cannot support 3.3v for DDR, try 1.8v.
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: Yunpeng Gao <yunpeng.gao@intel.com>
---
drivers/mmc/core/mmc.c | 19 +++++++++++++++++++
include/linux/mmc/host.h | 1 +
2 files changed, 20 insertions(+)
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 793c6f7..13a5b24 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1000,6 +1000,25 @@ static int mmc_select_hs_ddr(struct mmc_card *card)
return err;
}
+ /*
+ * Even eMMC card can support 3.3v to 1.2v vccq, but not all
+ * host controller can support this, like some of the SDHCI
+ * controller which connect to an eMMC device. Some of these
+ * host controller still needs to use 1.8v vccq for supporting
+ * DDR mode.
+ *
+ * If a host controller cannot support 3.3v for DDR, try 1.8v
+ */
+ if (unlikely(host->caps2 & MMC_CAP2_NO_3_3V_DDR)) {
+ if (card->mmc_avail_type & EXT_CSD_CARD_TYPE_HS200_1_8V) {
+ err = __mmc_set_signal_voltage(host,
+ MMC_SIGNAL_VOLTAGE_180);
+ if (err)
+ return err;
+ } else
+ return -EOPNOTSUPP;
+ }
+
mmc_set_timing(host, MMC_TIMING_MMC_DDR52);
return err;
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 7960424..e5d3ada 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -283,6 +283,7 @@ struct mmc_host {
#define MMC_CAP2_HS400 (MMC_CAP2_HS400_1_8V | \
MMC_CAP2_HS400_1_2V)
#define MMC_CAP2_SDIO_IRQ_NOTHREAD (1 << 17)
+#define MMC_CAP2_NO_3_3V_DDR (1 << 18) /* doesn't support 3.3v vccq in ddr */
mmc_pm_flag_t pm_caps; /* supported pm features */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: core: use 1.8v signling in ddr mode for some special host
2014-08-01 6:08 [PATCH] mmc: core: use 1.8v signling in ddr mode for some special host Chuanxiao Dong
@ 2014-08-12 13:21 ` Ulf Hansson
2014-08-13 2:15 ` Dong, Chuanxiao
0 siblings, 1 reply; 3+ messages in thread
From: Ulf Hansson @ 2014-08-12 13:21 UTC (permalink / raw)
To: Chuanxiao Dong; +Cc: linux-mmc, chris, Yunpeng Gao
On 1 August 2014 08:08, Chuanxiao Dong <chuanxiao.dong@intel.com> wrote:
> Even eMMC card can support 3.3v to 1.2v vccq in DDR, but not all
> host controller can support this, like some of the SDHCI host
> which connect to an eMMC device. Some of these host controller
> still needs to use 1.8v vccq for supporting DDR mode.
>
> If a host controller cannot support 3.3v for DDR, try 1.8v.
>
> Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
> Signed-off-by: Yunpeng Gao <yunpeng.gao@intel.com>
> ---
> drivers/mmc/core/mmc.c | 19 +++++++++++++++++++
> include/linux/mmc/host.h | 1 +
> 2 files changed, 20 insertions(+)
>
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 793c6f7..13a5b24 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -1000,6 +1000,25 @@ static int mmc_select_hs_ddr(struct mmc_card *card)
> return err;
> }
>
> + /*
> + * Even eMMC card can support 3.3v to 1.2v vccq, but not all
> + * host controller can support this, like some of the SDHCI
> + * controller which connect to an eMMC device. Some of these
> + * host controller still needs to use 1.8v vccq for supporting
> + * DDR mode.
> + *
> + * If a host controller cannot support 3.3v for DDR, try 1.8v
> + */
> + if (unlikely(host->caps2 & MMC_CAP2_NO_3_3V_DDR)) {
> + if (card->mmc_avail_type & EXT_CSD_CARD_TYPE_HS200_1_8V) {
> + err = __mmc_set_signal_voltage(host,
> + MMC_SIGNAL_VOLTAGE_180);
> + if (err)
> + return err;
> + } else
> + return -EOPNOTSUPP;
> + }
I am wondering if we could try an another approach while changing
signal voltage for (e)MMC. Simply start by trying with 1.2V, then 1.8V
and then 3.3V. Obviously we shouldn't try with something that isn't
supported, which card->mmc_avail_type tells us about.
I realize that it will mean a change in behaviour and depending on how
hosts are handling signal voltage, this is a bit uncertain if it would
work. Still I feel it would be the right approach. Can we give at
shot?
Kind regards
Uffe
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] mmc: core: use 1.8v signling in ddr mode for some special host
2014-08-12 13:21 ` Ulf Hansson
@ 2014-08-13 2:15 ` Dong, Chuanxiao
0 siblings, 0 replies; 3+ messages in thread
From: Dong, Chuanxiao @ 2014-08-13 2:15 UTC (permalink / raw)
To: Ulf Hansson; +Cc: linux-mmc, chris@printf.org, Gao, Yunpeng
> -----Original Message-----
> From: linux-mmc-owner@vger.kernel.org
> [mailto:linux-mmc-owner@vger.kernel.org] On Behalf Of Ulf Hansson
> Sent: Tuesday, August 12, 2014 9:21 PM
> To: Dong, Chuanxiao
> Cc: linux-mmc; chris@printf.org; Gao, Yunpeng
> Subject: Re: [PATCH] mmc: core: use 1.8v signling in ddr mode for some special
> host
>
> On 1 August 2014 08:08, Chuanxiao Dong <chuanxiao.dong@intel.com> wrote:
> > Even eMMC card can support 3.3v to 1.2v vccq in DDR, but not all host
> > controller can support this, like some of the SDHCI host which connect
> > to an eMMC device. Some of these host controller still needs to use
> > 1.8v vccq for supporting DDR mode.
> >
> > If a host controller cannot support 3.3v for DDR, try 1.8v.
> >
> > Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
> > Signed-off-by: Yunpeng Gao <yunpeng.gao@intel.com>
> > ---
> > drivers/mmc/core/mmc.c | 19 +++++++++++++++++++
> > include/linux/mmc/host.h | 1 +
> > 2 files changed, 20 insertions(+)
> >
> > diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index
> > 793c6f7..13a5b24 100644
> > --- a/drivers/mmc/core/mmc.c
> > +++ b/drivers/mmc/core/mmc.c
> > @@ -1000,6 +1000,25 @@ static int mmc_select_hs_ddr(struct mmc_card
> *card)
> > return err;
> > }
> >
> > + /*
> > + * Even eMMC card can support 3.3v to 1.2v vccq, but not all
> > + * host controller can support this, like some of the SDHCI
> > + * controller which connect to an eMMC device. Some of these
> > + * host controller still needs to use 1.8v vccq for supporting
> > + * DDR mode.
> > + *
> > + * If a host controller cannot support 3.3v for DDR, try 1.8v
> > + */
> > + if (unlikely(host->caps2 & MMC_CAP2_NO_3_3V_DDR)) {
> > + if (card->mmc_avail_type &
> EXT_CSD_CARD_TYPE_HS200_1_8V) {
> > + err = __mmc_set_signal_voltage(host,
> > +
> MMC_SIGNAL_VOLTAGE_180);
> > + if (err)
> > + return err;
> > + } else
> > + return -EOPNOTSUPP;
> > + }
>
> I am wondering if we could try an another approach while changing signal
> voltage for (e)MMC. Simply start by trying with 1.2V, then 1.8V and then 3.3V.
> Obviously we shouldn't try with something that isn't supported, which
> card->mmc_avail_type tells us about.
>
> I realize that it will mean a change in behaviour and depending on how hosts
> are handling signal voltage, this is a bit uncertain if it would work. Still I feel it
> would be the right approach. Can we give at shot?
I agree with you. Actually this is also out original approach. :) Given it we cannot test this approach on all host controllers, thus finally change to add a new CAP is to avoid impacting other host controllers.
I can post a v2 patch to implement this IO signal voltage changing sequence for review.
Thanks
Chuanxiao
>
> Kind regards
> Uffe
> --
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-13 2:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-01 6:08 [PATCH] mmc: core: use 1.8v signling in ddr mode for some special host Chuanxiao Dong
2014-08-12 13:21 ` Ulf Hansson
2014-08-13 2:15 ` Dong, Chuanxiao
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).