]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mtd: nand: mxs invalidate dcache before DMA read
authorPeng Fan <Peng.Fan@freescale.com>
Tue, 21 Jul 2015 08:15:21 +0000 (16:15 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 10 Sep 2015 09:29:44 +0000 (11:29 +0200)
Follow linux dma flow:
Before DMA read, be sure to invalidate the cache over the address
range of DMA buffer to prevent cache coherency problems.
After DMA read, invalidate dcache again.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Tim Harvey <tharvey@gateworks.com>
drivers/mtd/nand/mxs_nand.c

index fd008f49fec70a477618f7fd28909b013efa5441..3fdcebd5d97fa5da3a57d194d503c67da2a39588 100644 (file)
@@ -617,6 +617,10 @@ static void mxs_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int length)
 
        mxs_dma_desc_append(channel, d);
 #endif
+
+       /* Invalidate caches */
+       mxs_nand_inval_data_buf(nand_info);
+
        /* Execute the DMA chain. */
        ret = mxs_dma_go(channel);
        if (ret) {
@@ -795,6 +799,9 @@ static int mxs_nand_ecc_read_page(struct mtd_info *mtd, struct nand_chip *nand,
 
        mxs_dma_desc_append(channel, d);
 
+       /* Invalidate caches */
+       mxs_nand_inval_data_buf(nand_info);
+
        /* Execute the DMA chain. */
        ret = mxs_dma_go(channel);
        if (ret) {