mmc: core: try 1.8v signling in ddr mode if host and device
PATCH v3 1/1 mmc: core: try 1.8v signling in ddr mode if host and device
Even (e)MMC 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.
So the sequence will be:
if (host and device can both support 1.2v IO)
use 1.2v IO; else if (host and device can both support 1.8v IO) use 1.8v IO;
so if host and device can only support 3.3v IO, this is the last choice.
---
Changelog V2:
- For (e)MMC device switching to DDR mode, try 1.2v singaling first. Then try 1.8v. If 1.2v and 1.8v are both not supported, use the default
Changelog V3:
- continue to try 1.8v/3.3v vccq if there is IO voltage switching failure
drivers/mmc/core/mmc.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-)
drivers/mmc/core/mmc.c +25 -9
@@ -988,19 +988,35 @@ static int mmc_select_hs_ddr(struct mmc_card *card)* 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. +* Even (e)MMC 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. +* +* So the sequence will be: +* if (host and device can both support 1.2v IO) +* use 1.2v IO; +* else if (host and device can both support 1.8v IO) +* use 1.8v IO; +* so if host and device can only support 3.3v IO, this is the +* last choice. * * WARNING: eMMC rules are NOT the same as SD DDR */ -if (card->mmc_avail_type &EXT_CSD_CARD_TYPE_DDR_1_2V ) { - err =__mmc_set_signal_voltage (host, -MMC_SIGNAL_VOLTAGE_120 ); -if (err) -return err; - } + err = -EINVAL ; +if (card->mmc_avail_type &EXT_CSD_CARD_TYPE_DDR_1_2V ) + err =__mmc_set_signal_voltage (host,MMC_SIGNAL_VOLTAGE_120 ); -mmc_set_timing (host,MMC_TIMING_MMC_DDR52 ); +if (err && (card->mmc_avail_type &EXT_CSD_CARD_TYPE_DDR_1_8V )) + err =__mmc_set_signal_voltage (host,MMC_SIGNAL_VOLTAGE_180 ); + +/* make sure vccq is 3.3v after switching disaster */ +if (err) + err =__mmc_set_signal_voltage (host,MMC_SIGNAL_VOLTAGE_330 ); + +if (!err) +mmc_set_timing (host,MMC_TIMING_MMC_DDR52 );return err; }
Signature · 1 line
1.7.10.4
Quoted 7 lines · Chuanxiao Dong
Even (e)MMC 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.
So the sequence will be:
if (host and device can both support 1.2v IO)
Quoted 7 lines
use 1.2v IO; else if (host and device can both support 1.8v IO) use 1.8v IO;so if host and device can only support 3.3v IO, this is the last choice.
Signed-off-by Chuanxiao Dong <[email protected]>Signed-off-by Yunpeng Gao <[email protected]>
This looks good to me! But before I queue it for 3.18 I would appreciate if we could get some help in testing this for some various platforms, that support MMC DDR.
Kind regards
Uffe
Quoted 63 lines
---
Changelog V2:
- For (e)MMC device switching to DDR mode, try 1.2v singaling first. Then try 1.8v. If 1.2v and 1.8v are both not supported, use the defaultChangelog V3:
- continue to try 1.8v/3.3v vccq if there is IO voltage switching failuredrivers/mmc/core/mmc.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-)drivers/mmc/core/mmc.c +25
-10@@ -988,19 +988,35 @@ static int mmc_select_hs_ddr(struct mmc_card *card)* 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. +* Even (e)MMC 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. +* +* So the sequence will be: +* if (host and device can both support 1.2v IO) +* use 1.2v IO; +* else if (host and device can both support 1.8v IO) +* use 1.8v IO; +* so if host and device can only support 3.3v IO, this is the +* last choice. * * WARNING: eMMC rules are NOT the same as SD DDR */ -if (card->mmc_avail_type &EXT_CSD_CARD_TYPE_DDR_1_2V ) { - err =__mmc_set_signal_voltage (host, -MMC_SIGNAL_VOLTAGE_120 ); -if (err) -return err; - } + err = -EINVAL ; +if (card->mmc_avail_type &EXT_CSD_CARD_TYPE_DDR_1_2V ) + err =__mmc_set_signal_voltage (host,MMC_SIGNAL_VOLTAGE_120 ); -mmc_set_timing (host,MMC_TIMING_MMC_DDR52 ); +if (err && (card->mmc_avail_type &EXT_CSD_CARD_TYPE_DDR_1_8V )) + err =__mmc_set_signal_voltage (host,MMC_SIGNAL_VOLTAGE_180 ); + +/* make sure vccq is 3.3v after switching disaster */ +if (err) + err =__mmc_set_signal_voltage (host,MMC_SIGNAL_VOLTAGE_330 ); + +if (!err) +mmc_set_timing (host,MMC_TIMING_MMC_DDR52 );return err; } --1.7.10.4
Quoted 24 lines
-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Friday, August 15, 2014 4:34 PM
To: Dong, Chuanxiao
Cc: linux-mmc; [email protected]
Subject: Re: [PATCH v3] mmc: core: try 1.8v signling in ddr mode if host and deviceQuoted 12 lines · Chuanxiao Dong
Even (e)MMC 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.
So the sequence will be:
if (host and device can both support 1.2v IO)use 1.2v IO; else if (host and device can both support 1.8v IO) use 1.8v IO;so if host and device can only support 3.3v IO, this is the last choice.
Quoted 6 lines
Quoted 2 lines
Signed-off-by Chuanxiao Dong <[email protected]>Signed-off-by Yunpeng Gao <[email protected]>This looks good to me! But before I queue it for 3.18 I would appreciate if we could get some help in testing this for some various platforms, that support MMC DDR.
Thanks a lot. BTW, this patch is already tested on Intel's platform which can support MMC DDR.
Thanks
Chuanxiao
Quoted 75 lines
Kind regards
UffeQuoted 3 lines
---
Changelog V2:
- For (e)MMC device switching to DDR mode, try 1.2v singaling first.Then
drivers/mmc/core/mmc.c static int mmc_select_hs_ddr(struct mmc_card
Quoted 15 lines
try 1.8v. If 1.2v and 1.8v are both not supported, use the
defaultChangelog V3:
- continue to try 1.8v/3.3v vccq if there is IO voltage switching
failuredrivers/mmc/core/mmc.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-)drivers/mmc/core/mmc.c index renamed from drivers/mmc/core/mmc.c +0
-0793c6f7..8d69671 100644
drivers/mmc/core/mmc.c +0
-0@@ -988,19 +988,35 @@ static int mmc_select_hs_ddr(struct mmc_card*card)
Quoted 24 lines
drivers/mmc/core/mmc.c +13
-5* 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. +* Even (e)MMC 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. +* +* So the sequence will be: +* if (host and device can both support 1.2v IO) +* use 1.2v IO; +* else if (host and device can both support 1.8v IO) +* use 1.8v IO; +* so if host and device can only support 3.3v IO, this is the +* last choice. * * WARNING: eMMC rules are NOT the same as SD DDR */ -if (card->mmc_avail_type &EXT_CSD_CARD_TYPE_DDR_1_2V ) { - err =__mmc_set_signal_voltage (host, -MMC_SIGNAL_VOLTAGE_120 );drivers/mmc/core/mmc.c static int mmc_select_hs_ddr(struct mmc_card *card)
Quoted 10 lines
drivers/mmc/core/mmc.c +5
-4-if (err) -return err; - } + err = -EINVAL ; +if (card->mmc_avail_type &EXT_CSD_CARD_TYPE_DDR_1_2V ) + err =__mmc_set_signal_voltage (host, +MMC_SIGNAL_VOLTAGE_120 ); -mmc_set_timing (host,MMC_TIMING_MMC_DDR52 ); + if (err && (card->mmc_avail_type &
EXT_CSD_CARD_TYPE_DDR_1_8V))Quoted 16 lines
drivers/mmc/core/mmc.c +10
-1+ err =__mmc_set_signal_voltage (host, +MMC_SIGNAL_VOLTAGE_180 ); + +/* make sure vccq is 3.3v after switching disaster */ +if (err) + err =__mmc_set_signal_voltage (host, +MMC_SIGNAL_VOLTAGE_330 ); + +if (!err) +mmc_set_timing (host,MMC_TIMING_MMC_DDR52 );return err; } --1.7.10.4
2014-08-15 10:36 GMT+02:00 Dong, Chuanxiao <[email protected]>:
Quoted 24 lines
Quoted 24 lines
-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Friday, August 15, 2014 4:34 PM
To: Dong, Chuanxiao
Cc: linux-mmc; [email protected]
Subject: Re: [PATCH v3] mmc: core: try 1.8v signling in ddr mode if host and deviceQuoted 12 lines · Chuanxiao Dong
Even (e)MMC 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.
So the sequence will be:
if (host and device can both support 1.2v IO)use 1.2v IO; else if (host and device can both support 1.8v IO) use 1.8v IO;so if host and device can only support 3.3v IO, this is the last choice.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Signed-off-by Chuanxiao Dong <[email protected]>Signed-off-by Yunpeng Gao <[email protected]>This looks good to me! But before I queue it for 3.18 I would appreciate if we could get some help in testing this for some various platforms, that support MMC DDR.
Thanks a lot. BTW, this patch is already tested on Intel's platform which can support MMC DDR.
This patch associated with vqmmc-supply and vmmc-supply in the DT is working for me too on i.MX6.
JM
Ulf Hansson
AppliedQuoted 32 lines · Jean-Michel Hautbois
2014-08-15 10:36 GMT+02:00 Dong, Chuanxiao <[email protected]>:
Quoted 31 lines
Quoted 30 lines
-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Friday, August 15, 2014 4:34 PM
To: Dong, Chuanxiao
Cc: linux-mmc; [email protected]
Subject: Re: [PATCH v3] mmc: core: try 1.8v signling in ddr mode if host and deviceQuoted 7 lines · Chuanxiao Dong
Even (e)MMC 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.
So the sequence will be:
if (host and device can both support 1.2v IO)Quoted 7 lines
use 1.2v IO; else if (host and device can both support 1.8v IO) use 1.8v IO;so if host and device can only support 3.3v IO, this is the last choice.
Signed-off-by Chuanxiao Dong <[email protected]>Signed-off-by Yunpeng Gao <[email protected]>This looks good to me! But before I queue it for 3.18 I would appreciate if we could get some help in testing this for some various platforms, that support MMC DDR.
Quoted 5 lines
Quoted 1 line
Thanks a lot. BTW, this patch is already tested on Intel's platform which can support MMC DDR.
This patch associated with vqmmc-supply and vmmc-supply in the DT is working for me too on i.MX6.
JM
Thanks! Applied for next.
I took the liberty of updating the commit msg header to "mmc: core:
Fix sequence for I/O voltage in DDR mode for eMMC", to get a better description of the patch.
I also added a tested by tag from "JM".
Please tell me if you have any concern with my changes.
Kind regards
Uffe
Quoted 55 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ulf Hansson
Sent: Wednesday, September 03, 2014 3:21 PM
To: Jean-Michel Hautbois; Dong, Chuanxiao
Cc: linux-mmc; [email protected]
Subject: Re: [PATCH v3] mmc: core: try 1.8v signling in ddr mode if host and deviceQuoted 1 line · Jean-Michel Hautbois
2014-08-15 10:36 GMT+02:00 Dong, Chuanxiao
Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Friday, August 15, 2014 4:34 PM
To: Dong, Chuanxiao
Cc: linux-mmc; [email protected]
Subject: Re: [PATCH v3] mmc: core: try 1.8v signling in ddr mode if host and deviceQuoted 12 lines · Chuanxiao Dong
Even (e)MMC 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.
So the sequence will be:
if (host and device can both support 1.2v IO)use 1.2v IO; else if (host and device can both support 1.8v IO) use 1.8v IO;so if host and device can only support 3.3v IO, this is the last choice.
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Signed-off-by Chuanxiao Dong <[email protected]>Signed-off-by Yunpeng Gao <[email protected]>This looks good to me! But before I queue it for 3.18 I would appreciate if we could get some help in testing this for some various platforms, that support MMC DDR.
Thanks a lot. BTW, this patch is already tested on Intel's platform which can
support MMC DDR.
Quoted 4 lines
This patch associated with vqmmc-supply and vmmc-supply in the DT is working for me too on i.MX6.
JMThanks! Applied for next.
Quoted 7 lines
I took the liberty of updating the commit msg header to "mmc: core:
Fix sequence for I/O voltage in DDR mode for eMMC", to get a better description of the patch.I also added a tested by tag from "JM".
Please tell me if you have any concern with my changes.
No concern from my side.
Thanks JM for testing this patch, and also thanks Ulf for making this patch better :)
Thanks
Chuanxiao
Quoted 7 lines
Kind regards
Uffe
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html