linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Angelo Dureghello <angelo.dureghello@timesys.com>
To: adrian.hunter@intel.com
Cc: linux-mmc@vger.kernel.org, linux-m68k@vger.kernel.org,
	Angelo Dureghello <angelo.dureghello@timesys.com>
Subject: [PATCH v3 2/3] mmc: sdhci: add quirks for be to le byte swapping
Date: Sat,  2 May 2020 01:59:06 +0200	[thread overview]
Message-ID: <20200501235907.3978-2-angelo.dureghello@timesys.com> (raw)
In-Reply-To: <20200501235907.3978-1-angelo.dureghello@timesys.com>

Some controller as the ColdFire eshdc may require an endianness
byte swap, becouse DMA read endianness is not configurable.

Signed-off-by: Angelo Dureghello <angelo.dureghello@timesys.com>
---
Changes for v3:
- add post request callback
---
 drivers/mmc/host/sdhci.c | 7 +++++++
 drivers/mmc/host/sdhci.h | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 3f716466fcfd..d3bfbb6e11d5 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -637,6 +637,13 @@ static int sdhci_pre_dma_transfer(struct sdhci_host *host,
 			sg_copy_to_buffer(data->sg, data->sg_len,
 					  host->bounce_buffer,
 					  length);
+
+			/*
+			 * Endianness can't be swapped in the sg list,
+			 * since the sg list is processed again later on.
+			 */
+			if (host->ops->pre_dma_transfer)
+				host->ops->pre_dma_transfer(host, data);
 		}
 		/* Switch ownership to the DMA */
 		dma_sync_single_for_device(host->mmc->parent,
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 79dffbb731d3..076054308423 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -653,6 +653,8 @@ struct sdhci_ops {
 	void	(*voltage_switch)(struct sdhci_host *host);
 	void	(*adma_write_desc)(struct sdhci_host *host, void **desc,
 				   dma_addr_t addr, int len, unsigned int cmd);
+	void	(*pre_dma_transfer)(struct sdhci_host *host,
+				    struct mmc_data *data);
 	void	(*request_done)(struct sdhci_host *host,
 				struct mmc_request *mrq);
 };
-- 
2.26.0


  reply	other threads:[~2020-05-01 23:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01 23:59 [PATCH v3 1/3] m68k: mcf5441x: add support for esdhc mmc controller Angelo Dureghello
2020-05-01 23:59 ` Angelo Dureghello [this message]
2020-05-01 23:59 ` [PATCH v3 3/3] mmc: host: add Coldfire esdhc support Angelo Dureghello
2020-05-07  9:13 ` [PATCH v3 1/3] m68k: mcf5441x: add support for esdhc mmc controller Ulf Hansson
2020-05-07  9:23   ` Geert Uytterhoeven
2020-05-12 15:09   ` Greg Ungerer
2020-05-13 11:59     ` Ulf Hansson
2020-05-13 12:24       ` Greg Ungerer
2020-05-12 15:06 ` Greg Ungerer
2020-05-12 18:05   ` Angelo Dureghello

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200501235907.3978-2-angelo.dureghello@timesys.com \
    --to=angelo.dureghello@timesys.com \
    --cc=adrian.hunter@intel.com \
    --cc=linux-m68k@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).