u-boot/drivers/mtd
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
..
nand mtd: spinand: toshiba: Support for new Kioxia Serial NAND 2020-05-28 01:24:03 +05:30
onenand common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
spi spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI* 2020-06-29 13:34:43 -04:00
ubi common: Drop linux/bug.h from common header 2020-05-18 21:19:23 -04:00
ubispl common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
altera_qspi.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
cfi_flash.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
cfi_mtd.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
hbmc-am654.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
jedec_flash.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
Kconfig configs: migrate CONFIG_SYS_MTDPARTS_RUNTIME to defconfigs 2020-05-08 09:16:26 -04:00
Makefile mtd: Makefile: deep cleanup 2019-12-04 17:10:51 -05:00
mtd-uclass.c mtd: uclass: add probe function 2018-10-02 22:12:31 +05:30
mtd_uboot.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
mtdconcat.c common: Drop linux/bug.h from common header 2020-05-18 21:19:23 -04:00
mtdcore.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
mtdcore.h mtd: move definitions to enlarge their range 2018-09-20 20:10:49 +05:30
mtdpart.c common: Drop linux/bug.h from common header 2020-05-18 21:19:23 -04:00
mw_eeprom.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
pic32_flash.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
renesas_rpc_hf.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
st_smi.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
stm32_flash.c common: Drop flash.h from common header 2020-05-18 14:53:28 -04:00
stm32_flash.h stm32: stm32f4: move flash driver to mtd driver location 2016-03-26 18:49:28 -04:00