All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/1] mmc: S5P: Support DMA restarts at buffer boundaries
@ 2011-06-30 19:55 Anton Staaf
  2011-06-30 19:55 ` [U-Boot] [PATCH 1/1] " Anton Staaf
  2011-07-06  4:51 ` [U-Boot] [PATCH 0/1] " Jaehoon Chung
  0 siblings, 2 replies; 4+ messages in thread
From: Anton Staaf @ 2011-06-30 19:55 UTC (permalink / raw)
  To: u-boot

I don't actually have an S5P machine to test this patch with.  I wrote this
code while fixing an issue with the in progress Tegra MMC device driver that
is based on the S5P driver.  I have tested this patch on that platform.  If
someone with an S5P could give this a whirl that would be great.

Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>

Anton Staaf (1):
  mmc: S5P: Support DMA restarts at buffer boundaries

 drivers/mmc/s5p_mmc.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

-- 
1.7.3.1

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

* [U-Boot] [PATCH 1/1] mmc: S5P: Support DMA restarts at buffer boundaries
  2011-06-30 19:55 [U-Boot] [PATCH 0/1] mmc: S5P: Support DMA restarts at buffer boundaries Anton Staaf
@ 2011-06-30 19:55 ` Anton Staaf
  2011-07-06  4:51 ` [U-Boot] [PATCH 0/1] " Jaehoon Chung
  1 sibling, 0 replies; 4+ messages in thread
From: Anton Staaf @ 2011-06-30 19:55 UTC (permalink / raw)
  To: u-boot

Currently if a DMA buffer straddles a buffer alignment boundary
(512KiB) then the DMA engine will pause and generate a DMA
interrupt.  Since the DMA interrupt is not enabled it will hang
the MMC driver.

This patch adds support for restarting the DMA transfer.  The
SYSTEM_ADDRESS register contains the next address that would have
been read/written when a boundary is hit.  So we can read that
and write it back.  The write triggers the resumption of the
transfer.

Signed-off-by: Anton Staaf <robotboy@chromium.org>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
---
 drivers/mmc/s5p_mmc.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/s5p_mmc.c b/drivers/mmc/s5p_mmc.c
index 280738f..62a7abf 100644
--- a/drivers/mmc/s5p_mmc.c
+++ b/drivers/mmc/s5p_mmc.c
@@ -232,9 +232,15 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
 						__func__, mask);
 				return -1;
 			} else if (mask & (1 << 3)) {
-				/* DMA Interrupt */
+				/*
+				 * DMA Interrupt, restart the transfer where
+				 * it was interrupted.
+				 */
+				unsigned int address = readl(&host->reg->sysad);
+
 				debug("DMA end\n");
-				break;
+				writel((1 << 3), &host->reg->norintsts);
+				writel(address, &host->reg->sysad);
 			} else if (mask & (1 << 1)) {
 				/* Transfer Complete */
 				debug("r/w is done\n");
@@ -425,12 +431,13 @@ static int mmc_core_init(struct mmc *mmc)
 	 * NORMAL Interrupt Status Enable Register init
 	 * [5] ENSTABUFRDRDY : Buffer Read Ready Status Enable
 	 * [4] ENSTABUFWTRDY : Buffer write Ready Status Enable
+	 * [3] ENSTADMAINT : DMA Interrupt Status Enable
 	 * [1] ENSTASTANSCMPLT : Transfre Complete Status Enable
 	 * [0] ENSTACMDCMPLT : Command Complete Status Enable
-	*/
+	 */
 	mask = readl(&host->reg->norintstsen);
 	mask &= ~(0xffff);
-	mask |= (1 << 5) | (1 << 4) | (1 << 1) | (1 << 0);
+	mask |= (1 << 5) | (1 << 4) | (1 << 3) | (1 << 1) | (1 << 0);
 	writel(mask, &host->reg->norintstsen);
 
 	/*
-- 
1.7.3.1

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

* [U-Boot] [PATCH 0/1] mmc: S5P: Support DMA restarts at buffer boundaries
  2011-06-30 19:55 [U-Boot] [PATCH 0/1] mmc: S5P: Support DMA restarts at buffer boundaries Anton Staaf
  2011-06-30 19:55 ` [U-Boot] [PATCH 1/1] " Anton Staaf
@ 2011-07-06  4:51 ` Jaehoon Chung
  2011-07-13  8:54   ` Minkyu Kang
  1 sibling, 1 reply; 4+ messages in thread
From: Jaehoon Chung @ 2011-07-06  4:51 UTC (permalink / raw)
  To: u-boot

Tested-by : Jaehoon Chung <jh80.chung@samsung.com>

Anton Staaf wrote:
> I don't actually have an S5P machine to test this patch with.  I wrote this
> code while fixing an issue with the in progress Tegra MMC device driver that
> is based on the S5P driver.  I have tested this patch on that platform.  If
> someone with an S5P could give this a whirl that would be great.
> 
> Cc: Minkyu Kang <mk7.kang@samsung.com>
> Cc: Jaehoon Chung <jh80.chung@samsung.com>
> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
> 
> Anton Staaf (1):
>   mmc: S5P: Support DMA restarts at buffer boundaries
> 
>  drivers/mmc/s5p_mmc.c |   15 +++++++++++----
>  1 files changed, 11 insertions(+), 4 deletions(-)
> 

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

* [U-Boot] [PATCH 0/1] mmc: S5P: Support DMA restarts at buffer boundaries
  2011-07-06  4:51 ` [U-Boot] [PATCH 0/1] " Jaehoon Chung
@ 2011-07-13  8:54   ` Minkyu Kang
  0 siblings, 0 replies; 4+ messages in thread
From: Minkyu Kang @ 2011-07-13  8:54 UTC (permalink / raw)
  To: u-boot

Dear Anton Staaf,

On 6 July 2011 13:51, Jaehoon Chung <jh80.chung@samsung.com> wrote:
> Tested-by : Jaehoon Chung <jh80.chung@samsung.com>
>
> Anton Staaf wrote:
>> I don't actually have an S5P machine to test this patch with. ?I wrote this
>> code while fixing an issue with the in progress Tegra MMC device driver that
>> is based on the S5P driver. ?I have tested this patch on that platform. ?If
>> someone with an S5P could give this a whirl that would be great.
>>
>> Cc: Minkyu Kang <mk7.kang@samsung.com>
>> Cc: Jaehoon Chung <jh80.chung@samsung.com>
>> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
>>
>> Anton Staaf (1):
>> ? mmc: S5P: Support DMA restarts at buffer boundaries
>>
>> ?drivers/mmc/s5p_mmc.c | ? 15 +++++++++++----
>> ?1 files changed, 11 insertions(+), 4 deletions(-)
>>
>

applied to u-boot-samsung

Thanks
Minkyu Kang
-- 
from. prom.
www.promsoft.net

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

end of thread, other threads:[~2011-07-13  8:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-30 19:55 [U-Boot] [PATCH 0/1] mmc: S5P: Support DMA restarts at buffer boundaries Anton Staaf
2011-06-30 19:55 ` [U-Boot] [PATCH 1/1] " Anton Staaf
2011-07-06  4:51 ` [U-Boot] [PATCH 0/1] " Jaehoon Chung
2011-07-13  8:54   ` Minkyu Kang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.