summaryrefslogtreecommitdiffstats
path: root/drivers/mci/atmel_mci.c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2013-01-25 16:17:41 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-01-25 19:52:18 +0100
commit40a333b0623ebb4f188f9fb2820ed873f3415e41 (patch)
treeb8033cc1e64f03d46213a4e62508b55602f35571 /drivers/mci/atmel_mci.c
parent7bd476801a0c75ca655b1e2a1dba4039aadce4d4 (diff)
downloadbarebox-40a333b0623ebb4f188f9fb2820ed873f3415e41.tar.gz
barebox-40a333b0623ebb4f188f9fb2820ed873f3415e41.tar.xz
atmel_mci: rwproof is only needed up to IP version 0x200
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mci/atmel_mci.c')
-rw-r--r--drivers/mci/atmel_mci.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/mci/atmel_mci.c b/drivers/mci/atmel_mci.c
index d5fdd1df81..bf0adb0ad0 100644
--- a/drivers/mci/atmel_mci.c
+++ b/drivers/mci/atmel_mci.c
@@ -28,6 +28,7 @@
#include "atmel-mci-regs.h"
struct atmel_mci_caps {
+ bool has_rwproof;
bool has_odd_clk_div;
};
@@ -94,7 +95,13 @@ static void atmci_set_clk_rate(struct atmel_mci *host,
dev_dbg(host->hw_dev, "atmel_set_clk_rate: clkIn=%ld clkIos=%d divider=%d\n",
host->bus_hz, clock_min, clkdiv);
- host->mode_reg |= ATMCI_MR_RDPROOF | ATMCI_MR_WRPROOF;
+ /*
+ * WRPROOF and RDPROOF prevent overruns/underruns by
+ * stopping the clock when the FIFO is full/empty.
+ * This state is not expected to last for long.
+ */
+ if (host->caps.has_rwproof)
+ host->mode_reg |= ATMCI_MR_RDPROOF | ATMCI_MR_WRPROOF;
atmci_writel(host, ATMCI_MR, host->mode_reg);
}
@@ -470,6 +477,7 @@ static void atmci_get_cap(struct atmel_mci *host)
case 0x400:
case 0x300:
case 0x200:
+ host->caps.has_rwproof = 1;
case 0x100:
case 0x0:
break;