Skip to contentSkip to conversation

spi: Split CONFIG_DM_SPI* to CONFIG_{SPL_TPL}DM_SPI*

PATCH Superseded Zhiqiang Hou 5 participants 15 messages Jun 2, 2020 – Jun 3, 2020

Subsystems (7)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v4 cover spi: Split CONFIG_DM_SPI* to CONFIG_{SPL_TPL}DM_SPI*

From: Hou Zhiqiang <[email protected]>

Rebased the patch set below, and fixed build warning on ls1046a by removing SPL_DM_SPI from target ls1046 boards.
https://patchwork.ozlabs.org/project/uboot/list/?series=129069&archive=both&state=*

Lukasz Majewski (3):
spi: Move DM_SPI_FLASH to Kconfig (for NXP's ls1043a)
spi: Move DM_SPI_FLASH and SPI_FLASH_DATAFLASH to Kconfig (for

    ls1021aXXX)

spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI*

 arch/arm/Kconfig                            | 21 +++++++++++++++++++--
 board/l+g/vinco/vinco.c                     |  4 ++--
 cmd/sf.c                                    |  4 ++--
 cmd/spi.c                                   |  6 +++---
 common/spl/Kconfig                          | 20 ++++++++++++++++++++
 configs/am57xx_evm_defconfig                |  2 ++
 configs/am57xx_hs_evm_defconfig             |  2 ++
 configs/am57xx_hs_evm_usb_defconfig         |  2 ++
 configs/axm_defconfig                       |  2 ++
 configs/chromebook_link64_defconfig         |  2 ++
 configs/chromebook_samus_tpl_defconfig      |  4 ++++
 configs/dra7xx_evm_defconfig                |  2 ++
 configs/dra7xx_hs_evm_defconfig             |  2 ++
 configs/dra7xx_hs_evm_usb_defconfig         |  2 ++
 configs/j721e_evm_a72_defconfig             |  2 ++
 configs/j721e_evm_r5_defconfig              |  2 ++
 configs/ls1021aiot_qspi_defconfig           |  2 ++
 configs/ls1021aiot_sdcard_defconfig         |  2 ++
 configs/ls1021aqds_qspi_defconfig           |  1 +
 configs/ls1021aqds_sdcard_qspi_defconfig    |  1 +
 configs/ls1021atwr_qspi_defconfig           |  1 +
 configs/sama5d2_xplained_spiflash_defconfig |  2 ++
 configs/sama5d3xek_spiflash_defconfig       |  7 ++++---
 configs/sama5d4_xplained_spiflash_defconfig |  2 ++
 configs/sama5d4ek_spiflash_defconfig        |  2 ++
 configs/stm32mp15_basic_defconfig           |  2 ++
 configs/taurus_defconfig                    |  2 ++
 drivers/mtd/spi/Makefile                    |  4 ++--
 drivers/mtd/spi/sf_probe.c                  |  2 +-
 drivers/net/fm/fm.c                         |  4 ++--
 drivers/spi/Makefile                        |  2 +-
 drivers/spi/atmel_spi.c                     |  4 ++--
 drivers/spi/davinci_spi.c                   |  6 +++---
 drivers/spi/fsl_dspi.c                      |  5 +++--
 drivers/spi/kirkwood_spi.c                  |  2 +-
 drivers/spi/mxc_spi.c                       |  6 +++---
 drivers/spi/omap3_spi.c                     |  4 ++--
 drivers/spi/sh_qspi.c                       |  4 ++--
 env/sf.c                                    |  2 +-
 include/configs/ls1021aiot.h                |  6 ------
 include/configs/ls1021aqds.h                |  5 -----
 include/configs/ls1021atwr.h                |  5 -----
 include/configs/ls1043a_common.h            |  2 --
 include/spi.h                               |  8 ++++----
 include/spi_flash.h                         |  2 +-
 test/dm/spi.c                               |  2 +-
 46 files changed, 120 insertions(+), 58 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH v4 1/3 spi: Move DM_SPI_FLASH to Kconfig (for NXP's ls1043a)

From: Lukasz Majewski <[email protected]>

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.

---
V4:
- Rebase the patch, no change intended.

 arch/arm/Kconfig                 | 4 ++++
 include/configs/ls1043a_common.h | 2 --
 2 files changed, 4 insertions(+), 2 deletions(-)
arch/arm/Kconfig +4 -0
index 21df1c415f..28b8e9354f 100644
@@ -1501,6 +1501,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 && !SPL_NO_DSPI
 	imply SCSI
 	imply SCSI_AHCI
 	help
@@ -1515,6 +1517,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 && !SPL_NO_DSPI
 	help
 	  Support for Freescale LS1043ARDB platform.
 
include/configs/ls1043a_common.h +0 -2
index 985f40412c..0857b15fe0 100644
@@ -176,9 +176,7 @@
 
 /*  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 */
Signature · 1 line
2.17.1
#2 lore raw

PATCH v4 1/3 spi: Move DM_SPI_FLASH to Kconfig (for NXP's ls1043a)

Quoted 44 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Zhiqiang Hou
Sent: Tuesday, June 2, 2020 6:41 PM
To: u-boot at lists.denx.de; lokeshvutla at ti.com; afd at ti.com; hs at denx.de; sjg at chromium.org; feng.li_2 at nxp.com; Alison Wang <[email protected]>; sumit.garg at nxp.com;
eugen.hristev at microchip.com; patrick.delaunay at st.com;
jagan at amarulasolutions.com; vigneshr at ti.com; joe.hershberger at ni.com; sr at denx.de; wd at denx.de; lukma at denx.de; miquel.raynal at bootlin.com; marex at denx.de; bmeng.cn at gmail.com; simon.k.r.goldschmidt at gmail.com; markus.klotzbuecher at kistler.com; baruch at tkos.co.il; hws at denx.de; mrjoel at lixil.net; agust at denx.de; Priyanka Jain <[email protected]>; Madalin Bucur (OSS) <[email protected]>; Gervais, Francois <[email protected]>; Udit Agarwal <[email protected]>
Cc: Z.q. Hou <[email protected]>
Subject: [PATCHv4 1/3] spi: Move DM_SPI_FLASH to Kconfig (for NXP's ls1043a)

From: Lukasz Majewski <[email protected]>

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.

---
V4:
- Rebase the patch, no change intended.

arch/arm/Kconfig | 4 ++++
include/configs/ls1043a_common.h | 2 --

2 files changed, 4 insertions(+), 2 deletions(-)
arch/arm/Kconfig index renamed from arch/arm/Kconfig +0 -0

21df1c415f..28b8e9354f 100644

arch/arm/Kconfig config TARGET_LS1043AQDS · line 1505

Quoted 5 lines
arch/arm/Kconfig +2 -0
@@ -1501,6 +1501,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 && !SPL_NO_DSPI

Since you have already added check for !SPL_NO_DSPI in previous statement, no need to add here.

arch/arm/Kconfig config TARGET_LS1043ARDB · line 1521

Quoted 9 lines
arch/arm/Kconfig +2 -0
 	imply SCSI
 	imply SCSI_AHCI
 	help
@@ -1515,6 +1517,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 && !SPL_NO_DSPI

Since you have already added check for !SPL_NO_DSPI in previous statement, no need to add here.

Quoted 19 lines
arch/arm/Kconfig +0 -0
 	help
 	  Support for Freescale LS1043ARDB platform.
 
include/configs/ls1043a_common.h +0 -3
index 985f40412c..0857b15fe0 100644
@@ -176,9 +176,7 @@
 
 /*  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 */
--
Quoted 1 line

2.17.1

Thanks
Priyanka

author
#3 lore raw

PATCH v4 1/3 spi: Move DM_SPI_FLASH to Kconfig (for NXP's ls1043a)

Hi Priyanka,

Thanks a lot for your comments!

Quoted 58 lines

-----Original Message-----
From: Priyanka Jain (OSS)
Sent: 2020?6?3? 15:20
To: Z.q. Hou <[email protected]>; u-boot at lists.denx.de; lokeshvutla at ti.com; afd at ti.com; hs at denx.de; sjg at chromium.org; feng.li_2 at nxp.com; Alison Wang <[email protected]>;
sumit.garg at nxp.com; eugen.hristev at microchip.com; patrick.delaunay at st.com; jagan at amarulasolutions.com; vigneshr at ti.com; joe.hershberger at ni.com; sr at denx.de; wd at denx.de; lukma at denx.de; miquel.raynal at bootlin.com; marex at denx.de; bmeng.cn at gmail.com; simon.k.r.goldschmidt at gmail.com; markus.klotzbuecher at kistler.com; baruch at tkos.co.il; hws at denx.de; mrjoel at lixil.net; agust at denx.de; Madalin Bucur (OSS) <[email protected]>; Gervais, Francois <[email protected]>; Udit Agarwal <[email protected]>
Cc: Z.q. Hou <[email protected]>
Subject: RE: [PATCHv4 1/3] spi: Move DM_SPI_FLASH to Kconfig (for NXP's ls1043a)

Quoted 5 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Zhiqiang Hou
Sent: Tuesday, June 2, 2020 6:41 PM
To: u-boot at lists.denx.de; lokeshvutla at ti.com; afd at ti.com; hs at denx.de; sjg at chromium.org; feng.li_2 at nxp.com; Alison Wang

<[email protected]>;

Quoted 34 lines

sumit.garg at nxp.com; eugen.hristev at microchip.com; patrick.delaunay at st.com; jagan at amarulasolutions.com; vigneshr at ti.com; joe.hershberger at ni.com; sr at denx.de; wd at denx.de; lukma at denx.de; miquel.raynal at bootlin.com; marex at denx.de; bmeng.cn at gmail.com; simon.k.r.goldschmidt at gmail.com; markus.klotzbuecher at kistler.com; baruch at tkos.co.il; hws at denx.de; mrjoel at lixil.net; agust at denx.de; Priyanka Jain <[email protected]>; Madalin Bucur (OSS) <[email protected]>; Gervais, Francois <[email protected]>; Udit Agarwal <[email protected]>
Cc: Z.q. Hou <[email protected]>
Subject: [PATCHv4 1/3] spi: Move DM_SPI_FLASH to Kconfig (for NXP's ls1043a)

From: Lukasz Majewski <[email protected]>

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.

---
V4:
- Rebase the patch, no change intended.

arch/arm/Kconfig | 4 ++++
include/configs/ls1043a_common.h | 2 --

2 files changed, 4 insertions(+), 2 deletions(-)
Quoted 12 lines

arch/arm/Kconfig config TARGET_LS1043AQDS · line 1505

Quoted 10 lines
arch/arm/Kconfig index renamed from arch/arm/Kconfig +0 -0

21df1c415f..28b8e9354f 100644

arch/arm/Kconfig +2 -0
@@ -1501,6 +1501,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 && !SPL_NO_DSPI

Since you have already added check for !SPL_NO_DSPI in previous statement, no need to add here.

Make sense, will drop the redundant condition in next version.

Quoted 11 lines

arch/arm/Kconfig config TARGET_LS1043ARDB · line 1521

Quoted 9 lines
arch/arm/Kconfig +2 -0
 	imply SCSI
 	imply SCSI_AHCI
 	help
@@ -1515,6 +1517,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 && !SPL_NO_DSPI

Since you have already added check for !SPL_NO_DSPI in previous statement, no need to add here.

Ditto.

Thanks,
Zhiqiang

Quoted 22 lines
Quoted 19 lines
arch/arm/Kconfig +0 -0
 	help
 	  Support for Freescale LS1043ARDB platform.
 
include/configs/ls1043a_common.h +0 -3
index 985f40412c..0857b15fe0 100644
@@ -176,9 +176,7 @@
 
 /*  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 */
--
Quoted 1 line

2.17.1

Thanks
Priyanka

#4 lore raw

PATCH v4 2/3 spi: Move DM_SPI_FLASH and SPI_FLASH_DATAFLASH to Kconfig (for ls1021aXXX)

In reply to Zhiqiang Hou

From: Lukasz Majewski <[email protected]>

This patch moves the CONFIG_DM_SPI_FLASH and CONFIG_SPI_FLASH_DATAFLASH to be defined in Kconfig, not in board specific header file (include/configs/<board>.h).

Before this change the CONFIG_DM_SPI_FLASH was not set in .config (so it was not possible to use CONFIG_IS_ENABLED(DM_SPI_FLASH) in SPI DM/DTS converted drivers), but it was set in u-boot.cfg file.

---
V4:
- Rebase the patch, no change intended.

 arch/arm/Kconfig             | 6 ++++--
 include/configs/ls1021aiot.h | 6 ------
 include/configs/ls1021aqds.h | 5 -----
 include/configs/ls1021atwr.h | 5 -----
 4 files changed, 4 insertions(+), 18 deletions(-)
arch/arm/Kconfig +4 -2
index 28b8e9354f..053e169e2c 100644
@@ -1447,6 +1447,8 @@ config TARGET_LS1021AQDS
 	select SUPPORT_SPL
 	select SYS_FSL_DDR
 	select FSL_DDR_INTERACTIVE
+	select DM_SPI_FLASH if FSL_DSPI || FSL_QSPI
+	select SPI_FLASH_DATAFLASH if FSL_DSPI || FSL_QSPI
 	imply SCSI
 
 config TARGET_LS1021ATWR
@@ -1460,6 +1462,7 @@ config TARGET_LS1021ATWR
 	select CPU_V7_HAS_VIRT
 	select LS1_DEEP_SLEEP
 	select SUPPORT_SPL
+	select DM_SPI_FLASH if FSL_DSPI || FSL_QSPI
 	imply SCSI
 
 config TARGET_LS1021ATSN
@@ -1484,6 +1487,7 @@ config TARGET_LS1021AIOT
 	select CPU_V7_HAS_NONSEC
 	select CPU_V7_HAS_VIRT
 	select SUPPORT_SPL
+	select DM_SPI_FLASH if FSL_DSPI || FSL_QSPI
 	imply SCSI
 	help
 	  Support for Freescale LS1021AIOT platform.
@@ -1935,5 +1939,3 @@ config SPL_LDSCRIPT
 	default "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds" if (ARCH_MX23 || ARCH_MX28) && !SPL_FRAMEWORK
 	default "arch/arm/cpu/arm1136/u-boot-spl.lds" if CPU_ARM1136
 	default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARM64
-
-
include/configs/ls1021aiot.h +0 -6
index 6e94a2a4c9..8993fb2267 100644
@@ -139,12 +139,6 @@
 #define CONFIG_SPI_FLASH_SPANSION
 #endif
 
-/* DM SPI */
-#if defined(CONFIG_FSL_DSPI) || defined(CONFIG_FSL_QSPI)
-#define CONFIG_CMD_SF
-#define CONFIG_DM_SPI_FLASH
-#endif
-
 /*
  * eTSEC
  */
include/configs/ls1021aqds.h +0 -5
index e069467b53..0779b595c3 100644
@@ -363,11 +363,6 @@ unsigned long get_board_ddr_clk(void);
  * MMC
  */
 
-/* DM SPI */
-#if defined(CONFIG_FSL_DSPI) || defined(CONFIG_FSL_QSPI)
-#define CONFIG_DM_SPI_FLASH
-#endif
-
 /*
  * Video
  */
include/configs/ls1021atwr.h +0 -5
index 53a10ba4dd..16c30d09dc 100644
@@ -234,11 +234,6 @@
  * MMC
  */
 
-/* DM SPI */
-#if defined(CONFIG_FSL_DSPI) || defined(CONFIG_FSL_QSPI)
-#define CONFIG_DM_SPI_FLASH
-#endif
-
 /*
  * Video
  */
Signature · 1 line
2.17.1
#5 lore raw

PATCH v4 3/3 spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI*

In reply to Zhiqiang Hou

From: Lukasz Majewski <[email protected]>

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.

---
V4:
- Rebase the patch and remove SPL_DM_SPI from target ls1046 boards.

 arch/arm/Kconfig                            | 11 +++++++++++
 board/l+g/vinco/vinco.c                     |  4 ++--
 cmd/sf.c                                    |  4 ++--
 cmd/spi.c                                   |  6 +++---
 common/spl/Kconfig                          | 20 ++++++++++++++++++++
 configs/am57xx_evm_defconfig                |  2 ++
 configs/am57xx_hs_evm_defconfig             |  2 ++
 configs/am57xx_hs_evm_usb_defconfig         |  2 ++
 configs/axm_defconfig                       |  2 ++
 configs/chromebook_link64_defconfig         |  2 ++
 configs/chromebook_samus_tpl_defconfig      |  4 ++++
 configs/dra7xx_evm_defconfig                |  2 ++
 configs/dra7xx_hs_evm_defconfig             |  2 ++
 configs/dra7xx_hs_evm_usb_defconfig         |  2 ++
 configs/j721e_evm_a72_defconfig             |  2 ++
 configs/j721e_evm_r5_defconfig              |  2 ++
 configs/ls1021aiot_qspi_defconfig           |  2 ++
 configs/ls1021aiot_sdcard_defconfig         |  2 ++
 configs/ls1021aqds_qspi_defconfig           |  1 +
 configs/ls1021aqds_sdcard_qspi_defconfig    |  1 +
 configs/ls1021atwr_qspi_defconfig           |  1 +
 configs/sama5d2_xplained_spiflash_defconfig |  2 ++
 configs/sama5d3xek_spiflash_defconfig       |  7 ++++---
 configs/sama5d4_xplained_spiflash_defconfig |  2 ++
 configs/sama5d4ek_spiflash_defconfig        |  2 ++
 configs/stm32mp15_basic_defconfig           |  2 ++
 configs/taurus_defconfig                    |  2 ++
 drivers/mtd/spi/Makefile                    |  4 ++--
 drivers/mtd/spi/sf_probe.c                  |  2 +-
 drivers/net/fm/fm.c                         |  4 ++--
 drivers/spi/Makefile                        |  2 +-
 drivers/spi/atmel_spi.c                     |  4 ++--
 drivers/spi/davinci_spi.c                   |  6 +++---
 drivers/spi/fsl_dspi.c                      |  5 +++--
 drivers/spi/kirkwood_spi.c                  |  2 +-
 drivers/spi/mxc_spi.c                       |  6 +++---
 drivers/spi/omap3_spi.c                     |  4 ++--
 drivers/spi/sh_qspi.c                       |  4 ++--
 env/sf.c                                    |  2 +-
 include/spi.h                               |  8 ++++----
 include/spi_flash.h                         |  2 +-
 test/dm/spi.c                               |  2 +-
 42 files changed, 112 insertions(+), 38 deletions(-)
arch/arm/Kconfig +11 -0
index 053e169e2c..eb4ee84601 100644
@@ -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
@@ -1688,6 +1697,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
board/l+g/vinco/vinco.c +2 -2
index 5a998e37d8..440838c112 100644
@@ -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
 
cmd/sf.c +2 -2
index 727837d9cd..66ea43a44f 100644
@@ -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) {
cmd/spi.c +3 -3
index aec912167c..4aea191412 100644
@@ -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
 
common/spl/Kconfig +20 -0
index 414b6f396d..58b74ab74e 100644
@@ -739,6 +739,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
@@ -1075,6 +1080,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
@@ -1482,6 +1492,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
configs/am57xx_evm_defconfig +2 -0
index 42942e9ed4..47c94ce73b 100644
@@ -76,6 +76,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
@@ -94,6 +95,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
configs/am57xx_hs_evm_defconfig +2 -0
index f80ec38004..5c8c5d53cf 100644
@@ -72,6 +72,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
@@ -90,6 +91,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
configs/am57xx_hs_evm_usb_defconfig +2 -0
index 3b155cc202..0a1bcfd41f 100644
@@ -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_BAR=y
@@ -97,6 +98,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
configs/axm_defconfig +2 -0
index 1ae78463d4..bbf98b0b04 100644
@@ -63,6 +63,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
configs/chromebook_link64_defconfig +2 -0
index a13f6eac80..b3f7a215d9 100644
@@ -30,6 +30,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
configs/chromebook_samus_tpl_defconfig +4 -0
index a12a04b0bf..0a514517ea 100644
@@ -31,11 +31,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
configs/dra7xx_evm_defconfig +2 -0
index e4547d9dcc..019fe0d217 100644
@@ -83,6 +83,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
@@ -105,6 +106,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
configs/dra7xx_hs_evm_defconfig +2 -0
index c08bcce903..e14d4186ff 100644
@@ -86,6 +86,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
@@ -108,6 +109,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
configs/dra7xx_hs_evm_usb_defconfig +2 -0
index 879c2b650b..7bb1cbb7af 100644
@@ -83,6 +83,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
@@ -105,6 +106,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
configs/j721e_evm_a72_defconfig +2 -0
index 4deb4e219f..175fdbaeca 100644
@@ -120,6 +120,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
@@ -146,6 +147,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
configs/j721e_evm_r5_defconfig +2 -0
index ee9217aee2..60ad84ae38 100644
@@ -89,6 +89,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
@@ -112,6 +113,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
configs/ls1021aiot_qspi_defconfig +2 -0
index cb73a04b35..5f576b4255 100644
@@ -17,6 +17,7 @@ CONFIG_CMD_DHCP=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
@@ -44,6 +45,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
configs/ls1021aiot_sdcard_defconfig +2 -0
index 10b6930914..c2c24c39a4 100644
@@ -22,6 +22,7 @@ CONFIG_CMD_DHCP=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"
@@ -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
configs/ls1021aqds_qspi_defconfig +1 -0
index f91534cfdd..0542c5c303 100644
@@ -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
configs/ls1021aqds_sdcard_qspi_defconfig +1 -0
index 9871c8edf4..fd49917505 100644
@@ -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
configs/ls1021atwr_qspi_defconfig +1 -0
index 4c82d66899..8ef0589334 100644
@@ -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
configs/sama5d2_xplained_spiflash_defconfig +2 -0
index 43d493bf9c..377d6a32d0 100644
@@ -66,6 +66,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
configs/sama5d3xek_spiflash_defconfig +4 -3
index 6a76d7c9c0..47615464a5 100644
@@ -8,12 +8,12 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_ENV_SIZE=0x2000
-CONFIG_ENV_OFFSET=0x6000
 CONFIG_ENV_SECT_SIZE=0x1000
-CONFIG_SYS_SPI_U_BOOT_OFFS=0x10000
-CONFIG_DM_GPIO=y
+CONFIG_ENV_OFFSET=0x6000
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x10000
+CONFIG_DM_GPIO=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BOARD_INIT=y
@@ -22,6 +22,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
configs/sama5d4_xplained_spiflash_defconfig +2 -0
index 3be18e65a4..8c43fc785b 100644
@@ -67,6 +67,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
configs/sama5d4ek_spiflash_defconfig +2 -0
index a7541a22d6..a4addddffb 100644
@@ -64,6 +64,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
configs/stm32mp15_basic_defconfig +2 -0
index c7dd2926c9..87f15bd3db 100644
@@ -90,6 +90,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
@@ -120,6 +121,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
configs/taurus_defconfig +2 -0
index 19d85f9b5a..5149365617 100644
@@ -71,6 +71,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
drivers/mtd/spi/Makefile +2 -2
index b5dfa300de..952fd1e45a 100644
@@ -3,7 +3,7 @@
 # (C) Copyright 2006
 # Wolfgang Denk, DENX Software Engineering, wd at 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
drivers/mtd/spi/sf_probe.c +1 -1
index c2e51f9c68..444770f3e5 100644
@@ -54,7 +54,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)
 {
drivers/net/fm/fm.c +2 -2
index 8ab1816395..bbb1738c4b 100644
@@ -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 */
drivers/spi/Makefile +1 -1
index 6441694c8d..11d8d22cef 100644
@@ -4,7 +4,7 @@
 # Wolfgang Denk, DENX Software Engineering, wd at 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
drivers/spi/atmel_spi.c +2 -2
index f076e92a93..e2f2b3be44 100644
@@ -14,7 +14,7 @@
 
 #include <asm/arch/clk.h>
 #include <asm/arch/hardware.h>
-#ifdef CONFIG_DM_SPI
+#if CONFIG_IS_ENABLED(DM_SPI)
 #include <asm/arch/at91_spi.h>
 #endif
 #if CONFIG_IS_ENABLED(DM_GPIO)
@@ -23,7 +23,7 @@
 
 #include "atmel_spi.h"
 
-#ifndef CONFIG_DM_SPI
+#if !CONFIG_IS_ENABLED(DM_SPI)
 
 static int spi_has_wdrbt(struct atmel_spi_slave *slave)
 {
drivers/spi/davinci_spi.c +3 -3
index 97ac97b1a5..f619534764 100644
@@ -55,7 +55,7 @@
 /* SPIDEF */
 #define SPIDEF_CSDEF0_MASK	BIT(0)
 
-#ifndef CONFIG_DM_SPI
+#if !CONFIG_IS_ENABLED(DM_SPI)
 #define SPI0_BUS		0
 #define SPI0_BASE		CONFIG_SYS_SPI_BASE
 /*
@@ -122,7 +122,7 @@ struct davinci_spi_regs {
 
 /* davinci spi slave */
 struct davinci_spi_slave {
-#ifndef CONFIG_DM_SPI
+#if !CONFIG_IS_ENABLED(DM_SPI)
 	struct spi_slave slave;
 #endif
 	struct davinci_spi_regs *regs;
@@ -346,7 +346,7 @@ out:
 	return 0;
 }
 
-#ifndef CONFIG_DM_SPI
+#if !CONFIG_IS_ENABLED(DM_SPI)
 
 static inline struct davinci_spi_slave *to_davinci_spi(struct spi_slave *slave)
 {
drivers/spi/fsl_dspi.c +3 -2
index 1cdb233110..d9575aaf54 100644
@@ -100,7 +100,7 @@ struct fsl_dspi_priv {
 	struct dspi *regs;
 };
 
-#ifndef CONFIG_DM_SPI
+#if !CONFIG_IS_ENABLED(DM_SPI)
 struct fsl_dspi {
 	struct spi_slave slave;
 	struct fsl_dspi_priv priv;
@@ -414,7 +414,8 @@ static int fsl_dspi_cfg_speed(struct fsl_dspi_priv *priv, uint speed)
 
 	return 0;
 }
-#ifndef CONFIG_DM_SPI
+
+#if !CONFIG_IS_ENABLED(DM_SPI)
 int spi_cs_is_valid(unsigned int bus, unsigned int cs)
 {
 	if (((cs >= 0) && (cs < 8)) && ((bus >= 0) && (bus < 8)))
drivers/spi/kirkwood_spi.c +1 -1
index 01fcf6bef5..60ca09f2ac 100644
@@ -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;
drivers/spi/mxc_spi.c +3 -3
index f52ebf4d67..aad3780365 100644
@@ -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)
 {
drivers/spi/omap3_spi.c +2 -2
index 6a615d1498..ae08531f1e 100644
@@ -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)
 {
drivers/spi/sh_qspi.c +2 -2
index 2839dd1ceb..aa1c03047e 100644
@@ -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);
env/sf.c +1 -1
index 23de5a3495..a4106807c7 100644
@@ -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;
 
include/spi.h +4 -4
index 5cc6d6e008..9b4fb8dc0b 100644
@@ -39,7 +39,7 @@
 
 #define SPI_DEFAULT_WORDLEN	8
 
-#ifdef CONFIG_DM_SPI
+#if CONFIG_IS_ENABLED(DM_SPI)
 /* TODO(sjg at 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
include/spi_flash.h +1 -1
index 0b23f57a71..e8348adec2 100644
@@ -52,7 +52,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
  *
test/dm/spi.c +1 -1
index 8e417acc5f..474008cde0 100644
@@ -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
 
Signature · 1 line
2.17.1
#6 lore raw

PATCH v4 3/3 spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI*

Quoted 82 lines · Zhiqiang Hou

From: Lukasz Majewski <[email protected]>

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.

---
V4:
- Rebase the patch and remove SPL_DM_SPI from target ls1046 boards.

 arch/arm/Kconfig                            | 11 +++++++++++
 board/l+g/vinco/vinco.c                     |  4 ++--
 cmd/sf.c                                    |  4 ++--
 cmd/spi.c                                   |  6 +++---
 common/spl/Kconfig                          | 20 ++++++++++++++++++++
 configs/am57xx_evm_defconfig                |  2 ++
 configs/am57xx_hs_evm_defconfig             |  2 ++
 configs/am57xx_hs_evm_usb_defconfig         |  2 ++
 configs/axm_defconfig                       |  2 ++
 configs/chromebook_link64_defconfig         |  2 ++
 configs/chromebook_samus_tpl_defconfig      |  4 ++++
 configs/dra7xx_evm_defconfig                |  2 ++
 configs/dra7xx_hs_evm_defconfig             |  2 ++
 configs/dra7xx_hs_evm_usb_defconfig         |  2 ++
 configs/j721e_evm_a72_defconfig             |  2 ++
 configs/j721e_evm_r5_defconfig              |  2 ++
 configs/ls1021aiot_qspi_defconfig           |  2 ++
 configs/ls1021aiot_sdcard_defconfig         |  2 ++
 configs/ls1021aqds_qspi_defconfig           |  1 +
 configs/ls1021aqds_sdcard_qspi_defconfig    |  1 +
 configs/ls1021atwr_qspi_defconfig           |  1 +
 configs/sama5d2_xplained_spiflash_defconfig |  2 ++
 configs/sama5d3xek_spiflash_defconfig       |  7 ++++---
 configs/sama5d4_xplained_spiflash_defconfig |  2 ++
 configs/sama5d4ek_spiflash_defconfig        |  2 ++
 configs/stm32mp15_basic_defconfig           |  2 ++
 configs/taurus_defconfig                    |  2 ++
 drivers/mtd/spi/Makefile                    |  4 ++--
 drivers/mtd/spi/sf_probe.c                  |  2 +-
Quoted 8 lines
 drivers/net/fm/fm.c                         |  4 ++--
 drivers/spi/Makefile                        |  2 +-
 drivers/spi/atmel_spi.c                     |  4 ++--
 drivers/spi/davinci_spi.c                   |  6 +++---
 drivers/spi/fsl_dspi.c                      |  5 +++--
 drivers/spi/kirkwood_spi.c                  |  2 +-
 drivers/spi/mxc_spi.c                       |  6 +++---
 drivers/spi/omap3_spi.c                     |  4 ++--

nondm code on most of the driver will remove in the next version, So I didn't see any usecase of this conversion here.

Jagan.

#7 lore raw

PATCH v4 3/3 spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI*

Quoted 92 lines · Jagan Teki
Quoted 82 lines · Zhiqiang Hou

From: Lukasz Majewski <[email protected]>

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.

---
V4:
- Rebase the patch and remove SPL_DM_SPI from target ls1046 boards.

 arch/arm/Kconfig                            | 11 +++++++++++
 board/l+g/vinco/vinco.c                     |  4 ++--
 cmd/sf.c                                    |  4 ++--
 cmd/spi.c                                   |  6 +++---
 common/spl/Kconfig                          | 20 ++++++++++++++++++++
 configs/am57xx_evm_defconfig                |  2 ++
 configs/am57xx_hs_evm_defconfig             |  2 ++
 configs/am57xx_hs_evm_usb_defconfig         |  2 ++
 configs/axm_defconfig                       |  2 ++
 configs/chromebook_link64_defconfig         |  2 ++
 configs/chromebook_samus_tpl_defconfig      |  4 ++++
 configs/dra7xx_evm_defconfig                |  2 ++
 configs/dra7xx_hs_evm_defconfig             |  2 ++
 configs/dra7xx_hs_evm_usb_defconfig         |  2 ++
 configs/j721e_evm_a72_defconfig             |  2 ++
 configs/j721e_evm_r5_defconfig              |  2 ++
 configs/ls1021aiot_qspi_defconfig           |  2 ++
 configs/ls1021aiot_sdcard_defconfig         |  2 ++
 configs/ls1021aqds_qspi_defconfig           |  1 +
 configs/ls1021aqds_sdcard_qspi_defconfig    |  1 +
 configs/ls1021atwr_qspi_defconfig           |  1 +
 configs/sama5d2_xplained_spiflash_defconfig |  2 ++
 configs/sama5d3xek_spiflash_defconfig       |  7 ++++---
 configs/sama5d4_xplained_spiflash_defconfig |  2 ++
 configs/sama5d4ek_spiflash_defconfig        |  2 ++
 configs/stm32mp15_basic_defconfig           |  2 ++
 configs/taurus_defconfig                    |  2 ++
 drivers/mtd/spi/Makefile                    |  4 ++--
 drivers/mtd/spi/sf_probe.c                  |  2 +-
Quoted 8 lines
 drivers/net/fm/fm.c                         |  4 ++--
 drivers/spi/Makefile                        |  2 +-
 drivers/spi/atmel_spi.c                     |  4 ++--
 drivers/spi/davinci_spi.c                   |  6 +++---
 drivers/spi/fsl_dspi.c                      |  5 +++--
 drivers/spi/kirkwood_spi.c                  |  2 +-
 drivers/spi/mxc_spi.c                       |  6 +++---
 drivers/spi/omap3_spi.c                     |  4 ++--
Quoted 2 lines

nondm code on most of the driver will remove in the next version, So I didn't see any usecase of this conversion here.

I think this is still the right direction to go in. non-DM for SPL is allowed and this is part of the logical steps needed for moving forward with "now pull non-DM driver into own file for SPL" until the efforts to make DM smaller still are ready. So this series is on my list to test and confirm doesn't change binary size on.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200602/33b6e0df/attachment.sig>
#8 lore raw

PATCH v4 3/3 spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI*

Quoted 94 lines · Tom Rini
Quoted 92 lines · Jagan Teki
Quoted 90 lines · Zhiqiang Hou

From: Lukasz Majewski <[email protected]>

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.

---
V4:
- Rebase the patch and remove SPL_DM_SPI from target ls1046 boards.

 arch/arm/Kconfig                            | 11 +++++++++++
 board/l+g/vinco/vinco.c                     |  4 ++--
 cmd/sf.c                                    |  4 ++--
 cmd/spi.c                                   |  6 +++---
 common/spl/Kconfig                          | 20 ++++++++++++++++++++
 configs/am57xx_evm_defconfig                |  2 ++
 configs/am57xx_hs_evm_defconfig             |  2 ++
 configs/am57xx_hs_evm_usb_defconfig         |  2 ++
 configs/axm_defconfig                       |  2 ++
 configs/chromebook_link64_defconfig         |  2 ++
 configs/chromebook_samus_tpl_defconfig      |  4 ++++
 configs/dra7xx_evm_defconfig                |  2 ++
 configs/dra7xx_hs_evm_defconfig             |  2 ++
 configs/dra7xx_hs_evm_usb_defconfig         |  2 ++
 configs/j721e_evm_a72_defconfig             |  2 ++
 configs/j721e_evm_r5_defconfig              |  2 ++
 configs/ls1021aiot_qspi_defconfig           |  2 ++
 configs/ls1021aiot_sdcard_defconfig         |  2 ++
 configs/ls1021aqds_qspi_defconfig           |  1 +
 configs/ls1021aqds_sdcard_qspi_defconfig    |  1 +
 configs/ls1021atwr_qspi_defconfig           |  1 +
 configs/sama5d2_xplained_spiflash_defconfig |  2 ++
 configs/sama5d3xek_spiflash_defconfig       |  7 ++++---
 configs/sama5d4_xplained_spiflash_defconfig |  2 ++
 configs/sama5d4ek_spiflash_defconfig        |  2 ++
 configs/stm32mp15_basic_defconfig           |  2 ++
 configs/taurus_defconfig                    |  2 ++
 drivers/mtd/spi/Makefile                    |  4 ++--
 drivers/mtd/spi/sf_probe.c                  |  2 +-
 drivers/net/fm/fm.c                         |  4 ++--
 drivers/spi/Makefile                        |  2 +-
 drivers/spi/atmel_spi.c                     |  4 ++--
 drivers/spi/davinci_spi.c                   |  6 +++---
 drivers/spi/fsl_dspi.c                      |  5 +++--
 drivers/spi/kirkwood_spi.c                  |  2 +-
 drivers/spi/mxc_spi.c                       |  6 +++---
 drivers/spi/omap3_spi.c                     |  4 ++--
Quoted 8 lines
Quoted 2 lines

nondm code on most of the driver will remove in the next version, So I didn't see any usecase of this conversion here.

I think this is still the right direction to go in. non-DM for SPL is allowed and this is part of the logical steps needed for moving forward with "now pull non-DM driver into own file for SPL" until the efforts to make DM smaller still are ready. So this series is on my list to test and confirm doesn't change binary size on.

Sorry, I can't do a similar task over the years, I'm saying about nondm part of drivers which doesn't have any footprint issues? You may be true for nondm part which has SPL size issues like mxc_spi, sh_qspi, rest are fine to move. I'd remove those that part at max for next MW.

Jagan.

#9 lore raw

PATCH v4 3/3 spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI*

Quoted 104 lines · Jagan Teki
Quoted 94 lines · Tom Rini
Quoted 92 lines · Jagan Teki
Quoted 90 lines · Zhiqiang Hou

From: Lukasz Majewski <[email protected]>

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.

---
V4:
- Rebase the patch and remove SPL_DM_SPI from target ls1046 boards.

 arch/arm/Kconfig                            | 11 +++++++++++
 board/l+g/vinco/vinco.c                     |  4 ++--
 cmd/sf.c                                    |  4 ++--
 cmd/spi.c                                   |  6 +++---
 common/spl/Kconfig                          | 20 ++++++++++++++++++++
 configs/am57xx_evm_defconfig                |  2 ++
 configs/am57xx_hs_evm_defconfig             |  2 ++
 configs/am57xx_hs_evm_usb_defconfig         |  2 ++
 configs/axm_defconfig                       |  2 ++
 configs/chromebook_link64_defconfig         |  2 ++
 configs/chromebook_samus_tpl_defconfig      |  4 ++++
 configs/dra7xx_evm_defconfig                |  2 ++
 configs/dra7xx_hs_evm_defconfig             |  2 ++
 configs/dra7xx_hs_evm_usb_defconfig         |  2 ++
 configs/j721e_evm_a72_defconfig             |  2 ++
 configs/j721e_evm_r5_defconfig              |  2 ++
 configs/ls1021aiot_qspi_defconfig           |  2 ++
 configs/ls1021aiot_sdcard_defconfig         |  2 ++
 configs/ls1021aqds_qspi_defconfig           |  1 +
 configs/ls1021aqds_sdcard_qspi_defconfig    |  1 +
 configs/ls1021atwr_qspi_defconfig           |  1 +
 configs/sama5d2_xplained_spiflash_defconfig |  2 ++
 configs/sama5d3xek_spiflash_defconfig       |  7 ++++---
 configs/sama5d4_xplained_spiflash_defconfig |  2 ++
 configs/sama5d4ek_spiflash_defconfig        |  2 ++
 configs/stm32mp15_basic_defconfig           |  2 ++
 configs/taurus_defconfig                    |  2 ++
 drivers/mtd/spi/Makefile                    |  4 ++--
 drivers/mtd/spi/sf_probe.c                  |  2 +-
 drivers/net/fm/fm.c                         |  4 ++--
 drivers/spi/Makefile                        |  2 +-
 drivers/spi/atmel_spi.c                     |  4 ++--
 drivers/spi/davinci_spi.c                   |  6 +++---
 drivers/spi/fsl_dspi.c                      |  5 +++--
 drivers/spi/kirkwood_spi.c                  |  2 +-
 drivers/spi/mxc_spi.c                       |  6 +++---
 drivers/spi/omap3_spi.c                     |  4 ++--
Quoted 8 lines
Quoted 2 lines

nondm code on most of the driver will remove in the next version, So I didn't see any usecase of this conversion here.

I think this is still the right direction to go in. non-DM for SPL is allowed and this is part of the logical steps needed for moving forward with "now pull non-DM driver into own file for SPL" until the efforts to make DM smaller still are ready. So this series is on my list to test and confirm doesn't change binary size on.

Quoted 5 lines

Sorry, I can't do a similar task over the years, I'm saying about nondm part of drivers which doesn't have any footprint issues? You may be true for nondm part which has SPL size issues like mxc_spi, sh_qspi, rest are fine to move. I'd remove those that part at max for next MW.

It comes down to where are we at with everything again? I'm not saying you have to be the one to split the code out. But from what I recall of the thread last week, for mxc_spi we get back to "i.MX6 is having problems with size for DM+SPL". So we can't just "OK, no more i.MX6 support". Full U-Boot needs to be, and I believe is, converted.

So I guess the next question I have really is for Hou Zhiqiang and is, do you need this series as part of fixing / converting the eSPI driver and getting NXP platforms converted? Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200602/a35df26c/attachment.sig>
#10 lore raw

PATCH v4 3/3 spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI*

Quoted 112 lines · Tom Rini
Quoted 104 lines · Jagan Teki
Quoted 94 lines · Tom Rini
Quoted 92 lines · Jagan Teki
Quoted 90 lines · Zhiqiang Hou

From: Lukasz Majewski <[email protected]>

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.

---
V4:
- Rebase the patch and remove SPL_DM_SPI from target ls1046 boards.

 arch/arm/Kconfig                            | 11 +++++++++++
 board/l+g/vinco/vinco.c                     |  4 ++--
 cmd/sf.c                                    |  4 ++--
 cmd/spi.c                                   |  6 +++---
 common/spl/Kconfig                          | 20 ++++++++++++++++++++
 configs/am57xx_evm_defconfig                |  2 ++
 configs/am57xx_hs_evm_defconfig             |  2 ++
 configs/am57xx_hs_evm_usb_defconfig         |  2 ++
 configs/axm_defconfig                       |  2 ++
 configs/chromebook_link64_defconfig         |  2 ++
 configs/chromebook_samus_tpl_defconfig      |  4 ++++
 configs/dra7xx_evm_defconfig                |  2 ++
 configs/dra7xx_hs_evm_defconfig             |  2 ++
 configs/dra7xx_hs_evm_usb_defconfig         |  2 ++
 configs/j721e_evm_a72_defconfig             |  2 ++
 configs/j721e_evm_r5_defconfig              |  2 ++
 configs/ls1021aiot_qspi_defconfig           |  2 ++
 configs/ls1021aiot_sdcard_defconfig         |  2 ++
 configs/ls1021aqds_qspi_defconfig           |  1 +
 configs/ls1021aqds_sdcard_qspi_defconfig    |  1 +
 configs/ls1021atwr_qspi_defconfig           |  1 +
 configs/sama5d2_xplained_spiflash_defconfig |  2 ++
 configs/sama5d3xek_spiflash_defconfig       |  7 ++++---
 configs/sama5d4_xplained_spiflash_defconfig |  2 ++
 configs/sama5d4ek_spiflash_defconfig        |  2 ++
 configs/stm32mp15_basic_defconfig           |  2 ++
 configs/taurus_defconfig                    |  2 ++
 drivers/mtd/spi/Makefile                    |  4 ++--
 drivers/mtd/spi/sf_probe.c                  |  2 +-
 drivers/net/fm/fm.c                         |  4 ++--
 drivers/spi/Makefile                        |  2 +-
 drivers/spi/atmel_spi.c                     |  4 ++--
 drivers/spi/davinci_spi.c                   |  6 +++---
 drivers/spi/fsl_dspi.c                      |  5 +++--
 drivers/spi/kirkwood_spi.c                  |  2 +-
 drivers/spi/mxc_spi.c                       |  6 +++---
 drivers/spi/omap3_spi.c                     |  4 ++--
Quoted 8 lines
Quoted 2 lines

nondm code on most of the driver will remove in the next version, So I didn't see any usecase of this conversion here.

I think this is still the right direction to go in. non-DM for SPL is allowed and this is part of the logical steps needed for moving forward with "now pull non-DM driver into own file for SPL" until the efforts to make DM smaller still are ready. So this series is on my list to test and confirm doesn't change binary size on.

Quoted 5 lines

Sorry, I can't do a similar task over the years, I'm saying about nondm part of drivers which doesn't have any footprint issues? You may be true for nondm part which has SPL size issues like mxc_spi, sh_qspi, rest are fine to move. I'd remove those that part at max for next MW.

Quoted 5 lines

It comes down to where are we at with everything again? I'm not saying you have to be the one to split the code out. But from what I recall of the thread last week, for mxc_spi we get back to "i.MX6 is having problems with size for DM+SPL". So we can't just "OK, no more i.MX6 support". Full U-Boot needs to be, and I believe is, converted.

As I said No to mxc_spi, sh_qspi at this point, but rest are fine based on my series and some of the below drivers have nondm code which no board using in the tree.

drivers/spi/atmel_spi.c
drivers/spi/davinci_spi.c
drivers/spi/fsl_dspi.c
drivers/spi/kirkwood_spi.c
drivers/spi/mxc_spi.c
drivers/spi/omap3_spi.c

Quoted 4 lines

So I guess the next question I have really is for Hou Zhiqiang and is, do you need this series as part of fixing / converting the eSPI driver and getting NXP platforms converted? Thanks!

Yes fsl_espi, I would wait till MW as I mentioned before and will work to get these patches to be in proper shape before MW.

Overall, changes expect fsl_espi, mxc_spi, and sh_qspi can be fine for me.

Jagan.

#11 lore raw

PATCH v4 3/3 spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI*

Hi Jagan,

Quoted 134 lines · Tom Rini
Quoted 122 lines · Jagan Teki
Quoted 114 lines
Quoted 105 lines · Tom Rini
Quoted 99 lines · Jagan Teki
Quoted 88 lines · Zhiqiang Hou

From: Lukasz Majewski <[email protected]>

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.

---
V4:
- Rebase the patch and remove SPL_DM_SPI from target
ls1046 boards.

 arch/arm/Kconfig                            | 11
+++++++++++ board/l+g/vinco/vinco.c                     |
4 ++-- cmd/sf.c                                    |  4 ++--
 cmd/spi.c                                   |  6 +++---
 common/spl/Kconfig                          | 20
++++++++++++++++++++ configs/am57xx_evm_defconfig
     |  2 ++ configs/am57xx_hs_evm_defconfig             |
2 ++ configs/am57xx_hs_evm_usb_defconfig         |  2 ++
 configs/axm_defconfig                       |  2 ++
 configs/chromebook_link64_defconfig         |  2 ++
 configs/chromebook_samus_tpl_defconfig      |  4 ++++
 configs/dra7xx_evm_defconfig                |  2 ++
 configs/dra7xx_hs_evm_defconfig             |  2 ++
 configs/dra7xx_hs_evm_usb_defconfig         |  2 ++
 configs/j721e_evm_a72_defconfig             |  2 ++
 configs/j721e_evm_r5_defconfig              |  2 ++
 configs/ls1021aiot_qspi_defconfig           |  2 ++
 configs/ls1021aiot_sdcard_defconfig         |  2 ++
 configs/ls1021aqds_qspi_defconfig           |  1 +
 configs/ls1021aqds_sdcard_qspi_defconfig    |  1 +
 configs/ls1021atwr_qspi_defconfig           |  1 +
 configs/sama5d2_xplained_spiflash_defconfig |  2 ++
 configs/sama5d3xek_spiflash_defconfig       |  7 ++++---
 configs/sama5d4_xplained_spiflash_defconfig |  2 ++
 configs/sama5d4ek_spiflash_defconfig        |  2 ++
 configs/stm32mp15_basic_defconfig           |  2 ++
 configs/taurus_defconfig                    |  2 ++
 drivers/mtd/spi/Makefile                    |  4 ++--
 drivers/mtd/spi/sf_probe.c                  |  2 +-
Quoted 8 lines
 drivers/net/fm/fm.c                         |  4 ++--
 drivers/spi/Makefile                        |  2 +-
 drivers/spi/atmel_spi.c                     |  4 ++--
 drivers/spi/davinci_spi.c                   |  6 +++---
 drivers/spi/fsl_dspi.c                      |  5 +++--
 drivers/spi/kirkwood_spi.c                  |  2 +-
 drivers/spi/mxc_spi.c                       |  6 +++---
 drivers/spi/omap3_spi.c                     |  4 ++--  
Quoted 3 lines

nondm code on most of the driver will remove in the next version, So I didn't see any usecase of this conversion here.

Quoted 6 lines

I think this is still the right direction to go in. non-DM for SPL is allowed and this is part of the logical steps needed for moving forward with "now pull non-DM driver into own file for SPL" until the efforts to make DM smaller still are ready. So this series is on my list to test and confirm doesn't change binary size on.

Quoted 5 lines

Sorry, I can't do a similar task over the years, I'm saying about nondm part of drivers which doesn't have any footprint issues? You may be true for nondm part which has SPL size issues like mxc_spi, sh_qspi, rest are fine to move. I'd remove those that part at max for next MW.

Quoted 6 lines

It comes down to where are we at with everything again? I'm not saying you have to be the one to split the code out. But from what I recall of the thread last week, for mxc_spi we get back to "i.MX6 is having problems with size for DM+SPL". So we can't just "OK, no more i.MX6 support". Full U-Boot needs to be, and I believe is, converted.

As I said No to mxc_spi, sh_qspi at this point, but rest are fine based on my series and some of the below drivers have nondm code which no board using in the tree.

Quoted 5 lines

drivers/spi/atmel_spi.c
drivers/spi/davinci_spi.c
drivers/spi/fsl_dspi.c
drivers/spi/kirkwood_spi.c
drivers/spi/mxc_spi.c

Sorry to jump in late - the mxc_spi.c's non-dm part may be needed as it is used to have _really_ tiny SPL.

Please correct me if I misunderstood something - the non-dm part of mxc_spi.c will NOT be removed?

Quoted 7 lines

drivers/spi/omap3_spi.c

Quoted 4 lines

So I guess the next question I have really is for Hou Zhiqiang and is, do you need this series as part of fixing / converting the eSPI driver and getting NXP platforms converted? Thanks!

Quoted 7 lines

Yes fsl_espi, I would wait till MW as I mentioned before and will work to get these patches to be in proper shape before MW.

Overall, changes expect fsl_espi, mxc_spi, and sh_qspi can be fine for me.

Jagan.

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200603/d7537693/attachment.sig>

author
#12 lore raw

PATCH v4 3/3 spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI*

In reply to Tom Rini

Hi Tom and Jagan,

Thanks a lot for your comments!

Quoted 149 lines

-----Original Message-----
From: Tom Rini <[email protected]>
Sent: 2020?6?3? 3:02
To: Jagan Teki <[email protected]>; Z.q. Hou <[email protected]>
Cc: U-Boot-Denx <[email protected]>; Lokesh Vutla <[email protected]>; Andrew F Davis <[email protected]>; Heiko Schocher <[email protected]>; Simon Glass <[email protected]>; Feng Li <[email protected]>; Alison Wang <[email protected]>; Sumit Garg <[email protected]>; Eugen Hristev <[email protected]>; Patrick Delaunay <[email protected]>; Vignesh R <[email protected]>; Joe Hershberger <[email protected]>; Stefan Roese <[email protected]>; Wolfgang Denk <[email protected]>; Lukasz Majewski <[email protected]>; Miquel Raynal <[email protected]>; Marek Vasut <[email protected]>; Bin Meng <[email protected]>; Simon Goldschmidt <[email protected]>; Markus Klotzbuecher <[email protected]>; Baruch Siach <[email protected]>; Harald Seiler <[email protected]>; Joel Johnson <[email protected]>; Anatolij Gustschin <[email protected]>; Priyanka Jain <[email protected]>; Madalin Bucur (OSS) <[email protected]>; Gervais, Francois <[email protected]>; Udit Agarwal <[email protected]>
Subject: Re: [PATCHv4 3/3] spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI*

Quoted 4 lines · Jagan Teki
Quoted 3 lines · Tom Rini
Quoted 1 line · Jagan Teki

On Tue, Jun 2, 2020 at 6:47 PM Zhiqiang Hou <[email protected]>

Quoted 15 lines · wrote:
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines

From: Lukasz Majewski <[email protected]>

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
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

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).

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

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).

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

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

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

run full blown DT/DTS)
- SPL driver with DT/DTS and SPL_OF_PLATDATA (when one have

constrained

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

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.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

---
V4:
- Rebase the patch and remove SPL_DM_SPI from target ls1046

boards.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
 arch/arm/Kconfig                            | 11

+++++++++++

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
 board/l+g/vinco/vinco.c                     |  4 ++--
 cmd/sf.c                                    |  4 ++--
 cmd/spi.c                                   |  6 +++---
 common/spl/Kconfig                          | 20

++++++++++++++++++++

Quoted 42 lines
Quoted 33 lines
Quoted 33 lines
Quoted 32 lines
 configs/am57xx_evm_defconfig                |  2 ++
 configs/am57xx_hs_evm_defconfig             |  2 ++
 configs/am57xx_hs_evm_usb_defconfig         |  2 ++
 configs/axm_defconfig                       |  2 ++
 configs/chromebook_link64_defconfig         |  2 ++
 configs/chromebook_samus_tpl_defconfig      |  4 ++++
 configs/dra7xx_evm_defconfig                |  2 ++
 configs/dra7xx_hs_evm_defconfig             |  2 ++
 configs/dra7xx_hs_evm_usb_defconfig         |  2 ++
 configs/j721e_evm_a72_defconfig             |  2 ++
 configs/j721e_evm_r5_defconfig              |  2 ++
 configs/ls1021aiot_qspi_defconfig           |  2 ++
 configs/ls1021aiot_sdcard_defconfig         |  2 ++
 configs/ls1021aqds_qspi_defconfig           |  1 +
 configs/ls1021aqds_sdcard_qspi_defconfig    |  1 +
 configs/ls1021atwr_qspi_defconfig           |  1 +
 configs/sama5d2_xplained_spiflash_defconfig |  2 ++
 configs/sama5d3xek_spiflash_defconfig       |  7 ++++---
 configs/sama5d4_xplained_spiflash_defconfig |  2 ++
 configs/sama5d4ek_spiflash_defconfig        |  2 ++
 configs/stm32mp15_basic_defconfig           |  2 ++
 configs/taurus_defconfig                    |  2 ++
 drivers/mtd/spi/Makefile                    |  4 ++--
 drivers/mtd/spi/sf_probe.c                  |  2 +-
 drivers/net/fm/fm.c                         |  4 ++--
 drivers/spi/Makefile                        |  2 +-
 drivers/spi/atmel_spi.c                     |  4 ++--
 drivers/spi/davinci_spi.c                   |  6 +++---
 drivers/spi/fsl_dspi.c                      |  5 +++--
 drivers/spi/kirkwood_spi.c                  |  2 +-
 drivers/spi/mxc_spi.c                       |  6 +++---
 drivers/spi/omap3_spi.c                     |  4 ++--
Quoted 8 lines
Quoted 2 lines

nondm code on most of the driver will remove in the next version, So I didn't see any usecase of this conversion here.

I think this is still the right direction to go in. non-DM for SPL is allowed and this is part of the logical steps needed for moving forward with "now pull non-DM driver into own file for SPL" until the efforts to make DM smaller still are ready. So this series is on my list to test and confirm doesn't change binary size on.

Quoted 5 lines

Sorry, I can't do a similar task over the years, I'm saying about nondm part of drivers which doesn't have any footprint issues? You may be true for nondm part which has SPL size issues like mxc_spi, sh_qspi, rest are fine to move. I'd remove those that part at max for next MW.

It comes down to where are we at with everything again? I'm not saying you have to be the one to split the code out. But from what I recall of the thread last week, for mxc_spi we get back to "i.MX6 is having problems with size for DM+SPL". So we can't just "OK, no more i.MX6 support". Full U-Boot needs to be, and I believe is, converted.

Quoted 3 lines

So I guess the next question I have really is for Hou Zhiqiang and is, do you need this series as part of fixing / converting the eSPI driver and getting NXP platforms converted? Thanks!

Yes, the eSPI DM converting depends on this series, since the SPL now is non-DM.

Thanks,
Zhiqiang

Quoted 3 lines

--
Tom

#13 lore raw

PATCH v4 3/3 spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI*

Quoted 154 lines · Z.q. Hou

Hi Tom and Jagan,

Thanks a lot for your comments!

Quoted 149 lines

-----Original Message-----
From: Tom Rini <[email protected]>
Sent: 2020?6?3? 3:02
To: Jagan Teki <[email protected]>; Z.q. Hou <[email protected]>
Cc: U-Boot-Denx <[email protected]>; Lokesh Vutla <[email protected]>; Andrew F Davis <[email protected]>; Heiko Schocher <[email protected]>; Simon Glass <[email protected]>; Feng Li <[email protected]>; Alison Wang <[email protected]>; Sumit Garg <[email protected]>; Eugen Hristev <[email protected]>; Patrick Delaunay <[email protected]>; Vignesh R <[email protected]>; Joe Hershberger <[email protected]>; Stefan Roese <[email protected]>; Wolfgang Denk <[email protected]>; Lukasz Majewski <[email protected]>; Miquel Raynal <[email protected]>; Marek Vasut <[email protected]>; Bin Meng <[email protected]>; Simon Goldschmidt <[email protected]>; Markus Klotzbuecher <[email protected]>; Baruch Siach <[email protected]>; Harald Seiler <[email protected]>; Joel Johnson <[email protected]>; Anatolij Gustschin <[email protected]>; Priyanka Jain <[email protected]>; Madalin Bucur (OSS) <[email protected]>; Gervais, Francois <[email protected]>; Udit Agarwal <[email protected]>
Subject: Re: [PATCHv4 3/3] spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI*

Quoted 4 lines · Jagan Teki
Quoted 3 lines · Tom Rini
Quoted 1 line · Jagan Teki

On Tue, Jun 2, 2020 at 6:47 PM Zhiqiang Hou <[email protected]>

Quoted 15 lines · wrote:
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines

From: Lukasz Majewski <[email protected]>

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
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

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).

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

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).

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

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

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

run full blown DT/DTS)
- SPL driver with DT/DTS and SPL_OF_PLATDATA (when one have

constrained

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

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.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

---
V4:
- Rebase the patch and remove SPL_DM_SPI from target ls1046

boards.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
 arch/arm/Kconfig                            | 11

+++++++++++

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
 board/l+g/vinco/vinco.c                     |  4 ++--
 cmd/sf.c                                    |  4 ++--
 cmd/spi.c                                   |  6 +++---
 common/spl/Kconfig                          | 20

++++++++++++++++++++

Quoted 42 lines
Quoted 33 lines
Quoted 33 lines
Quoted 32 lines
 configs/am57xx_evm_defconfig                |  2 ++
 configs/am57xx_hs_evm_defconfig             |  2 ++
 configs/am57xx_hs_evm_usb_defconfig         |  2 ++
 configs/axm_defconfig                       |  2 ++
 configs/chromebook_link64_defconfig         |  2 ++
 configs/chromebook_samus_tpl_defconfig      |  4 ++++
 configs/dra7xx_evm_defconfig                |  2 ++
 configs/dra7xx_hs_evm_defconfig             |  2 ++
 configs/dra7xx_hs_evm_usb_defconfig         |  2 ++
 configs/j721e_evm_a72_defconfig             |  2 ++
 configs/j721e_evm_r5_defconfig              |  2 ++
 configs/ls1021aiot_qspi_defconfig           |  2 ++
 configs/ls1021aiot_sdcard_defconfig         |  2 ++
 configs/ls1021aqds_qspi_defconfig           |  1 +
 configs/ls1021aqds_sdcard_qspi_defconfig    |  1 +
 configs/ls1021atwr_qspi_defconfig           |  1 +
 configs/sama5d2_xplained_spiflash_defconfig |  2 ++
 configs/sama5d3xek_spiflash_defconfig       |  7 ++++---
 configs/sama5d4_xplained_spiflash_defconfig |  2 ++
 configs/sama5d4ek_spiflash_defconfig        |  2 ++
 configs/stm32mp15_basic_defconfig           |  2 ++
 configs/taurus_defconfig                    |  2 ++
 drivers/mtd/spi/Makefile                    |  4 ++--
 drivers/mtd/spi/sf_probe.c                  |  2 +-
 drivers/net/fm/fm.c                         |  4 ++--
 drivers/spi/Makefile                        |  2 +-
 drivers/spi/atmel_spi.c                     |  4 ++--
 drivers/spi/davinci_spi.c                   |  6 +++---
 drivers/spi/fsl_dspi.c                      |  5 +++--
 drivers/spi/kirkwood_spi.c                  |  2 +-
 drivers/spi/mxc_spi.c                       |  6 +++---
 drivers/spi/omap3_spi.c                     |  4 ++--
Quoted 8 lines
Quoted 2 lines

nondm code on most of the driver will remove in the next version, So I didn't see any usecase of this conversion here.

I think this is still the right direction to go in. non-DM for SPL is allowed and this is part of the logical steps needed for moving forward with "now pull non-DM driver into own file for SPL" until the efforts to make DM smaller still are ready. So this series is on my list to test and confirm doesn't change binary size on.

Quoted 5 lines

Sorry, I can't do a similar task over the years, I'm saying about nondm part of drivers which doesn't have any footprint issues? You may be true for nondm part which has SPL size issues like mxc_spi, sh_qspi, rest are fine to move. I'd remove those that part at max for next MW.

It comes down to where are we at with everything again? I'm not saying you have to be the one to split the code out. But from what I recall of the thread last week, for mxc_spi we get back to "i.MX6 is having problems with size for DM+SPL". So we can't just "OK, no more i.MX6 support". Full U-Boot needs to be, and I believe is, converted.

Quoted 5 lines
Quoted 3 lines

So I guess the next question I have really is for Hou Zhiqiang and is, do you need this series as part of fixing / converting the eSPI driver and getting NXP platforms converted? Thanks!

Yes, the eSPI DM converting depends on this series, since the SPL now is non-DM.

But, I was wonder why it would touch other drivers, other than fsl_espi.c ?

Jagan.

author
#14 lore raw

PATCH v4 3/3 spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI*

Hi Jagan,

Thanks a lot for your comments!

Quoted 188 lines

-----Original Message-----
From: Jagan Teki [mailto:jagan at amarulasolutions.com]
Sent: 2020?6?3? 15:39
To: Z.q. Hou <[email protected]>
Cc: Tom Rini <[email protected]>; U-Boot-Denx <[email protected]>; Lokesh Vutla <[email protected]>; Andrew F Davis <[email protected]>; Heiko Schocher <[email protected]>; Simon Glass <[email protected]>; Feng Li <[email protected]>; Alison Wang <[email protected]>; Sumit Garg <[email protected]>; Eugen Hristev <[email protected]>; Patrick Delaunay <[email protected]>; Vignesh R <[email protected]>; Joe Hershberger <[email protected]>; Stefan Roese <[email protected]>; Wolfgang Denk <[email protected]>; Lukasz Majewski <[email protected]>; Miquel Raynal <[email protected]>; Marek Vasut <[email protected]>; Bin Meng <[email protected]>; Simon Goldschmidt <[email protected]>; Markus Klotzbuecher <[email protected]>; Baruch Siach <[email protected]>; Harald Seiler <[email protected]>; Joel Johnson <[email protected]>; Anatolij Gustschin <[email protected]>; Priyanka Jain <[email protected]>; Madalin Bucur (OSS) <[email protected]>; Gervais, Francois <[email protected]>; Udit Agarwal <[email protected]>
Subject: Re: [PATCHv4 3/3] spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI*

Quoted 27 lines · Z.q. Hou

Hi Tom and Jagan,

Thanks a lot for your comments!

Quoted 22 lines

-----Original Message-----
From: Tom Rini <[email protected]>
Sent: 2020?6?3? 3:02
To: Jagan Teki <[email protected]>; Z.q. Hou <[email protected]>
Cc: U-Boot-Denx <[email protected]>; Lokesh Vutla <[email protected]>; Andrew F Davis <[email protected]>; Heiko Schocher <[email protected]>; Simon Glass <[email protected]>; Feng Li <[email protected]>; Alison Wang <[email protected]>; Sumit Garg <[email protected]>; Eugen Hristev <[email protected]>; Patrick Delaunay <[email protected]>; Vignesh R <[email protected]>; Joe Hershberger <[email protected]>; Stefan Roese <[email protected]>; Wolfgang Denk <[email protected]>; Lukasz Majewski <[email protected]>; Miquel Raynal <[email protected]>; Marek Vasut <[email protected]>; Bin Meng <[email protected]>; Simon Goldschmidt <[email protected]>; Markus Klotzbuecher <[email protected]>; Baruch Siach <[email protected]>; Harald Seiler <[email protected]>; Joel Johnson <[email protected]>; Anatolij Gustschin <[email protected]>; Priyanka Jain <[email protected]>; Madalin Bucur (OSS) <[email protected]>; Gervais, Francois <[email protected]>; Udit Agarwal

<[email protected]>

Quoted 9 lines
Quoted 9 lines

Subject: Re: [PATCHv4 3/3] spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI*

Quoted 5 lines · Jagan Teki
Quoted 4 lines · Tom Rini
Quoted 2 lines · Jagan Teki

On Tue, Jun 2, 2020 at 6:47 PM Zhiqiang Hou
<[email protected]>

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines · wrote:
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

From: Lukasz Majewski <[email protected]>

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.

Quoted 32 lines
Quoted 32 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

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
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

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).

Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines

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

Quoted 8 lines
Quoted 8 lines

resources to

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

run full blown DT/DTS)
- SPL driver with DT/DTS and SPL_OF_PLATDATA (when one have

constrained

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

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.

Quoted 12 lines
Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

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

Kconfig.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

---
V4:
- Rebase the patch and remove SPL_DM_SPI from target ls1046

Quoted 7 lines
Quoted 7 lines

boards.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
 arch/arm/Kconfig                            | 11

+++++++++++

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
 board/l+g/vinco/vinco.c                     |  4 ++--
 cmd/sf.c                                    |  4 ++--
 cmd/spi.c                                   |  6

+++---

Quoted 35 lines
Quoted 35 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
 common/spl/Kconfig                          | 20

++++++++++++++++++++

Quoted 33 lines
Quoted 33 lines
Quoted 33 lines
Quoted 32 lines
 configs/am57xx_evm_defconfig                |  2 ++
 configs/am57xx_hs_evm_defconfig             |  2 ++
 configs/am57xx_hs_evm_usb_defconfig         |  2 ++
 configs/axm_defconfig                       |  2 ++
 configs/chromebook_link64_defconfig         |  2 ++
 configs/chromebook_samus_tpl_defconfig      |  4 ++++
 configs/dra7xx_evm_defconfig                |  2 ++
 configs/dra7xx_hs_evm_defconfig             |  2 ++
 configs/dra7xx_hs_evm_usb_defconfig         |  2 ++
 configs/j721e_evm_a72_defconfig             |  2 ++
 configs/j721e_evm_r5_defconfig              |  2 ++
 configs/ls1021aiot_qspi_defconfig           |  2 ++
 configs/ls1021aiot_sdcard_defconfig         |  2 ++
 configs/ls1021aqds_qspi_defconfig           |  1 +
 configs/ls1021aqds_sdcard_qspi_defconfig    |  1 +
 configs/ls1021atwr_qspi_defconfig           |  1 +
 configs/sama5d2_xplained_spiflash_defconfig |  2 ++
 configs/sama5d3xek_spiflash_defconfig       |  7 ++++---
 configs/sama5d4_xplained_spiflash_defconfig |  2 ++
 configs/sama5d4ek_spiflash_defconfig        |  2 ++
 configs/stm32mp15_basic_defconfig           |  2 ++
 configs/taurus_defconfig                    |  2 ++
 drivers/mtd/spi/Makefile                    |  4 ++--
 drivers/mtd/spi/sf_probe.c                  |  2 +-
 drivers/net/fm/fm.c                         |  4 ++--
 drivers/spi/Makefile                        |  2 +-
 drivers/spi/atmel_spi.c                     |  4 ++--
 drivers/spi/davinci_spi.c                   |  6 +++---
 drivers/spi/fsl_dspi.c                      |  5 +++--
 drivers/spi/kirkwood_spi.c                  |  2 +-
 drivers/spi/mxc_spi.c                       |  6 +++---
 drivers/spi/omap3_spi.c                     |  4 ++--
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

nondm code on most of the driver will remove in the next version, So I didn't see any usecase of this conversion here.

I think this is still the right direction to go in. non-DM for SPL is allowed and this is part of the logical steps needed for moving forward with "now pull non-DM driver into own file for SPL" until the efforts to make DM smaller still are ready. So this series is on my list to test and confirm doesn't change binary size

on.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

Sorry, I can't do a similar task over the years, I'm saying about nondm part of drivers which doesn't have any footprint issues? You may be true for nondm part which has SPL size issues like mxc_spi, sh_qspi, rest are fine to move. I'd remove those that part at max for next MW.

Quoted 5 lines
Quoted 5 lines

It comes down to where are we at with everything again? I'm not saying you have to be the one to split the code out. But from what I recall of the thread last week, for mxc_spi we get back to "i.MX6 is having problems with size for DM+SPL". So we can't just "OK, no more i.MX6 support". Full U-Boot needs to be, and I believe is,

converted.

Quoted 1 line
Quoted 1 line
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

So I guess the next question I have really is for Hou Zhiqiang and is, do you need this series as part of fixing / converting the eSPI driver and getting NXP platforms converted? Thanks!

Yes, the eSPI DM converting depends on this series, since the SPL now is

non-DM.

But, I was wonder why it would touch other drivers, other than fsl_espi.c ?

This series is not belong to eSPI converting patchset, the author of this series is Lukasz, I help to rebase them to the latest code base, because the eSPI converting patch depends on this series.

Thanks,
Zhiqiang

Quoted 2 lines

Jagan.