Patchwork [U-Boot,v1,2/6] blackfin: limit the max memory dma peripheral transfer size to 4 bytes.

login
register
mail settings
Submitter Sonic Zhang
Date Feb. 27, 2013, 6:50 a.m.
Message ID <1361947807-27384-3-git-send-email-sonic.adi@gmail.com>
Download mbox | patch
Permalink /patch/223519/
State Accepted
Delegated to: Sonic Zhang
Headers show

Comments

Sonic Zhang - Feb. 27, 2013, 6:50 a.m.
From: Sonic Zhang <sonic.zhang@analog.com>

Othersize, the bf609 memory dma halts after being enabled.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 arch/blackfin/lib/string.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

Patch

diff --git a/arch/blackfin/lib/string.c b/arch/blackfin/lib/string.c
index 44d8c6d..5b7ac0b 100644
--- a/arch/blackfin/lib/string.c
+++ b/arch/blackfin/lib/string.c
@@ -128,10 +128,12 @@  static void dma_calc_size(unsigned long ldst, unsigned long lsrc, size_t count,
 	unsigned long limit;
 
 #ifdef MSIZE
-	limit = 6;
+	/* The max memory DMA memory transfer size is 32 bytes. */
+	limit = 5;
 	*dshift = MSIZE_P;
 #else
-	limit = 3;
+	/* The max memory DMA memory transfer size is 4 bytes. */
+	limit = 2;
 	*dshift = WDSIZE_P;
 #endif
 
@@ -170,7 +172,8 @@  void dma_memcpy_nocache(void *dst, const void *src, size_t count)
 	mod = 1 << bpos;
 
 #ifdef PSIZE
-	dsize |= min(3, bpos) << PSIZE_P;
+	/* The max memory DMA peripheral transfer size is 4 bytes. */
+	dsize |= min(2, bpos) << PSIZE_P;
 #endif
 
 	/* Copy sram functions from sdram to sram */