summaryrefslogtreecommitdiff
path: root/libre/linux-libre-dtb/0004-fix-mvsdio-eMMC-timing.patch
blob: a147f3bc005cc5c2568f72714ce7b466f466f09d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From 3fe82206833efc04b2625c60eb7f3ea6972d5a53 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Fri, 5 Sep 2014 15:43:56 -0600
Subject: [PATCH 4/8] fix mvsdio eMMC timing

These changes from Globalscale change the MMC timing to allow the eMMC versions
of the Mirabox and SMILE Plug to work.

Signed-off-by: Kevin Mihelich <kevin@archlinuxarm.org>
---
 drivers/mmc/host/mvsdio.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index a448498..14441a6 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -96,7 +96,7 @@ static int mvsd_setup_data(struct mvsd_host *host, struct mmc_data *data)
 	tmout_index = fls(tmout - 1) - 12;
 	if (tmout_index < 0)
 		tmout_index = 0;
-	if (tmout_index > MVSD_HOST_CTRL_TMOUT_MAX)
+//	if (tmout_index > MVSD_HOST_CTRL_TMOUT_MAX)	//by steven, try to setup the timeout to maximum value
 		tmout_index = MVSD_HOST_CTRL_TMOUT_MAX;
 
 	dev_dbg(host->dev, "data %s at 0x%08x: blocks=%d blksz=%d tmout=%u (%d)\n",
@@ -618,6 +618,8 @@ static void mvsd_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		u32 m = DIV_ROUND_UP(host->base_clock, ios->clock) - 1;
 		if (m > MVSD_BASE_DIV_MAX)
 			m = MVSD_BASE_DIV_MAX;
+		if(ios->clock==50000000 )	//by steven
+			m=1;
 		mvsd_write(MVSD_CLK_DIV, m);
 		host->clock = ios->clock;
 		host->ns_per_clk = 1000000000 / (host->base_clock / (m+1));
-- 
2.4.4