]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: imx6: cm_fx6: Enable DM SPI and SPI_FLASH, fix SPL build errors
authorSuniel Mahesh <sunil.m@techveda.org>
Wed, 27 Nov 2019 10:47:48 +0000 (16:17 +0530)
committerStefano Babic <sbabic@denx.de>
Tue, 7 Jan 2020 09:26:56 +0000 (10:26 +0100)
Enable driver model for SPI and SPI_FLASH to remove the following
compile warning on CM-FX6 SOM:
===================== WARNING ======================
This board does not use CONFIG_DM_SPI_FLASH. Please update
the board to use CONFIG_SPI_FLASH before the v2019.07 release.
====================================================

This change introduced SPL build error as shown:

In file included from include/common.h:47:0,
                 from drivers/mtd/spi/sf_probe.c:10:
drivers/mtd/spi/sf_probe.c: In function 'spi_flash_std_probe':
drivers/mtd/spi/sf_probe.c:149:54: error: dereferencing pointer to incomplete type 'struct dm_spi_slave_platdata'
scripts/Makefile.build:278: recipe for target 'spl/drivers/mtd/spi/sf_probe.o' failed
make[3]: *** [spl/drivers/mtd/spi/sf_probe.o] Error 1
scripts/Makefile.build:432: recipe for target 'spl/drivers/mtd/spi' failed
make[2]: *** [spl/drivers/mtd/spi] Error 2

Disabling DM for SPI support(SPI and SF) in SPL resolves the issue.
Target was compile tested, build was clean.

Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
configs/cm_fx6_defconfig
include/configs/cm_fx6.h

index 9bf6da1bed83de9799599dc1188e10910821d517..a4191607515c4b308441161b727ab746eaf93e8a 100644 (file)
@@ -67,6 +67,7 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_MXS=y
 CONFIG_SPI_FLASH=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=25000000
 CONFIG_SPI_FLASH_ATMEL=y
@@ -83,6 +84,7 @@ CONFIG_MII=y
 CONFIG_DM_PMIC=y
 CONFIG_DM_REGULATOR=y
 CONFIG_SPI=y
+CONFIG_DM_SPI=y
 CONFIG_MXC_SPI=y
 CONFIG_DM_ETH=y
 CONFIG_USB=y
index eb29f07032b2094bf04fe11bf4411fcbce1b81ee..53ae5f08ebd305147d651b500ddcc38fd1820865 100644 (file)
 /* APBH DMA is required for NAND support */
 #endif
 
+/* SPI Flash Configs */
+#if defined(CONFIG_SPL_BUILD)
+#undef CONFIG_DM_SPI
+#undef CONFIG_DM_SPI_FLASH
+#undef CONFIG_SPI_FLASH_MTD
+#endif
+
 /* Ethernet */
 #define CONFIG_FEC_MXC
 #define CONFIG_FEC_MXC_PHYADDR         0