linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: mmci: Add new VE MMCI variant
@ 2012-12-14 15:38 Pawel Moll
  2012-12-14 17:11 ` Russell King - ARM Linux
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Pawel Moll @ 2012-12-14 15:38 UTC (permalink / raw)
  To: Chris Ball
  Cc: linux-mmc, Russell King, Ulf Hansson, Linus Walleij, Pawel Moll

The Versatile Express IOFPGA as shipped on VECD 5.0 (bitfiles v108/208
and v116/216) contains a modified version of the PL180 MMCI, with
PeriphID Configuration value changed to 0x2.

This version adds an optional "hardware flow control" feature. When
enabled MMC card clock will be automatically disabled when FIFO is
about to over/underflow and re-enabled once the host retrieved some
data. This makes the controller immune to over/underrun errors caused
by big interrupt handling latencies.

This patch adds relevant device variant in the driver.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
---
 drivers/mmc/host/mmci.c |   13 +++++++++++++
 drivers/mmc/host/mmci.h |    2 ++
 2 files changed, 15 insertions(+)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index edc3e9b..b2b550f 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -86,6 +86,14 @@ static struct variant_data variant_arm_extended_fifo = {
 	.pwrreg_powerup		= MCI_PWR_UP,
 };
 
+static struct variant_data variant_arm_extended_fifo_hwfc = {
+	.fifosize		= 128 * 4,
+	.fifohalfsize		= 64 * 4,
+	.clkreg_enable		= MCI_ARM_HWFCEN,
+	.datalength_bits	= 16,
+	.pwrreg_powerup		= MCI_PWR_UP,
+};
+
 static struct variant_data variant_u300 = {
 	.fifosize		= 16 * 4,
 	.fifohalfsize		= 8 * 4,
@@ -1628,6 +1636,11 @@ static struct amba_id mmci_ids[] = {
 		.data	= &variant_arm_extended_fifo,
 	},
 	{
+		.id	= 0x02041180,
+		.mask	= 0xff0fffff,
+		.data	= &variant_arm_extended_fifo_hwfc,
+	},
+	{
 		.id	= 0x00041181,
 		.mask	= 0x000fffff,
 		.data	= &variant_arm,
diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h
index d437ccf..00d6d0c 100644
--- a/drivers/mmc/host/mmci.h
+++ b/drivers/mmc/host/mmci.h
@@ -28,6 +28,8 @@
 #define MCI_ST_UX500_NEG_EDGE	(1 << 13)
 #define MCI_ST_UX500_HWFCEN	(1 << 14)
 #define MCI_ST_UX500_CLK_INV	(1 << 15)
+/* Modified PL180 on Versatile Express platform */
+#define MCI_ARM_HWFCEN		(1 << 12)
 
 #define MMCIARGUMENT		0x008
 #define MMCICOMMAND		0x00c
-- 
1.7.10.4



^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2013-01-26 18:53 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-14 15:38 [PATCH] mmc: mmci: Add new VE MMCI variant Pawel Moll
2012-12-14 17:11 ` Russell King - ARM Linux
2012-12-14 17:35   ` Pawel Moll
2012-12-14 19:49   ` Linus Walleij
2012-12-14 19:44 ` Linus Walleij
2012-12-21 11:05 ` Ulf Hansson
2013-01-24 12:36   ` Pawel Moll
2013-01-24 12:48     ` Ulf Hansson
2013-01-24 12:59       ` Russell King - ARM Linux
2013-01-24 13:16         ` Ulf Hansson
2013-01-24 17:12         ` Linus Walleij
2013-01-24 20:11           ` Ulf Hansson
2013-01-25  9:35             ` Linus Walleij
2013-01-26 18:53               ` Ulf Hansson
2013-01-24 12:54 ` Pawel Moll
2013-01-24 13:04   ` Ulf Hansson
2013-01-24 13:05     ` Ulf Hansson
2013-01-24 12:57 ` Chris Ball
2013-01-24 13:03   ` Pawel Moll

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).