]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/mtd/nand/mxs_nand.c
nand: mxs: make fake_ecc_layout static
[karo-tx-uboot.git] / drivers / mtd / nand / mxs_nand.c
index fd008f49fec70a477618f7fd28909b013efa5441..480b4a514c5aef4ef4a8616773f24b898c2b5dec 100644 (file)
@@ -31,7 +31,7 @@
 #define        MXS_NAND_DMA_DESCRIPTOR_COUNT           4
 
 #define        MXS_NAND_CHUNK_DATA_CHUNK_SIZE          512
-#if defined(CONFIG_SOC_MX6)
+#if defined(CONFIG_ARCH_MX6)
 #define        MXS_NAND_CHUNK_DATA_CHUNK_SIZE_SHIFT    2
 #else
 #define        MXS_NAND_CHUNK_DATA_CHUNK_SIZE_SHIFT    0
@@ -174,7 +174,7 @@ static inline void dump_regs(void)
 }
 #endif
 
-struct nand_ecclayout fake_ecc_layout;
+static struct nand_ecclayout fake_ecc_layout;
 static int chunk_data_size = MXS_NAND_CHUNK_DATA_CHUNK_SIZE;
 static int galois_field = 13;
 
@@ -592,7 +592,7 @@ static void mxs_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int length)
 
        mxs_dma_desc_append(channel, d);
 
-#ifndef CONFIG_SOC_MX6Q
+#ifndef CONFIG_ARCH_MX6
        /*
         * A DMA descriptor that waits for the command to end and the chip to
         * become ready.
@@ -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) {