mmc: core: use 1.8v signling in ddr mode for some special host
PATCH 1/1 mmc: core: use 1.8v signling in ddr mode for some special host
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.
--- drivers/mmc/core/mmc.c | 19 +++++++++++++++++++ include/linux/mmc/host.h | 1 + 2 files changed, 20 insertions(+)
drivers/mmc/core/mmc.c +19 -0
@@ -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;
include/linux/mmc/host.h +1 -0
@@ -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 */
Signature · 1 line
1.7.10.4
Quoted 30 lines · Chuanxiao Dong
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 <[email protected]>Signed-off-by Yunpeng Gao <[email protected]>--- drivers/mmc/core/mmc.c | 19 +++++++++++++++++++ include/linux/mmc/host.h | 1 + 2 files changed, 20 insertions(+)drivers/mmc/core/mmc.c +8
-0@@ -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
drivers/mmc/core/mmc.c static int mmc_select_hs_ddr(struct mmc_card *card) · line 1020
Quoted 10 lines
drivers/mmc/core/mmc.c +10
-0+*/ +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
Quoted 56 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ulf Hansson
Sent: Tuesday, August 12, 2014 9:21 PM
To: Dong, Chuanxiao
Cc: linux-mmc; [email protected]; Gao, Yunpeng
Subject: Re: [PATCH] mmc: core: use 1.8v signling in ddr mode for some special hostdrivers/mmc/core/mmc.c static int mmc_select_hs_ddr(struct mmc_card
Quoted 19 lines · Chuanxiao Dong
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 <[email protected]>Signed-off-by Yunpeng Gao <[email protected]>--- drivers/mmc/core/mmc.c | 19 +++++++++++++++++++ include/linux/mmc/host.h | 1 + 2 files changed, 20 insertions(+)drivers/mmc/core/mmc.c index renamed from drivers/mmc/core/mmc.c +0
-0793c6f7..13a5b24 100644
drivers/mmc/core/mmc.c +0
-0@@ -1000,6 +1000,25 @@ static int mmc_select_hs_ddr(struct mmc_card*card)
Quoted 4 lines
drivers/mmc/core/mmc.c +1
-0return err; } +/* drivers/mmc/core/mmc.c static int mmc_select_hs_ddr(struct mmc_card *card)
Quoted 10 lines
drivers/mmc/core/mmc.c +10
-0+* 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) {drivers/mmc/core/mmc.c static int mmc_select_hs_ddr(struct mmc_card *card) · line 1021
Quoted 2 lines
drivers/mmc/core/mmc.c +2
-0+ err = __mmc_set_signal_voltage(host, +
MMC_SIGNAL_VOLTAGE_180);drivers/mmc/core/mmc.c static int mmc_select_hs_ddr(struct mmc_card *card) · line 1020
Quoted 5 lines
drivers/mmc/core/mmc.c +5
-0+if (err) +return err; + }else +return -EOPNOTSUPP ; + }
Quoted 8 lines
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_typetells 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
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