mtd: blackfin NFC: fix hang when using NAND on BF527-EZKITs

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Jun 5 14:59:23 EDT 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=c3a9f35673290f49ec115d36ad283961c82c135a
Commit:     c3a9f35673290f49ec115d36ad283961c82c135a
Parent:     530c3b60658687e2ad7bf98ef83631a8280ae8a6
Author:     Cliff Cai <cliff.cai at analog.com>
AuthorDate: Tue May 26 06:24:14 2009 -0400
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Jun 5 18:27:43 2009 +0100

    mtd: blackfin NFC: fix hang when using NAND on BF527-EZKITs
    
    The DMAs have different bit sizes on BF52x and BF54x.  From the PHRM:
    
    "The 16-bit DMA Access Bus (DAB) connects the DMA controller to the
    on-chip peripherals, PPI, SPI, Ethernet MAC, the SPORTs, NFC,
    HOSTDP and the UARTs."
    
    32-bit DMA won't work for BF52x.
    
    Signed-off-by: Cliff Cai <cliff.cai at analog.com>
    Signed-off-by: Mike Frysinger <vapier at gentoo.org>
    Signed-off-by: Bryan Wu <cooloney at kernel.org>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/bf5xx_nand.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c
index 2ab42d2..8506e7e 100644
--- a/drivers/mtd/nand/bf5xx_nand.c
+++ b/drivers/mtd/nand/bf5xx_nand.c
@@ -496,11 +496,20 @@ static void bf5xx_nand_dma_rw(struct mtd_info *mtd,
 	/* setup DMA register with Blackfin DMA API */
 	set_dma_config(CH_NFC, 0x0);
 	set_dma_start_addr(CH_NFC, (unsigned long) buf);
+
+/* The DMAs have different size on BF52x and BF54x */
+#ifdef CONFIG_BF52x
+	set_dma_x_count(CH_NFC, (page_size >> 1));
+	set_dma_x_modify(CH_NFC, 2);
+	val = DI_EN | WDSIZE_16;
+#endif
+
+#ifdef CONFIG_BF54x
 	set_dma_x_count(CH_NFC, (page_size >> 2));
 	set_dma_x_modify(CH_NFC, 4);
-
-	/* setup write or read operation */
 	val = DI_EN | WDSIZE_32;
+#endif
+	/* setup write or read operation */
 	if (is_read)
 		val |= WNR;
 	set_dma_config(CH_NFC, val);



More information about the linux-mtd-cvs mailing list