spi: Move DM_SPI_FLASH to Kconfig (for NXP's ls1043a)
authorLukasz Majewski <lukma@denx.de>
Thu, 4 Jun 2020 15:11:51 +0000 (23:11 +0800)
committerTom Rini <trini@konsulko.com>
Sat, 27 Jun 2020 12:00:33 +0000 (08:00 -0400)
This patch fixes issue with defining the DM_SPI_FLASH in the
configs/include/<board.h> instead of enabling this option in Kconfig.

The problem is that CONFIG_IS_ENABLED(DM_SPI_FLASH) shows false as there
is no DM_SPI_FLASH=y in .config (but the define is set in u-boot.cfg).

As a result conversion of DM_SPI_FLASH to using CONFIG_IS_ENABLED() is not
working properly.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
arch/arm/Kconfig
include/configs/ls1043a_common.h

index 73a27316dfb648e75c4593d32fdf72cb8dcbffc0..714c81e1a974cb4e23867e9fe70ee89770c0c00e 100644 (file)
@@ -1510,6 +1510,8 @@ config TARGET_LS1043AQDS
        select BOARD_LATE_INIT
        select SUPPORT_SPL
        select FSL_DDR_INTERACTIVE if !SPL
+       select FSL_DSPI if !SPL_NO_DSPI
+       select DM_SPI_FLASH if FSL_DSPI
        imply SCSI
        imply SCSI_AHCI
        help
@@ -1524,6 +1526,8 @@ config TARGET_LS1043ARDB
        select BOARD_EARLY_INIT_F
        select BOARD_LATE_INIT
        select SUPPORT_SPL
+       select FSL_DSPI if !SPL_NO_DSPI
+       select DM_SPI_FLASH if FSL_DSPI
        help
          Support for Freescale LS1043ARDB platform.
 
index b18eab51ed1d6789d3804cbccaf2af22eef44304..3efac1fa7800aa0b18a76c623d2193d214b61038 100644 (file)
 
 /*  DSPI  */
 #ifndef SPL_NO_DSPI
-#define CONFIG_FSL_DSPI
 #ifdef CONFIG_FSL_DSPI
-#define CONFIG_DM_SPI_FLASH
 #define CONFIG_SPI_FLASH_STMICRO       /* cs0 */
 #define CONFIG_SPI_FLASH_SST           /* cs1 */
 #define CONFIG_SPI_FLASH_EON           /* cs2 */