Skip to contentSkip to conversation

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

PATCH Superseded Lukasz Majewski 3 participants 11 messages Sep 4, 2019 – Sep 12, 2019

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

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

This patch series introduces new SPL and TPL specific Kconfig entries for DM_SPI* options. Such change allows using the spi driver in SPL/TPL or U-Boot proper.

First two patches - related to ls10{42}* NXP soc fix some issues with defining the DM_SPI* defines in <board>.h file instead of Kconfig.

This series doesn't introduce build breaks, but board maintainers are kindly asked to check if their boards still boots.

Buildman setup for binary size regression checking:

./tools/buildman/buildman.py -b HEAD --count=4 ls1043 --output-dir=../BUILD/ --force-build -CveE ./tools/buildman/buildman.py -b HEAD --count=4 ls1043 --output-dir=../BUILD/ -Ssdel

Changes in v3:
- Provide better Kconfig flags conditionals to avoid not compiling relavant code (there is negative diff observed after applying those patches)
- Fix da850evm_nand and da850evm by enabling SPL_DM_SPI support in Kconfig
- Drop patch from the series
[U-Boot,v2,1/4] kconfig: doc: Update comment regarding CONFIG_IS_ENABLED(FOO) for TPL as not being related to this particular change

Changes in v2:
- Resend patches with some not yet in mainline code removed as suggested by Adam Ford

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                            | 24 ++++++++++++++++++++++--
 board/l+g/vinco/vinco.c                     |  4 ++--
 cmd/sf.c                                    |  4 ++--
 cmd/spi.c                                   |  6 +++---
 common/spl/Kconfig                          | 28 ++++++++++++++++++++++++++++
 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       |  6 ++++--
 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                  |  8 ++++----
 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                |  8 --------
 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, 134 insertions(+), 63 deletions(-)
Signature · 1 line
2.11.0
#1 lore raw

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

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.

---

Changes in v3:
- Provide better Kconfig flags conditionals to avoid not compiling relavant code (there is negative diff observed after applying those patches)

Changes in v2: None

Buildman test code:
./tools/buildman/buildman.py -b HEAD --count=4 ls1043 --output-dir=../BUILD/ --force-build -CveE ./tools/buildman/buildman.py -b HEAD --count=4 ls1043 --output-dir=../BUILD/ -Ssdel

---
 arch/arm/Kconfig                 | 4 ++++
 include/configs/ls1043a_common.h | 2 --
 2 files changed, 4 insertions(+), 2 deletions(-)
arch/arm/Kconfig +4 -0
index 3b0e315061..b13173d7a0 100644
@@ -1407,6 +1407,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
@@ -1421,6 +1423,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 70447a2183..fd8bf705cd 100644
@@ -165,9 +165,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.11.0
#2 lore raw

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

In reply to Lukasz Majewski

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.

---

Changes in v3: None
Changes in v2: None

 arch/arm/Kconfig             | 6 ++++--
 include/configs/ls1021aiot.h | 6 ------
 include/configs/ls1021aqds.h | 8 --------
 include/configs/ls1021atwr.h | 5 -----
 4 files changed, 4 insertions(+), 21 deletions(-)
arch/arm/Kconfig +4 -2
index b13173d7a0..490f2abcf1 100644
@@ -1353,6 +1353,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
@@ -1366,6 +1368,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
@@ -1390,6 +1393,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.
@@ -1825,5 +1829,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 ee570bc1a9..0ab1fb17a6 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 -8
index 66771e279b..e2529dfb9c 100644
@@ -363,14 +363,6 @@ unsigned long get_board_ddr_clk(void);
 #define QSPI0_AMBA_BASE			0x40000000
 #define FSL_QSPI_FLASH_SIZE		(1 << 24)
 #define FSL_QSPI_FLASH_NUM		2
-
-/* DSPI */
-
-/* DM SPI */
-#if defined(CONFIG_FSL_DSPI) || defined(CONFIG_FSL_QSPI)
-#define CONFIG_DM_SPI_FLASH
-#define CONFIG_SPI_FLASH_DATAFLASH
-#endif
 #endif
 
 /*
include/configs/ls1021atwr.h +0 -5
index 31abee81ed..397afb668b 100644
@@ -238,11 +238,6 @@
 /* DSPI */
 #endif
 
-/* DM SPI */
-#if defined(CONFIG_FSL_DSPI) || defined(CONFIG_FSL_QSPI)
-#define CONFIG_DM_SPI_FLASH
-#endif
-
 /*
  * Video
  */
Signature · 1 line
2.11.0
#3 lore raw

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

In reply to Lukasz Majewski

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.

---

Changes in v3:
- Fix da850evm_nand and da850evm by enabling SPL_DM_SPI support in Kconfig
- Drop patch from the series
[U-Boot,v2,1/4] kconfig: doc: Update comment regarding CONFIG_IS_ENABLED(FOO) for TPL as not being related to this particular change

Changes in v2:
- Resend patches with some not yet in mainline code removed as suggested by Adam Ford

===================================
BIG FAT NOTE (REQUEST FOR TESTING):
===================================

The adjustments were done only to make the buildman / travis-CI build clean.

Board maintainers are kindly asked to check if there are no failures on boards booting (or unintentional increase of binary size).

Note:
=====

Some boards require adjustments in ./configs/<board>_defconfig (like Siemens). Other boards require modification in arch/arm/Kconfig (like MVEBU) Yet another ones - like ones from Samsung - doesn't use SPL at all. There are also boards - like i.MX{25678} - which (till now) doesn't use SPI drivers supporting DM in their SPL.

Applied on top of -master branch:
SHA1: 448f11f7503995746a7b71e5e3b3a831c4651be9

---
 arch/arm/Kconfig                            | 14 ++++++++++++++
 board/l+g/vinco/vinco.c                     |  4 ++--
 cmd/sf.c                                    |  4 ++--
 cmd/spi.c                                   |  6 +++---
 common/spl/Kconfig                          | 28 ++++++++++++++++++++++++++++
 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       |  6 ++++--
 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                  |  8 ++++----
 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, 126 insertions(+), 40 deletions(-)
arch/arm/Kconfig +14 -0
index 490f2abcf1..c55c4f25fe 100644
@@ -493,6 +493,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.
@@ -510,6 +511,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
@@ -918,6 +921,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
@@ -1006,6 +1011,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
@@ -1042,6 +1049,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_SEPARATE_BSS if SPL
 	select SUPPORT_SPL
 	imply BOARD_LATE_INIT
@@ -1441,6 +1450,7 @@ config TARGET_LS1046AQDS
 	select BOARD_EARLY_INIT_F
 	select BOARD_LATE_INIT
 	select DM_SPI_FLASH if DM_SPI
+	select SPL_DM_SPI
 	select SUPPORT_SPL
 	select FSL_DDR_BIST if !SPL
 	select FSL_DDR_INTERACTIVE  if !SPL
@@ -1461,6 +1471,7 @@ config TARGET_LS1046ARDB
 	select BOARD_EARLY_INIT_F
 	select BOARD_LATE_INIT
 	select DM_SPI_FLASH if DM_SPI
+	select SPL_DM_SPI
 	select POWER_MC34VR500
 	select SUPPORT_SPL
 	select FSL_DDR_BIST
@@ -1481,6 +1492,7 @@ config TARGET_LS1046AFRWY
 	select BOARD_EARLY_INIT_F
 	select BOARD_LATE_INIT
 	select DM_SPI_FLASH if DM_SPI
+	select SPL_DM_SPI
 	imply SCSI
 	help
 	  Support for Freescale LS1046AFRWY platform.
@@ -1593,6 +1605,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 SPL_SYS_MALLOC_SIMPLE if SPL
 	select SYS_MALLOC_F
 	select SYS_THUMB_BUILD if !ARM64
board/l+g/vinco/vinco.c +2 -2
index 029ab12391..d7cb1bda5e 100644
@@ -33,7 +33,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;
@@ -166,7 +166,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 6ccf98ae51..5487a05c3f 100644
@@ -85,7 +85,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
@@ -118,7 +118,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 75226fd368..f163cec23b 100644
@@ -37,7 +37,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;
 
@@ -62,7 +62,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;
@@ -78,7 +78,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 +28 -0
index f467eca2be..77c5a9f818 100644
@@ -671,6 +671,19 @@ config SPL_UBI
 	  Enable support for loading payloads from UBI. See
 	  README.ubispl for more info.
 
+if SPL_DM
+config SPL_DM_SPI
+	bool "Support SPI DM drivers in SPL"
+	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
 	bool "Support loading volumes by name"
@@ -995,6 +1008,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
@@ -1387,6 +1405,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 248c302057..66d812e4fc 100644
@@ -65,6 +65,7 @@ CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
@@ -84,6 +85,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 7b56df8db7..74ed44d3f4 100644
@@ -63,6 +63,7 @@ CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
@@ -82,6 +83,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 c8078e9f4e..ec798ef90d 100644
@@ -69,6 +69,7 @@ CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
@@ -89,6 +90,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 a1d374aeb5..b49d681bd6 100644
@@ -60,6 +60,8 @@ CONFIG_CLK_AT91=y
 CONFIG_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=y
 CONFIG_SPI_FLASH_STMICRO=y
configs/chromebook_link64_defconfig +2 -0
index 4bbd7a67dc..24042aef6a 100644
@@ -27,6 +27,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 973460082d..10ff4167c1 100644
@@ -27,11 +27,15 @@ CONFIG_BLOBLIST_ADDR=0xff7c0000
 CONFIG_HANDOFF=y
 CONFIG_SPL_TEXT_BASE=0xffe70000
 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_FLASH is not set
configs/dra7xx_evm_defconfig +2 -0
index ad8868e512..1bf8f97192 100644
@@ -75,6 +75,7 @@ CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
@@ -96,6 +97,7 @@ CONFIG_DM_SCSI=y
 CONFIG_DM_SERIAL=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
+CONFIG_SPL_DM_SPI=y
 CONFIG_TI_QSPI=y
 CONFIG_TIMER=y
 CONFIG_OMAP_TIMER=y
configs/dra7xx_hs_evm_defconfig +2 -0
index 7a5c3e72d4..6d3d357411 100644
@@ -78,6 +78,7 @@ CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
 CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
@@ -99,6 +100,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 040e6f7fdd..4b2dce6b15 100644
@@ -78,6 +78,7 @@ CONFIG_MMC_HS200_SUPPORT=y
 CONFIG_SPL_MMC_HS200_SUPPORT=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=76800000
@@ -100,6 +101,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 6e355f5247..380bd0b814 100644
@@ -63,6 +63,7 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_AM654=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PINCTRL=y
@@ -77,6 +78,7 @@ CONFIG_RESET_TI_SCI=y
 CONFIG_DM_SERIAL=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 b516f9d0e5..cdf10503e6 100644
@@ -67,6 +67,7 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_AM654=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PINCTRL=y
@@ -83,6 +84,7 @@ CONFIG_RESET_TI_SCI=y
 CONFIG_DM_SERIAL=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 5dcec24005..00a5f13dba 100644
@@ -12,6 +12,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
@@ -35,6 +36,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 93eb83471c..3dc879fe70 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_SPL_EFI_PARTITION is not set
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="ls1021a-iot-duart"
@@ -41,6 +42,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 db74cc5712..bb1d1afcb4 100644
@@ -54,6 +54,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 cc71c28259..285a7bcaa6 100644
@@ -66,6 +66,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 0e2525fd71..27ce459ffb 100644
@@ -53,6 +53,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 6958621cdf..0a448b57d4 100644
@@ -65,6 +65,8 @@ CONFIG_I2C_EEPROM=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ATMEL=y
+CONFIG_SPL_DM_SPI=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
configs/sama5d3xek_spiflash_defconfig +4 -2
index b27a288b4a..bcbc4312dc 100644
@@ -7,10 +7,11 @@ CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
-CONFIG_SPL_SERIAL_SUPPORT=y
-CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_ENV_SIZE=0x2000
+CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x6000
+CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SPL=y
 CONFIG_DEBUG_UART_BOARD_INIT=y
@@ -28,6 +29,7 @@ CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,768k(uboot)ro,256K(env_redundant),256k(env),512k(dtb),6M(kernel)ro,-(rootfs) rootfstype=ubifs ubi.mtd=6 root=ubi0:rootfs"
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_SPL_TEXT_BASE=0x300000
+CONFIG_SPL_DM_SPI=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x10000
 CONFIG_HUSH_PARSER=y
configs/sama5d4_xplained_spiflash_defconfig +2 -0
index a2e9595088..3a8b291721 100644
@@ -66,6 +66,7 @@ CONFIG_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_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=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 aa1a492997..dfc1100466 100644
@@ -63,6 +63,7 @@ CONFIG_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_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_SPI_FLASH_ATMEL=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 09785b5dc1..61758f4c55 100644
@@ -83,6 +83,7 @@ CONFIG_MTD=y
 CONFIG_NAND=y
 CONFIG_NAND_STM32_FMC2=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_SPANSION=y
@@ -110,6 +111,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 3676ecd419..a53f04f1c8 100644
@@ -68,6 +68,8 @@ CONFIG_DFU_NAND=y
 CONFIG_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=y
 CONFIG_SPI_FLASH_STMICRO=y
drivers/mtd/spi/Makefile +2 -2
index f99f6cb16e..b9566dcbb8 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 sf.o
-obj-$(CONFIG_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 +4 -4
index 73297e1a0a..5bc0c1d7f2 100644
@@ -44,7 +44,7 @@ static int spi_flash_probe_slave(struct spi_flash *flash)
 	if (ret)
 		goto err_read_id;
 
-#ifdef CONFIG_SPI_FLASH_MTD
+#if CONFIG_IS_ENABLED(SPI_FLASH_MTD)
 	ret = spi_flash_mtd_register(flash);
 #endif
 
@@ -53,7 +53,7 @@ err_read_id:
 	return ret;
 }
 
-#ifndef CONFIG_DM_SPI_FLASH
+#if !CONFIG_IS_ENABLED(DM_SPI_FLASH)
 struct spi_flash *spi_flash_probe(unsigned int busnum, unsigned int cs,
 				  unsigned int max_hz, unsigned int spi_mode)
 {
@@ -83,7 +83,7 @@ struct spi_flash *spi_flash_probe(unsigned int busnum, unsigned int cs,
 
 void spi_flash_free(struct spi_flash *flash)
 {
-#ifdef CONFIG_SPI_FLASH_MTD
+#if CONFIG_IS_ENABLED(SPI_FLASH_MTD)
 	spi_flash_mtd_unregister();
 #endif
 	spi_free_slave(flash->spi);
@@ -152,7 +152,7 @@ static int spi_flash_std_probe(struct udevice *dev)
 
 static int spi_flash_std_remove(struct udevice *dev)
 {
-#ifdef CONFIG_SPI_FLASH_MTD
+#if CONFIG_IS_ENABLED(SPI_FLASH_MTD)
 	spi_flash_mtd_unregister();
 #endif
 	return 0;
drivers/net/fm/fm.c +2 -2
index 4c9dce8dc5..1d0eb20cb9 100644
@@ -377,7 +377,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 */
@@ -464,7 +464,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 ae4f2958f8..93d20672eb 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 cf4de9ee1a..80002e5167 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
 #ifdef CONFIG_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 4d2c106440..fe15126e74 100644
@@ -52,7 +52,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
 /*
@@ -119,7 +119,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;
@@ -343,7 +343,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 a68a51945e..09a60bd05b 100644
@@ -97,7 +97,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;
@@ -411,7 +411,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 c725625146..afb25e6ee9 100644
@@ -93,7 +93,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 d94aaf9fdb..efcb214fae 100644
@@ -63,7 +63,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);
 
@@ -81,7 +81,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);
 
@@ -411,7 +411,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 ff4c700645..9508947c61 100644
@@ -108,7 +108,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;
@@ -454,7 +454,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 5ae203d8d4..37f83b0bab 100644
@@ -67,7 +67,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;
@@ -222,7 +222,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 590d0cedd8..59d8af2ec6 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 378594163b..81e07b2da6 100644
@@ -36,7 +36,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;
@@ -95,7 +95,7 @@ struct dm_spi_slave_platdata {
  * @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;
@@ -261,7 +261,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
@@ -311,7 +311,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 55b4721813..d63465758f 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 ffd789cd7f..e101a078fd 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.11.0
#4 lore raw

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

In reply to Lukasz Majewski
Quoted 7 lines · Lukasz Majewski

This patch series introduces new SPL and TPL specific Kconfig entries for DM_SPI* options. Such change allows using the spi driver in SPL/TPL or U-Boot proper.

First two patches - related to ls10{42}* NXP soc fix some issues with defining the DM_SPI* defines in <board>.h file instead of Kconfig.

Quoted 7 lines

This series doesn't introduce build breaks, but board maintainers are kindly asked to check if their boards still boots.

Buildman setup for binary size regression checking:

./tools/buildman/buildman.py -b HEAD --count=4 ls1043 --output-dir=../BUILD/ --force-build -CveE ./tools/buildman/buildman.py -b HEAD --count=4 ls1043 --output-dir=../BUILD/ -Ssdel

So you did fix the ls1043 problems but ls1046 is still a problem.
There's also changes in (add 'B' to the buildman flags above for this
info):
x86: (for 26/26 boards) spl/u-boot-spl:all -31.6 spl/u-boot-spl:data -11.4 spl/u-boot-spl:rodata -6.3 spl/u-boot-spl:text -13.9
qemu-x86_64 : spl/u-boot-spl:all -821 spl/u-boot-spl:data -296 spl/u-boot-spl:rodata -164 spl/u-boot-spl:text -361
spl-u-boot-spl: add: 0/-10, grow: 0/0 bytes: 0/-657 (-657)
function old new delta
spi_flash_post_bind 3 - -3
dev_get_parent_priv 11 - -11
spi_post_probe 35 - -35
spi_child_post_bind 37 - -37
spi_child_pre_probe 46 - -46
_u_boot_list_2_driver_2_spi_generic_drv 68 - -68
_u_boot_list_2_uclass_2_spi_nor 76 - -76
_u_boot_list_2_uclass_2_spi_generic 76 - -76
_u_boot_list_2_uclass_2_spi 76 - -76
spi_slave_ofdata_to_platdata 229 - -229
arm: (for 688/688 boards) all -19.6 bss -4.5 rodata -2.2 spl/u-boot-spl:all -12.2 spl/u-boot-spl:bss -1.1 spl/u-boot-spl:data -1.9 spl/u-boot-spl:rodata -2.0 spl/u-boot-spl:text -7.2 text -12.9
uniphier_v7 : bss -8 rodata +8
opos6uldev : bss -8 rodata +8
uniphier_ld4_sld8: bss -8 rodata +8
da850evm : spl/u-boot-spl:all -614 spl/u-boot-spl:data -144 spl/u-boot-spl:rodata -150 spl/u-boot-spl:text -320
spl-u-boot-spl: add: 2/-15, grow: 2/0 bytes: 112/-574 (-462)
function old new delta
spi_flash_probe 38 82 +44
spi_setup_slave - 42 +42
spl_spi_load_image 124 144 +20
spi_free_slave - 6 +6
spi_flash_std_remove 4 - -4
spi_flash_post_bind 4 - -4
spi_flash_cmd_get_sw_write_prot 8 - -8
____aeabi_uidivmod_from_thumb 8 - -8
spi_flash_std_get_sw_write_prot 18 - -18
spi_flash_read_dm 20 - -20
__aeabi_uidivmod 24 - -24
__aeabi_idivmod 24 - -24
spi_flash_std_write 42 - -42
spi_flash_std_read 42 - -42
spi_flash_probe_bus_cs 56 - -56
_u_boot_list_2_driver_2_spi_flash_std 68 - -68
_u_boot_list_2_uclass_2_spi_nor 76 - -76
spi_flash_std_probe 88 - -88
spi_flash_std_erase 92 - -92
da850evm_nand : spl/u-boot-spl:all -614 spl/u-boot-spl:data -144 spl/u-boot-spl:rodata -150 spl/u-boot-spl:text -320
spl-u-boot-spl: add: 2/-15, grow: 2/0 bytes: 112/-574 (-462)
function old new delta
spi_flash_probe 38 82 +44
spi_setup_slave - 42 +42
spl_spi_load_image 124 144 +20
spi_free_slave - 6 +6
spi_flash_std_remove 4 - -4
spi_flash_post_bind 4 - -4
spi_flash_cmd_get_sw_write_prot 8 - -8
____aeabi_uidivmod_from_thumb 8 - -8
spi_flash_std_get_sw_write_prot 18 - -18
spi_flash_read_dm 20 - -20
__aeabi_uidivmod 24 - -24
__aeabi_idivmod 24 - -24
spi_flash_std_write 42 - -42
spi_flash_std_read 42 - -42
spi_flash_probe_bus_cs 56 - -56
_u_boot_list_2_driver_2_spi_flash_std 68 - -68
_u_boot_list_2_uclass_2_spi_nor 76 - -76
spi_flash_std_probe 88 - -88
spi_flash_std_erase 92 - -92
sama5d3xek_spiflash: spl/u-boot-spl:all -630 spl/u-boot-spl:data -144 spl/u-boot-spl:rodata -150 spl/u-boot-spl:text -336
spl-u-boot-spl: add: 2/-12, grow: 2/0 bytes: 196/-676 (-480)
function old new delta
spi_flash_probe 44 120 +76
spi_setup_slave - 60 +60
spl_spi_load_image 172 220 +48
spi_free_slave - 12 +12
spi_flash_std_remove 8 - -8
spi_flash_post_bind 8 - -8
spi_flash_cmd_get_sw_write_prot 12 - -12
spi_flash_std_get_sw_write_prot 16 - -16
spi_flash_read_dm 28 - -28
spi_flash_std_write 64 - -64
spi_flash_std_read 64 - -64
_u_boot_list_2_driver_2_spi_flash_std 68 - -68
spi_flash_probe_bus_cs 76 - -76
_u_boot_list_2_uclass_2_spi_nor 76 - -76
spi_flash_std_probe 116 - -116
spi_flash_std_erase 140 - -140
socfpga_cyclone5: all -722 bss -136 rodata -98 text -488
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_std_remove 10 4 -6
sf_mtd_name 8 - -8
spi_flash_std_probe 88 76 -12
spi_flash_mtd_write 38 - -38
spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52 - -52
spi_flash_mtd_erase 78 - -78
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
socfpga_socrates: all -794 bss -208 rodata -98 text -488
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_std_remove 10 4 -6
sf_mtd_name 8 - -8
spi_flash_std_probe 88 76 -12
spi_flash_mtd_write 38 - -38
spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52 - -52
spi_flash_mtd_erase 78 - -78
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
socfpga_sockit : all -794 bss -208 rodata -98 text -488
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_std_remove 10 4 -6
sf_mtd_name 8 - -8
spi_flash_std_probe 88 76 -12
spi_flash_mtd_write 38 - -38
spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52 - -52
spi_flash_mtd_erase 78 - -78
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
socfpga_arria5 : all -794 bss -208 rodata -98 text -488
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_std_remove 10 4 -6
sf_mtd_name 8 - -8
spi_flash_std_probe 88 76 -12
spi_flash_mtd_write 38 - -38
spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52 - -52
spi_flash_mtd_erase 78 - -78
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
socfpga_is1 : all -794 bss -208 rodata -98 text -488
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_std_remove 10 4 -6
sf_mtd_name 8 - -8
spi_flash_std_probe 88 76 -12
spi_flash_mtd_write 38 - -38
spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52 - -52
spi_flash_mtd_erase 78 - -78
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
socfpga_vining_fpga: all -858 bss -272 rodata -98 text -488
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_std_remove 10 4 -6
sf_mtd_name 8 - -8
spi_flash_std_probe 88 76 -12
spi_flash_mtd_write 38 - -38
spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52 - -52
spi_flash_mtd_erase 78 - -78
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
socfpga_sr1500 : all -858 bss -280 rodata -98 text -480
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_std_remove 10 4 -6
sf_mtd_name 8 - -8
spi_flash_std_probe 88 76 -12
spi_flash_mtd_write 38 - -38
spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52 - -52
spi_flash_mtd_erase 78 - -78
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
cm_fx6 : all -1130 bss -296 rodata -146 text -688
u-boot: add: 0/-11, grow: 0/-2 bytes: 0/-829 (-829)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_free 26 22 -4
sf_mtd_name 8 - -8
spi_flash_probe 88 78 -10
idr_remove 20 - -20
spi_flash_mtd_write 44 - -44
spi_flash_mtd_read 44 - -44
spi_flash_mtd_unregister 52 - -52
del_mtd_device 68 - -68
spi_flash_mtd_erase 164 - -164
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
aristainetos : all -1186 bss -264 rodata -98 text -824
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-981 (-981)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 4 - -4
spi_flash_free 32 28 -4
sf_mtd_name 8 - -8
spi_flash_probe 136 120 -16
spi_flash_mtd_write 80 - -80
spi_flash_mtd_read 80 - -80
spi_flash_mtd_unregister 84 - -84
spi_flash_mtd_erase 220 - -220
sf_mtd_info 240 - -240
spi_flash_mtd_register 244 - -244
aristainetos2 : all -1186 bss -264 rodata -98 text -824
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-981 (-981)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 4 - -4
spi_flash_free 32 28 -4
sf_mtd_name 8 - -8
spi_flash_probe 136 120 -16
spi_flash_mtd_write 80 - -80
spi_flash_mtd_read 80 - -80
spi_flash_mtd_unregister 84 - -84
spi_flash_mtd_erase 220 - -220
sf_mtd_info 240 - -240
spi_flash_mtd_register 244 - -244
aristainetos2b : all -1186 bss -264 rodata -98 text -824
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-981 (-981)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 4 - -4
spi_flash_free 32 28 -4
sf_mtd_name 8 - -8
spi_flash_probe 136 120 -16
spi_flash_mtd_write 80 - -80
spi_flash_mtd_read 80 - -80
spi_flash_mtd_unregister 84 - -84
spi_flash_mtd_erase 220 - -220
sf_mtd_info 240 - -240
spi_flash_mtd_register 244 - -244
display5_factory: all -1561 bss -216 rodata -201 text -1144
u-boot: add: 0/-13, grow: 0/-2 bytes: 0/-1237 (-1237)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_free 26 22 -4
sf_mtd_name 8 - -8
spi_flash_probe 88 78 -10
idr_remove 20 - -20
spi_flash_mtd_write 44 - -44
spi_flash_mtd_read 44 - -44
spi_flash_mtd_unregister 52 - -52
del_mtd_device 68 - -68
mtd_unlock 80 - -80
spi_flash_mtd_erase 164 - -164
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
add_mtd_device 328 - -328
display5 : all -1605 bss -248 rodata -201 text -1156
u-boot: add: 0/-13, grow: 0/-2 bytes: 0/-1237 (-1237)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_free 26 22 -4
sf_mtd_name 8 - -8
spi_flash_probe 88 78 -10
idr_remove 20 - -20
spi_flash_mtd_write 44 - -44
spi_flash_mtd_read 44 - -44
spi_flash_mtd_unregister 52 - -52
del_mtd_device 68 - -68
mtd_unlock 80 - -80
spi_flash_mtd_erase 164 - -164
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
add_mtd_device 328 - -328
brppt1_spi : spl/u-boot-spl:all -2109 spl/u-boot-spl:bss -4 spl/u-boot-spl:data -436 spl/u-boot-spl:rodata -309 spl/u-boot-spl:text -1360
spl-u-boot-spl: add: 3/-41, grow: 5/-2 bytes: 1310/-3100 (-1790)
function old new delta
spi_xfer 6 800 +794
spi_claim_bus 6 248 +242
spi_setup_slave - 156 +156
spi_do_alloc_slave - 48 +48
spi_flash_probe 26 72 +46
spl_spi_load_image 124 140 +16
spi_release_bus 6 12 +6
spi_free_slave - 2 +2
spi_flash_std_remove 4 - -4
spi_flash_post_bind 4 - -4
omap4_pdata 4 - -4
omap2_pdata 4 - -4
dev_get_parent_priv 6 - -6
spi_flash_cmd_get_sw_write_prot 8 - -8
spi_flash_std_get_sw_write_prot 14 - -14
spi_flash_read_dm 14 - -14
dm_spi_release_bus 14 - -14
ofnode_read_bool 16 - -16
fdtdec_get_bool 20 - -20
omap3_spi_release_bus 22 - -22
spi_mem_adjust_op_size 92 68 -24
spi_child_post_bind 30 - -30
spi_post_probe 32 - -32
spi_flash_std_write 34 - -34
spi_flash_std_read 34 - -34
spi_child_pre_probe 34 - -34
dm_spi_xfer 34 - -34
spi_mem_supports_op 36 - -36
spi_flash_probe_bus_cs 48 - -48
spi_find_chip_select 50 - -50
omap3_spi_claim_bus 54 - -54
static.spi_check_buswidth_req 56 - -56
omap3_spi_set_wordlen 62 - -62
spi_mem_exec_op 284 220 -64
_u_boot_list_2_driver_2_spi_generic_drv 68 - -68
_u_boot_list_2_driver_2_spi_flash_std 68 - -68
_u_boot_list_2_driver_2_omap3_spi 68 - -68
spi_set_speed_mode 72 - -72
spi_flash_std_probe 76 - -76
omap3_spi_set_speed 76 - -76
_u_boot_list_2_uclass_2_spi_nor 76 - -76
_u_boot_list_2_uclass_2_spi_generic 76 - -76
_u_boot_list_2_uclass_2_spi 76 - -76
spi_flash_std_erase 84 - -84
spi_mem_default_supports_op 86 - -86
omap3_spi_set_mode 96 - -96
dm_spi_claim_bus 100 - -100
omap3_spi_probe 116 - -116
spi_slave_ofdata_to_platdata 212 - -212
spi_get_bus_and_cs 232 - -232
omap3_spi_xfer 796 - -796
brsmarc1 : spl/u-boot-spl:all -2113 spl/u-boot-spl:bss -4 spl/u-boot-spl:data -436 spl/u-boot-spl:rodata -309 spl/u-boot-spl:text -1364
spl-u-boot-spl: add: 3/-41, grow: 5/-2 bytes: 1310/-3100 (-1790)
function old new delta
spi_xfer 6 800 +794
spi_claim_bus 6 248 +242
spi_setup_slave - 156 +156
spi_do_alloc_slave - 48 +48
spi_flash_probe 26 72 +46
spl_spi_load_image 124 140 +16
spi_release_bus 6 12 +6
spi_free_slave - 2 +2
spi_flash_std_remove 4 - -4
spi_flash_post_bind 4 - -4
omap4_pdata 4 - -4
omap2_pdata 4 - -4
dev_get_parent_priv 6 - -6
spi_flash_cmd_get_sw_write_prot 8 - -8
spi_flash_std_get_sw_write_prot 14 - -14
spi_flash_read_dm 14 - -14
dm_spi_release_bus 14 - -14
ofnode_read_bool 16 - -16
fdtdec_get_bool 20 - -20
omap3_spi_release_bus 22 - -22
spi_mem_adjust_op_size 92 68 -24
spi_child_post_bind 30 - -30
spi_post_probe 32 - -32
spi_flash_std_write 34 - -34
spi_flash_std_read 34 - -34
spi_child_pre_probe 34 - -34
dm_spi_xfer 34 - -34
spi_mem_supports_op 36 - -36
spi_flash_probe_bus_cs 48 - -48
spi_find_chip_select 50 - -50
omap3_spi_claim_bus 54 - -54
static.spi_check_buswidth_req 56 - -56
omap3_spi_set_wordlen 62 - -62
spi_mem_exec_op 284 220 -64
_u_boot_list_2_driver_2_spi_generic_drv 68 - -68
_u_boot_list_2_driver_2_spi_flash_std 68 - -68
_u_boot_list_2_driver_2_omap3_spi 68 - -68
spi_set_speed_mode 72 - -72
spi_flash_std_probe 76 - -76
omap3_spi_set_speed 76 - -76
_u_boot_list_2_uclass_2_spi_nor 76 - -76
_u_boot_list_2_uclass_2_spi_generic 76 - -76
_u_boot_list_2_uclass_2_spi 76 - -76
spi_flash_std_erase 84 - -84
spi_mem_default_supports_op 86 - -86
omap3_spi_set_mode 96 - -96
dm_spi_claim_bus 100 - -100
omap3_spi_probe 116 - -116
spi_slave_ofdata_to_platdata 212 - -212
spi_get_bus_and_cs 232 - -232
omap3_spi_xfer 796 - -796
stm32mp15_basic: spl/u-boot-spl:all -2312 spl/u-boot-spl:bss -772 spl/u-boot-spl:rodata -292 spl/u-boot-spl:text -1248
spl-u-boot-spl: add: 0/-19, grow: 0/-2 bytes: 0/-2013 (-2013)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_std_remove 10 4 -6
spi_flash_erase_dm 8 - -8
sf_mtd_name 8 - -8
spi_flash_std_probe 88 76 -12
spi_flash_write_dm 14 - -14
idr_remove 20 - -20
spi_flash_mtd_write 38 - -38
spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52 - -52
spi_flash_mtd_erase 78 - -78
mtd_unlock 80 - -80
del_mtd_device 80 - -80
mtd_erase_callback 88 - -88
part_erase 96 - -96
del_mtd_partitions 136 - -136
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
add_mtd_device 328 - -328
mtd_idr 516 - -516

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190905/56d05d8c/attachment.sig>
#5 lore raw

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

Hi Lukasz,

Quoted 11 lines · Tom Rini
Quoted 10 lines · Lukasz Majewski

This patch series introduces new SPL and TPL specific Kconfig entries for DM_SPI* options. Such change allows using the spi driver in SPL/TPL or U-Boot proper.

First two patches - related to ls10{42}* NXP soc fix some issues with defining the DM_SPI* defines in <board>.h file instead of Kconfig.

This series doesn't introduce build breaks, but board maintainers are kindly asked to check if their boards still boots.

Quoted 6 lines
Quoted 4 lines

Buildman setup for binary size regression checking:

./tools/buildman/buildman.py -b HEAD --count=4 ls1043 --output-dir=../BUILD/ --force-build -CveE ./tools/buildman/buildman.py -b HEAD --count=4 ls1043 --output-dir=../BUILD/ -Ssdel

So you did fix the ls1043 problems but ls1046 is still a problem.

I was trying to clean up this config mess some weeks ago. I stumbled over the same issues (size deltas below) when I tested with buildman and finally gave up on it. This was my testing branch for reference: [1].

Thanks for your work and I hope you/we can get this sorted out somehow...

Regards,
Frieder

[1]: https://github.com/fschrempf/u-boot/commits/non_dm_spi_flash_in_spl

Quoted 414 lines

There's also changes in (add 'B' to the buildman flags above for this
info):
x86: (for 26/26 boards) spl/u-boot-spl:all -31.6 spl/u-boot-spl:data -11.4 spl/u-boot-spl:rodata -6.3 spl/u-boot-spl:text -13.9
qemu-x86_64 : spl/u-boot-spl:all -821 spl/u-boot-spl:data -296 spl/u-boot-spl:rodata -164 spl/u-boot-spl:text -361
spl-u-boot-spl: add: 0/-10, grow: 0/0 bytes: 0/-657 (-657)
function old new delta
spi_flash_post_bind 3 - -3
dev_get_parent_priv 11 - -11
spi_post_probe 35 - -35
spi_child_post_bind 37 - -37
spi_child_pre_probe 46 - -46
_u_boot_list_2_driver_2_spi_generic_drv 68 - -68
_u_boot_list_2_uclass_2_spi_nor 76 - -76
_u_boot_list_2_uclass_2_spi_generic 76 - -76
_u_boot_list_2_uclass_2_spi 76 - -76
spi_slave_ofdata_to_platdata 229 - -229
arm: (for 688/688 boards) all -19.6 bss -4.5 rodata -2.2 spl/u-boot-spl:all -12.2 spl/u-boot-spl:bss -1.1 spl/u-boot-spl:data -1.9 spl/u-boot-spl:rodata -2.0 spl/u-boot-spl:text -7.2 text -12.9
uniphier_v7 : bss -8 rodata +8
opos6uldev : bss -8 rodata +8
uniphier_ld4_sld8: bss -8 rodata +8
da850evm : spl/u-boot-spl:all -614 spl/u-boot-spl:data -144 spl/u-boot-spl:rodata -150 spl/u-boot-spl:text -320
spl-u-boot-spl: add: 2/-15, grow: 2/0 bytes: 112/-574 (-462)
function old new delta
spi_flash_probe 38 82 +44
spi_setup_slave - 42 +42
spl_spi_load_image 124 144 +20
spi_free_slave - 6 +6
spi_flash_std_remove 4 - -4
spi_flash_post_bind 4 - -4
spi_flash_cmd_get_sw_write_prot 8 - -8
____aeabi_uidivmod_from_thumb 8 - -8
spi_flash_std_get_sw_write_prot 18 - -18
spi_flash_read_dm 20 - -20
__aeabi_uidivmod 24 - -24
__aeabi_idivmod 24 - -24
spi_flash_std_write 42 - -42
spi_flash_std_read 42 - -42
spi_flash_probe_bus_cs 56 - -56
_u_boot_list_2_driver_2_spi_flash_std 68 - -68
_u_boot_list_2_uclass_2_spi_nor 76 - -76
spi_flash_std_probe 88 - -88
spi_flash_std_erase 92 - -92
da850evm_nand : spl/u-boot-spl:all -614 spl/u-boot-spl:data -144 spl/u-boot-spl:rodata -150 spl/u-boot-spl:text -320
spl-u-boot-spl: add: 2/-15, grow: 2/0 bytes: 112/-574 (-462)
function old new delta
spi_flash_probe 38 82 +44
spi_setup_slave - 42 +42
spl_spi_load_image 124 144 +20
spi_free_slave - 6 +6
spi_flash_std_remove 4 - -4
spi_flash_post_bind 4 - -4
spi_flash_cmd_get_sw_write_prot 8 - -8
____aeabi_uidivmod_from_thumb 8 - -8
spi_flash_std_get_sw_write_prot 18 - -18
spi_flash_read_dm 20 - -20
__aeabi_uidivmod 24 - -24
__aeabi_idivmod 24 - -24
spi_flash_std_write 42 - -42
spi_flash_std_read 42 - -42
spi_flash_probe_bus_cs 56 - -56
_u_boot_list_2_driver_2_spi_flash_std 68 - -68
_u_boot_list_2_uclass_2_spi_nor 76 - -76
spi_flash_std_probe 88 - -88
spi_flash_std_erase 92 - -92
sama5d3xek_spiflash: spl/u-boot-spl:all -630 spl/u-boot-spl:data -144 spl/u-boot-spl:rodata -150 spl/u-boot-spl:text -336
spl-u-boot-spl: add: 2/-12, grow: 2/0 bytes: 196/-676 (-480)
function old new delta
spi_flash_probe 44 120 +76
spi_setup_slave - 60 +60
spl_spi_load_image 172 220 +48
spi_free_slave - 12 +12
spi_flash_std_remove 8 - -8
spi_flash_post_bind 8 - -8
spi_flash_cmd_get_sw_write_prot 12 - -12
spi_flash_std_get_sw_write_prot 16 - -16
spi_flash_read_dm 28 - -28
spi_flash_std_write 64 - -64
spi_flash_std_read 64 - -64
_u_boot_list_2_driver_2_spi_flash_std 68 - -68
spi_flash_probe_bus_cs 76 - -76
_u_boot_list_2_uclass_2_spi_nor 76 - -76
spi_flash_std_probe 116 - -116
spi_flash_std_erase 140 - -140
socfpga_cyclone5: all -722 bss -136 rodata -98 text -488
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_std_remove 10 4 -6
sf_mtd_name 8 - -8
spi_flash_std_probe 88 76 -12
spi_flash_mtd_write 38 - -38
spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52 - -52
spi_flash_mtd_erase 78 - -78
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
socfpga_socrates: all -794 bss -208 rodata -98 text -488
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_std_remove 10 4 -6
sf_mtd_name 8 - -8
spi_flash_std_probe 88 76 -12
spi_flash_mtd_write 38 - -38
spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52 - -52
spi_flash_mtd_erase 78 - -78
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
socfpga_sockit : all -794 bss -208 rodata -98 text -488
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_std_remove 10 4 -6
sf_mtd_name 8 - -8
spi_flash_std_probe 88 76 -12
spi_flash_mtd_write 38 - -38
spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52 - -52
spi_flash_mtd_erase 78 - -78
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
socfpga_arria5 : all -794 bss -208 rodata -98 text -488
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_std_remove 10 4 -6
sf_mtd_name 8 - -8
spi_flash_std_probe 88 76 -12
spi_flash_mtd_write 38 - -38
spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52 - -52
spi_flash_mtd_erase 78 - -78
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
socfpga_is1 : all -794 bss -208 rodata -98 text -488
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_std_remove 10 4 -6
sf_mtd_name 8 - -8
spi_flash_std_probe 88 76 -12
spi_flash_mtd_write 38 - -38
spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52 - -52
spi_flash_mtd_erase 78 - -78
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
socfpga_vining_fpga: all -858 bss -272 rodata -98 text -488
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_std_remove 10 4 -6
sf_mtd_name 8 - -8
spi_flash_std_probe 88 76 -12
spi_flash_mtd_write 38 - -38
spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52 - -52
spi_flash_mtd_erase 78 - -78
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
socfpga_sr1500 : all -858 bss -280 rodata -98 text -480
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_std_remove 10 4 -6
sf_mtd_name 8 - -8
spi_flash_std_probe 88 76 -12
spi_flash_mtd_write 38 - -38
spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52 - -52
spi_flash_mtd_erase 78 - -78
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
cm_fx6 : all -1130 bss -296 rodata -146 text -688
u-boot: add: 0/-11, grow: 0/-2 bytes: 0/-829 (-829)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_free 26 22 -4
sf_mtd_name 8 - -8
spi_flash_probe 88 78 -10
idr_remove 20 - -20
spi_flash_mtd_write 44 - -44
spi_flash_mtd_read 44 - -44
spi_flash_mtd_unregister 52 - -52
del_mtd_device 68 - -68
spi_flash_mtd_erase 164 - -164
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
aristainetos : all -1186 bss -264 rodata -98 text -824
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-981 (-981)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 4 - -4
spi_flash_free 32 28 -4
sf_mtd_name 8 - -8
spi_flash_probe 136 120 -16
spi_flash_mtd_write 80 - -80
spi_flash_mtd_read 80 - -80
spi_flash_mtd_unregister 84 - -84
spi_flash_mtd_erase 220 - -220
sf_mtd_info 240 - -240
spi_flash_mtd_register 244 - -244
aristainetos2 : all -1186 bss -264 rodata -98 text -824
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-981 (-981)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 4 - -4
spi_flash_free 32 28 -4
sf_mtd_name 8 - -8
spi_flash_probe 136 120 -16
spi_flash_mtd_write 80 - -80
spi_flash_mtd_read 80 - -80
spi_flash_mtd_unregister 84 - -84
spi_flash_mtd_erase 220 - -220
sf_mtd_info 240 - -240
spi_flash_mtd_register 244 - -244
aristainetos2b : all -1186 bss -264 rodata -98 text -824
u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-981 (-981)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 4 - -4
spi_flash_free 32 28 -4
sf_mtd_name 8 - -8
spi_flash_probe 136 120 -16
spi_flash_mtd_write 80 - -80
spi_flash_mtd_read 80 - -80
spi_flash_mtd_unregister 84 - -84
spi_flash_mtd_erase 220 - -220
sf_mtd_info 240 - -240
spi_flash_mtd_register 244 - -244
display5_factory: all -1561 bss -216 rodata -201 text -1144
u-boot: add: 0/-13, grow: 0/-2 bytes: 0/-1237 (-1237)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_free 26 22 -4
sf_mtd_name 8 - -8
spi_flash_probe 88 78 -10
idr_remove 20 - -20
spi_flash_mtd_write 44 - -44
spi_flash_mtd_read 44 - -44
spi_flash_mtd_unregister 52 - -52
del_mtd_device 68 - -68
mtd_unlock 80 - -80
spi_flash_mtd_erase 164 - -164
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
add_mtd_device 328 - -328
display5 : all -1605 bss -248 rodata -201 text -1156
u-boot: add: 0/-13, grow: 0/-2 bytes: 0/-1237 (-1237)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_free 26 22 -4
sf_mtd_name 8 - -8
spi_flash_probe 88 78 -10
idr_remove 20 - -20
spi_flash_mtd_write 44 - -44
spi_flash_mtd_read 44 - -44
spi_flash_mtd_unregister 52 - -52
del_mtd_device 68 - -68
mtd_unlock 80 - -80
spi_flash_mtd_erase 164 - -164
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
add_mtd_device 328 - -328
brppt1_spi : spl/u-boot-spl:all -2109 spl/u-boot-spl:bss -4 spl/u-boot-spl:data -436 spl/u-boot-spl:rodata -309 spl/u-boot-spl:text -1360
spl-u-boot-spl: add: 3/-41, grow: 5/-2 bytes: 1310/-3100 (-1790)
function old new delta
spi_xfer 6 800 +794
spi_claim_bus 6 248 +242
spi_setup_slave - 156 +156
spi_do_alloc_slave - 48 +48
spi_flash_probe 26 72 +46
spl_spi_load_image 124 140 +16
spi_release_bus 6 12 +6
spi_free_slave - 2 +2
spi_flash_std_remove 4 - -4
spi_flash_post_bind 4 - -4
omap4_pdata 4 - -4
omap2_pdata 4 - -4
dev_get_parent_priv 6 - -6
spi_flash_cmd_get_sw_write_prot 8 - -8
spi_flash_std_get_sw_write_prot 14 - -14
spi_flash_read_dm 14 - -14
dm_spi_release_bus 14 - -14
ofnode_read_bool 16 - -16
fdtdec_get_bool 20 - -20
omap3_spi_release_bus 22 - -22
spi_mem_adjust_op_size 92 68 -24
spi_child_post_bind 30 - -30
spi_post_probe 32 - -32
spi_flash_std_write 34 - -34
spi_flash_std_read 34 - -34
spi_child_pre_probe 34 - -34
dm_spi_xfer 34 - -34
spi_mem_supports_op 36 - -36
spi_flash_probe_bus_cs 48 - -48
spi_find_chip_select 50 - -50
omap3_spi_claim_bus 54 - -54
static.spi_check_buswidth_req 56 - -56
omap3_spi_set_wordlen 62 - -62
spi_mem_exec_op 284 220 -64
_u_boot_list_2_driver_2_spi_generic_drv 68 - -68
_u_boot_list_2_driver_2_spi_flash_std 68 - -68
_u_boot_list_2_driver_2_omap3_spi 68 - -68
spi_set_speed_mode 72 - -72
spi_flash_std_probe 76 - -76
omap3_spi_set_speed 76 - -76
_u_boot_list_2_uclass_2_spi_nor 76 - -76
_u_boot_list_2_uclass_2_spi_generic 76 - -76
_u_boot_list_2_uclass_2_spi 76 - -76
spi_flash_std_erase 84 - -84
spi_mem_default_supports_op 86 - -86
omap3_spi_set_mode 96 - -96
dm_spi_claim_bus 100 - -100
omap3_spi_probe 116 - -116
spi_slave_ofdata_to_platdata 212 - -212
spi_get_bus_and_cs 232 - -232
omap3_spi_xfer 796 - -796
brsmarc1 : spl/u-boot-spl:all -2113 spl/u-boot-spl:bss -4 spl/u-boot-spl:data -436 spl/u-boot-spl:rodata -309 spl/u-boot-spl:text -1364
spl-u-boot-spl: add: 3/-41, grow: 5/-2 bytes: 1310/-3100 (-1790)
function old new delta
spi_xfer 6 800 +794
spi_claim_bus 6 248 +242
spi_setup_slave - 156 +156
spi_do_alloc_slave - 48 +48
spi_flash_probe 26 72 +46
spl_spi_load_image 124 140 +16
spi_release_bus 6 12 +6
spi_free_slave - 2 +2
spi_flash_std_remove 4 - -4
spi_flash_post_bind 4 - -4
omap4_pdata 4 - -4
omap2_pdata 4 - -4
dev_get_parent_priv 6 - -6
spi_flash_cmd_get_sw_write_prot 8 - -8
spi_flash_std_get_sw_write_prot 14 - -14
spi_flash_read_dm 14 - -14
dm_spi_release_bus 14 - -14
ofnode_read_bool 16 - -16
fdtdec_get_bool 20 - -20
omap3_spi_release_bus 22 - -22
spi_mem_adjust_op_size 92 68 -24
spi_child_post_bind 30 - -30
spi_post_probe 32 - -32
spi_flash_std_write 34 - -34
spi_flash_std_read 34 - -34
spi_child_pre_probe 34 - -34
dm_spi_xfer 34 - -34
spi_mem_supports_op 36 - -36
spi_flash_probe_bus_cs 48 - -48
spi_find_chip_select 50 - -50
omap3_spi_claim_bus 54 - -54
static.spi_check_buswidth_req 56 - -56
omap3_spi_set_wordlen 62 - -62
spi_mem_exec_op 284 220 -64
_u_boot_list_2_driver_2_spi_generic_drv 68 - -68
_u_boot_list_2_driver_2_spi_flash_std 68 - -68
_u_boot_list_2_driver_2_omap3_spi 68 - -68
spi_set_speed_mode 72 - -72
spi_flash_std_probe 76 - -76
omap3_spi_set_speed 76 - -76
_u_boot_list_2_uclass_2_spi_nor 76 - -76
_u_boot_list_2_uclass_2_spi_generic 76 - -76
_u_boot_list_2_uclass_2_spi 76 - -76
spi_flash_std_erase 84 - -84
spi_mem_default_supports_op 86 - -86
omap3_spi_set_mode 96 - -96
dm_spi_claim_bus 100 - -100
omap3_spi_probe 116 - -116
spi_slave_ofdata_to_platdata 212 - -212
spi_get_bus_and_cs 232 - -232
omap3_spi_xfer 796 - -796
stm32mp15_basic: spl/u-boot-spl:all -2312 spl/u-boot-spl:bss -772 spl/u-boot-spl:rodata -292 spl/u-boot-spl:text -1248
spl-u-boot-spl: add: 0/-19, grow: 0/-2 bytes: 0/-2013 (-2013)
function old new delta
sf_mtd_registered 1 - -1
spi_flash_mtd_sync 2 - -2
spi_flash_std_remove 10 4 -6
spi_flash_erase_dm 8 - -8
sf_mtd_name 8 - -8
spi_flash_std_probe 88 76 -12
spi_flash_write_dm 14 - -14
idr_remove 20 - -20
spi_flash_mtd_write 38 - -38
spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52 - -52
spi_flash_mtd_erase 78 - -78
mtd_unlock 80 - -80
del_mtd_device 80 - -80
mtd_erase_callback 88 - -88
part_erase 96 - -96
del_mtd_partitions 136 - -136
spi_flash_mtd_register 172 - -172
sf_mtd_info 240 - -240
add_mtd_device 328 - -328
mtd_idr 516 - -516

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#6 lore raw

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

Quoted 24 lines · On Mon, 9 Sep 2019 11:11:50 +0000 Schrempf Frieder…

Hi Lukasz,

Quoted 12 lines · Tom Rini
Quoted 11 lines · Lukasz Majewski

This patch series introduces new SPL and TPL specific Kconfig entries for DM_SPI* options. Such change allows using the spi driver in SPL/TPL or U-Boot proper.

First two patches - related to ls10{42}* NXP soc fix some issues with defining the DM_SPI* defines in <board>.h file instead of Kconfig.

This series doesn't introduce build breaks, but board maintainers are kindly asked to check if their boards still boots.

Quoted 8 lines
Quoted 6 lines

Buildman setup for binary size regression checking:

./tools/buildman/buildman.py -b HEAD --count=4 ls1043 --output-dir=../BUILD/ --force-build -CveE ./tools/buildman/buildman.py -b HEAD --count=4 ls1043 --output-dir=../BUILD/ -Ssdel

So you did fix the ls1043 problems but ls1046 is still a problem.

Quoted 7 lines

I was trying to clean up this config mess some weeks ago. I stumbled over the same issues (size deltas below) when I tested with buildman and finally gave up on it. This was my testing branch for reference:
[1].

Thanks for your work and I hope you/we can get this sorted out somehow...

For now I've only posted the patch to introduce SPL_DM_SPI in Kconig:
https://patchwork.ozlabs.org/patch/1159655/

Quoted 425 lines

Regards,
Frieder

[1]:
https://github.com/fschrempf/u-boot/commits/non_dm_spi_flash_in_spl

Quoted 418 lines

There's also changes in (add 'B' to the buildman flags above for this info):

        x86: (for 26/26 boards) spl/u-boot-spl:all -31.6

spl/u-boot-spl:data -11.4 spl/u-boot-spl:rodata -6.3
spl/u-boot-spl:text -13.9 qemu-x86_64 : spl/u-boot-spl:all -821
spl/u-boot-spl:data -296 spl/u-boot-spl:rodata -164 spl/u-boot-spl:text -361 spl-u-boot-spl: add: 0/-10, grow: 0/0
bytes: 0/-657 (-657) function old
new delta spi_flash_post_bind 3
- -3 dev_get_parent_priv 11 -
-11 spi_post_probe 35 -
-35 spi_child_post_bind 37 - -37
spi_child_pre_probe 46 - -46
_u_boot_list_2_driver_2_spi_generic_drv 68 - -68

_u_boot_list_2_uclass_2_spi_nor             76       -     -76
_u_boot_list_2_uclass_2_spi_generic         76       -     -76
_u_boot_list_2_uclass_2_spi                 76       -     -76
spi_slave_ofdata_to_platdata               229       -    -229 arm:

(for 688/688 boards) all -19.6 bss -4.5 rodata -2.2 spl/u-boot-spl:all -12.2 spl/u-boot-spl:bss -1.1 spl/u-boot-spl:data -1.9 spl/u-boot-spl:rodata -2.0
spl/u-boot-spl:text -7.2 text -12.9 uniphier_v7 : bss -8 rodata
+8 opos6uldev : bss -8 rodata +8 uniphier_ld4_sld8: bss -8
rodata +8 da850evm : spl/u-boot-spl:all -614
spl/u-boot-spl:data -144 spl/u-boot-spl:rodata -150 spl/u-boot-spl:text -320 spl-u-boot-spl: add: 2/-15, grow: 2/0
bytes: 112/-574 (-462) function
old new delta spi_flash_probe 38
82 +44 spi_setup_slave -
42 +42 spl_spi_load_image 124 144
+20 spi_free_slave - 6
+6 spi_flash_std_remove 4 - -4

spi_flash_post_bind                          4       -      -4
spi_flash_cmd_get_sw_write_prot              8       -      -8
____aeabi_uidivmod_from_thumb                8       -      -8
spi_flash_std_get_sw_write_prot             18       -     -18
spi_flash_read_dm                           20       -     -20
__aeabi_uidivmod                            24       -     -24
__aeabi_idivmod                             24       -     -24
spi_flash_std_write                         42       -     -42
spi_flash_std_read                          42       -     -42
spi_flash_probe_bus_cs                      56       -     -56
_u_boot_list_2_driver_2_spi_flash_std       68       -     -68
_u_boot_list_2_uclass_2_spi_nor             76       -     -76
spi_flash_std_probe                         88       -     -88
spi_flash_std_erase                         92       -     -92

da850evm_nand : spl/u-boot-spl:all -614 spl/u-boot-spl:data -144 spl/u-boot-spl:rodata -150 spl/u-boot-spl:text -320 spl-u-boot-spl:
add: 2/-15, grow: 2/0 bytes: 112/-574 (-462) function
old new delta spi_flash_probe
38 82 +44 spi_setup_slave
- 42 +42 spl_spi_load_image
124 144 +20 spi_free_slave
- 6 +6 spi_flash_std_remove 4
- -4 spi_flash_post_bind 4
- -4 spi_flash_cmd_get_sw_write_prot 8 -
-8 ____aeabi_uidivmod_from_thumb 8 - -8

spi_flash_std_get_sw_write_prot             18       -     -18
spi_flash_read_dm                           20       -     -20
__aeabi_uidivmod                            24       -     -24
__aeabi_idivmod                             24       -     -24
spi_flash_std_write                         42       -     -42
spi_flash_std_read                          42       -     -42
spi_flash_probe_bus_cs                      56       -     -56
_u_boot_list_2_driver_2_spi_flash_std       68       -     -68
_u_boot_list_2_uclass_2_spi_nor             76       -     -76
spi_flash_std_probe                         88       -     -88
spi_flash_std_erase                         92       -     -92

sama5d3xek_spiflash: spl/u-boot-spl:all -630 spl/u-boot-spl:data -144 spl/u-boot-spl:rodata -150 spl/u-boot-spl:text -336
spl-u-boot-spl: add: 2/-12, grow: 2/0 bytes: 196/-676 (-480)
function old new delta

spi_flash_probe                             44     120     +76
spi_setup_slave                              -      60     +60
spl_spi_load_image                         172     220     +48
spi_free_slave                               -      12     +12
spi_flash_std_remove                         8       -      -8
spi_flash_post_bind                          8       -      -8
spi_flash_cmd_get_sw_write_prot             12       -     -12
spi_flash_std_get_sw_write_prot             16       -     -16
spi_flash_read_dm                           28       -     -28
spi_flash_std_write                         64       -     -64
spi_flash_std_read                          64       -     -64
_u_boot_list_2_driver_2_spi_flash_std       68       -     -68
spi_flash_probe_bus_cs                      76       -     -76
_u_boot_list_2_uclass_2_spi_nor             76       -     -76
spi_flash_std_probe                        116       -    -116
spi_flash_std_erase                        140       -    -140

socfpga_cyclone5: all -722 bss -136 rodata -98 text -488 u-boot:
add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647) function
old new delta sf_mtd_registered
1 - -1 spi_flash_mtd_sync
2 - -2 spi_flash_std_remove
10 4 -6 sf_mtd_name
8 - -8 spi_flash_std_probe 88
76 -12 spi_flash_mtd_write 38 -
-38 spi_flash_mtd_read 38 -
-38 spi_flash_mtd_unregister 52 - -52

spi_flash_mtd_erase                         78       -     -78
spi_flash_mtd_register                     172       -    -172
sf_mtd_info                                240       -    -240

socfpga_socrates: all -794 bss -208 rodata -98 text -488 u-boot:
add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647) function
old new delta sf_mtd_registered
1 - -1 spi_flash_mtd_sync
2 - -2 spi_flash_std_remove
10 4 -6 sf_mtd_name
8 - -8 spi_flash_std_probe 88
76 -12 spi_flash_mtd_write 38 -
-38 spi_flash_mtd_read 38 -
-38 spi_flash_mtd_unregister 52 - -52

spi_flash_mtd_erase                         78       -     -78
spi_flash_mtd_register                     172       -    -172
sf_mtd_info                                240       -    -240

socfpga_sockit : all -794 bss -208 rodata -98 text -488 u-boot:
add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647) function
old new delta sf_mtd_registered
1 - -1 spi_flash_mtd_sync
2 - -2 spi_flash_std_remove
10 4 -6 sf_mtd_name
8 - -8 spi_flash_std_probe 88
76 -12 spi_flash_mtd_write 38 -
-38 spi_flash_mtd_read 38 -
-38 spi_flash_mtd_unregister 52 - -52

spi_flash_mtd_erase                         78       -     -78
spi_flash_mtd_register                     172       -    -172
sf_mtd_info                                240       -    -240

socfpga_arria5 : all -794 bss -208 rodata -98 text -488 u-boot:
add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647) function
old new delta sf_mtd_registered
1 - -1 spi_flash_mtd_sync
2 - -2 spi_flash_std_remove
10 4 -6 sf_mtd_name
8 - -8 spi_flash_std_probe 88
76 -12 spi_flash_mtd_write 38 -
-38 spi_flash_mtd_read 38 -
-38 spi_flash_mtd_unregister 52 - -52

spi_flash_mtd_erase                         78       -     -78
spi_flash_mtd_register                     172       -    -172
sf_mtd_info                                240       -    -240

socfpga_is1 : all -794 bss -208 rodata -98 text -488 u-boot:
add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647) function
old new delta sf_mtd_registered
1 - -1 spi_flash_mtd_sync
2 - -2 spi_flash_std_remove
10 4 -6 sf_mtd_name
8 - -8 spi_flash_std_probe 88
76 -12 spi_flash_mtd_write 38 -
-38 spi_flash_mtd_read 38 -
-38 spi_flash_mtd_unregister 52 - -52
spi_flash_mtd_erase 78
- -78 spi_flash_mtd_register 172 -
-172 sf_mtd_info 240 -
-240 socfpga_vining_fpga: all -858 bss -272 rodata -98 text -488

                u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647)
                  function                                   old

new delta sf_mtd_registered 1 -
-1 spi_flash_mtd_sync 2 -
-2 spi_flash_std_remove 10 4 -6
sf_mtd_name 8
- -8 spi_flash_std_probe 88 76
-12 spi_flash_mtd_write 38 -
-38 spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52
- -52 spi_flash_mtd_erase 78 -
-78 spi_flash_mtd_register 172 -
-172 sf_mtd_info 240 - -240

             socfpga_sr1500 : all -858 bss -280 rodata -98 text -480
                u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647)
                  function                                   old

new delta sf_mtd_registered 1 -
-1 spi_flash_mtd_sync 2 -
-2 spi_flash_std_remove 10 4 -6
sf_mtd_name 8
- -8 spi_flash_std_probe 88 76
-12 spi_flash_mtd_write 38 -
-38 spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52
- -52 spi_flash_mtd_erase 78 -
-78 spi_flash_mtd_register 172 -
-172 sf_mtd_info 240 - -240

             cm_fx6         : all -1130 bss -296 rodata -146 text

-688 u-boot: add: 0/-11, grow: 0/-2 bytes: 0/-829 (-829)
function old
new delta sf_mtd_registered 1 -
-1 spi_flash_mtd_sync 2 -
-2 spi_flash_free 26 22 -4
sf_mtd_name 8
- -8 spi_flash_probe 88 78
-10 idr_remove 20 -
-20 spi_flash_mtd_write 44 - -44
spi_flash_mtd_read 44
- -44 spi_flash_mtd_unregister 52 -
-52 del_mtd_device 68 -
-68 spi_flash_mtd_erase 164 - -164
spi_flash_mtd_register 172
- -172 sf_mtd_info 240 -
-240 aristainetos : all -1186 bss -264 rodata -98 text -824

                u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-981 (-981)
                  function                                   old

new delta sf_mtd_registered 1 -
-1 spi_flash_mtd_sync 4 -
-4 spi_flash_free 32 28 -4
sf_mtd_name 8
- -8 spi_flash_probe 136 120
-16 spi_flash_mtd_write 80 -
-80 spi_flash_mtd_read 80 - -80
spi_flash_mtd_unregister 84
- -84 spi_flash_mtd_erase 220 -
-220 sf_mtd_info 240 -
-240 spi_flash_mtd_register 244 - -244

             aristainetos2  : all -1186 bss -264 rodata -98 text

-824 u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-981 (-981)
function old
new delta sf_mtd_registered 1 -
-1 spi_flash_mtd_sync 4 -
-4 spi_flash_free 32 28 -4
sf_mtd_name 8
- -8 spi_flash_probe 136 120
-16 spi_flash_mtd_write 80 -
-80 spi_flash_mtd_read 80 - -80
spi_flash_mtd_unregister 84
- -84 spi_flash_mtd_erase 220 -
-220 sf_mtd_info 240 -
-240 spi_flash_mtd_register 244 - -244

             aristainetos2b : all -1186 bss -264 rodata -98 text

-824 u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-981 (-981)
function old
new delta sf_mtd_registered 1 -
-1 spi_flash_mtd_sync 4 -
-4 spi_flash_free 32 28 -4
sf_mtd_name 8
- -8 spi_flash_probe 136 120
-16 spi_flash_mtd_write 80 -
-80 spi_flash_mtd_read 80 - -80
spi_flash_mtd_unregister 84
- -84 spi_flash_mtd_erase 220 -
-220 sf_mtd_info 240 -
-240 spi_flash_mtd_register 244 - -244

             display5_factory: all -1561 bss -216 rodata -201 text

-1144 u-boot: add: 0/-13, grow: 0/-2 bytes: 0/-1237 (-1237)
function old
new delta sf_mtd_registered 1 -
-1 spi_flash_mtd_sync 2 -
-2 spi_flash_free 26 22 -4
sf_mtd_name 8
- -8 spi_flash_probe 88 78
-10 idr_remove 20 -
-20 spi_flash_mtd_write 44 - -44
spi_flash_mtd_read 44
- -44 spi_flash_mtd_unregister 52 -
-52 del_mtd_device 68 -
-68 mtd_unlock 80 - -80
spi_flash_mtd_erase 164
- -164 spi_flash_mtd_register 172 -
-172 sf_mtd_info 240 -
-240 add_mtd_device 328 - -328

             display5       : all -1605 bss -248 rodata -201 text

-1156 u-boot: add: 0/-13, grow: 0/-2 bytes: 0/-1237 (-1237)
function old
new delta sf_mtd_registered 1 -
-1 spi_flash_mtd_sync 2 -
-2 spi_flash_free 26 22 -4
sf_mtd_name 8
- -8 spi_flash_probe 88 78
-10 idr_remove 20 -
-20 spi_flash_mtd_write 44 - -44
spi_flash_mtd_read 44
- -44 spi_flash_mtd_unregister 52 -
-52 del_mtd_device 68 -
-68 mtd_unlock 80 - -80
spi_flash_mtd_erase 164
- -164 spi_flash_mtd_register 172 -
-172 sf_mtd_info 240 -
-240 add_mtd_device 328 - -328

             brppt1_spi     : spl/u-boot-spl:all -2109
spl/u-boot-spl:bss -4 spl/u-boot-spl:data -436
spl/u-boot-spl:rodata -309 spl/u-boot-spl:text -1360
spl-u-boot-spl: add: 3/-41, grow: 5/-2 bytes: 1310/-3100 (-1790)
function                                   old     new   delta
spi_xfer                                     6     800    +794
spi_claim_bus                                6     248    +242
spi_setup_slave                              -     156    +156
spi_do_alloc_slave                           -      48     +48
spi_flash_probe                             26      72     +46
spl_spi_load_image                         124     140     +16
spi_release_bus                              6      12      +6
spi_free_slave                               -       2      +2
spi_flash_std_remove                         4       -      -4
spi_flash_post_bind                          4       -      -4
omap4_pdata                                  4       -      -4
omap2_pdata                                  4       -      -4
dev_get_parent_priv                          6       -      -6
spi_flash_cmd_get_sw_write_prot              8       -      -8
spi_flash_std_get_sw_write_prot             14       -     -14
spi_flash_read_dm                           14       -     -14
dm_spi_release_bus                          14       -     -14
ofnode_read_bool                            16       -     -16
fdtdec_get_bool                             20       -     -20
omap3_spi_release_bus                       22       -     -22
spi_mem_adjust_op_size                      92      68     -24
spi_child_post_bind                         30       -     -30
spi_post_probe                              32       -     -32
spi_flash_std_write                         34       -     -34
spi_flash_std_read                          34       -     -34
spi_child_pre_probe                         34       -     -34
dm_spi_xfer                                 34       -     -34
spi_mem_supports_op                         36       -     -36
spi_flash_probe_bus_cs                      48       -     -48
spi_find_chip_select                        50       -     -50
omap3_spi_claim_bus                         54       -     -54
static.spi_check_buswidth_req               56       -     -56
omap3_spi_set_wordlen                       62       -     -62
spi_mem_exec_op                            284     220     -64
_u_boot_list_2_driver_2_spi_generic_drv      68       -     -68
_u_boot_list_2_driver_2_spi_flash_std       68       -     -68
_u_boot_list_2_driver_2_omap3_spi           68       -     -68
spi_set_speed_mode                          72       -     -72
spi_flash_std_probe                         76       -     -76
omap3_spi_set_speed                         76       -     -76
_u_boot_list_2_uclass_2_spi_nor             76       -     -76
_u_boot_list_2_uclass_2_spi_generic         76       -     -76
_u_boot_list_2_uclass_2_spi                 76       -     -76
spi_flash_std_erase                         84       -     -84
spi_mem_default_supports_op                 86       -     -86
omap3_spi_set_mode                          96       -     -96
dm_spi_claim_bus                           100       -    -100
omap3_spi_probe                            116       -    -116
spi_slave_ofdata_to_platdata               212       -    -212
spi_get_bus_and_cs                         232       -    -232
omap3_spi_xfer                             796       -    -796

brsmarc1 : spl/u-boot-spl:all -2113 spl/u-boot-spl:bss -4
spl/u-boot-spl:data -436 spl/u-boot-spl:rodata -309 spl/u-boot-spl:text -1364 spl-u-boot-spl: add: 3/-41, grow: 5/-2
bytes: 1310/-3100 (-1790) function
old new delta spi_xfer 6
800 +794 spi_claim_bus 6
248 +242 spi_setup_slave - 156
+156 spi_do_alloc_slave - 48
+48 spi_flash_probe 26 72 +46
spl_spi_load_image 124 140 +16

spi_release_bus                              6      12      +6
spi_free_slave                               -       2      +2
spi_flash_std_remove                         4       -      -4
spi_flash_post_bind                          4       -      -4
omap4_pdata                                  4       -      -4
omap2_pdata                                  4       -      -4
dev_get_parent_priv                          6       -      -6
spi_flash_cmd_get_sw_write_prot              8       -      -8
spi_flash_std_get_sw_write_prot             14       -     -14
spi_flash_read_dm                           14       -     -14
dm_spi_release_bus                          14       -     -14
ofnode_read_bool                            16       -     -16
fdtdec_get_bool                             20       -     -20
omap3_spi_release_bus                       22       -     -22
spi_mem_adjust_op_size                      92      68     -24
spi_child_post_bind                         30       -     -30
spi_post_probe                              32       -     -32
spi_flash_std_write                         34       -     -34
spi_flash_std_read                          34       -     -34
spi_child_pre_probe                         34       -     -34
dm_spi_xfer                                 34       -     -34
spi_mem_supports_op                         36       -     -36
spi_flash_probe_bus_cs                      48       -     -48
spi_find_chip_select                        50       -     -50
omap3_spi_claim_bus                         54       -     -54
static.spi_check_buswidth_req               56       -     -56
omap3_spi_set_wordlen                       62       -     -62
spi_mem_exec_op                            284     220     -64
_u_boot_list_2_driver_2_spi_generic_drv      68       -     -68
_u_boot_list_2_driver_2_spi_flash_std       68       -     -68
_u_boot_list_2_driver_2_omap3_spi           68       -     -68
spi_set_speed_mode                          72       -     -72
spi_flash_std_probe                         76       -     -76
omap3_spi_set_speed                         76       -     -76
_u_boot_list_2_uclass_2_spi_nor             76       -     -76
_u_boot_list_2_uclass_2_spi_generic         76       -     -76
_u_boot_list_2_uclass_2_spi                 76       -     -76
spi_flash_std_erase                         84       -     -84
spi_mem_default_supports_op                 86       -     -86
omap3_spi_set_mode                          96       -     -96
dm_spi_claim_bus                           100       -    -100
omap3_spi_probe                            116       -    -116
spi_slave_ofdata_to_platdata               212       -    -212
spi_get_bus_and_cs                         232       -    -232
omap3_spi_xfer                             796       -    -796

stm32mp15_basic: spl/u-boot-spl:all -2312 spl/u-boot-spl:bss -772 spl/u-boot-spl:rodata -292 spl/u-boot-spl:text -1248
spl-u-boot-spl: add: 0/-19, grow: 0/-2 bytes: 0/-2013 (-2013)
function old new delta

sf_mtd_registered                            1       -      -1
spi_flash_mtd_sync                           2       -      -2
spi_flash_std_remove                        10       4      -6
spi_flash_erase_dm                           8       -      -8
sf_mtd_name                                  8       -      -8
spi_flash_std_probe                         88      76     -12
spi_flash_write_dm                          14       -     -14
idr_remove                                  20       -     -20
spi_flash_mtd_write                         38       -     -38
spi_flash_mtd_read                          38       -     -38
spi_flash_mtd_unregister                    52       -     -52
spi_flash_mtd_erase                         78       -     -78
mtd_unlock                                  80       -     -80
del_mtd_device                              80       -     -80
mtd_erase_callback                          88       -     -88
part_erase                                  96       -     -96
del_mtd_partitions                         136       -    -136
spi_flash_mtd_register                     172       -    -172
sf_mtd_info                                240       -    -240
add_mtd_device                             328       -    -328
mtd_idr                                    516       -    -516

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

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: <http://lists.denx.de/pipermail/u-boot/attachments/20190909/70c6acb7/attachment.sig>

#7 lore raw

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

Hi Frieder,

Quoted 34 lines
Quoted 31 lines · On Mon, 9 Sep 2019 11:11:50 +0000 Schrempf Frieder…

Hi Lukasz,

Quoted 13 lines · Tom Rini
Quoted 11 lines · Lukasz Majewski

This patch series introduces new SPL and TPL specific Kconfig entries for DM_SPI* options. Such change allows using the spi driver in SPL/TPL or U-Boot proper.

First two patches - related to ls10{42}* NXP soc fix some issues with defining the DM_SPI* defines in <board>.h file instead of Kconfig.

This series doesn't introduce build breaks, but board maintainers are kindly asked to check if their boards still boots.

Quoted 9 lines
Quoted 6 lines

Buildman setup for binary size regression checking:

./tools/buildman/buildman.py -b HEAD --count=4 ls1043 --output-dir=../BUILD/ --force-build -CveE ./tools/buildman/buildman.py -b HEAD --count=4 ls1043 --output-dir=../BUILD/ -Ssdel

So you did fix the ls1043 problems but ls1046 is still a problem.

I was trying to clean up this config mess some weeks ago. I stumbled over the same issues (size deltas below) when I tested with buildman and finally gave up on it. This was my testing branch for reference: [1].

Quoted 5 lines
Quoted 2 lines

Thanks for your work and I hope you/we can get this sorted out somehow...

For now I've only posted the patch to introduce SPL_DM_SPI in Kconig:
https://patchwork.ozlabs.org/patch/1159655/

However, I've looked on your patchset and IMHO this work could be divided (as doing it at once is not feasible).

For example the CONFIG_SPI_FLASH_MTD could be converted to (SPL_TPL_)SPI_FLASH_MTD and then one could use

#if CONFIG_IS_ENABLED(SPI_FLASH_MTD) in drivers/mtd/spi/sf_probe.c (as it is only used there).

Then we could avoid situations where code is added as you remove it here [1]:
https://github.com/fschrempf/u-boot/commit/b6489fb5928c2b41d7e4cb39933f078659b4f10e#diff-9d3e174d033b8b9c9d380a22a81600aaL136

What I'm afraid though, is that split of SPI_FLASH_MTD will require adding unwillingly SPL_(TPL_)SPI_FLASH_MTD to all boards which already define it (and only drop ones, which use in <config>.h file pattern as [1]).

Frieder, would you be able to work on this topic any time soon?

Quoted 431 lines
Quoted 426 lines

Regards,
Frieder

[1]:
https://github.com/fschrempf/u-boot/commits/non_dm_spi_flash_in_spl

Quoted 418 lines

There's also changes in (add 'B' to the buildman flags above for this info):

        x86: (for 26/26 boards) spl/u-boot-spl:all -31.6

spl/u-boot-spl:data -11.4 spl/u-boot-spl:rodata -6.3
spl/u-boot-spl:text -13.9 qemu-x86_64 : spl/u-boot-spl:all -821
spl/u-boot-spl:data -296 spl/u-boot-spl:rodata -164 spl/u-boot-spl:text -361 spl-u-boot-spl: add: 0/-10, grow: 0/0
bytes: 0/-657 (-657) function
old new delta spi_flash_post_bind 3
- -3 dev_get_parent_priv 11 -
-11 spi_post_probe 35 -
-35 spi_child_post_bind 37 - -37
spi_child_pre_probe 46 - -46
_u_boot_list_2_driver_2_spi_generic_drv 68 - -68

_u_boot_list_2_uclass_2_spi_nor             76       -     -76
_u_boot_list_2_uclass_2_spi_generic         76       -     -76
_u_boot_list_2_uclass_2_spi                 76       -     -76
spi_slave_ofdata_to_platdata               229       -    -229

arm: (for 688/688 boards) all -19.6 bss -4.5 rodata -2.2 spl/u-boot-spl:all -12.2 spl/u-boot-spl:bss -1.1 spl/u-boot-spl:data -1.9 spl/u-boot-spl:rodata -2.0
spl/u-boot-spl:text -7.2 text -12.9 uniphier_v7 : bss -8 rodata
+8 opos6uldev : bss -8 rodata +8 uniphier_ld4_sld8: bss -8
rodata +8 da850evm : spl/u-boot-spl:all -614
spl/u-boot-spl:data -144 spl/u-boot-spl:rodata -150 spl/u-boot-spl:text -320 spl-u-boot-spl: add: 2/-15, grow: 2/0
bytes: 112/-574 (-462) function
old new delta spi_flash_probe 38
82 +44 spi_setup_slave -
42 +42 spl_spi_load_image 124 144
+20 spi_free_slave - 6
+6 spi_flash_std_remove 4 - -4

spi_flash_post_bind                          4       -      -4
spi_flash_cmd_get_sw_write_prot              8       -      -8
____aeabi_uidivmod_from_thumb                8       -      -8
spi_flash_std_get_sw_write_prot             18       -     -18
spi_flash_read_dm                           20       -     -20
__aeabi_uidivmod                            24       -     -24
__aeabi_idivmod                             24       -     -24
spi_flash_std_write                         42       -     -42
spi_flash_std_read                          42       -     -42
spi_flash_probe_bus_cs                      56       -     -56
_u_boot_list_2_driver_2_spi_flash_std       68       -     -68
_u_boot_list_2_uclass_2_spi_nor             76       -     -76
spi_flash_std_probe                         88       -     -88
spi_flash_std_erase                         92       -     -92

da850evm_nand : spl/u-boot-spl:all -614 spl/u-boot-spl:data -144 spl/u-boot-spl:rodata -150 spl/u-boot-spl:text -320
spl-u-boot-spl: add: 2/-15, grow: 2/0 bytes: 112/-574 (-462)
function old new delta spi_flash_probe

                38      82     +44 spi_setup_slave
            -      42     +42 spl_spi_load_image
     124     144     +20 spi_free_slave

- 6 +6 spi_flash_std_remove 4
- -4 spi_flash_post_bind 4
- -4 spi_flash_cmd_get_sw_write_prot 8 -
-8 ____aeabi_uidivmod_from_thumb 8 -
-8 spi_flash_std_get_sw_write_prot 18 - -18

spi_flash_read_dm                           20       -     -20
__aeabi_uidivmod                            24       -     -24
__aeabi_idivmod                             24       -     -24
spi_flash_std_write                         42       -     -42
spi_flash_std_read                          42       -     -42
spi_flash_probe_bus_cs                      56       -     -56
_u_boot_list_2_driver_2_spi_flash_std       68       -     -68
_u_boot_list_2_uclass_2_spi_nor             76       -     -76
spi_flash_std_probe                         88       -     -88
spi_flash_std_erase                         92       -     -92

sama5d3xek_spiflash: spl/u-boot-spl:all -630 spl/u-boot-spl:data -144 spl/u-boot-spl:rodata -150 spl/u-boot-spl:text -336
spl-u-boot-spl: add: 2/-12, grow: 2/0 bytes: 196/-676 (-480)
function old new delta

spi_flash_probe                             44     120     +76
spi_setup_slave                              -      60     +60
spl_spi_load_image                         172     220     +48
spi_free_slave                               -      12     +12
spi_flash_std_remove                         8       -      -8
spi_flash_post_bind                          8       -      -8
spi_flash_cmd_get_sw_write_prot             12       -     -12
spi_flash_std_get_sw_write_prot             16       -     -16
spi_flash_read_dm                           28       -     -28
spi_flash_std_write                         64       -     -64
spi_flash_std_read                          64       -     -64
_u_boot_list_2_driver_2_spi_flash_std       68       -     -68
spi_flash_probe_bus_cs                      76       -     -76
_u_boot_list_2_uclass_2_spi_nor             76       -     -76
spi_flash_std_probe                        116       -    -116
spi_flash_std_erase                        140       -    -140

socfpga_cyclone5: all -722 bss -136 rodata -98 text -488 u-boot:
add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647) function
old new delta sf_mtd_registered
1 - -1 spi_flash_mtd_sync
2 - -2 spi_flash_std_remove
10 4 -6 sf_mtd_name
8 - -8 spi_flash_std_probe 88
76 -12 spi_flash_mtd_write 38
- -38 spi_flash_mtd_read 38 -
-38 spi_flash_mtd_unregister 52 - -52

spi_flash_mtd_erase                         78       -     -78
spi_flash_mtd_register                     172       -    -172
sf_mtd_info                                240       -    -240

socfpga_socrates: all -794 bss -208 rodata -98 text -488 u-boot:
add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647) function
old new delta sf_mtd_registered
1 - -1 spi_flash_mtd_sync
2 - -2 spi_flash_std_remove
10 4 -6 sf_mtd_name
8 - -8 spi_flash_std_probe 88
76 -12 spi_flash_mtd_write 38
- -38 spi_flash_mtd_read 38 -
-38 spi_flash_mtd_unregister 52 - -52

spi_flash_mtd_erase                         78       -     -78
spi_flash_mtd_register                     172       -    -172
sf_mtd_info                                240       -    -240

socfpga_sockit : all -794 bss -208 rodata -98 text -488 u-boot:
add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647) function
old new delta sf_mtd_registered
1 - -1 spi_flash_mtd_sync
2 - -2 spi_flash_std_remove
10 4 -6 sf_mtd_name
8 - -8 spi_flash_std_probe 88
76 -12 spi_flash_mtd_write 38
- -38 spi_flash_mtd_read 38 -
-38 spi_flash_mtd_unregister 52 - -52

spi_flash_mtd_erase                         78       -     -78
spi_flash_mtd_register                     172       -    -172
sf_mtd_info                                240       -    -240

socfpga_arria5 : all -794 bss -208 rodata -98 text -488 u-boot:
add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647) function
old new delta sf_mtd_registered
1 - -1 spi_flash_mtd_sync
2 - -2 spi_flash_std_remove
10 4 -6 sf_mtd_name
8 - -8 spi_flash_std_probe 88
76 -12 spi_flash_mtd_write 38
- -38 spi_flash_mtd_read 38 -
-38 spi_flash_mtd_unregister 52 - -52

spi_flash_mtd_erase                         78       -     -78
spi_flash_mtd_register                     172       -    -172
sf_mtd_info                                240       -    -240

socfpga_is1 : all -794 bss -208 rodata -98 text -488 u-boot:
add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647) function
old new delta sf_mtd_registered
1 - -1 spi_flash_mtd_sync
2 - -2 spi_flash_std_remove
10 4 -6 sf_mtd_name
8 - -8 spi_flash_std_probe 88
76 -12 spi_flash_mtd_write 38
- -38 spi_flash_mtd_read 38 -
-38 spi_flash_mtd_unregister 52 - -52
spi_flash_mtd_erase 78
- -78 spi_flash_mtd_register 172
- -172 sf_mtd_info 240 -
-240 socfpga_vining_fpga: all -858 bss -272 rodata -98 text -488

                u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647)
                  function                                   old

new delta sf_mtd_registered 1
- -1 spi_flash_mtd_sync 2 -
-2 spi_flash_std_remove 10 4 -6
sf_mtd_name 8
- -8 spi_flash_std_probe 88
76 -12 spi_flash_mtd_write 38 -
-38 spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52
- -52 spi_flash_mtd_erase 78
- -78 spi_flash_mtd_register 172 -
-172 sf_mtd_info 240 -
-240 socfpga_sr1500 : all -858 bss -280 rodata -98 text -480

                u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-647 (-647)
                  function                                   old

new delta sf_mtd_registered 1
- -1 spi_flash_mtd_sync 2 -
-2 spi_flash_std_remove 10 4 -6
sf_mtd_name 8
- -8 spi_flash_std_probe 88
76 -12 spi_flash_mtd_write 38 -
-38 spi_flash_mtd_read 38 - -38
spi_flash_mtd_unregister 52
- -52 spi_flash_mtd_erase 78
- -78 spi_flash_mtd_register 172 -
-172 sf_mtd_info 240 -
-240 cm_fx6 : all -1130 bss -296 rodata -146 text
-688 u-boot: add: 0/-11, grow: 0/-2 bytes: 0/-829 (-829)
function old
new delta sf_mtd_registered 1
- -1 spi_flash_mtd_sync 2 -
-2 spi_flash_free 26 22 -4
sf_mtd_name 8
- -8 spi_flash_probe 88
78 -10 idr_remove 20 -
-20 spi_flash_mtd_write 44 - -44
spi_flash_mtd_read 44
- -44 spi_flash_mtd_unregister 52
- -52 del_mtd_device 68 -
-68 spi_flash_mtd_erase 164 - -164
spi_flash_mtd_register 172
- -172 sf_mtd_info 240
- -240 aristainetos : all -1186 bss -264 rodata -98 text -824

                u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-981 (-981)
                  function                                   old

new delta sf_mtd_registered 1
- -1 spi_flash_mtd_sync 4 -
-4 spi_flash_free 32 28 -4
sf_mtd_name 8
- -8 spi_flash_probe 136
120 -16 spi_flash_mtd_write 80 -
-80 spi_flash_mtd_read 80 - -80
spi_flash_mtd_unregister 84
- -84 spi_flash_mtd_erase 220
- -220 sf_mtd_info 240 -
-240 spi_flash_mtd_register 244 -
-244 aristainetos2 : all -1186 bss -264 rodata -98 text -824 u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-981 (-981)
function old
new delta sf_mtd_registered 1
- -1 spi_flash_mtd_sync 4 -
-4 spi_flash_free 32 28 -4
sf_mtd_name 8
- -8 spi_flash_probe 136
120 -16 spi_flash_mtd_write 80 -
-80 spi_flash_mtd_read 80 - -80
spi_flash_mtd_unregister 84
- -84 spi_flash_mtd_erase 220
- -220 sf_mtd_info 240 -
-240 spi_flash_mtd_register 244 -
-244 aristainetos2b : all -1186 bss -264 rodata -98 text -824 u-boot: add: 0/-9, grow: 0/-2 bytes: 0/-981 (-981)
function old
new delta sf_mtd_registered 1
- -1 spi_flash_mtd_sync 4 -
-4 spi_flash_free 32 28 -4
sf_mtd_name 8
- -8 spi_flash_probe 136
120 -16 spi_flash_mtd_write 80 -
-80 spi_flash_mtd_read 80 - -80
spi_flash_mtd_unregister 84
- -84 spi_flash_mtd_erase 220
- -220 sf_mtd_info 240 -
-240 spi_flash_mtd_register 244 -
-244 display5_factory: all -1561 bss -216 rodata -201 text -1144 u-boot: add: 0/-13, grow: 0/-2 bytes: 0/-1237 (-1237)
function old
new delta sf_mtd_registered 1
- -1 spi_flash_mtd_sync 2 -
-2 spi_flash_free 26 22 -4
sf_mtd_name 8
- -8 spi_flash_probe 88
78 -10 idr_remove 20 -
-20 spi_flash_mtd_write 44 - -44
spi_flash_mtd_read 44
- -44 spi_flash_mtd_unregister 52
- -52 del_mtd_device 68 -
-68 mtd_unlock 80 - -80
spi_flash_mtd_erase 164
- -164 spi_flash_mtd_register 172
- -172 sf_mtd_info 240 -
-240 add_mtd_device 328 -
-328 display5 : all -1605 bss -248 rodata -201 text
-1156 u-boot: add: 0/-13, grow: 0/-2 bytes: 0/-1237 (-1237)
function old
new delta sf_mtd_registered 1
- -1 spi_flash_mtd_sync 2 -
-2 spi_flash_free 26 22 -4
sf_mtd_name 8
- -8 spi_flash_probe 88
78 -10 idr_remove 20 -
-20 spi_flash_mtd_write 44 - -44
spi_flash_mtd_read 44
- -44 spi_flash_mtd_unregister 52
- -52 del_mtd_device 68 -
-68 mtd_unlock 80 - -80
spi_flash_mtd_erase 164
- -164 spi_flash_mtd_register 172
- -172 sf_mtd_info 240 -
-240 add_mtd_device 328 -
-328 brppt1_spi : spl/u-boot-spl:all -2109
spl/u-boot-spl:bss -4 spl/u-boot-spl:data -436 spl/u-boot-spl:rodata -309 spl/u-boot-spl:text -1360
spl-u-boot-spl: add: 3/-41, grow: 5/-2 bytes: 1310/-3100 (-1790)

function                                   old     new   delta
spi_xfer                                     6     800    +794
spi_claim_bus                                6     248    +242
spi_setup_slave                              -     156    +156
spi_do_alloc_slave                           -      48     +48
spi_flash_probe                             26      72     +46
spl_spi_load_image                         124     140     +16
spi_release_bus                              6      12      +6
spi_free_slave                               -       2      +2
spi_flash_std_remove                         4       -      -4
spi_flash_post_bind                          4       -      -4
omap4_pdata                                  4       -      -4
omap2_pdata                                  4       -      -4
dev_get_parent_priv                          6       -      -6
spi_flash_cmd_get_sw_write_prot              8       -      -8
spi_flash_std_get_sw_write_prot             14       -     -14
spi_flash_read_dm                           14       -     -14
dm_spi_release_bus                          14       -     -14
ofnode_read_bool                            16       -     -16
fdtdec_get_bool                             20       -     -20
omap3_spi_release_bus                       22       -     -22
spi_mem_adjust_op_size                      92      68     -24
spi_child_post_bind                         30       -     -30
spi_post_probe                              32       -     -32
spi_flash_std_write                         34       -     -34
spi_flash_std_read                          34       -     -34
spi_child_pre_probe                         34       -     -34
dm_spi_xfer                                 34       -     -34
spi_mem_supports_op                         36       -     -36
spi_flash_probe_bus_cs                      48       -     -48
spi_find_chip_select                        50       -     -50
omap3_spi_claim_bus                         54       -     -54
static.spi_check_buswidth_req               56       -     -56
omap3_spi_set_wordlen                       62       -     -62
spi_mem_exec_op                            284     220     -64
_u_boot_list_2_driver_2_spi_generic_drv      68       -     -68
_u_boot_list_2_driver_2_spi_flash_std       68       -     -68
_u_boot_list_2_driver_2_omap3_spi           68       -     -68
spi_set_speed_mode                          72       -     -72
spi_flash_std_probe                         76       -     -76
omap3_spi_set_speed                         76       -     -76
_u_boot_list_2_uclass_2_spi_nor             76       -     -76
_u_boot_list_2_uclass_2_spi_generic         76       -     -76
_u_boot_list_2_uclass_2_spi                 76       -     -76
spi_flash_std_erase                         84       -     -84
spi_mem_default_supports_op                 86       -     -86
omap3_spi_set_mode                          96       -     -96
dm_spi_claim_bus                           100       -    -100
omap3_spi_probe                            116       -    -116
spi_slave_ofdata_to_platdata               212       -    -212
spi_get_bus_and_cs                         232       -    -232
omap3_spi_xfer                             796       -    -796

brsmarc1 : spl/u-boot-spl:all -2113 spl/u-boot-spl:bss -4
spl/u-boot-spl:data -436 spl/u-boot-spl:rodata -309 spl/u-boot-spl:text -1364 spl-u-boot-spl: add: 3/-41, grow: 5/-2
bytes: 1310/-3100 (-1790) function
old new delta spi_xfer
6 800 +794 spi_claim_bus 6
248 +242 spi_setup_slave - 156
+156 spi_do_alloc_slave - 48
+48 spi_flash_probe 26 72 +46
spl_spi_load_image 124 140 +16

spi_release_bus                              6      12      +6
spi_free_slave                               -       2      +2
spi_flash_std_remove                         4       -      -4
spi_flash_post_bind                          4       -      -4
omap4_pdata                                  4       -      -4
omap2_pdata                                  4       -      -4
dev_get_parent_priv                          6       -      -6
spi_flash_cmd_get_sw_write_prot              8       -      -8
spi_flash_std_get_sw_write_prot             14       -     -14
spi_flash_read_dm                           14       -     -14
dm_spi_release_bus                          14       -     -14
ofnode_read_bool                            16       -     -16
fdtdec_get_bool                             20       -     -20
omap3_spi_release_bus                       22       -     -22
spi_mem_adjust_op_size                      92      68     -24
spi_child_post_bind                         30       -     -30
spi_post_probe                              32       -     -32
spi_flash_std_write                         34       -     -34
spi_flash_std_read                          34       -     -34
spi_child_pre_probe                         34       -     -34
dm_spi_xfer                                 34       -     -34
spi_mem_supports_op                         36       -     -36
spi_flash_probe_bus_cs                      48       -     -48
spi_find_chip_select                        50       -     -50
omap3_spi_claim_bus                         54       -     -54
static.spi_check_buswidth_req               56       -     -56
omap3_spi_set_wordlen                       62       -     -62
spi_mem_exec_op                            284     220     -64
_u_boot_list_2_driver_2_spi_generic_drv      68       -     -68
_u_boot_list_2_driver_2_spi_flash_std       68       -     -68
_u_boot_list_2_driver_2_omap3_spi           68       -     -68
spi_set_speed_mode                          72       -     -72
spi_flash_std_probe                         76       -     -76
omap3_spi_set_speed                         76       -     -76
_u_boot_list_2_uclass_2_spi_nor             76       -     -76
_u_boot_list_2_uclass_2_spi_generic         76       -     -76
_u_boot_list_2_uclass_2_spi                 76       -     -76
spi_flash_std_erase                         84       -     -84
spi_mem_default_supports_op                 86       -     -86
omap3_spi_set_mode                          96       -     -96
dm_spi_claim_bus                           100       -    -100
omap3_spi_probe                            116       -    -116
spi_slave_ofdata_to_platdata               212       -    -212
spi_get_bus_and_cs                         232       -    -232
omap3_spi_xfer                             796       -    -796

stm32mp15_basic: spl/u-boot-spl:all -2312 spl/u-boot-spl:bss -772 spl/u-boot-spl:rodata -292 spl/u-boot-spl:text -1248
spl-u-boot-spl: add: 0/-19, grow: 0/-2 bytes: 0/-2013 (-2013)
function old new delta

sf_mtd_registered                            1       -      -1
spi_flash_mtd_sync                           2       -      -2
spi_flash_std_remove                        10       4      -6
spi_flash_erase_dm                           8       -      -8
sf_mtd_name                                  8       -      -8
spi_flash_std_probe                         88      76     -12
spi_flash_write_dm                          14       -     -14
idr_remove                                  20       -     -20
spi_flash_mtd_write                         38       -     -38
spi_flash_mtd_read                          38       -     -38
spi_flash_mtd_unregister                    52       -     -52
spi_flash_mtd_erase                         78       -     -78
mtd_unlock                                  80       -     -80
del_mtd_device                              80       -     -80
mtd_erase_callback                          88       -     -88
part_erase                                  96       -     -96
del_mtd_partitions                         136       -    -136
spi_flash_mtd_register                     172       -    -172
sf_mtd_info                                240       -    -240
add_mtd_device                             328       -    -328
mtd_idr                                    516       -    -516

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

Best regards,

Quoted 8 lines

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

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: <http://lists.denx.de/pipermail/u-boot/attachments/20190910/a6250a88/attachment.sig>

#8 lore raw

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

Hi Lukasz,

Quoted 51 lines · Lukasz Majewski

Hi Frieder,

Quoted 34 lines
Quoted 31 lines · On Mon, 9 Sep 2019 11:11:50 +0000 Schrempf Frieder…

Hi Lukasz,

Quoted 13 lines · Tom Rini
Quoted 11 lines · Lukasz Majewski

This patch series introduces new SPL and TPL specific Kconfig entries for DM_SPI* options. Such change allows using the spi driver in SPL/TPL or U-Boot proper.

First two patches - related to ls10{42}* NXP soc fix some issues with defining the DM_SPI* defines in <board>.h file instead of Kconfig.

This series doesn't introduce build breaks, but board maintainers are kindly asked to check if their boards still boots.

Quoted 9 lines
Quoted 6 lines

Buildman setup for binary size regression checking:

./tools/buildman/buildman.py -b HEAD --count=4 ls1043 --output-dir=../BUILD/ --force-build -CveE ./tools/buildman/buildman.py -b HEAD --count=4 ls1043 --output-dir=../BUILD/ -Ssdel

So you did fix the ls1043 problems but ls1046 is still a problem.

I was trying to clean up this config mess some weeks ago. I stumbled over the same issues (size deltas below) when I tested with buildman and finally gave up on it. This was my testing branch for reference: [1].

Quoted 5 lines
Quoted 2 lines

Thanks for your work and I hope you/we can get this sorted out somehow...

For now I've only posted the patch to introduce SPL_DM_SPI in Kconig:
https://patchwork.ozlabs.org/patch/1159655/

However, I've looked on your patchset and IMHO this work could be divided (as doing it at once is not feasible).

For example the CONFIG_SPI_FLASH_MTD could be converted to (SPL_TPL_)SPI_FLASH_MTD and then one could use

#if CONFIG_IS_ENABLED(SPI_FLASH_MTD) in drivers/mtd/spi/sf_probe.c (as it is only used there).

Quoted 8 lines

Then we could avoid situations where code is added as you remove it here [1]:
https://github.com/fschrempf/u-boot/commit/b6489fb5928c2b41d7e4cb39933f078659b4f10e#diff-9d3e174d033b8b9c9d380a22a81600aaL136

What I'm afraid though, is that split of SPI_FLASH_MTD will require adding unwillingly SPL_(TPL_)SPI_FLASH_MTD to all boards which already define it (and only drop ones, which use in <config>.h file pattern as [1]).

Yes, this looks like what I've tried to do separately in this branch [1].

The problem with some socfpga boards is, that they enable CONFIG_SPI_FLASH_MTD in socfpga_common.h, without enabling CONFIG_SPI_FLASH, which is probably wrong. So I tried to correct this, but looking at it again, this should be done separately.

So if I remove the added "CONFIG_SPI_FLASH=y" from my patches and rebase, this should be ok.

For this set I have still one question: Should I split the patches as currently done in [1]? This would mean after the first patch some boards miss SPI_FLASH_MTD code and the subsequent board config patches correct it afterwards. Or should I merge all the changes to a single patch, to not break the boards in between.
Unfortunately I can't do it the other way round and apply the board config changes first, as this breaks the build.

Quoted 1 line

Frieder, would you be able to work on this topic any time soon?

I can try to find some time this weekend and try to get [1] ready. But I probably won't be able to spend serious amounts of time anytime soon on the remaining tasks.

Thanks,
Frieder

[1]: https://github.com/fschrempf/u-boot/commits/spi_flash_mtd_cleanup

#9 lore raw

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

Hi Frieder,

Quoted 64 lines

Hi Lukasz,

Quoted 52 lines · Lukasz Majewski

Hi Frieder,

Quoted 35 lines
Quoted 32 lines · On Mon, 9 Sep 2019 11:11:50 +0000 Schrempf Frieder…

Hi Lukasz,

Quoted 14 lines · Tom Rini
Quoted 12 lines · Lukasz Majewski

This patch series introduces new SPL and TPL specific Kconfig entries for DM_SPI* options. Such change allows using the spi driver in SPL/TPL or U-Boot proper.

First two patches - related to ls10{42}* NXP soc fix some issues with defining the DM_SPI* defines in <board>.h file instead of Kconfig.

This series doesn't introduce build breaks, but board maintainers are kindly asked to check if their boards still boots.

Quoted 9 lines
Quoted 6 lines

Buildman setup for binary size regression checking:

./tools/buildman/buildman.py -b HEAD --count=4 ls1043 --output-dir=../BUILD/ --force-build -CveE ./tools/buildman/buildman.py -b HEAD --count=4 ls1043 --output-dir=../BUILD/ -Ssdel

So you did fix the ls1043 problems but ls1046 is still a problem.

I was trying to clean up this config mess some weeks ago. I stumbled over the same issues (size deltas below) when I tested with buildman and finally gave up on it. This was my testing branch for reference: [1].

Quoted 5 lines
Quoted 2 lines

Thanks for your work and I hope you/we can get this sorted out somehow...

For now I've only posted the patch to introduce SPL_DM_SPI in
Kconig: https://patchwork.ozlabs.org/patch/1159655/

However, I've looked on your patchset and IMHO this work could be divided (as doing it at once is not feasible).

For example the CONFIG_SPI_FLASH_MTD could be converted to (SPL_TPL_)SPI_FLASH_MTD and then one could use

#if CONFIG_IS_ENABLED(SPI_FLASH_MTD) in drivers/mtd/spi/sf_probe.c (as it is only used there).

Quoted 8 lines

Then we could avoid situations where code is added as you remove it here [1]:
https://github.com/fschrempf/u-boot/commit/b6489fb5928c2b41d7e4cb39933f078659b4f10e#diff-9d3e174d033b8b9c9d380a22a81600aaL136

What I'm afraid though, is that split of SPI_FLASH_MTD will require adding unwillingly SPL_(TPL_)SPI_FLASH_MTD to all boards which already define it (and only drop ones, which use in <config>.h file pattern as [1]).

Quoted 6 lines

Yes, this looks like what I've tried to do separately in this branch [1].

The problem with some socfpga boards is, that they enable CONFIG_SPI_FLASH_MTD in socfpga_common.h, without enabling CONFIG_SPI_FLASH, which is probably wrong.

It looks to me like the code in:
https://github.com/fschrempf/u-boot/commit/059d67efa34da92aaf738758e596f436203c84c2#diff-9d3e174d033b8b9c9d380a22a81600aaL136

is to prevent ALL socfpgas from compiling in FLASH MTD support to SPL, as it causes build breaks (as I do have such situation in one of my boards - it uses tiny SPI in SPL to read data from SPI-NOR, without the need to enable MTD there) .

In other words those boards only use FLASH MTD driver in U-Boot proper. (and probably there shall not be any deltas in buildman build binaries [*])

Quoted 5 lines

So I tried to correct
this, but looking at it again, this should be done separately.

So if I remove the added "CONFIG_SPI_FLASH=y" from my patches and rebase, this should be ok.

I think yes. I guess that ALL socfpgas shall have added CONFIG_SPI_FLASH_MTD=y to their _defconfigs

It may also happen that boards, which define CONFIG_SPI_FLASH_MTD would require both CONFIG_SPI_FLASH_MTD and CONFIG_SPL_SPI_FLASH_MTD defined (if they don't use socfpga style <config>.h code) to have the same binaries build.

Quoted 6 lines

For this set I have still one question: Should I split the patches as currently done in [1]? This would mean after the first patch some boards miss SPI_FLASH_MTD code and the subsequent board config patches correct it afterwards. Or should I merge all the changes to a single patch, to not break the boards in between.

I would opt for preparing one single patch with conversion (to avoid build breaks). This would also allow easy buildman testing [*] to see if there is any difference in sizes of binaries (elf sections to be precise).

I would also add the patch to define CONFIG_SPL_SPI_FLASH_MTD in Kconfig to show that such option is available for use after the conversion (IMHO it shall be added before the conversion patch).

Quoted 2 lines

Unfortunately I can't do it the other way round and apply the board config changes first, as this breaks the build.

The volume of changes is rather small - so single patch would be optimal here.

Quoted 4 lines
Quoted 2 lines

Frieder, would you be able to work on this topic any time soon?

I can try to find some time this weekend and try to get [1] ready.

Great, thanks :-)

Quoted 2 lines

But I probably won't be able to spend serious amounts of time anytime soon on the remaining tasks.

I think that we shall do it step by step. As we both learned from the experience - doing it at once is not feasible.

My comments to the patch set [1]:

1.
https://github.com/fschrempf/u-boot/commit/059d67efa34da92aaf738758e596f436203c84c2#diff-94a725bbe2cb8781105dab5153da9209R44

Is the CONFIG_SPI_FLASH = y necessary?

[*] - Buildman setup for testing (shared with me by Tom):

Set date:
export SOURCE_DATE_EPOCH=date +%s

Build the code:

./tools/buildman/buildman.py -b HEAD --count=1 socfpga dh_imx6 <other> --output-dir=../BUILD/ --force-build -CveE

Check build results (including binary deltas):

./tools/buildman/buildman.py -b HEAD --count=1 socfpga dh_imx6 <other> --output-dir=../BUILD/ -SsdelB

And you shall see the build results (with binary deltas).

Quoted 5 lines

Thanks,
Frieder

[1]: https://github.com/fschrempf/u-boot/commits/spi_flash_mtd_cleanup

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: <http://lists.denx.de/pipermail/u-boot/attachments/20190912/239828a5/attachment.sig>

#10 lore raw

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

Quoted 76 lines · Lukasz Majewski

Hi Frieder,

Quoted 64 lines

Hi Lukasz,

Quoted 52 lines · Lukasz Majewski

Hi Frieder,

Quoted 35 lines
Quoted 32 lines · On Mon, 9 Sep 2019 11:11:50 +0000 Schrempf Frieder…

Hi Lukasz,

Quoted 14 lines · Tom Rini
Quoted 12 lines · Lukasz Majewski

This patch series introduces new SPL and TPL specific Kconfig entries for DM_SPI* options. Such change allows using the spi driver in SPL/TPL or U-Boot proper.

First two patches - related to ls10{42}* NXP soc fix some issues with defining the DM_SPI* defines in <board>.h file instead of Kconfig.

This series doesn't introduce build breaks, but board maintainers are kindly asked to check if their boards still boots.

Quoted 9 lines
Quoted 6 lines

Buildman setup for binary size regression checking:

./tools/buildman/buildman.py -b HEAD --count=4 ls1043 --output-dir=../BUILD/ --force-build -CveE ./tools/buildman/buildman.py -b HEAD --count=4 ls1043 --output-dir=../BUILD/ -Ssdel

So you did fix the ls1043 problems but ls1046 is still a problem.

I was trying to clean up this config mess some weeks ago. I stumbled over the same issues (size deltas below) when I tested with buildman and finally gave up on it. This was my testing branch for reference: [1].

Quoted 5 lines
Quoted 2 lines

Thanks for your work and I hope you/we can get this sorted out somehow...

For now I've only posted the patch to introduce SPL_DM_SPI in
Kconig: https://patchwork.ozlabs.org/patch/1159655/

However, I've looked on your patchset and IMHO this work could be divided (as doing it at once is not feasible).

For example the CONFIG_SPI_FLASH_MTD could be converted to (SPL_TPL_)SPI_FLASH_MTD and then one could use

#if CONFIG_IS_ENABLED(SPI_FLASH_MTD) in drivers/mtd/spi/sf_probe.c (as it is only used there).

Quoted 8 lines

Then we could avoid situations where code is added as you remove it here [1]:
https://github.com/fschrempf/u-boot/commit/b6489fb5928c2b41d7e4cb39933f078659b4f10e#diff-9d3e174d033b8b9c9d380a22a81600aaL136

What I'm afraid though, is that split of SPI_FLASH_MTD will require adding unwillingly SPL_(TPL_)SPI_FLASH_MTD to all boards which already define it (and only drop ones, which use in <config>.h file pattern as [1]).

Quoted 6 lines

Yes, this looks like what I've tried to do separately in this branch [1].

The problem with some socfpga boards is, that they enable CONFIG_SPI_FLASH_MTD in socfpga_common.h, without enabling CONFIG_SPI_FLASH, which is probably wrong.

It looks to me like the code in:
https://github.com/fschrempf/u-boot/commit/059d67efa34da92aaf738758e596f436203c84c2#diff-9d3e174d033b8b9c9d380a22a81600aaL136

Quoted 8 lines

is to prevent ALL socfpgas from compiling in FLASH MTD support to SPL, as it causes build breaks (as I do have such situation in one of my boards - it uses tiny SPI in SPL to read data from SPI-NOR, without the need to enable MTD there) .

In other words those boards only use FLASH MTD driver in U-Boot proper. (and probably there shall not be any deltas in buildman build binaries [*])

Right.

Quoted 9 lines
Quoted 6 lines

So I tried to correct
this, but looking at it again, this should be done separately.

So if I remove the added "CONFIG_SPI_FLASH=y" from my patches and rebase, this should be ok.

I think yes. I guess that ALL socfpgas shall have added CONFIG_SPI_FLASH_MTD=y to their _defconfigs

Right.

Quoted 6 lines

It may also happen that boards, which define CONFIG_SPI_FLASH_MTD would require both CONFIG_SPI_FLASH_MTD and CONFIG_SPL_SPI_FLASH_MTD defined (if they don't use socfpga style <config>.h code) to have the same binaries build.

Last time I looked such boards didn't exist, but I'll check again.

Quoted 8 lines
Quoted 7 lines

For this set I have still one question: Should I split the patches as currently done in [1]? This would mean after the first patch some boards miss SPI_FLASH_MTD code and the subsequent board config patches correct it afterwards. Or should I merge all the changes to a single patch, to not break the boards in between.

Quoted 8 lines

I would opt for preparing one single patch with conversion (to avoid build breaks). This would also allow easy buildman testing [*] to see if there is any difference in sizes of binaries (elf sections to be precise).

I would also add the patch to define CONFIG_SPL_SPI_FLASH_MTD in Kconfig to show that such option is available for use after the conversion (IMHO it shall be added before the conversion patch).

Ok. Last time I worked on this, there was no board using SPI_FLASH_MTD in SPL. But this might not be true anymore. Anyway, I'll add the option.

Quoted 6 lines
Quoted 3 lines

Unfortunately I can't do it the other way round and apply the board config changes first, as this breaks the build.

The volume of changes is rather small - so single patch would be optimal here.

Ok.

Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

Frieder, would you be able to work on this topic any time soon?

I can try to find some time this weekend and try to get [1] ready.

Quoted 7 lines

Great, thanks :-)

Quoted 2 lines

But I probably won't be able to spend serious amounts of time anytime soon on the remaining tasks.

I think that we shall do it step by step. As we both learned from the experience - doing it at once is not feasible.

Definitely!

Quoted 7 lines

My comments to the patch set [1]:

1.
https://github.com/fschrempf/u-boot/commit/059d67efa34da92aaf738758e596f436203c84c2#diff-94a725bbe2cb8781105dab5153da9209R44

Is the CONFIG_SPI_FLASH = y necessary?

For the boards to work properly, it probably is necessary, but it builds fine without, so as said above I will leave this fix for someone who knows about socfpga.

Quoted 13 lines

[*] - Buildman setup for testing (shared with me by Tom):

Set date:
export SOURCE_DATE_EPOCH=date +%s

Build the code:

./tools/buildman/buildman.py -b HEAD --count=1 socfpga dh_imx6 <other> --output-dir=../BUILD/ --force-build -CveE

Quoted 7 lines

Check build results (including binary deltas):

./tools/buildman/buildman.py -b HEAD --count=1 socfpga dh_imx6 <other> --output-dir=../BUILD/ -SsdelB

And you shall see the build results (with binary deltas).

Thanks, I already use such buildman setup to test the binary deltas.

Quoted 18 lines
Quoted 6 lines

Thanks,
Frieder

[1]: https://github.com/fschrempf/u-boot/commits/spi_flash_mtd_cleanup

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