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:43 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-01-25 19:52:43 +0100
commitbc33582a8ab917b76142de90aad9aa3057dbb437 (patch)
tree62f16d348658098f9c9ad5756eb0c19d3b1cc0d8 /drivers/mci/atmel_mci.c
parent14b2c8f15b10661ddb57a894df08a13a5accb7ac (diff)
downloadbarebox-bc33582a8ab917b76142de90aad9aa3057dbb437.tar.gz
barebox-bc33582a8ab917b76142de90aad9aa3057dbb437.tar.xz
atmel_mci: after a software timeout the IP need to be reset
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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mci/atmel_mci.c b/drivers/mci/atmel_mci.c
index 1b603481f9..53df2e301f 100644
--- a/drivers/mci/atmel_mci.c
+++ b/drivers/mci/atmel_mci.c
@@ -48,6 +48,7 @@ struct atmel_mci {
unsigned long bus_hz;
u32 mode_reg;
+ bool need_reset;
};
#define to_mci_host(mci) container_of(mci, struct atmel_mci, mci)
@@ -118,6 +119,7 @@ static int atmci_poll_status(struct atmel_mci *host, u32 mask)
return stat;
if (is_timeout(start, SECOND)) {
dev_err(host->hw_dev, "timeout\n");
+ host->need_reset = true;
return ATMCI_RTOE | stat;
}
if (stat & mask)
@@ -412,10 +414,11 @@ static int atmci_request(struct mci_host *mci, struct mci_cmd *cmd, struct mci_d
u32 stat, cmdat = 0;
int ret;
- if (host->caps.need_reset_after_xfer) {
+ if (host->need_reset || host->caps.need_reset_after_xfer) {
atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIEN);
atmci_writel(host, ATMCI_MR, host->mode_reg);
+ host->need_reset = false;
}
if (cmd->resp_type != MMC_RSP_NONE)