Message ID | 20180628192610.28197-1-grygorii.strashko@ti.com |
---|---|
State | Deferred |
Delegated to: | Jagannadha Sutradharudu Teki |
Headers | show |
Series | [U-Boot] mtd: spi: spi_flash: fix build with dma enabled | expand |
On Fri, Jun 29, 2018 at 12:56 AM, Grygorii Strashko <grygorii.strashko@ti.com> wrote: > Fix build with CONFIG_DMA enabled > drivers/mtd/spi/spi_flash.c:376: undefined reference to `dma_memcpy' > > Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> > --- > drivers/mtd/spi/spi_flash.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c > index c159124..d6cbdf2 100644 > --- a/drivers/mtd/spi/spi_flash.c > +++ b/drivers/mtd/spi/spi_flash.c > @@ -457,7 +457,7 @@ 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_DMA > +#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_DMA) What if SPI flash using in SPL with DMA enabled?
On 07/16/2018 03:56 AM, Jagan Teki wrote: > On Fri, Jun 29, 2018 at 12:56 AM, Grygorii Strashko > <grygorii.strashko@ti.com> wrote: >> Fix build with CONFIG_DMA enabled >> drivers/mtd/spi/spi_flash.c:376: undefined reference to `dma_memcpy' >> >> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> >> --- >> drivers/mtd/spi/spi_flash.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c >> index c159124..d6cbdf2 100644 >> --- a/drivers/mtd/spi/spi_flash.c >> +++ b/drivers/mtd/spi/spi_flash.c >> @@ -457,7 +457,7 @@ 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_DMA >> +#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_DMA) > > What if SPI flash using in SPL with DMA enabled? > It'd require to do additional fix/rework. I've been thinking about it, but I don't know how to fix it other way - any advice?
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index c159124..d6cbdf2 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -457,7 +457,7 @@ 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_DMA +#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_DMA) if (!dma_memcpy(data, offset, len)) return; #endif
Fix build with CONFIG_DMA enabled drivers/mtd/spi/spi_flash.c:376: undefined reference to `dma_memcpy' Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> --- drivers/mtd/spi/spi_flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)