spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI*
authorLukasz Majewski <lukma@denx.de>
Thu, 4 Jun 2020 15:11:53 +0000 (23:11 +0800)
committerTom Rini <trini@konsulko.com>
Sat, 27 Jun 2020 11:59:55 +0000 (07:59 -0400)
This change allows more fine tuning of driver model based SPI support in
SPL and TPL. It is now possible to explicitly enable/disable the DM_SPI
support in SPL and TPL via Kconfig option.

Before this change it was necessary to use:
    /* SPI Flash Configs */
    #if defined(CONFIG_SPL_BUILD)
    #undef CONFIG_DM_SPI
    #undef CONFIG_DM_SPI_FLASH
    #undef CONFIG_SPI_FLASH_MTD
    #endif

in the ./include/configs/<board>.h, which is error prone and shall be
avoided when we strive to switch to Kconfig.

The goal of this patch:

Provide distinction for DM_SPI support in both U-Boot proper and SPL (TPL).
Valid use case is when U-Boot proper wants to use DM_SPI, but SPL must
still support non DM driver.

Another use case is the conversion of non DM/DTS SPI driver to support
DM/DTS. When such driver needs to work in both SPL and U-Boot proper, the
distinction is needed in Kconfig (also if SPL version of the driver
supports OF_PLATDATA).

In the end of the day one would have to support following use cases (in
single driver file - e.g. mxs_spi.c):

- U-Boot proper driver supporting DT/DTS
- U-Boot proper driver without DT/DTS support (deprecated)
- SPL driver without DT/DTS support
- SPL (and TPL) driver with DT/DTS (when the SoC has enough resources to
  run full blown DT/DTS)
- SPL driver with DT/DTS and SPL_OF_PLATDATA (when one have constrained
  environment with no fitImage and OF_LIBFDT support).

Some boards do require SPI support (with DM) in SPL (TPL) and some only
have DM_SPI{_FLASH} defined to allow compiling SPL.

This patch converts #ifdef CONFIG_DM_SPI* to #if CONFIG_IS_ENABLED(DM_SPI)
and provides corresponding defines in Kconfig.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Tested-by: Adam Ford <aford173@gmail.com> #da850-evm
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
[trini: Fixup a few platforms]
Signed-off-by: Tom Rini <trini@konsulko.com>
59 files changed:
arch/arm/Kconfig
board/l+g/vinco/vinco.c
cmd/sf.c
cmd/spi.c
common/spl/Kconfig
configs/am57xx_evm_defconfig
configs/am57xx_hs_evm_defconfig
configs/am57xx_hs_evm_usb_defconfig
configs/am65x_evm_a53_defconfig
configs/am65x_evm_r5_defconfig
configs/am65x_hs_evm_a53_defconfig
configs/am65x_hs_evm_r5_defconfig
configs/axm_defconfig
configs/brppt1_spi_defconfig
configs/brppt2_defconfig
configs/brsmarc1_defconfig
configs/chromebook_coral_defconfig
configs/chromebook_link64_defconfig
configs/chromebook_samus_tpl_defconfig
configs/cm_t43_defconfig
configs/da850evm_defconfig
configs/dra7xx_evm_defconfig
configs/dra7xx_hs_evm_defconfig
configs/dra7xx_hs_evm_usb_defconfig
configs/imx28_xea_defconfig
configs/j721e_evm_a72_defconfig
configs/j721e_evm_r5_defconfig
configs/j721e_hs_evm_a72_defconfig
configs/j721e_hs_evm_r5_defconfig
configs/k2e_evm_defconfig
configs/k2hk_evm_defconfig
configs/k2l_evm_defconfig
configs/ls1021aiot_qspi_defconfig
configs/ls1021aiot_sdcard_defconfig
configs/ls1021aqds_qspi_defconfig
configs/ls1021aqds_sdcard_qspi_defconfig
configs/ls1021atwr_qspi_defconfig
configs/qemu-x86_64_defconfig
configs/sama5d27_wlsom1_ek_qspiflash_defconfig
configs/sama5d2_xplained_spiflash_defconfig
configs/sama5d3xek_spiflash_defconfig
configs/sama5d4_xplained_spiflash_defconfig
configs/sama5d4ek_spiflash_defconfig
configs/stm32mp15_basic_defconfig
configs/stm32mp15_dhcom_basic_defconfig
configs/stm32mp15_dhcor_basic_defconfig
configs/taurus_defconfig
drivers/mtd/spi/Makefile
drivers/mtd/spi/sf_probe.c
drivers/net/fm/fm.c
drivers/spi/Makefile
drivers/spi/kirkwood_spi.c
drivers/spi/mxc_spi.c
drivers/spi/omap3_spi.c
drivers/spi/sh_qspi.c
env/sf.c
include/spi.h
include/spi_flash.h
test/dm/spi.c

index 54d65f84889f32b7137b12dcf062247231096331..73a27316dfb648e75c4593d32fdf72cb8dcbffc0 100644 (file)
@@ -549,6 +549,7 @@ config TARGET_GPLUGD
 config ARCH_DAVINCI
        bool "TI DaVinci"
        select CPU_ARM926EJS
+       select SPL_DM_SPI if SPL
        imply CMD_SAVES
        help
          Support for TI's DaVinci platform.
@@ -566,6 +567,8 @@ config ARCH_MVEBU
        select DM_SERIAL
        select DM_SPI
        select DM_SPI_FLASH
+       select SPL_DM_SPI if SPL
+       select SPL_DM_SPI_FLASH if SPL
        select OF_CONTROL
        select OF_SEPARATE
        select SPI
@@ -985,6 +988,8 @@ config ARCH_SOCFPGA
        imply FAT_WRITE
        imply SPL
        imply SPL_DM
+       imply SPL_DM_SPI
+       imply SPL_DM_SPI_FLASH
        imply SPL_LIBDISK_SUPPORT
        imply SPL_MMC_SUPPORT
        imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
@@ -1093,6 +1098,8 @@ config ARCH_ZYNQ
        select SPL_BOARD_INIT if SPL
        select SPL_CLK if SPL
        select SPL_DM if SPL
+       select SPL_DM_SPI if SPL
+       select SPL_DM_SPI_FLASH if SPL
        select SPL_OF_CONTROL if SPL
        select SPL_SEPARATE_BSS if SPL
        select SUPPORT_SPL
@@ -1131,6 +1138,8 @@ config ARCH_ZYNQMP
        select OF_CONTROL
        select SPL_BOARD_INIT if SPL
        select SPL_CLK if SPL
+       select SPL_DM_SPI if SPI
+       select SPL_DM_SPI_FLASH if SPL_DM_SPI
        select SPL_DM_MAILBOX if SPL
        select SPL_FIRMWARE if SPL
        select SPL_SEPARATE_BSS if SPL
@@ -1680,6 +1689,8 @@ config ARCH_ROCKCHIP
        select OF_CONTROL
        select SPI
        select SPL_DM if SPL
+       select SPL_DM_SPI if SPL
+       select SPL_DM_SPI_FLASH if SPL
        select SYS_MALLOC_F
        select SYS_THUMB_BUILD if !ARM64
        imply ADC
index 5a998e37d8a612c0ea3f01d5673514b90a85a74c..440838c1124f5213ebfba82dcac2fa72015389fa 100644 (file)
@@ -34,7 +34,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 /* FIXME gpio code here need to handle through DM_GPIO */
-#ifndef CONFIG_DM_SPI
+#if !CONFIG_IS_ENABLED(DM_SPI)
 int spi_cs_is_valid(unsigned int bus, unsigned int cs)
 {
        return bus == 0 && cs == 0;
@@ -167,7 +167,7 @@ int board_init(void)
        /* adress of boot parameters */
        gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
-#ifndef CONFIG_DM_SPI
+#if !CONFIG_IS_ENABLED(DM_SPI)
        vinco_spi0_hw_init();
 #endif
 
index d18f6a888ce48c6ec142e7c658a828668d3c079e..c0d6a8f8a06f00040a332f93b789188729a7ec30 100644 (file)
--- a/cmd/sf.c
+++ b/cmd/sf.c
@@ -91,7 +91,7 @@ static int do_spi_flash_probe(int argc, char *const argv[])
        unsigned int speed = CONFIG_SF_DEFAULT_SPEED;
        unsigned int mode = CONFIG_SF_DEFAULT_MODE;
        char *endp;
-#ifdef CONFIG_DM_SPI_FLASH
+#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
        struct udevice *new, *bus_dev;
        int ret;
 #else
@@ -124,7 +124,7 @@ static int do_spi_flash_probe(int argc, char *const argv[])
                        return -1;
        }
 
-#ifdef CONFIG_DM_SPI_FLASH
+#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
        /* Remove the old device, otherwise probe will just be a nop */
        ret = spi_find_bus_and_cs(bus, cs, &bus_dev, &new);
        if (!ret) {
index aec912167c675a0dd56cbf2ad358024ea97c120a..4aea19141290f09ccfe559650849af0268eef935 100644 (file)
--- a/cmd/spi.c
+++ b/cmd/spi.c
@@ -38,7 +38,7 @@ static int do_spi_xfer(int bus, int cs)
        struct spi_slave *slave;
        int ret = 0;
 
-#ifdef CONFIG_DM_SPI
+#if CONFIG_IS_ENABLED(DM_SPI)
        char name[30], *str;
        struct udevice *dev;
 
@@ -63,7 +63,7 @@ static int do_spi_xfer(int bus, int cs)
                goto done;
        ret = spi_xfer(slave, bitlen, dout, din,
                       SPI_XFER_BEGIN | SPI_XFER_END);
-#ifndef CONFIG_DM_SPI
+#if !CONFIG_IS_ENABLED(DM_SPI)
        /* We don't get an error code in this case */
        if (ret)
                ret = -EIO;
@@ -79,7 +79,7 @@ static int do_spi_xfer(int bus, int cs)
        }
 done:
        spi_release_bus(slave);
-#ifndef CONFIG_DM_SPI
+#if !CONFIG_IS_ENABLED(DM_SPI)
        spi_free_slave(slave);
 #endif
 
index 3eae65ebc1997b7ec929154ebf24e9d85f9c5d12..d09e52e88bf14af9c123345b8ad7c67fd402c311 100644 (file)
@@ -756,6 +756,11 @@ config SPL_DM_SPI
        help
          Enable support for SPI DM drivers in SPL.
 
+config SPL_DM_SPI_FLASH
+       bool "Support SPI DM FLASH drivers in SPL"
+       help
+         Enable support for SPI DM flash drivers in SPL.
+
 endif
 if SPL_UBI
 config SPL_UBI_LOAD_BY_VOLNAME
@@ -1092,6 +1097,11 @@ config SPL_SPI_FLASH_SFDP_SUPPORT
         SPI NOR flashes using Serial Flash Discoverable Parameters (SFDP)
         tables as per JESD216 standard in SPL.
 
+config SPL_SPI_FLASH_MTD
+       bool "Support for SPI flash MTD drivers in SPL"
+       help
+         Enable support for SPI flash MTD drivers in SPL.
+
 config SPL_SPI_LOAD
        bool "Support loading from SPI flash"
        help
@@ -1499,6 +1509,16 @@ config TPL_SPI_SUPPORT
          Enable support for using SPI in TPL. See SPL_SPI_SUPPORT for
          details.
 
+config TPL_DM_SPI
+       bool "Support SPI DM drivers in TPL"
+       help
+         Enable support for SPI DM drivers in TPL.
+
+config TPL_DM_SPI_FLASH
+       bool "Support SPI DM FLASH drivers in TPL"
+       help
+         Enable support for SPI DM flash drivers in TPL.
+
 config TPL_YMODEM_SUPPORT
        bool "Support loading using Ymodem"
        depends on TPL_SERIAL_SUPPORT
index 7c907fd3f496169b41257e77a5b147a95ffe5e22..cefed5b060032d54d7b0cf5ee698f2638788bf99 100644 (file)
@@ -78,6 +78,7 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
 CONFIG_SPI_FLASH_SPANSION=y
@@ -96,6 +97,7 @@ CONFIG_DM_SCSI=y
 CONFIG_DM_SERIAL=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
+CONFIG_SPL_DM_SPI=y
 CONFIG_TI_QSPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
index 81bac5592eb61839f990ab96f1b0dc9af7d3d848..081a48f03807cbd4694e6ff098487534f2636d7e 100644 (file)
@@ -74,6 +74,7 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
 CONFIG_SPI_FLASH_SPANSION=y
@@ -92,6 +93,7 @@ CONFIG_DM_SCSI=y
 CONFIG_DM_SERIAL=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
+CONFIG_SPL_DM_SPI=y
 CONFIG_TI_QSPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
index ea5215e8cf3aba8c23278f187134d38a76555b0e..154154c68fb05a03bb7753bfc166b8421bfa1426 100644 (file)
@@ -80,6 +80,7 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
 CONFIG_SPI_FLASH_BAR=y
@@ -99,6 +100,7 @@ CONFIG_DM_REGULATOR_PALMAS=y
 CONFIG_DM_SERIAL=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
+CONFIG_SPL_DM_SPI=y
 CONFIG_TI_QSPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
index 9d97a488db259ebbb11c075039eec39ff0cfb195..3f2f4e45e329fd7f8abb84b966bcf65f7364a710 100644 (file)
@@ -37,6 +37,7 @@ CONFIG_SPL_DMA=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_DM_MAILBOX=y
 CONFIG_SPL_MTD_SUPPORT=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_DM_RESET=y
 CONFIG_SPL_POWER_DOMAIN=y
 # CONFIG_SPL_SPI_FLASH_TINY is not set
index 1e7a7d1e6eec46aceafedd91c847bd03a178b432..14466465ab450e0f2d8e604247b4b082a3fb233b 100644 (file)
@@ -33,6 +33,7 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x400
 CONFIG_SPL_DMA=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_DM_MAILBOX=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_DM_RESET=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_POWER_DOMAIN=y
index 49fe5a5b6dad9d73d5370273c083f270a9748b0a..373eb4b009330a6ca9c425151ea8bd579a1b3759 100644 (file)
@@ -40,6 +40,7 @@ CONFIG_SPL_DMA=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_DM_MAILBOX=y
 CONFIG_SPL_MTD_SUPPORT=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_DM_RESET=y
 CONFIG_SPL_POWER_DOMAIN=y
 # CONFIG_SPL_SPI_FLASH_TINY is not set
index 9977e97f2b0513dc994f21a740b03adf93270226..6e83f33379389435472dea97dfb87917e8cd8295 100644 (file)
@@ -35,6 +35,7 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x400
 CONFIG_SPL_DMA=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_DM_MAILBOX=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_DM_RESET=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_POWER_DOMAIN=y
index 6a3336c256b6f3215c11d776a18e1cc3f70ecddf..ce3ad9f8b486f87f3370433952a4fde69e3fff9a 100644 (file)
@@ -65,6 +65,8 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
+CONFIG_SPL_DM_SPI=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
index aea67c25dc201b5e3d6004e6ff27a86fa5d3533d..be527fd7257229f9a2c28a8d68523530bbce5c1f 100644 (file)
@@ -39,6 +39,7 @@ CONFIG_SPL_SEPARATE_BSS=y
 # CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set
 CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_NAND_SUPPORT is not set
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
index c4eb03bde07c595bca5a86d1c6ebc0573b6c2bf0..3bfe882c98ec197aba108b797c5078e8f8210227 100644 (file)
@@ -33,6 +33,7 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL_BOARD_INIT=y
 # CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set
 CONFIG_SPL_I2C_SUPPORT=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
index aac8d17876bd87fbb42babbcbc72b1ecf11e77db..a7778674c0f50abd8f5ad96754b7312357a8f3e5 100644 (file)
@@ -39,6 +39,7 @@ CONFIG_SPL_SEPARATE_BSS=y
 # CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set
 CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_NAND_SUPPORT is not set
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_SPL_YMODEM_SUPPORT=y
index 6cc3a8469febdbffa36f490d878b0b9653e1ffc1..79f9b5a2321d5fda909a6f32652fcb8fd3a0aa20 100644 (file)
@@ -37,6 +37,7 @@ CONFIG_HANDOFF=y
 CONFIG_TPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_CPU_SUPPORT=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_PCI=y
 # CONFIG_SPL_SPI_FLASH_TINY is not set
 CONFIG_HUSH_PARSER=y
index a80225a11f3aac20c6688d2f046f4204b384ac90..3e760e75ddda0a5ca405fc94654aeec67698484c 100644 (file)
@@ -31,6 +31,8 @@ CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_CPU_SUPPORT=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
+CONFIG_SPL_DM_SPI=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_NET_SUPPORT=y
 CONFIG_SPL_PCI=y
 CONFIG_SPL_PCH_SUPPORT=y
index 95c9b6e6af53d78b81b8a2013c633c530f2dc3d0..422bcfd8af4136984a5babe901a2be7f368393da 100644 (file)
@@ -32,11 +32,15 @@ CONFIG_BLOBLIST_SIZE=0x1000
 CONFIG_BLOBLIST_ADDR=0xff7c0000
 CONFIG_HANDOFF=y
 CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SPL_DM_SPI=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_NET_SUPPORT=y
 CONFIG_SPL_PCI=y
 CONFIG_SPL_PCH_SUPPORT=y
 CONFIG_TPL_PCI=y
 CONFIG_TPL_PCH_SUPPORT=y
+CONFIG_TPL_DM_SPI=y
+CONFIG_TPL_DM_SPI_FLASH=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
 CONFIG_CMD_GPIO=y
index 4232aaca002e4d88bf3e3d02458a478d9ddebed7..98c50954b6bd37966425c2ebefaea080b7d79613 100644 (file)
@@ -31,6 +31,7 @@ CONFIG_SPL_FS_EXT4=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_MTD_SUPPORT=y
 # CONFIG_SPL_NAND_SUPPORT is not set
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_SYS_PROMPT="CM-T43 # "
index 12768065f3ab51febb322b446b6e773e9917be90..2e87637f7e4d4b91b8fb226dc51c02ecaff334dc 100644 (file)
@@ -30,6 +30,7 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_SEPARATE_BSS=y
 # CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot > "
index f117077111e6faf4ad8fa9409e88edbff674aef6..022dfaeb3784d477b1f7c0617be13013feefd625 100644 (file)
@@ -84,6 +84,7 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
 CONFIG_SPI_FLASH_SPANSION=y
@@ -106,6 +107,7 @@ CONFIG_DM_SCSI=y
 CONFIG_DM_SERIAL=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
+CONFIG_SPL_DM_SPI=y
 CONFIG_TI_QSPI=y
 CONFIG_TIMER=y
 CONFIG_OMAP_TIMER=y
index 6fa117cfae0f9d1444c1c7fe82d9aafe3dcfb2e8..e15f62eded9881497f9d6030617e859b4a8288dd 100644 (file)
@@ -87,6 +87,7 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
 CONFIG_SPI_FLASH_SPANSION=y
@@ -109,6 +110,7 @@ CONFIG_DM_SCSI=y
 CONFIG_DM_SERIAL=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
+CONFIG_SPL_DM_SPI=y
 CONFIG_TI_QSPI=y
 CONFIG_TIMER=y
 CONFIG_OMAP_TIMER=y
index 53cf7047553e2a04b43f96f44e30c4af2c14c27e..91e286189236e1cb4ddbfb65478affac31b0979a 100644 (file)
@@ -84,6 +84,7 @@ CONFIG_SPL_MMC_HS200_SUPPORT=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
 CONFIG_SPI_FLASH_BAR=y
@@ -106,6 +107,7 @@ CONFIG_DM_SCSI=y
 CONFIG_DM_SERIAL=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
+CONFIG_SPL_DM_SPI=y
 CONFIG_TI_QSPI=y
 CONFIG_TIMER=y
 CONFIG_OMAP_TIMER=y
index 592f3e387cc02b981658a2c8d40da83eb1c5e474..0001f468ddd43fe71f3ce397d7dc70b6de4526da 100644 (file)
@@ -33,6 +33,7 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0
 CONFIG_SUPPORT_EMMC_BOOT_OVERRIDE_PART_CONFIG=y
 CONFIG_SPL_DMA=y
 CONFIG_SPL_MMC_TINY=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_HUSH_PARSER=y
index 9bf07570b14aed22ce641c75816e88e7ca658a91..7c7b9905f94f7a72038da7d84081d897e72d6e23 100644 (file)
@@ -121,6 +121,7 @@ CONFIG_FLASH_CFI_MTD=y
 CONFIG_SYS_FLASH_CFI=y
 CONFIG_HBMC_AM654=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 # CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
 CONFIG_SPI_FLASH_MTD=y
@@ -147,6 +148,7 @@ CONFIG_DM_SERIAL=y
 CONFIG_SOC_TI=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
+CONFIG_SPL_DM_SPI=y
 CONFIG_CADENCE_QSPI=y
 CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
index c597f83092387f9bc5c0353c804d95394b12ba9a..822d1fc48699ef47b295544aefdea4fcfc4fdd3e 100644 (file)
@@ -90,6 +90,7 @@ CONFIG_SPL_MMC_SDHCI_ADMA=y
 CONFIG_MMC_SDHCI_AM654=y
 CONFIG_MTD=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PINCTRL=y
@@ -113,6 +114,7 @@ CONFIG_DM_SERIAL=y
 CONFIG_SOC_TI=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
+CONFIG_SPL_DM_SPI=y
 CONFIG_CADENCE_QSPI=y
 CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
index ef4b1149e5c334e05a5641af04d598c0ba6a8f6f..0bfa4ff23d402c48ccb2fe49e47b2aa75dd0f341 100644 (file)
@@ -35,6 +35,7 @@ CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_DM_MAILBOX=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_DM_RESET=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_POWER_DOMAIN=y
index 7bdf3401a1a52198e1f54b1ad80e21ec7069f9dd..b1ee47557544a299cf134b2dda00e4eb22922fb0 100644 (file)
@@ -34,6 +34,7 @@ CONFIG_SPL_DMA=y
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_DM_MAILBOX=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_DM_RESET=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_POWER_DOMAIN=y
index ae07f860e3a7113162f8ce1ff3d57a24d88e9f7b..f37644fe2cfd6fceb1f2a8b39af0aca13ae26416 100644 (file)
@@ -24,6 +24,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL_I2C_SUPPORT=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_CMD_MX_CYCLIC=y
index 9f992055caef0431396b819f8b46f132b31dc656..a14db7db399cf7cbf9e128d8c889045721fd6efe 100644 (file)
@@ -24,6 +24,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL_I2C_SUPPORT=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_CMD_MX_CYCLIC=y
index 3311587c2c15173d2b4c45829035d4adeb8c1578..7180c23cc2628d0835b8e34aea05e6ae17680f74 100644 (file)
@@ -24,6 +24,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL_I2C_SUPPORT=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_CMD_MX_CYCLIC=y
index 85ceeb480ad0878a2a0debf84de9eea8e580b954..f0bf8abaeee3d37fb6e32fdb8afec9c54f46e291 100644 (file)
@@ -23,6 +23,7 @@ CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
+CONFIG_CMD_SF=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="ls1021a-iot-duart"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
@@ -50,6 +51,7 @@ CONFIG_DM_SCSI=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
+CONFIG_SPL_DM_SPI=y
 CONFIG_FSL_DSPI=y
 CONFIG_FSL_QSPI=y
 CONFIG_USB=y
index 11ccf57aad1c95cbdff59708bee5e3a4c92f315a..9c5dd8a5a165e313803de42af29ebf9ce25e66e9 100644 (file)
@@ -28,6 +28,7 @@ CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
+CONFIG_CMD_SF=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="ls1021a-iot-duart"
@@ -56,6 +57,7 @@ CONFIG_DM_SCSI=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
+CONFIG_SPL_DM_SPI=y
 CONFIG_FSL_DSPI=y
 CONFIG_FSL_QSPI=y
 CONFIG_USB=y
index f91534cfdd60820395738a0cc5bd022760dec1b1..0542c5c3036dafde7bf2d4c5c2882474a2bddce0 100644 (file)
@@ -64,6 +64,7 @@ CONFIG_DM_SCSI=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
+CONFIG_SPL_DM_SPI=y
 CONFIG_FSL_DSPI=y
 CONFIG_FSL_QSPI=y
 CONFIG_USB=y
index 9871c8edf446771b1b270a6be081f83d7fc2726d..fd499175059cde60767a11687d5cb3971e9c19d6 100644 (file)
@@ -76,6 +76,7 @@ CONFIG_DM_SCSI=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
+CONFIG_SPL_DM_SPIy=y
 CONFIG_FSL_DSPI=y
 CONFIG_FSL_QSPI=y
 CONFIG_USB=y
index 4c82d6689988619be8c5c782db7ac0ec1b6cda94..8ef058933420f47796dffdb794668c371762bfe6 100644 (file)
@@ -62,6 +62,7 @@ CONFIG_DM_SCSI=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
+CONFIG_SPI_DM_SPI=y
 CONFIG_FSL_DSPI=y
 CONFIG_FSL_QSPI=y
 CONFIG_USB=y
index a5be09b2ba1cf5a8f1c140b80636e7600c078803..ec126b2d9ae1260c5563bd9b8f0167d68a03c578 100644 (file)
@@ -32,6 +32,7 @@ CONFIG_PCI_INIT_R=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_CPU_SUPPORT=y
 CONFIG_SPL_ENV_SUPPORT=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_NET_SUPPORT=y
 CONFIG_SPL_PCI=y
 CONFIG_SPL_PCH_SUPPORT=y
index 58b906ad5923422e41342b76edb1910a7183c9e5..cf949cd7419e302a947ea0a091fe4c6fe54ecd87 100644 (file)
@@ -33,6 +33,7 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_DISPLAY_PRINT=y
 # CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_SPL_AT91_MCK_BYPASS=y
 CONFIG_HUSH_PARSER=y
index e5227b11f50b5c7c604de3a90188a8a2858e0d53..320175b517a8afea73e534bfe2229c8292ea786a 100644 (file)
@@ -67,6 +67,8 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ATMEL=y
 CONFIG_MTD=y
+CONFIG_SPL_DM_SPI=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
index b3bc4b4fe593f9ca00e43903516d8e3540bff8bc..8db078abaf7366d72df5cfb6a9c09594b9adb50c 100644 (file)
@@ -23,6 +23,7 @@ CONFIG_DEBUG_UART_CLOCK=132000000
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_SPL_TEXT_BASE=0x300000
+CONFIG_SPL_DM_SPI=y
 CONFIG_DEBUG_UART=y
 CONFIG_ENV_VARS_UBOOT_CONFIG=y
 CONFIG_FIT=y
@@ -31,6 +32,7 @@ CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,768k(uboot)ro,256K(env_redundant),256k(env),512k(dtb),6M(kernel)ro,-(rootfs) rootfstype=ubifs ubi.mtd=6 root=ubi0:rootfs"
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
index 2799b69a5d2fd68a2daa25faa9ef5467d260d5fe..4239c050304dd0445c7ae12949507ae70e948648 100644 (file)
@@ -68,6 +68,7 @@ CONFIG_MTD_RAW_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_DM_ETH=y
@@ -80,6 +81,7 @@ CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
+CONFIG_SPL_DM_SPI=y
 CONFIG_TIMER=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
index 4b7e825ce022a7d4496fb6cb935db761aff4d040..3e5b2fd8b6164def0e0c66dbc12b5af8c9a06ebd 100644 (file)
@@ -65,6 +65,7 @@ CONFIG_MTD_RAW_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=y
 CONFIG_DM_ETH=y
@@ -77,6 +78,7 @@ CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_ATMEL_USART=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
+CONFIG_SPL_DM_SPI=y
 CONFIG_TIMER=y
 CONFIG_SPL_TIMER=y
 CONFIG_ATMEL_PIT_TIMER=y
index 668cd434f1e11f93e4c5f1af4e4b008809fe559c..f0abc89a43bb999e5edfec957dd3d002c1f638e9 100644 (file)
@@ -91,6 +91,7 @@ CONFIG_MTD_RAW_NAND=y
 CONFIG_NAND_STM32_FMC2=y
 CONFIG_MTD_SPI_NAND=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
@@ -121,6 +122,7 @@ CONFIG_RTC_STM32=y
 CONFIG_SERIAL_RX_BUFFER=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
+CONFIG_SPL_DM_SPI=y
 CONFIG_STM32_QSPI=y
 CONFIG_STM32_SPI=y
 CONFIG_USB=y
index 1ac07c5865b880a956ec342caab5defba154e26e..be5926d03a83f68652b3dda472e39533f101c83b 100644 (file)
@@ -93,6 +93,7 @@ CONFIG_STM32_SDMMC2=y
 CONFIG_MTD=y
 CONFIG_SYS_MTDPARTS_RUNTIME=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
index 225d04497948ffa0a76d6b9d482d4a473d26a740..0344f07daeeb995ab10b8ae06b0131e2a947a132 100644 (file)
@@ -89,6 +89,7 @@ CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_STM32_SDMMC2=y
 CONFIG_MTD=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
index 953f7784be422b43961807d067b42ae1cc5198c8..229c97ead5a2bab2cabc08217e78e76f2c24bb69 100644 (file)
@@ -73,6 +73,8 @@ CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
 # CONFIG_SYS_NAND_USE_FLASH_BBT is not set
 CONFIG_NAND_ATMEL=y
+CONFIG_SPL_DM_SPI=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
index b5dfa300de49c9563252ef3fda7ad4bbd75c549a..952fd1e45a17ecd75c85d037252c9f07cf09c422 100644 (file)
@@ -3,7 +3,7 @@
 # (C) Copyright 2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 
-obj-$(CONFIG_DM_SPI_FLASH) += sf-uclass.o
+obj-$(CONFIG_$(SPL_TPL_)DM_SPI_FLASH) += sf-uclass.o
 spi-nor-y := sf_probe.o spi-nor-ids.o
 
 ifdef CONFIG_SPL_BUILD
@@ -19,5 +19,5 @@ endif
 
 obj-$(CONFIG_SPI_FLASH) += spi-nor.o
 obj-$(CONFIG_SPI_FLASH_DATAFLASH) += sf_dataflash.o
-obj-$(CONFIG_$(SPL_)SPI_FLASH_MTD) += sf_mtd.o
+obj-$(CONFIG_$(SPL_TPL_)SPI_FLASH_MTD) += sf_mtd.o
 obj-$(CONFIG_SPI_FLASH_SANDBOX) += sandbox.o
index 3548d6319b305f491816bf81c0486cd99fc404ff..afda241dd067a7337ecd588979962594466c38cb 100644 (file)
@@ -53,7 +53,7 @@ err_read_id:
        return ret;
 }
 
-#ifndef CONFIG_DM_SPI_FLASH
+#if !CONFIG_IS_ENABLED(DM_SPI_FLASH)
 struct spi_flash *spi_flash_probe(unsigned int busnum, unsigned int cs,
                                  unsigned int max_hz, unsigned int spi_mode)
 {
index 8ab18163954ca79a1ec8ecfab124e37321d32dfa..bbb1738c4bdcba9fa88f12e5751e13361b08243c 100644 (file)
@@ -383,7 +383,7 @@ int fm_init_common(int index, struct ccsr_fman *reg)
                addr = malloc(CONFIG_SYS_QE_FMAN_FW_LENGTH);
                int ret = 0;
 
-#ifdef CONFIG_DM_SPI_FLASH
+#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
                struct udevice *new;
 
                /* speed and mode will be read from DT */
@@ -470,7 +470,7 @@ int fm_init_common(int index, struct ccsr_fman *reg)
        void *addr = malloc(CONFIG_SYS_QE_FMAN_FW_LENGTH);
        int ret = 0;
 
-#ifdef CONFIG_DM_SPI_FLASH
+#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
        struct udevice *new;
 
        /* speed and mode will be read from DT */
index 54881a74124db14303572499a986f9d648f675ea..9559e938d26281ed4de00715f4d37ada13f1f7a5 100644 (file)
@@ -4,7 +4,7 @@
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 
 # There are many options which enable SPI, so make this library available
-ifdef CONFIG_DM_SPI
+ifdef CONFIG_$(SPL_TPL_)DM_SPI
 obj-y += spi-uclass.o
 obj-$(CONFIG_SANDBOX) += spi-emul-uclass.o
 obj-$(CONFIG_SOFT_SPI) += soft_spi.o
index 3986b06b25ce2c96a451c54705e9698c1a01c73f..c03923f87494986b37abbc7c1bb25500b2e0560f 100644 (file)
@@ -94,7 +94,7 @@ static int _spi_xfer(struct kwspi_registers *reg, unsigned int bitlen,
        return 0;
 }
 
-#ifndef CONFIG_DM_SPI
+#if !CONFIG_IS_ENABLED(DM_SPI)
 
 static struct kwspi_registers *spireg =
        (struct kwspi_registers *)MVEBU_SPI_BASE;
index f52ebf4d67c47d3cd83b5b902676f6e110fb496f..aad37803655f539120e430141b8e17b049d40ceb 100644 (file)
@@ -67,7 +67,7 @@ static inline struct mxc_spi_slave *to_mxc_spi_slave(struct spi_slave *slave)
 
 static void mxc_spi_cs_activate(struct mxc_spi_slave *mxcs)
 {
-#if defined(CONFIG_DM_SPI)
+#if CONFIG_IS_ENABLED(DM_SPI)
        struct udevice *dev = mxcs->dev;
        struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
 
@@ -85,7 +85,7 @@ static void mxc_spi_cs_activate(struct mxc_spi_slave *mxcs)
 
 static void mxc_spi_cs_deactivate(struct mxc_spi_slave *mxcs)
 {
-#if defined(CONFIG_DM_SPI)
+#if CONFIG_IS_ENABLED(DM_SPI)
        struct udevice *dev = mxcs->dev;
        struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
 
@@ -415,7 +415,7 @@ static int mxc_spi_claim_bus_internal(struct mxc_spi_slave *mxcs, int cs)
        return 0;
 }
 
-#ifndef CONFIG_DM_SPI
+#if !CONFIG_IS_ENABLED(DM_SPI)
 int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
                void *din, unsigned long flags)
 {
index 6a615d1498e3f03994b0f0735bf4d67d74b802d3..ae08531f1ed22d7fd3b5dee5a878f70efcdb7281 100644 (file)
@@ -109,7 +109,7 @@ struct mcspi {
 };
 
 struct omap3_spi_priv {
-#ifndef CONFIG_DM_SPI
+#if !CONFIG_IS_ENABLED(DM_SPI)
        struct spi_slave slave;
 #endif
        struct mcspi *regs;
@@ -455,7 +455,7 @@ static void _omap3_spi_claim_bus(struct omap3_spi_priv *priv)
        writel(conf, &priv->regs->modulctrl);
 }
 
-#ifndef CONFIG_DM_SPI
+#if !CONFIG_IS_ENABLED(DM_SPI)
 
 static inline struct omap3_spi_priv *to_omap3_spi(struct spi_slave *slave)
 {
index 2839dd1cebd5be592a4a3ecda6f3ca399235a8ea..aa1c03047e286c53bdcc7065b0522664193f1ddf 100644 (file)
@@ -68,7 +68,7 @@ struct sh_qspi_regs {
 };
 
 struct sh_qspi_slave {
-#ifndef CONFIG_DM_SPI
+#if !CONFIG_IS_ENABLED(DM_SPI)
        struct spi_slave        slave;
 #endif
        struct sh_qspi_regs     *regs;
@@ -223,7 +223,7 @@ static int sh_qspi_xfer_common(struct sh_qspi_slave *ss, unsigned int bitlen,
        return ret;
 }
 
-#ifndef CONFIG_DM_SPI
+#if !CONFIG_IS_ENABLED(DM_SPI)
 static inline struct sh_qspi_slave *to_sh_qspi(struct spi_slave *slave)
 {
        return container_of(slave, struct sh_qspi_slave, slave);
index 02ed846fc73d0ce892641aedaf708c530f3bd842..3e524f294794f14f52f0b3d28023405730d79f97 100644 (file)
--- a/env/sf.c
+++ b/env/sf.c
@@ -38,7 +38,7 @@ static struct spi_flash *env_flash;
 
 static int setup_flash_device(void)
 {
-#ifdef CONFIG_DM_SPI_FLASH
+#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
        struct udevice *new;
        int     ret;
 
index 5cc6d6e0087fa5b00eff5d9489ff4838cf2e0a6a..9b4fb8dc0b28418941ee009694f9402b36cbe6f0 100644 (file)
@@ -39,7 +39,7 @@
 
 #define SPI_DEFAULT_WORDLEN    8
 
-#ifdef CONFIG_DM_SPI
+#if CONFIG_IS_ENABLED(DM_SPI)
 /* TODO(sjg@chromium.org): Remove this and use max_hz from struct spi_slave */
 struct dm_spi_bus {
        uint max_hz;
@@ -131,7 +131,7 @@ enum spi_polarity {
  * @flags:             Indication of SPI flags.
  */
 struct spi_slave {
-#ifdef CONFIG_DM_SPI
+#if CONFIG_IS_ENABLED(DM_SPI)
        struct udevice *dev;    /* struct spi_slave is dev->parentdata */
        uint max_hz;
        uint speed;
@@ -317,7 +317,7 @@ void spi_flash_copy_mmap(void *data, void *offset, size_t len);
  */
 int spi_cs_is_valid(unsigned int bus, unsigned int cs);
 
-#ifndef CONFIG_DM_SPI
+#if !CONFIG_IS_ENABLED(DM_SPI)
 /**
  * Activate a SPI chipselect.
  * This function is provided by the board code when using a driver
@@ -367,7 +367,7 @@ static inline int spi_w8r8(struct spi_slave *slave, unsigned char byte)
        return ret < 0 ? ret : din[1];
 }
 
-#ifdef CONFIG_DM_SPI
+#if CONFIG_IS_ENABLED(DM_SPI)
 
 /**
  * struct spi_cs_info - Information about a bus chip select
index d9b2af856c08feb18adda8934452483800f83bb4..b336619487659f70beac915c2b0138b4b3e4b078 100644 (file)
@@ -39,7 +39,7 @@ struct dm_spi_flash_ops {
 /* Access the serial operations for a device */
 #define sf_get_ops(dev) ((struct dm_spi_flash_ops *)(dev)->driver->ops)
 
-#ifdef CONFIG_DM_SPI_FLASH
+#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
 /**
  * spi_flash_read_dm() - Read data from SPI flash
  *
index 8e417acc5f203665293126c27c4829f3c36cafa0..474008cde0db657887a44a1ff2c2f58ac6937f67 100644 (file)
@@ -117,7 +117,7 @@ static int dm_test_spi_xfer(struct unit_test_state *uts)
         * Since we are about to destroy all devices, we must tell sandbox
         * to forget the emulation device
         */
-#ifdef CONFIG_DM_SPI_FLASH
+#if CONFIG_IS_ENABLED(DM_SPI_FLASH)
        sandbox_sf_unbind_emul(state_get_current(), busnum, cs);
 #endif