Add dma memcpy api to the default spi_flash_copy_mmap(), so that
dma will be used to copy data when CONFIG_DMA is defined for the
platform.
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagan Teki <jteki@openedev.com>
#include <spi.h>
#include <spi_flash.h>
#include <linux/log2.h>
+#include <dma.h>
#include "sf_internal.h"
return ret;
}
+/*
+ * TODO: remove the weak after all the other spi_flash_copy_mmap
+ * implementations removed from drivers
+ */
void __weak spi_flash_copy_mmap(void *data, void *offset, size_t len)
{
+#ifdef CONFIG_DMA
+ if (!dma_memcpy(data, offset, len))
+ return;
+#endif
memcpy(data, offset, len);
}