arm: imx6: cm_fx6: Enable DM SPI and SPI_FLASH, fix SPL build errors
PATCH 1/1 arm: imx6: cm_fx6: Enable DM SPI and SPI_FLASH, fix SPL build errors
From: Suniel Mahesh <[email protected]>
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 1scripts/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.
--- configs/cm_fx6_defconfig | 2 ++ include/configs/cm_fx6.h | 7 +++++++ 2 files changed, 9 insertions(+)
configs/cm_fx6_defconfig +2 -0
@@ -62,6 +62,7 @@ CONFIG_FSL_USDHC=y CONFIG_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
@@ -77,6 +78,7 @@ CONFIG_MII=y CONFIG_DM_PMIC=y CONFIG_DM_REGULATOR=y CONFIG_SPI=y +CONFIG_DM_SPI=y CONFIG_MXC_SPI=y CONFIG_USB=y CONFIG_DM_USB=y
include/configs/cm_fx6.h +7 -0
@@ -163,6 +163,13 @@/* 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
Signature · 1 line
2.7.4
PATCH 1/1 arm: imx6: cm_fx6: Enable DM SPI and SPI_FLASH, fix SPL build errors
Hi stefano,
Can you please review this patch, Its been a longtime since its arrival on the list, and still lying there untouched.
Regards
Suniel
Quoted 68 lines · sunil.m at techveda.org
From: Suniel Mahesh <[email protected]>
Enable driver model for SPI and
SPI_FLASHto remove the following compile warning on CM-FX6 SOM:
===================== WARNING ====================== This board does not useCONFIG_DM_SPI_FLASH. Please update the board to useCONFIG_SPI_FLASHbefore 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 'structdm_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 1scripts/Makefile.build:432: recipe for target 'spl/drivers/mtd/spi' failed
make[2]: *** [spl/drivers/mtd/spi] Error 2Disabling DM for SPI support(SPI and SF) in SPL resolves the issue. Target was compile tested, build was clean.
Signed-off-by Suniel Mahesh <[email protected]>--- configs/cm_fx6_defconfig | 2 ++ include/configs/cm_fx6.h | 7 +++++++ 2 files changed, 9 insertions(+)configs/cm_fx6_defconfig +2
-0@@ -62,6 +62,7 @@ CONFIG_FSL_USDHC=y CONFIG_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@@ -77,6 +78,7 @@ CONFIG_MII=y CONFIG_DM_PMIC=y CONFIG_DM_REGULATOR=y CONFIG_SPI=y +CONFIG_DM_SPI=y CONFIG_MXC_SPI=y CONFIG_USB=y CONFIG_DM_USB=yinclude/configs/cm_fx6.h +7
-0@@ -163,6 +163,13 @@/* 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