public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: dw_mmc-k3: Fix DDR52 mode by setting required clock divisor
@ 2018-03-29 18:24 oscardagrach
  2018-04-03 11:31 ` Shawn Lin
  0 siblings, 1 reply; 7+ messages in thread
From: oscardagrach @ 2018-03-29 18:24 UTC (permalink / raw)
  Cc: oscardagrach, Jaehoon Chung, Ulf Hansson, linux-mmc, linux-kernel

Signed-off-by: oscardagrach <ryan@edited.us>
---
 drivers/mmc/host/dw_mmc-k3.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc-k3.c b/drivers/mmc/host/dw_mmc-k3.c
index 89cdb3d533bb..efc546cb4db8 100644
--- a/drivers/mmc/host/dw_mmc-k3.c
+++ b/drivers/mmc/host/dw_mmc-k3.c
@@ -194,8 +194,14 @@ static void dw_mci_hi6220_set_ios(struct dw_mci *host, struct mmc_ios *ios)
 	int ret;
 	unsigned int clock;
 
-	clock = (ios->clock <= 25000000) ? 25000000 : ios->clock;
-
+	/* CLKDIV must be 1 for DDR52/8-bit mode */
+	if (ios->bus_width == MMC_BUS_WIDTH_8 &&
+		ios->timing == MMC_TIMING_MMC_DDR52) {
+		mci_writel(host, CLKDIV, 0x1);
+		clock = ios->clock;
+	} else {
+		clock = (ios->clock <= 25000000) ? 25000000 : ios->clock;
+	}
 	ret = clk_set_rate(host->biu_clk, clock);
 	if (ret)
 		dev_warn(host->dev, "failed to set rate %uHz\n", clock);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-04-08  8:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-29 18:24 [PATCH] mmc: dw_mmc-k3: Fix DDR52 mode by setting required clock divisor oscardagrach
2018-04-03 11:31 ` Shawn Lin
     [not found]   ` <CAGoBSJq+tSpvFZsJLPffTaFBg5o2Nn2eeXXvHqt4Us_dd7==1w@mail.gmail.com>
2018-04-05  0:51     ` Shawn Lin
2018-04-05  2:08       ` zhangfei
2018-04-06 13:41       ` Ryan Grachek
2018-04-08  1:51         ` Shawn Lin
2018-04-08  8:23           ` 答复: " liwei (CM)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox