* [PATCH] mmc: sdhci: fix ctrl_2 on super-speed selection
@ 2013-06-13 14:41 Giuseppe CAVALLARO
2013-06-27 15:56 ` Chris Ball
0 siblings, 1 reply; 2+ messages in thread
From: Giuseppe CAVALLARO @ 2013-06-13 14:41 UTC (permalink / raw)
To: linux-mmc; +Cc: Giuseppe Cavallaro
This patch fixes the HC ctrl_2 programming where, in case of
SDR104 and HS200, we have to write 100b in the the UHS Mode
bits. We wrote 101b that is reserved from Arasan Specs.
Reported-by: Youssef Triki <youssef.triki@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
drivers/mmc/host/sdhci.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index b8bb3b3..ae745ab 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1526,16 +1526,15 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
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_MMC_HS200)
- ctrl_2 |= SDHCI_CTRL_HS_SDR200;
+ if ((ios->timing == MMC_TIMING_MMC_HS200) ||
+ (ios->timing == MMC_TIMING_UHS_SDR104))
+ ctrl_2 |= SDHCI_CTRL_UHS_SDR104;
else 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);
--
1.7.4.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mmc: sdhci: fix ctrl_2 on super-speed selection
2013-06-13 14:41 [PATCH] mmc: sdhci: fix ctrl_2 on super-speed selection Giuseppe CAVALLARO
@ 2013-06-27 15:56 ` Chris Ball
0 siblings, 0 replies; 2+ messages in thread
From: Chris Ball @ 2013-06-27 15:56 UTC (permalink / raw)
To: Giuseppe CAVALLARO; +Cc: linux-mmc
Hi Giuseppe,
On Thu, Jun 13 2013, Giuseppe CAVALLARO wrote:
> This patch fixes the HC ctrl_2 programming where, in case of
> SDR104 and HS200, we have to write 100b in the the UHS Mode
> bits. We wrote 101b that is reserved from Arasan Specs.
>
> Reported-by: Youssef Triki <youssef.triki@st.com>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> ---
> drivers/mmc/host/sdhci.c | 7 +++----
> 1 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index b8bb3b3..ae745ab 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1526,16 +1526,15 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
> 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_MMC_HS200)
> - ctrl_2 |= SDHCI_CTRL_HS_SDR200;
> + if ((ios->timing == MMC_TIMING_MMC_HS200) ||
> + (ios->timing == MMC_TIMING_UHS_SDR104))
> + ctrl_2 |= SDHCI_CTRL_UHS_SDR104;
> else 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);
Thanks, pushed to mmc-next for 3.11.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-06-27 15:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-13 14:41 [PATCH] mmc: sdhci: fix ctrl_2 on super-speed selection Giuseppe CAVALLARO
2013-06-27 15:56 ` Chris Ball
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox