aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2013-05-13 10:40:56 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-05-22 19:07:03 -0400
commit024629c62ffc25f267d57bf588cc10c96ccc0ce5 (patch)
tree2e4b76aa003fd64cf79a93a380180e4184335fda
parentc58a85090c8fbf7274af5ed0fe30828320c40ad6 (diff)
ARM: 7719/1: mmc: mmci: Support for CMD23
Support added for transmission of CMD23 during multi block read or write. In order to activate this feature, MMC_CAP_CMD23 flag needs to be enabled in the capabilities field. Note that CMD23 support is mandatory to support features like reliable write, data tag, context ID, packed command. This patch is based upon a patch from Saugata Das. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--drivers/mmc/host/mmci.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 5f53cf8b8f5a..9df8b84145b1 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -848,7 +848,7 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data,
848 /* The error clause is handled above, success! */ 848 /* The error clause is handled above, success! */
849 data->bytes_xfered = data->blksz * data->blocks; 849 data->bytes_xfered = data->blksz * data->blocks;
850 850
851 if (!data->stop) { 851 if (!data->stop || host->mrq->sbc) {
852 mmci_request_end(host, data->mrq); 852 mmci_request_end(host, data->mrq);
853 } else { 853 } else {
854 mmci_start_command(host, data->stop, 0); 854 mmci_start_command(host, data->stop, 0);
@@ -861,6 +861,7 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd,
861 unsigned int status) 861 unsigned int status)
862{ 862{
863 void __iomem *base = host->base; 863 void __iomem *base = host->base;
864 bool sbc = (cmd == host->mrq->sbc);
864 865
865 host->cmd = NULL; 866 host->cmd = NULL;
866 867
@@ -875,7 +876,7 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd,
875 cmd->resp[3] = readl(base + MMCIRESPONSE3); 876 cmd->resp[3] = readl(base + MMCIRESPONSE3);
876 } 877 }
877 878
878 if (!cmd->data || cmd->error) { 879 if ((!sbc && !cmd->data) || cmd->error) {
879 if (host->data) { 880 if (host->data) {
880 /* Terminate the DMA transfer */ 881 /* Terminate the DMA transfer */
881 if (dma_inprogress(host)) { 882 if (dma_inprogress(host)) {
@@ -884,7 +885,9 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd,
884 } 885 }
885 mmci_stop_data(host); 886 mmci_stop_data(host);
886 } 887 }
887 mmci_request_end(host, cmd->mrq); 888 mmci_request_end(host, host->mrq);
889 } else if (sbc) {
890 mmci_start_command(host, host->mrq->cmd, 0);
888 } else if (!(cmd->data->flags & MMC_DATA_READ)) { 891 } else if (!(cmd->data->flags & MMC_DATA_READ)) {
889 mmci_start_data(host, cmd->data); 892 mmci_start_data(host, cmd->data);
890 } 893 }
@@ -1125,7 +1128,10 @@ static void mmci_request(struct mmc_host *mmc, struct mmc_request *mrq)
1125 if (mrq->data && mrq->data->flags & MMC_DATA_READ) 1128 if (mrq->data && mrq->data->flags & MMC_DATA_READ)
1126 mmci_start_data(host, mrq->data); 1129 mmci_start_data(host, mrq->data);
1127 1130
1128 mmci_start_command(host, mrq->cmd, 0); 1131 if (mrq->sbc)
1132 mmci_start_command(host, mrq->sbc, 0);
1133 else
1134 mmci_start_command(host, mrq->cmd, 0);
1129 1135
1130 spin_unlock_irqrestore(&host->lock, flags); 1136 spin_unlock_irqrestore(&host->lock, flags);
1131} 1137}