Skip to contentSkip to conversation

mtd: spi: spi_flash: fix build with dma enabled

PATCH New Grygorii Strashko 2 participants 3 messages Jun 28, 2018 – Jul 20, 2018 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: spi: spi_flash: fix build with dma enabled

Fix build with CONFIG_DMA enabled
drivers/mtd/spi/spi_flash.c:376: undefined reference to `dma_memcpy'

---
 drivers/mtd/spi/spi_flash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi/spi_flash.c +1 -1
index c159124..d6cbdf2 100644
@@ -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
Signature · 1 line
2.10.5
#1 lore raw

PATCH 1/1 mtd: spi: spi_flash: fix build with dma enabled

Quoted 13 lines · Grygorii Strashko

Fix build with CONFIG_DMA enabled
drivers/mtd/spi/spi_flash.c:376: undefined reference to `dma_memcpy'

---
 drivers/mtd/spi/spi_flash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi/spi_flash.c +0 -0
index c159124..d6cbdf2 100644

drivers/mtd/spi/spi_flash.c int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd, · line 460

Quoted 5 lines
drivers/mtd/spi/spi_flash.c +1 -1
@@ -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?

#2 lore raw

PATCH 1/1 mtd: spi: spi_flash: fix build with dma enabled

Quoted 10 lines · Jagan Teki
Quoted 8 lines · Grygorii Strashko

Fix build with CONFIG_DMA enabled
drivers/mtd/spi/spi_flash.c:376: undefined reference to `dma_memcpy'

---
  drivers/mtd/spi/spi_flash.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines

drivers/mtd/spi/spi_flash.c int spi_flash_read_common(struct spi_flash *flash, const u8 *cmd, · line 460

Quoted 10 lines
drivers/mtd/spi/spi_flash.c +1 -1
index c159124..d6cbdf2 100644
@@ -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?

Signature · 2 lines
regards,
-grygorii