u-boot-brain/env
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
..
Kconfig env: Kconfig: cosmetics: update comment for SYS_RELOC_GD_ENV_ADDR 2020-06-15 11:24:36 -04:00
Makefile env: remove callback.o for an SPL build 2020-04-24 10:09:59 -04:00
attr.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
callback.c make env_entry::callback conditional on !CONFIG_SPL_BUILD 2020-04-24 10:09:59 -04:00
common.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
eeprom.c common: Move old EEPROM functions into a new header 2019-12-02 18:25:25 -05:00
embedded.c env: Finish migration of common ENV options 2019-11-20 18:32:09 -05:00
env.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
ext4.c common: Drop part.h from common header 2020-05-18 17:33:33 -04:00
fat.c common: Drop part.h from common header 2020-05-18 17:33:33 -04:00
flags.c make env_entry::callback conditional on !CONFIG_SPL_BUILD 2020-04-24 10:09:59 -04:00
flash.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
mmc.c part: Drop disk_partition_t typedef 2020-05-18 17:33:33 -04:00
nand.c crc32: Use the crc.h header for crc functions 2019-12-02 18:23:08 -05:00
nowhere.c env: Rename environment.h to env_internal.h 2019-08-11 19:27:31 -04:00
nvram.c env: make file-scope env_ptr variables static 2020-04-17 12:29:43 -04:00
onenand.c env: Rename environment.h to env_internal.h 2019-08-11 19:27:31 -04:00
remote.c env: make file-scope env_ptr variables static 2020-04-17 12:29:43 -04:00
sata.c env: Remove useless CONFIG_ENV_SIZE_REDUND and fix ENV_IS_REDUND check 2019-11-20 18:31:24 -05:00
sf.c spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI* 2020-06-29 13:34:43 -04:00
ubi.c env: Rename environment.h to env_internal.h 2019-08-11 19:27:31 -04:00