Commit 8e86fbab authored by Russell King's avatar Russell King

[MMC] MMCI: data FSM handling updates

- Use mmci_stop_host() to ensure that the data FSM is shut down and
  any driver held data is properly released.
- FIFO size is 64 bytes not 16.
parent a0309bbd
...@@ -43,10 +43,9 @@ static void ...@@ -43,10 +43,9 @@ static void
mmci_request_end(struct mmci_host *host, struct mmc_request *mrq) mmci_request_end(struct mmci_host *host, struct mmc_request *mrq)
{ {
writel(0, host->base + MMCICOMMAND); writel(0, host->base + MMCICOMMAND);
host->mrq = NULL; host->mrq = NULL;
host->cmd = NULL; host->cmd = NULL;
host->data = NULL;
host->buffer = NULL;
if (mrq->data) if (mrq->data)
mrq->data->bytes_xfered = host->data_xfered; mrq->data->bytes_xfered = host->data_xfered;
...@@ -60,6 +59,13 @@ mmci_request_end(struct mmci_host *host, struct mmc_request *mrq) ...@@ -60,6 +59,13 @@ mmci_request_end(struct mmci_host *host, struct mmc_request *mrq)
spin_lock(&host->lock); spin_lock(&host->lock);
} }
static void mmci_stop_data(struct mmci_host *host)
{
writel(0, host->base + MMCIDATACTRL);
host->data = NULL;
host->buffer = NULL;
}
static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
{ {
unsigned int datactrl, timeout, irqmask; unsigned int datactrl, timeout, irqmask;
...@@ -147,7 +153,8 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data, ...@@ -147,7 +153,8 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data,
status |= MCI_DATAEND; status |= MCI_DATAEND;
} }
if (status & MCI_DATAEND) { if (status & MCI_DATAEND) {
host->data = NULL; mmci_stop_data(host);
if (!data->stop) { if (!data->stop) {
mmci_request_end(host, data->mrq); mmci_request_end(host, data->mrq);
} else { } else {
......
...@@ -109,7 +109,10 @@ ...@@ -109,7 +109,10 @@
MCI_CMDRESPENDMASK|MCI_CMDSENTMASK|MCI_DATAENDMASK| \ MCI_CMDRESPENDMASK|MCI_CMDSENTMASK|MCI_DATAENDMASK| \
MCI_DATABLOCKENDMASK) MCI_DATABLOCKENDMASK)
#define MCI_FIFOSIZE 16 /*
* The size of the FIFO in bytes.
*/
#define MCI_FIFOSIZE (16*4)
#define MCI_FIFOHALFSIZE (MCI_FIFOSIZE / 2) #define MCI_FIFOHALFSIZE (MCI_FIFOSIZE / 2)
...@@ -139,5 +142,3 @@ struct mmci_host { ...@@ -139,5 +142,3 @@ struct mmci_host {
void *buffer; void *buffer;
unsigned int size; unsigned int size;
}; };
#define to_mmci_host(mmc) container_of(mmc, struct mmci_host, mmc)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment