u-boot-brain/drivers/spi
Lukasz Majewski 56c4046038 spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI*
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>
2020-06-29 13:34:43 -04:00
..
altera_spi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
atcspi200_spi.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
ath79_spi.c common: Move clock functions into a new file 2020-01-17 13:27:29 -05:00
atmel_spi.c spi: atmel: Drop atmel_spi.h 2020-06-11 15:14:04 +05:30
atmel_spi.h spi: atmel: Remove nondm code 2020-06-11 15:14:04 +05:30
atmel-quadspi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
bcm63xx_hsspi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
bcm63xx_spi.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
bcmstb_spi.c board: arm: Add support for Broadcom BCM7445 2018-07-10 16:55:57 -04:00
cadence_qspi_apb.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
cadence_qspi.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
cadence_qspi.h spi: cadence-qspi: Add direct mode support 2020-01-27 22:27:22 +05:30
cf_spi.c spi Drop spi_init() 2020-06-01 17:55:24 +05:30
davinci_spi.c spi: davinci: Drop non-dm code 2020-06-11 15:14:04 +05:30
designware_spi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
exynos_spi.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
fsl_dspi.c spi: fsl_dspi: Drop nondm code 2020-06-11 15:14:04 +05:30
fsl_espi.c dm: spi: Convert Freescale ESPI driver to driver model 2020-06-18 21:47:08 +05:30
fsl_qspi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
ich.c x86: spi: Rewrite logic for obtaining the SPI memory map 2020-06-02 09:16:13 +08:00
ich.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
Kconfig spi: davinci: Drop non-dm code 2020-06-11 15:14:04 +05:30
kirkwood_spi.c spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI* 2020-06-29 13:34:43 -04:00
Makefile spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI* 2020-06-29 13:34:43 -04:00
meson_spifc.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
mpc8xx_spi.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
mpc8xxx_spi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
mscc_bb_spi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
mt7621_spi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
mtk_snfi_spi.c spi: add spi-mem driver for MediaTek MT7629 SoC 2019-07-25 18:52:12 +05:30
mvebu_a3700_spi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
mxc_spi.c spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI* 2020-06-29 13:34:43 -04:00
mxs_spi.c spi: mxs: Code cleanup 2020-06-11 15:14:03 +05:30
nxp_fspi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
omap3_spi.c spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI* 2020-06-29 13:34:43 -04:00
pic32_spi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
pl022_spi.c dm: platform_data: spi: s/pl022_spi.h/spi_pl022.h 2018-11-27 21:06:46 +05:30
renesas_rpc_spi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
rk_spi.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
rk_spi.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
sandbox_spi.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
sh_qspi.c spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI* 2020-06-29 13:34:43 -04:00
soft_spi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
spi-emul-uclass.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
spi-mem-nodm.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
spi-mem.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
spi-sifive.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
spi-sunxi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
spi-uclass.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
spi.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
stm32_qspi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
stm32_spi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
tegra_spi.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
tegra20_sflash.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
tegra20_slink.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
tegra114_spi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
tegra210_qspi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
ti_qspi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
uniphier_spi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
xilinx_spi.c spi: zynq_[q]spi: Convert config's to macro's 2020-06-24 13:11:08 +02:00
zynq_qspi.c spi: zynq_[q]spi: Convert config's to macro's 2020-06-24 13:11:08 +02:00
zynq_spi.c spi: zynq_[q]spi: Convert config's to macro's 2020-06-24 13:11:08 +02:00
zynqmp_gqspi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00