Merge tag 'u-boot-imx-20211020' of https://source.denx.de/u-boot/custodians/u-boot-imx
[platform/kernel/u-boot.git] / drivers / mtd / cfi_mtd.c
index a5bb096..78293ca 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <dma.h>
 #include <flash.h>
 #include <malloc.h>
 
@@ -70,7 +71,8 @@ static int cfi_mtd_read(struct mtd_info *mtd, loff_t from, size_t len,
        flash_info_t *fi = mtd->priv;
        u_char *f = (u_char*)(fi->start[0]) + from;
 
-       memcpy(buf, f, len);
+       if (dma_memcpy(buf, f, len) < 0)
+               memcpy(buf, f, len);
        *retlen = len;
 
        return 0;