Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
---
- drivers/mmc/host/atmel-mci.c | 92 +++++++++++++++++++++++++++++++++++++-------
+ drivers/mmc/host/atmel-mci.c | 92 ++++++++++++++++++++++++++++++++++++-------
1 file changed, 78 insertions(+), 14 deletions(-)
-diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
-index e94476b..6f56ef0 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -91,6 +91,11 @@ struct atmel_mci_dma {
* @cur_slot: The slot which is currently using the controller.
* @mrq: The request currently being processed on @cur_slot,
* or NULL if the controller is idle.
-@@ -166,6 +171,9 @@ struct atmel_mci {
-
+@@ -167,6 +172,9 @@ struct atmel_mci {
struct scatterlist *sg;
+ unsigned int sg_len;
unsigned int pio_offset;
+ unsigned int *buffer;
+ unsigned int buf_size;
struct atmel_mci_slot *cur_slot;
struct mmc_request *mrq;
-@@ -480,6 +488,11 @@ err:
+@@ -481,6 +489,11 @@ err:
dev_err(&mmc->class_dev, "failed to initialize debugfs for slot\n");
}
static inline unsigned int atmci_ns_to_clocks(struct atmel_mci *host,
unsigned int ns)
{
-@@ -603,6 +616,7 @@ static void atmci_pdc_set_single_buf(struct atmel_mci *host,
+@@ -604,6 +617,7 @@ static void atmci_pdc_set_single_buf(str
enum atmci_xfer_dir dir, enum atmci_pdc_buf buf_nb)
{
u32 pointer_reg, counter_reg;
if (dir == XFER_RECEIVE) {
pointer_reg = ATMEL_PDC_RPR;
-@@ -617,8 +631,15 @@ static void atmci_pdc_set_single_buf(struct atmel_mci *host,
+@@ -618,8 +632,15 @@ static void atmci_pdc_set_single_buf(str
counter_reg += ATMEL_PDC_SCND_BUF_OFF;
}
if (host->data_size & 0x3) {
/* If size is different from modulo 4, transfer bytes */
atmci_writel(host, counter_reg, host->data_size);
-@@ -670,7 +691,15 @@ static void atmci_pdc_cleanup(struct atmel_mci *host)
+@@ -671,7 +692,15 @@ static void atmci_pdc_cleanup(struct atm
*/
static void atmci_pdc_complete(struct atmel_mci *host)
{
atmci_pdc_cleanup(host);
/*
-@@ -818,6 +847,12 @@ atmci_prepare_data_pdc(struct atmel_mci *host, struct mmc_data *data)
+@@ -820,6 +849,12 @@ atmci_prepare_data_pdc(struct atmel_mci
/* Configure PDC */
host->data_size = data->blocks * data->blksz;
sg_len = dma_map_sg(&host->pdev->dev, data->sg, data->sg_len, dir);
if (host->data_size)
atmci_pdc_set_both_buf(host,
((dir == DMA_FROM_DEVICE) ? XFER_RECEIVE : XFER_TRANSMIT));
-@@ -1877,13 +1912,26 @@ static int __init atmci_init_slot(struct atmel_mci *host,
+@@ -1883,13 +1918,26 @@ static int __init atmci_init_slot(struct
mmc->caps |= MMC_CAP_SDIO_IRQ;
if (host->caps.has_highspeed)
mmc->caps |= MMC_CAP_SD_HIGHSPEED;
/* Assume card is present initially */
set_bit(ATMCI_CARD_PRESENT, &slot->flags);
-@@ -2007,11 +2055,6 @@ static bool atmci_configure_dma(struct atmel_mci *host)
+@@ -2013,11 +2061,6 @@ static bool atmci_configure_dma(struct a
}
}
/*
* HSMCI (High Speed MCI) module is not fully compatible with MCI module.
* HSMCI provides DMA support and a new config register but no more supports
-@@ -2138,14 +2181,20 @@ static int __init atmci_probe(struct platform_device *pdev)
+@@ -2144,14 +2187,20 @@ static int __init atmci_probe(struct pla
if (pdata->slot[0].bus_width) {
ret = atmci_init_slot(host, &pdata->slot[0],
0, ATMCI_SDCSEL_SLOT_A, ATMCI_SDIOIRQA);
}
if (!nr_slots) {
-@@ -2153,6 +2202,17 @@ static int __init atmci_probe(struct platform_device *pdev)
+@@ -2159,6 +2208,17 @@ static int __init atmci_probe(struct pla
goto err_init_slot;
}
dev_info(&pdev->dev,
"Atmel MCI controller at 0x%08lx irq %d, %u slots\n",
host->mapbase, irq, nr_slots);
-@@ -2179,6 +2239,10 @@ static int __exit atmci_remove(struct platform_device *pdev)
+@@ -2185,6 +2245,10 @@ static int __exit atmci_remove(struct pl
platform_set_drvdata(pdev, NULL);
for (i = 0; i < ATMCI_MAX_NR_SLOTS; i++) {
if (host->slot[i])
atmci_cleanup_slot(host->slot[i], i);
---
-1.8.0.197.g5a90748
-
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
---
- drivers/mmc/host/atmel-mci.c | 278 +++++++++++++++++++++++++------------------
+ drivers/mmc/host/atmel-mci.c | 278 +++++++++++++++++++++++++------------------
1 file changed, 162 insertions(+), 116 deletions(-)
-diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
-index 6f56ef0..1baaaebb 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -45,19 +45,19 @@
};
enum atmci_xfer_dir {
-@@ -709,7 +709,6 @@ static void atmci_pdc_complete(struct atmel_mci *host)
+@@ -710,7 +710,6 @@ static void atmci_pdc_complete(struct at
if (host->data) {
atmci_set_pending(host, EVENT_XFER_COMPLETE);
tasklet_schedule(&host->tasklet);
}
}
-@@ -835,7 +834,7 @@ atmci_prepare_data_pdc(struct atmel_mci *host, struct mmc_data *data)
+@@ -837,7 +836,7 @@ atmci_prepare_data_pdc(struct atmel_mci
iflags |= ATMCI_ENDRX | ATMCI_RXBUFF;
} else {
dir = DMA_TO_DEVICE;
}
/* Set BLKLEN */
-@@ -975,8 +974,7 @@ static void atmci_stop_transfer(struct atmel_mci *host)
+@@ -977,8 +976,7 @@ static void atmci_stop_transfer(struct a
*/
static void atmci_stop_transfer_pdc(struct atmel_mci *host)
{
}
static void atmci_stop_transfer_dma(struct atmel_mci *host)
-@@ -1012,6 +1010,7 @@ static void atmci_start_request(struct atmel_mci *host,
+@@ -1014,6 +1012,7 @@ static void atmci_start_request(struct a
host->pending_events = 0;
host->completed_events = 0;
host->data_status = 0;
if (host->need_reset) {
-@@ -1029,7 +1028,7 @@ static void atmci_start_request(struct atmel_mci *host,
+@@ -1031,7 +1030,7 @@ static void atmci_start_request(struct a
iflags = atmci_readl(host, ATMCI_IMR);
if (iflags & ~(ATMCI_SDIOIRQA | ATMCI_SDIOIRQB))
iflags);
if (unlikely(test_and_clear_bit(ATMCI_CARD_NEED_INIT, &slot->flags))) {
-@@ -1367,19 +1366,6 @@ static void atmci_command_complete(struct atmel_mci *host,
+@@ -1369,19 +1368,6 @@ static void atmci_command_complete(struc
cmd->error = -EIO;
else
cmd->error = 0;
}
static void atmci_detect_change(unsigned long data)
-@@ -1442,23 +1428,21 @@ static void atmci_detect_change(unsigned long data)
+@@ -1444,23 +1430,21 @@ static void atmci_detect_change(unsigned
break;
case STATE_SENDING_CMD:
mrq->cmd->error = -ENOMEDIUM;
}
atmci_request_end(host, mrq);
-@@ -1486,7 +1470,6 @@ static void atmci_tasklet_func(unsigned long priv)
+@@ -1488,7 +1472,6 @@ static void atmci_tasklet_func(unsigned
struct atmel_mci *host = (struct atmel_mci *)priv;
struct mmc_request *mrq = host->mrq;
struct mmc_data *data = host->data;
enum atmel_mci_state state = host->state;
enum atmel_mci_state prev_state;
u32 status;
-@@ -1508,101 +1491,164 @@ static void atmci_tasklet_func(unsigned long priv)
+@@ -1510,101 +1493,164 @@ static void atmci_tasklet_func(unsigned
break;
case STATE_SENDING_CMD:
spin_unlock(&host->lock);
}
-@@ -1655,9 +1701,6 @@ static void atmci_read_data_pio(struct atmel_mci *host)
+@@ -1659,9 +1705,6 @@ static void atmci_read_data_pio(struct a
| ATMCI_DATA_ERROR_FLAGS));
host->data_status = status;
data->bytes_xfered += nbytes;
return;
}
} while (status & ATMCI_RXRDY);
-@@ -1726,9 +1769,6 @@ static void atmci_write_data_pio(struct atmel_mci *host)
+@@ -1732,9 +1775,6 @@ static void atmci_write_data_pio(struct
| ATMCI_DATA_ERROR_FLAGS));
host->data_status = status;
data->bytes_xfered += nbytes;
return;
}
} while (status & ATMCI_TXRDY);
-@@ -1746,16 +1786,6 @@ done:
+@@ -1752,16 +1792,6 @@ done:
atmci_set_pending(host, EVENT_XFER_COMPLETE);
}
static void atmci_sdio_interrupt(struct atmel_mci *host, u32 status)
{
int i;
-@@ -1784,8 +1814,9 @@ static irqreturn_t atmci_interrupt(int irq, void *dev_id)
+@@ -1790,8 +1820,9 @@ static irqreturn_t atmci_interrupt(int i
if (pending & ATMCI_DATA_ERROR_FLAGS) {
atmci_writel(host, ATMCI_IDR, ATMCI_DATA_ERROR_FLAGS
host->data_status = status;
smp_wmb();
-@@ -1843,23 +1874,38 @@ static irqreturn_t atmci_interrupt(int irq, void *dev_id)
+@@ -1849,23 +1880,38 @@ static irqreturn_t atmci_interrupt(int i
}
}
if (pending & (ATMCI_SDIOIRQA | ATMCI_SDIOIRQB))
atmci_sdio_interrupt(host, status);
---
-1.8.0.197.g5a90748
-
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
---
- drivers/mmc/host/atmel-mci.c | 62 +++++++++++++++++++++++++++++++++++++++++---
+ drivers/mmc/host/atmel-mci.c | 62 ++++++++++++++++++++++++++++++++++++++++---
1 file changed, 58 insertions(+), 4 deletions(-)
-diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
-index 1baaaebb..5fe8300 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -78,6 +78,9 @@ struct atmel_mci_caps {
* @mode_reg: Value of the MR register.
* @cfg_reg: Value of the CFG register.
* @bus_hz: The rate of @mck in Hz. This forms the basis for MMC bus
-@@ -197,6 +201,7 @@ struct atmel_mci {
+@@ -198,6 +202,7 @@ struct atmel_mci {
bool need_clock_update;
bool need_reset;
u32 mode_reg;
u32 cfg_reg;
unsigned long bus_hz;
-@@ -493,6 +498,27 @@ static inline unsigned int atmci_get_version(struct atmel_mci *host)
+@@ -494,6 +499,27 @@ static inline unsigned int atmci_get_ver
return atmci_readl(host, ATMCI_VERSION) & 0x00000fff;
}
static inline unsigned int atmci_ns_to_clocks(struct atmel_mci *host,
unsigned int ns)
{
-@@ -692,13 +718,18 @@ static void atmci_pdc_cleanup(struct atmel_mci *host)
+@@ -693,13 +719,18 @@ static void atmci_pdc_cleanup(struct atm
static void atmci_pdc_complete(struct atmel_mci *host)
{
int transfer_size = host->data->blocks * host->data->blksz;
atmci_pdc_cleanup(host);
-@@ -819,6 +850,7 @@ atmci_prepare_data_pdc(struct atmel_mci *host, struct mmc_data *data)
+@@ -821,6 +852,7 @@ atmci_prepare_data_pdc(struct atmel_mci
u32 iflags, tmp;
unsigned int sg_len;
enum dma_data_direction dir;
data->error = -EINPROGRESS;
-@@ -848,9 +880,13 @@ atmci_prepare_data_pdc(struct atmel_mci *host, struct mmc_data *data)
+@@ -850,9 +882,13 @@ atmci_prepare_data_pdc(struct atmel_mci
sg_len = dma_map_sg(&host->pdev->dev, data->sg, data->sg_len, dir);
if ((!host->caps.has_rwproof)
if (host->data_size)
atmci_pdc_set_both_buf(host,
-@@ -1013,7 +1049,7 @@ static void atmci_start_request(struct atmel_mci *host,
+@@ -1015,7 +1051,7 @@ static void atmci_start_request(struct a
host->cmd_status = 0;
host->data_status = 0;
iflags = atmci_readl(host, ATMCI_IMR);
iflags &= (ATMCI_SDIOIRQA | ATMCI_SDIOIRQB);
atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
-@@ -1077,6 +1113,8 @@ static void atmci_start_request(struct atmel_mci *host,
+@@ -1079,6 +1115,8 @@ static void atmci_start_request(struct a
* prepared yet.)
*/
atmci_writel(host, ATMCI_IER, iflags);
}
static void atmci_queue_request(struct atmel_mci *host,
-@@ -1342,6 +1380,8 @@ static void atmci_request_end(struct atmel_mci *host, struct mmc_request *mrq)
+@@ -1344,6 +1382,8 @@ static void atmci_request_end(struct atm
host->state = STATE_IDLE;
}
spin_unlock(&host->lock);
mmc_request_done(prev_mmc, mrq);
spin_lock(&host->lock);
-@@ -1364,7 +1404,12 @@ static void atmci_command_complete(struct atmel_mci *host,
+@@ -1366,7 +1406,12 @@ static void atmci_command_complete(struc
cmd->error = -EILSEQ;
else if (status & (ATMCI_RINDE | ATMCI_RDIRE | ATMCI_RENDE))
cmd->error = -EIO;
cmd->error = 0;
}
-@@ -2121,6 +2166,9 @@ static void __init atmci_get_cap(struct atmel_mci *host)
+@@ -2127,6 +2172,9 @@ static void __init atmci_get_cap(struct
host->caps.has_highspeed = 0;
host->caps.has_rwproof = 0;
host->caps.has_odd_clk_div = 0;
/* keep only major version number */
switch (version & 0xf00) {
-@@ -2140,7 +2188,11 @@ static void __init atmci_get_cap(struct atmel_mci *host)
+@@ -2146,7 +2194,11 @@ static void __init atmci_get_cap(struct
host->caps.has_highspeed = 1;
case 0x200:
host->caps.has_rwproof = 1;
break;
default:
host->caps.has_pdc = 0;
-@@ -2259,6 +2311,8 @@ static int __init atmci_probe(struct platform_device *pdev)
+@@ -2265,6 +2317,8 @@ static int __init atmci_probe(struct pla
}
}
dev_info(&pdev->dev,
"Atmel MCI controller at 0x%08lx irq %d, %u slots\n",
host->mapbase, irq, nr_slots);
---
-1.8.0.197.g5a90748
-
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
---
- drivers/mmc/host/atmel-mci.c | 41 +++++++++++++++++++++++++++++++++++++++++
+ drivers/mmc/host/atmel-mci.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
-diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
-index 5fe8300..420aca6 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
-@@ -630,6 +630,7 @@ static void atmci_send_command(struct atmel_mci *host,
+@@ -631,6 +631,7 @@ static void atmci_send_command(struct at
static void atmci_send_stop_cmd(struct atmel_mci *host, struct mmc_data *data)
{
atmci_send_command(host, data->stop, host->stop_cmdr);
atmci_writel(host, ATMCI_IER, ATMCI_CMDRDY);
}
-@@ -738,6 +739,8 @@ static void atmci_pdc_complete(struct atmel_mci *host)
+@@ -739,6 +740,8 @@ static void atmci_pdc_complete(struct at
* to send the stop command or waiting for NBUSY in this case.
*/
if (host->data) {
atmci_set_pending(host, EVENT_XFER_COMPLETE);
tasklet_schedule(&host->tasklet);
}
-@@ -775,6 +778,8 @@ static void atmci_dma_complete(void *arg)
+@@ -776,6 +779,8 @@ static void atmci_dma_complete(void *arg
* to send the stop command or waiting for NBUSY in this case.
*/
if (data) {
atmci_set_pending(host, EVENT_XFER_COMPLETE);
tasklet_schedule(&host->tasklet);
-@@ -1001,6 +1006,8 @@ atmci_submit_data_dma(struct atmel_mci *host, struct mmc_data *data)
+@@ -1003,6 +1008,8 @@ atmci_submit_data_dma(struct atmel_mci *
static void atmci_stop_transfer(struct atmel_mci *host)
{
atmci_set_pending(host, EVENT_XFER_COMPLETE);
atmci_writel(host, ATMCI_IER, ATMCI_NOTBUSY);
}
-@@ -1022,6 +1029,8 @@ static void atmci_stop_transfer_dma(struct atmel_mci *host)
+@@ -1024,6 +1031,8 @@ static void atmci_stop_transfer_dma(stru
atmci_dma_cleanup(host);
} else {
/* Data transfer was stopped by the interrupt handler */
atmci_set_pending(host, EVENT_XFER_COMPLETE);
atmci_writel(host, ATMCI_IER, ATMCI_NOTBUSY);
}
-@@ -1049,6 +1058,8 @@ static void atmci_start_request(struct atmel_mci *host,
+@@ -1051,6 +1060,8 @@ static void atmci_start_request(struct a
host->cmd_status = 0;
host->data_status = 0;
if (host->need_reset || host->caps.need_reset_after_xfer) {
iflags = atmci_readl(host, ATMCI_IMR);
iflags &= (ATMCI_SDIOIRQA | ATMCI_SDIOIRQB);
-@@ -1129,6 +1140,7 @@ static void atmci_queue_request(struct atmel_mci *host,
+@@ -1131,6 +1142,7 @@ static void atmci_queue_request(struct a
host->state = STATE_SENDING_CMD;
atmci_start_request(host, slot);
} else {
list_add_tail(&slot->queue_node, &host->queue);
}
spin_unlock_bh(&host->lock);
-@@ -1141,6 +1153,7 @@ static void atmci_request(struct mmc_host *mmc, struct mmc_request *mrq)
+@@ -1143,6 +1155,7 @@ static void atmci_request(struct mmc_hos
struct mmc_data *data;
WARN_ON(slot->mrq);
/*
* We may "know" the card is gone even though there's still an
-@@ -1530,6 +1543,7 @@ static void atmci_tasklet_func(unsigned long priv)
+@@ -1532,6 +1545,7 @@ static void atmci_tasklet_func(unsigned
do {
prev_state = state;
switch (state) {
case STATE_IDLE:
-@@ -1542,14 +1556,18 @@ static void atmci_tasklet_func(unsigned long priv)
+@@ -1544,14 +1558,18 @@ static void atmci_tasklet_func(unsigned
* END_REQUEST by default, WAITING_NOTBUSY if it's a
* command needing it or DATA_XFER if there is data.
*/
/*
* If there is a command error don't start
* data transfer.
-@@ -1564,6 +1582,8 @@ static void atmci_tasklet_func(unsigned long priv)
+@@ -1566,6 +1584,8 @@ static void atmci_tasklet_func(unsigned
} else
state = STATE_DATA_XFER;
} else if ((!mrq->data) && (mrq->cmd->flags & MMC_RSP_BUSY)) {
atmci_writel(host, ATMCI_IER, ATMCI_NOTBUSY);
state = STATE_WAITING_NOTBUSY;
} else
-@@ -1574,6 +1594,7 @@ static void atmci_tasklet_func(unsigned long priv)
+@@ -1576,6 +1596,7 @@ static void atmci_tasklet_func(unsigned
case STATE_DATA_XFER:
if (atmci_test_and_clear_pending(host,
EVENT_DATA_ERROR)) {
atmci_set_completed(host, EVENT_DATA_ERROR);
state = STATE_END_REQUEST;
break;
-@@ -1586,10 +1607,14 @@ static void atmci_tasklet_func(unsigned long priv)
+@@ -1588,10 +1609,14 @@ static void atmci_tasklet_func(unsigned
* to the next step which is WAITING_NOTBUSY in write
* case and directly SENDING_STOP in read case.
*/
atmci_set_completed(host, EVENT_XFER_COMPLETE);
if (host->data->flags & MMC_DATA_WRITE) {
-@@ -1614,10 +1639,12 @@ static void atmci_tasklet_func(unsigned long priv)
+@@ -1616,10 +1641,12 @@ static void atmci_tasklet_func(unsigned
* included) or a write operation. In the latest case,
* we need to send a stop command.
*/
atmci_set_completed(host, EVENT_NOTBUSY);
if (host->data) {
-@@ -1649,10 +1676,12 @@ static void atmci_tasklet_func(unsigned long priv)
+@@ -1651,10 +1678,12 @@ static void atmci_tasklet_func(unsigned
* in order to go to the end request state instead of
* sending stop again.
*/
host->cmd = NULL;
host->data = NULL;
data->bytes_xfered = data->blocks * data->blksz;
-@@ -1858,18 +1887,21 @@ static irqreturn_t atmci_interrupt(int irq, void *dev_id)
+@@ -1864,18 +1893,21 @@ static irqreturn_t atmci_interrupt(int i
break;
if (pending & ATMCI_DATA_ERROR_FLAGS) {
atmci_writel(host, ATMCI_IDR, ATMCI_TXBUFE);
atmci_writel(host, ATMCI_IDR, ATMCI_ENDTX);
/*
-@@ -1885,6 +1917,7 @@ static irqreturn_t atmci_interrupt(int irq, void *dev_id)
+@@ -1891,6 +1923,7 @@ static irqreturn_t atmci_interrupt(int i
atmci_pdc_complete(host);
}
} else if (pending & ATMCI_ENDTX) {
atmci_writel(host, ATMCI_IDR, ATMCI_ENDTX);
if (host->data_size) {
-@@ -1895,6 +1928,7 @@ static irqreturn_t atmci_interrupt(int irq, void *dev_id)
+@@ -1901,6 +1934,7 @@ static irqreturn_t atmci_interrupt(int i
}
if (pending & ATMCI_RXBUFF) {
atmci_writel(host, ATMCI_IDR, ATMCI_RXBUFF);
atmci_writel(host, ATMCI_IDR, ATMCI_ENDRX);
/*
-@@ -1910,6 +1944,7 @@ static irqreturn_t atmci_interrupt(int irq, void *dev_id)
+@@ -1916,6 +1950,7 @@ static irqreturn_t atmci_interrupt(int i
atmci_pdc_complete(host);
}
} else if (pending & ATMCI_ENDRX) {
atmci_writel(host, ATMCI_IDR, ATMCI_ENDRX);
if (host->data_size) {
-@@ -1926,15 +1961,19 @@ static irqreturn_t atmci_interrupt(int irq, void *dev_id)
+@@ -1932,15 +1967,19 @@ static irqreturn_t atmci_interrupt(int i
* The appropriate workaround is to use the BLKE signal.
*/
if (pending & ATMCI_BLKE) {
atmci_set_pending(host, EVENT_NOTBUSY);
tasklet_schedule(&host->tasklet);
}
-@@ -1945,9 +1984,11 @@ static irqreturn_t atmci_interrupt(int irq, void *dev_id)
+@@ -1951,9 +1990,11 @@ static irqreturn_t atmci_interrupt(int i
atmci_write_data_pio(host);
if (pending & ATMCI_CMDRDY) {
atmci_set_pending(host, EVENT_CMD_RDY);
tasklet_schedule(&host->tasklet);
}
---
-1.8.0.197.g5a90748
-
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
- drivers/mmc/host/atmel-mci.c | 4 ++--
+ drivers/mmc/host/atmel-mci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
-diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
-index 420aca6..456c077 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
-@@ -2314,6 +2314,8 @@ static int __init atmci_probe(struct platform_device *pdev)
+@@ -2320,6 +2320,8 @@ static int __init atmci_probe(struct pla
platform_set_drvdata(pdev, host);
/* We need at least one slot to succeed */
nr_slots = 0;
ret = -ENODEV;
-@@ -2352,8 +2354,6 @@ static int __init atmci_probe(struct platform_device *pdev)
+@@ -2358,8 +2360,6 @@ static int __init atmci_probe(struct pla
}
}
dev_info(&pdev->dev,
"Atmel MCI controller at 0x%08lx irq %d, %u slots\n",
host->mapbase, irq, nr_slots);
---
-1.8.0.197.g5a90748
-
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
- drivers/mmc/host/atmel-mci-regs.h | 14 ++++++++++++++
- drivers/mmc/host/atmel-mci.c | 8 +++++---
+ drivers/mmc/host/atmel-mci-regs.h | 14 ++++++++++++++
+ drivers/mmc/host/atmel-mci.c | 8 +++++---
2 files changed, 19 insertions(+), 3 deletions(-)
-diff --git a/drivers/mmc/host/atmel-mci-regs.h b/drivers/mmc/host/atmel-mci-regs.h
-index 787aba1..ab56f7d 100644
--- a/drivers/mmc/host/atmel-mci-regs.h
+++ b/drivers/mmc/host/atmel-mci-regs.h
@@ -140,4 +140,18 @@
+}
+
#endif /* __DRIVERS_MMC_ATMEL_MCI_H__ */
-diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
-index 456c077..f2c115e 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
-@@ -910,6 +910,7 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data)
+@@ -912,6 +912,7 @@ atmci_prepare_data_dma(struct atmel_mci
enum dma_data_direction direction;
enum dma_transfer_direction slave_dirn;
unsigned int sglen;
u32 iflags;
data->error = -EINPROGRESS;
-@@ -943,17 +944,18 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data)
+@@ -945,17 +946,18 @@ atmci_prepare_data_dma(struct atmel_mci
if (!chan)
return -ENODEV;
sglen = dma_map_sg(chan->device->dev, data->sg,
data->sg_len, direction);
---
-1.8.0.197.g5a90748
-
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
- .../devicetree/bindings/mmc/atmel-hsmci.txt | 67 +++++++++++++++++
- drivers/mmc/host/atmel-mci.c | 85 +++++++++++++++++++++-
+ Documentation/devicetree/bindings/mmc/atmel-hsmci.txt | 67 ++++++++++++++
+ drivers/mmc/host/atmel-mci.c | 85 +++++++++++++++++-
2 files changed, 150 insertions(+), 2 deletions(-)
create mode 100644 Documentation/devicetree/bindings/mmc/atmel-hsmci.txt
-diff --git a/Documentation/devicetree/bindings/mmc/atmel-hsmci.txt b/Documentation/devicetree/bindings/mmc/atmel-hsmci.txt
-new file mode 100644
-index 0000000..81c20cc
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/atmel-hsmci.txt
@@ -0,0 +1,67 @@
+ bus-width = <4>;
+ };
+};
-diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
-index f2c115e..47421fc 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -19,6 +19,9 @@
#include <linux/platform_device.h>
#include <linux/scatterlist.h>
#include <linux/seq_file.h>
-@@ -493,6 +496,70 @@ err:
+@@ -494,6 +497,70 @@ err:
dev_err(&mmc->class_dev, "failed to initialize debugfs for slot\n");
}
static inline unsigned int atmci_get_version(struct atmel_mci *host)
{
return atmci_readl(host, ATMCI_VERSION) & 0x00000fff;
-@@ -2038,6 +2105,13 @@ static int __init atmci_init_slot(struct atmel_mci *host,
+@@ -2044,6 +2111,13 @@ static int __init atmci_init_slot(struct
slot->sdc_reg = sdc_reg;
slot->sdio_irq = sdio_irq;
mmc->ops = &atmci_ops;
mmc->f_min = DIV_ROUND_UP(host->bus_hz, 512);
mmc->f_max = host->bus_hz / 2;
-@@ -2258,8 +2332,14 @@ static int __init atmci_probe(struct platform_device *pdev)
+@@ -2264,8 +2338,14 @@ static int __init atmci_probe(struct pla
if (!regs)
return -ENXIO;
pdata = pdev->dev.platform_data;
irq = platform_get_irq(pdev, 0);
if (irq < 0)
return irq;
-@@ -2477,6 +2557,7 @@ static struct platform_driver atmci_driver = {
+@@ -2481,6 +2561,7 @@ static struct platform_driver atmci_driv
.driver = {
.name = "atmel_mci",
.pm = ATMCI_PM_OPS,
},
};
---
-1.8.0.197.g5a90748
-
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
- drivers/mmc/host/atmel-mci.c | 5 ++---
+ drivers/mmc/host/atmel-mci.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
-diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
-index 47421fc..7d9812c 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
-@@ -834,9 +834,8 @@ static void atmci_dma_complete(void *arg)
+@@ -835,9 +835,8 @@ static void atmci_dma_complete(void *arg
dev_vdbg(&host->pdev->dev, "DMA complete\n");
atmci_dma_cleanup(host);
---
-1.8.0.197.g5a90748
-
+++ /dev/null
-From 85edd366befdc9eed99473da3ad3f5a8a325c085 Mon Sep 17 00:00:00 2001
-From: Nicolas Ferre <nicolas.ferre@atmel.com>
-Date: Thu, 15 Mar 2012 14:28:58 +0100
-Subject: mmc: atmel-mci: remove the need for CONFIG_MMC_ATMELMCI_DMA
-
-This Kconfig option is not needed anymore, so remove it.
-
-Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
-Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
-
-Conflicts:
-
- drivers/mmc/host/Kconfig
----
- drivers/mmc/host/Kconfig | 10 ----------
- drivers/mmc/host/atmel-mci.c | 2 --
- 2 files changed, 12 deletions(-)
-
-diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
-index 2bc06e7..dbdd907 100644
---- a/drivers/mmc/host/Kconfig
-+++ b/drivers/mmc/host/Kconfig
-@@ -297,16 +297,6 @@ config MMC_ATMELMCI
-
- endchoice
-
--config MMC_ATMELMCI_DMA
-- bool "Atmel MCI DMA support"
-- depends on MMC_ATMELMCI && (AVR32 || ARCH_AT91SAM9G45) && DMA_ENGINE
-- help
-- Say Y here to have the Atmel MCI driver use a DMA engine to
-- do data transfers and thus increase the throughput and
-- reduce the CPU utilization.
--
-- If unsure, say N.
--
- config MMC_IMX
- tristate "Motorola i.MX Multimedia Card Interface support"
- depends on ARCH_MX1
-diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
-index 7d9812c..cc81ef8 100644
---- a/drivers/mmc/host/atmel-mci.c
-+++ b/drivers/mmc/host/atmel-mci.c
-@@ -2476,10 +2476,8 @@ static int __exit atmci_remove(struct platform_device *pdev)
- atmci_readl(host, ATMCI_SR);
- clk_disable(host->mck);
-
--#ifdef CONFIG_MMC_ATMELMCI_DMA
- if (host->dma.chan)
- dma_release_channel(host->dma.chan);
--#endif
-
- free_irq(platform_get_irq(pdev, 0), host);
- iounmap(host->regs);
---
-1.8.0.197.g5a90748
-
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
- arch/arm/boot/dts/at91sam9260.dtsi | 2 +-
- arch/arm/boot/dts/at91sam9263.dtsi | 4 ++--
- arch/arm/boot/dts/at91sam9g45.dtsi | 4 ++--
- arch/arm/boot/dts/at91sam9n12.dtsi | 2 +-
- arch/arm/boot/dts/at91sam9x5.dtsi | 4 ++--
+ arch/arm/boot/dts/at91sam9260.dtsi | 2 +-
+ arch/arm/boot/dts/at91sam9263.dtsi | 4 ++--
+ arch/arm/boot/dts/at91sam9g45.dtsi | 4 ++--
+ arch/arm/boot/dts/at91sam9n12.dtsi | 2 +-
+ arch/arm/boot/dts/at91sam9x5.dtsi | 4 ++--
5 files changed, 8 insertions(+), 8 deletions(-)
-diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi
-index 1f2c7d0..8d95e83c 100644
--- a/arch/arm/boot/dts/at91sam9260.dtsi
+++ b/arch/arm/boot/dts/at91sam9260.dtsi
@@ -205,7 +205,7 @@
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
-diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi
-index a76f6cd..54e6984 100644
--- a/arch/arm/boot/dts/at91sam9263.dtsi
+++ b/arch/arm/boot/dts/at91sam9263.dtsi
@@ -189,7 +189,7 @@
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
-diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi
-index 4b833d4..da135f9 100644
--- a/arch/arm/boot/dts/at91sam9g45.dtsi
+++ b/arch/arm/boot/dts/at91sam9g45.dtsi
@@ -209,7 +209,7 @@
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
-diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
-index aead257..42d5fc2 100644
--- a/arch/arm/boot/dts/at91sam9n12.dtsi
+++ b/arch/arm/boot/dts/at91sam9n12.dtsi
@@ -85,7 +85,7 @@
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
-diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
-index 1be3df7..ad7016a 100644
--- a/arch/arm/boot/dts/at91sam9x5.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5.dtsi
@@ -199,7 +199,7 @@
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
---
-1.8.0.197.g5a90748
-
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
- drivers/mmc/host/atmel-mci.c | 3 +++
+ drivers/mmc/host/atmel-mci.c | 3 +++
1 file changed, 3 insertions(+)
-diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
-index cc81ef8..b626d1e 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
-@@ -1261,6 +1261,9 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
+@@ -1263,6 +1263,9 @@ static void atmci_set_ios(struct mmc_hos
case MMC_BUS_WIDTH_4:
slot->sdc_reg |= ATMCI_SDCBUS_4BIT;
break;
}
if (ios->clock) {
---
-1.8.0.197.g5a90748
-
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Seungwon Jeon <tgih.jun@samsung.com>
---
- drivers/mmc/host/atmel-mci.c | 2 +-
+ drivers/mmc/host/atmel-mci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
-index b626d1e..90df83b 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
-@@ -1754,7 +1754,6 @@ static void atmci_tasklet_func(unsigned long priv)
+@@ -1756,7 +1756,6 @@ static void atmci_tasklet_func(unsigned
dev_dbg(&host->pdev->dev, "FSM: cmd ready\n");
host->cmd = NULL;
data->bytes_xfered = data->blocks * data->blksz;
data->error = 0;
atmci_command_complete(host, mrq->stop);
-@@ -1768,6 +1767,7 @@ static void atmci_tasklet_func(unsigned long priv)
+@@ -1770,6 +1769,7 @@ static void atmci_tasklet_func(unsigned
atmci_writel(host, ATMCI_IER, ATMCI_NOTBUSY);
state = STATE_WAITING_NOTBUSY;
}
break;
case STATE_END_REQUEST:
---
-1.8.0.197.g5a90748
-
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
- drivers/mmc/host/atmel-mci.c | 12 +++++++++---
+ drivers/mmc/host/atmel-mci.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
-diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
-index 90df83b..e03367c 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
-@@ -394,11 +394,17 @@ static int atmci_regs_show(struct seq_file *s, void *v)
+@@ -395,11 +395,17 @@ static int atmci_regs_show(struct seq_fi
clk_disable(host->mck);
spin_unlock_bh(&host->lock);
seq_printf(s, "DTOR:\t0x%08x\n", buf[ATMCI_DTOR / 4]);
seq_printf(s, "SDCR:\t0x%08x\n", buf[ATMCI_SDCR / 4]);
seq_printf(s, "ARGR:\t0x%08x\n", buf[ATMCI_ARGR / 4]);
---
-1.8.0.197.g5a90748
-
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
- drivers/mmc/host/atmel-mci.c | 6 +++++-
+ drivers/mmc/host/atmel-mci.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
-diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
-index 05a293e..3d9c7b8 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -84,6 +84,7 @@ struct atmel_mci_caps {
};
struct atmel_mci_dma {
-@@ -1694,7 +1695,8 @@ static void atmci_tasklet_func(unsigned long priv)
+@@ -1696,7 +1697,8 @@ static void atmci_tasklet_func(unsigned
__func__);
atmci_set_completed(host, EVENT_XFER_COMPLETE);
atmci_writel(host, ATMCI_IER, ATMCI_NOTBUSY);
state = STATE_WAITING_NOTBUSY;
} else if (host->mrq->stop) {
-@@ -2294,6 +2296,7 @@ static void __init atmci_get_cap(struct atmel_mci *host)
+@@ -2300,6 +2302,7 @@ static void __init atmci_get_cap(struct
host->caps.has_bad_data_ordering = 1;
host->caps.need_reset_after_xfer = 1;
host->caps.need_blksz_mul_4 = 1;
/* keep only major version number */
switch (version & 0xf00) {
-@@ -2314,6 +2317,7 @@ static void __init atmci_get_cap(struct atmel_mci *host)
+@@ -2320,6 +2323,7 @@ static void __init atmci_get_cap(struct
case 0x200:
host->caps.has_rwproof = 1;
host->caps.need_blksz_mul_4 = 0;
case 0x100:
host->caps.has_bad_data_ordering = 0;
host->caps.need_reset_after_xfer = 0;
---
-1.8.0.197.g5a90748
-
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
- drivers/mmc/host/atmel-mci.c | 36 ++++++++++++++++++++++++++++++------
+ drivers/mmc/host/atmel-mci.c | 36 ++++++++++++++++++++++++++++++------
1 file changed, 30 insertions(+), 6 deletions(-)
-diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
-index 3d9c7b8..9739604 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -28,6 +28,7 @@
#include <linux/mmc/host.h>
#include <linux/mmc/sdio.h>
-@@ -2154,12 +2155,20 @@ static int __init atmci_init_slot(struct atmel_mci *host,
+@@ -2160,12 +2161,20 @@ static int __init atmci_init_slot(struct
/* Assume card is present initially */
set_bit(ATMCI_CARD_PRESENT, &slot->flags);
if (gpio_is_valid(slot->detect_pin)) {
}
}
-@@ -2167,9 +2176,17 @@ static int __init atmci_init_slot(struct atmel_mci *host,
+@@ -2173,9 +2182,17 @@ static int __init atmci_init_slot(struct
mmc->caps |= MMC_CAP_NEEDS_POLL;
if (gpio_is_valid(slot->wp_pin)) {
}
}
-@@ -2339,6 +2356,7 @@ static int __init atmci_probe(struct platform_device *pdev)
+@@ -2345,6 +2362,7 @@ static int __init atmci_probe(struct pla
unsigned int nr_slots;
int irq;
int ret;
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!regs)
-@@ -2352,6 +2370,12 @@ static int __init atmci_probe(struct platform_device *pdev)
+@@ -2358,6 +2376,12 @@ static int __init atmci_probe(struct pla
}
}
irq = platform_get_irq(pdev, 0);
if (irq < 0)
return irq;
---
-1.8.0.197.g5a90748
-
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
- drivers/mmc/host/atmel-mci.c | 82 ++++++++++++++++++++++++++++++++++++++++----
+ drivers/mmc/host/atmel-mci.c | 82 +++++++++++++++++++++++++++++++++++++++----
1 file changed, 75 insertions(+), 7 deletions(-)
-diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
-index 9739604..17dc598 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
-@@ -512,12 +512,65 @@ static const struct of_device_id atmci_dt_ids[] = {
+@@ -513,12 +513,65 @@ static const struct of_device_id atmci_d
MODULE_DEVICE_TABLE(of, atmci_dt_ids);
u32 slot_id;
if (!np) {
-@@ -531,6 +584,24 @@ atmci_of_init(struct platform_device *pdev)
+@@ -532,6 +585,24 @@ atmci_of_init(struct platform_device *pd
return ERR_PTR(-ENOMEM);
}
for_each_child_of_node(np, cnp) {
if (of_property_read_u32(cnp, "reg", &slot_id)) {
dev_warn(&pdev->dev, "reg property is missing for %s\n",
-@@ -2253,16 +2324,13 @@ static bool atmci_filter(struct dma_chan *chan, void *slave)
+@@ -2259,16 +2330,13 @@ static bool atmci_filter(struct dma_chan
}
}
dma_cap_mask_t mask;
/* Try to grab a DMA channel */
-@@ -2414,7 +2482,7 @@ static int __init atmci_probe(struct platform_device *pdev)
+@@ -2420,7 +2488,7 @@ static int __init atmci_probe(struct pla
/* Get MCI capabilities and set operations according to it */
atmci_get_cap(host);
host->prepare_data = &atmci_prepare_data_dma;
host->submit_data = &atmci_submit_data_dma;
host->stop_transfer = &atmci_stop_transfer_dma;
---
-1.8.0.197.g5a90748
-
CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP026]), /* SCIF0 */
CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP025]), /* SCIF1 */
CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP024]), /* SCIF2 */
-
@@ -1,7 +1,7 @@
VERSION = 3
PATCHLEVEL = 4
- SUBLEVEL = 39
+ SUBLEVEL = 46
-EXTRAVERSION =
+EXTRAVERSION = -ltsi
NAME = Saber-toothed Squirrel
patches.at91/0160-ARM-dts-add-nodes-for-atmel-hsmci-controllers-for-at.patch
patches.at91/0161-mmc-atmel-mci-remove-not-needed-DMA-capability-test.patch
patches.at91/0162-ARM-at91-atmel-mci-remove-unused-setup_dma_addr-macr.patch
-patches.at91/0163-mmc-atmel-mci-remove-the-need-for-CONFIG_MMC_ATMELMC.patch
patches.at91/0164-ARM-dts-fix-add-mmc-irq-priority.patch
patches.at91/0165-mmc-atmel-mci-support-8-bit-buswidth.patch
patches.at91/0166-mmc-atmel-mci-fix-incorrect-setting-of-host-data-to-.patch