Hi, On 1 December 2015 at 04:13, Mugunthan V N <mugunthan...@ti.com> wrote: > Add dma memcpy api to the default spi_flash_copy_mmap(), so that > dma will be used to copy data when DM_DMA is defined for the > platform. > > Signed-off-by: Mugunthan V N <mugunthan...@ti.com> > --- > drivers/mtd/spi/sf_ops.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c > index 3a56d7f..3c83f8a 100644 > --- a/drivers/mtd/spi/sf_ops.c > +++ b/drivers/mtd/spi/sf_ops.c > @@ -16,6 +16,7 @@ > #include <watchdog.h> > #include <linux/compiler.h> > #include <linux/log2.h> > +#include <dma.h> > > #include "sf_internal.h" > > @@ -389,6 +390,10 @@ int spi_flash_read_common(struct spi_flash *flash, const > u8 *cmd, > > void __weak spi_flash_copy_mmap(void *data, void *offset, size_t len) > { > +#ifdef CONFIG_DM_DMA > + if (!dma_memcpy(data, offset, len)) > + return; > +#endif > memcpy(data, offset, len); > } > > -- > 2.6.3.368.gf34be46 >
This looks like one driver (SPI flash) calling a weak function in another (SPI). Why isn't this done with the driver interface? Regards, Simon _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot