Skip to contentSkip to conversation

mtd: Add SPI-NOR core support

PATCH New Jagan Teki 3 participants 7 messages Mar 22, 2016 – Mar 28, 2016

lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

v7 cover mtd: Add SPI-NOR core support

Some of the SPI device drivers at drivers/spi not a real spi controllers, Unlike normal/generic SPI controllers they operates only with SPI-NOR flash devices. these were technically termed as SPI-NOR controllers, Ex: drivers/spi/fsl_qspi.c

The problem with these were resides at drivers/spi is entire SPI layer becomes SPI-NOR flash oriented which is absolutely a wrong indication where SPI layer getting effected more with flash operations - So this SPI-NOR core will resolve this issue by separating all SPI-NOR flash operations from spi layer and creats a generic layer called SPI-NOR core which can be used to interact SPI-NOR to SPI driver interface layer and the SPI-NOR controller driver. The idea is taken from Linux spi-nor framework.

Before SPI-NOR:

-----------------------
cmd/sf.c
-----------------------
spi_flash.c
-----------------------
sf_probe.c
-----------------------
spi-uclass
-----------------------
spi drivers
-----------------------
SPI NOR chip
-----------------------

After SPI-NOR:

------------------------------
cmd/sf.c
------------------------------
spi-nor.c
-------------------------------
m25p80.c spi nor drivers
-------------------------------
spi-uclass SPI NOR chip
-------------------------------
spi drivers
-------------------------------
SPI NOR chip
-------------------------------

SPI-NOR with MTD:

------------------------------
cmd/sf.c
------------------------------
MTD core
------------------------------
spi-nor.c
-------------------------------
m25p80.c spi nor drivers
-------------------------------
spi-uclass SPI NOR chip
-------------------------------
spi drivers
-------------------------------
SPI NOR chip
-------------------------------

drivers/mtd/spi-nor/spi-nor.c: spi-nor core drivers/mtd/spi-nor/m25p80.c: mtd uclass driver
which is an interface layer b/w spi-nor core drivers/spi drivers/mtd/spi-nor/fsl_qspi.c: spi-nor controller driver(mtd uclass)

Changes for v7:
- Rebase to latest
- Fixed git bisectable issues, with buildman.
- Fixed spi-nor compilation issues
- newly designed changes.

Changes for v6:
- Fixed git bisectable issues, with buildman.
- Fixed spi-nor compilation issues
- newly designed changes.

Changes for v5:
- newly designed changes

Testing:

$ git clone git://git.denx.de/u-boot-spi.git
$ cd u-boot-spi
$ git checkout -b spi-nor-test origin/spi-nor-test

Alison Wang (1):
defconfig: ls1021atwr_sdcard_qspi: Enable CONFIG_MTD

Jagan Teki (86):
mtd: Add m25p80 driver
mtd: Add Kconfig entry for MTD_M25P80
mtd: Add SPI-NOR core support
doc: device-tree-bindings: jedec,spi-nor
mtd: spi-nor: Add Kconfig entry for MTD_SPI_NOR
mtd: spi-nor: Add kconfig for MTD_SPI_NOR_USE_4K_SECTORS
mtd: spi-nor: Add MTD support
mtd: spi-nor: Add spi_nor support in m25p80
mtd: spi-nor: Add dm spi-nor probing
mtd: spi-nor: Add spi_flash_probe for mtd-dm-spi-nor
mtd: spi-nor: Add spi_flash_free for mtd-dm-spi-nor
mtd: spi-nor: m25p80: Add spi_nor support for non-dm
sf: Rename erase_size to erasesize
sf: Use erasesize instead of sector_size
sf: Use uint64_t for flash->size
spi_flash: Use mtd_info operation for SPI-NOR
spi_flash: Use spi_flash_t instead of struct spi_flash
mtd: spi-nor: Move spi_read_then_write to spi layer
spi: Rename spi_read_then_write to spi_write_then_read
mtd: spi-nor: Rename SPI_FLASH_BAR to SPI_NOR_BAR
mtd: spi-nor: Add Kconfig entry for SPI_NOR_BAR
mtd: spi-nor: Copy spl files from drivers/mtd/spi
mtd: spi-nor: spl: Follow ascending order of include headers
mtd: spi-nor: fsl_espi_spl: Use mtd_info
mtd: spi-nor: fsl_espi_spl: Use writebufsize instead of page_size
mtd: spi-nor: spi_spl_load: Use mtd_info
spl: Add CONFIG_SPL_SPI_NOR_SUPPORT
mtd: spi-nor: Add flash vendor Kconfig entries
arm: zynq: Kconfig: Select MTD uclass
arm: zynq: Kconfig: Drop DM_SPI_FLASH
mtd: spi-nor: Copy sf_dataflash
mtd: dataflash: Remove unneeded spi data
mtd: dataflash: Move flash id detection into jedec_probe
mtd: dataflash: Fix add_dataflash return logic
mtd: dataflash: Add UCLASS_MTD support
mtd: dataflash: Use spi_write_then_read
mtd: dataflash: Drop sf_internal.h
mtd: dataflash: Minor cleanups
mtd: Rename sf_dataflash.c to mtd_dataflash.c
mtd: spi-nor: Add Kconfig entry for mtd_dataflash
mtd: dataflash: Add MTD_DATAFLASH_WRITE_VERIFY
mtd: spi-nor: Add kconfig MTD_DATAFLASH_WRITE_VERIFY
configs: ls1021aqds: Drop DM_SPI_FLASH and DATAFLASH
defconfig: ls1021aqds_qspi: Enable SPI-NOR
defconfig: ls1021aqds_qspi: Enable CONFIG_MTD_DATAFLASH
mtd: spi-nor: Copy sandbox
mtd: spi-nor: sandbox: Use spi-nor header
mtd: spi-nor: sandbox: Fix ID exctract from spi_nor_info
mtd: spi-nor: Add SPI_NOR_SANDBOX
test/dm: Makefile: Use CONFIG_DM_MTD_SPI_NOR
test/dm: spi: Use CONFIG_DM_MTD_SPI_NOR
configs: sandbox: Enable SPI-NOR sandbox driver test/dm: spi: Use m25p80 as driver name
dts: sandbox: Use jedec,spi-nor compatible string
x86: Drop using spi_flash_dm_ops
spi_flash: Use spi_flash_t
defconfig: zynq_zc770_xm013: Enable ZYNQ_QSPI
configs: Drop CONFIG_SPI_FLASH_MTD
config: Enable SPI-NOR framework
spi-nor: Use CONFIG_MTD_SPI_NOR
configs: Use CONFIG_SPI_NOR_BAR
configs: spi-nor: Add new flash vendor configs
mtd: spi-nor: Add CONFIG_SPI_NOR_MISC
configs: Use CONFIG_SPI_NOR_MISC
powerpc/mpc85xx: Use spi.h instead of spi_flash.h
sf: Drop entire spi-flash framework
uclass: Drop UCLASS_SPI_FLASH
spi: Drop mode_rx
spi: Drop SPI_RX_FAST
MAINTAINERS: Add myself as SPI NOR maintainer
configs: CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
dts: spi-nor: Use jedec,spi-nor compatible string
dts: spi-nor: Use spi-nor as node name
mtd: spi-nor: Add erase ops
mtd: spi-nor: Not required to memset dummy byte
mtd: spi-nor: Move opcode handling in m25p80
mtd: spi-nor: Rename spi_nor_addr to m25p_addr2cmd
mtd: spi-nor: Add addr_width
mtd: spi-nor: Add m25p_cmdsz
mtd: spi-nor: read_dummy refers to dummy cycles not bytes
mtd: spi-nor: Use to instead of offset in write
mtd: spi-nor: offset with addr
mtd: m25p80: Rename cmd with opcode
armv8/ls1043a: move CONFIG_MTD to defconfig
defconfig: ls1021aqds_sdcard_qspi: Enable MTD
defconfig: ls1021aqds_sdcard_qspi: Enable MTD_DATAFLASH

 MAINTAINERS                                        |   11 +-
 Makefile                                           |    2 +-
 arch/Kconfig                                       |    4 +-
 arch/arm/Kconfig                                   |   13 +-
 arch/arm/dts/am437x-sk-evm.dts                     |    2 +-
 arch/arm/dts/armada-388-clearfog.dts               |    2 +-
 arch/arm/dts/armada-388-gp.dts                     |    2 +-
 arch/arm/dts/armada-xp-gp.dts                      |    2 +-
 arch/arm/dts/armada-xp-maxbcm.dts                  |    2 +-
 arch/arm/dts/armada-xp-synology-ds414.dts          |    2 +-
 arch/arm/dts/armada-xp-theadorable.dts             |    2 +-
 arch/arm/dts/dra7-evm.dts                          |    2 +-
 arch/arm/dts/dra72-evm.dts                         |    2 +-
 arch/arm/dts/exynos5250-snow.dts                   |    2 +-
 arch/arm/dts/exynos5250-spring.dts                 |    2 +-
 arch/arm/dts/exynos5420-peach-pit.dts              |    2 +-
 arch/arm/dts/fsl-ls1043a-qds.dtsi                  |    8 +-
 arch/arm/dts/fsl-ls1043a-rdb.dts                   |    2 +-
 arch/arm/dts/fsl-ls2080a-qds.dts                   |    6 +-
 arch/arm/dts/fsl-ls2080a-rdb.dts                   |    2 +-
 arch/arm/dts/ls1021a-qds.dtsi                      |    2 +-
 arch/arm/dts/ls1021a-twr.dtsi                      |    4 +-
 arch/arm/dts/rk3288-veyron.dtsi                    |    2 +-
 arch/arm/dts/socfpga_cyclone5_sockit.dts           |    2 +-
 arch/arm/dts/socfpga_cyclone5_sr1500.dts           |    2 +-
 arch/arm/dts/stv0991.dts                           |    2 +-
 arch/arm/dts/tegra30-beaver.dts                    |    2 +-
 arch/arm/dts/zynq-zc770-xm010.dts                  |    2 +-
 arch/arm/mach-rockchip/Kconfig                     |    2 +-
 arch/arm/mach-rockchip/rk3288-board-spl.c          |    2 +-
 arch/arm/mach-tegra/Kconfig                        |    2 +-
 arch/sandbox/dts/test.dts                          |    2 +-
 arch/x86/dts/bayleybay.dts                         |    4 +-
 arch/x86/dts/broadwell_som-6896.dts                |    4 +-
 arch/x86/dts/chromebook_link.dts                   |    4 +-
 arch/x86/dts/chromebox_panther.dts                 |    4 +-
 arch/x86/dts/cougarcanyon2.dts                     |    4 +-
 arch/x86/dts/crownbay.dts                          |    4 +-
 arch/x86/dts/galileo.dts                           |    4 +-
 arch/x86/dts/minnowmax.dts                         |    4 +-
 arch/x86/lib/mrccache.c                            |    9 +-
 board/Arcturus/ucp1020/cmd_arc.c                   |    2 +-
 board/Arcturus/ucp1020/ucp1020.c                   |    2 +-
 board/Synology/ds414/cmd_syno.c                    |    2 +-
 board/buffalo/lsxl/lsxl.c                          |    2 +-
 board/congatec/cgtqmx6eval/cgtqmx6eval.c           |    2 +-
 board/davinci/da8xxevm/da850evm.c                  |    4 +-
 board/davinci/ea20/ea20.c                          |    2 +-
 board/renesas/sh7752evb/sh7752evb.c                |    4 +-
 board/renesas/sh7753evb/sh7753evb.c                |    4 +-
 board/renesas/sh7757lcr/sh7757lcr.c                |    6 +-
 board/siemens/taurus/taurus.c                      |    2 +-
 cmd/sf.c                                           |   38 +-
 common/env_sf.c                                    |    6 +-
 common/splash_source.c                             |    4 +-
 configs/B4420QDS_NAND_defconfig                    |    5 +-
 configs/B4420QDS_SPIFLASH_defconfig                |    5 +-
 configs/B4420QDS_defconfig                         |    5 +-
 configs/B4860QDS_NAND_defconfig                    |    5 +-
 configs/B4860QDS_SECURE_BOOT_defconfig             |    5 +-
 configs/B4860QDS_SPIFLASH_defconfig                |    5 +-
 configs/B4860QDS_SRIO_PCIE_BOOT_defconfig          |    5 +-
 configs/B4860QDS_defconfig                         |    5 +-
 configs/BSC9131RDB_NAND_SYSCLK100_defconfig        |    5 +-
 configs/BSC9131RDB_NAND_defconfig                  |    5 +-
 configs/BSC9131RDB_SPIFLASH_SYSCLK100_defconfig    |    5 +-
 configs/BSC9131RDB_SPIFLASH_defconfig              |    5 +-
 configs/BSC9132QDS_NAND_DDRCLK100_SECURE_defconfig |    5 +-
 configs/BSC9132QDS_NAND_DDRCLK100_defconfig        |    5 +-
 configs/BSC9132QDS_NAND_DDRCLK133_SECURE_defconfig |    5 +-
 configs/BSC9132QDS_NAND_DDRCLK133_defconfig        |    5 +-
 configs/BSC9132QDS_NOR_DDRCLK100_SECURE_defconfig  |    5 +-
 configs/BSC9132QDS_NOR_DDRCLK100_defconfig         |    5 +-
 configs/BSC9132QDS_NOR_DDRCLK133_SECURE_defconfig  |    5 +-
 configs/BSC9132QDS_NOR_DDRCLK133_defconfig         |    5 +-
 .../BSC9132QDS_SDCARD_DDRCLK100_SECURE_defconfig   |    5 +-
 configs/BSC9132QDS_SDCARD_DDRCLK100_defconfig      |    5 +-
 .../BSC9132QDS_SDCARD_DDRCLK133_SECURE_defconfig   |    5 +-
 configs/BSC9132QDS_SDCARD_DDRCLK133_defconfig      |    5 +-
 .../BSC9132QDS_SPIFLASH_DDRCLK100_SECURE_defconfig |    5 +-
 configs/BSC9132QDS_SPIFLASH_DDRCLK100_defconfig    |    5 +-
 .../BSC9132QDS_SPIFLASH_DDRCLK133_SECURE_defconfig |    5 +-
 configs/BSC9132QDS_SPIFLASH_DDRCLK133_defconfig    |    5 +-
 configs/C29XPCIE_NAND_defconfig                    |    7 +-
 configs/C29XPCIE_NOR_SECBOOT_defconfig             |    7 +-
 configs/C29XPCIE_SPIFLASH_SECBOOT_defconfig        |    7 +-
 configs/C29XPCIE_SPIFLASH_defconfig                |    7 +-
 configs/C29XPCIE_defconfig                         |    7 +-
 configs/M52277EVB_defconfig                        |    5 +-
 configs/M52277EVB_stmicro_defconfig                |    5 +-
 configs/M54418TWR_defconfig                        |    5 +-
 configs/M54418TWR_nand_mii_defconfig               |    5 +-
 configs/M54418TWR_nand_rmii_defconfig              |    5 +-
 configs/M54418TWR_nand_rmii_lowfreq_defconfig      |    5 +-
 configs/M54418TWR_serial_mii_defconfig             |    5 +-
 configs/M54418TWR_serial_rmii_defconfig            |    5 +-
 configs/M54451EVB_defconfig                        |    5 +-
 configs/M54451EVB_stmicro_defconfig                |    5 +-
 configs/M54455EVB_a66_defconfig                    |    5 +-
 configs/M54455EVB_defconfig                        |    5 +-
 configs/M54455EVB_i66_defconfig                    |    5 +-
 configs/M54455EVB_intel_defconfig                  |    5 +-
 configs/M54455EVB_stm33_defconfig                  |    5 +-
 configs/MPC8536DS_36BIT_defconfig                  |    5 +-
 configs/MPC8536DS_SDCARD_defconfig                 |    5 +-
 configs/MPC8536DS_SPIFLASH_defconfig               |    5 +-
 configs/MPC8536DS_defconfig                        |    5 +-
 configs/P1010RDB-PA_36BIT_NAND_SECBOOT_defconfig   |    5 +-
 configs/P1010RDB-PA_36BIT_NAND_defconfig           |    5 +-
 configs/P1010RDB-PA_36BIT_NOR_SECBOOT_defconfig    |    5 +-
 configs/P1010RDB-PA_36BIT_NOR_defconfig            |    5 +-
 configs/P1010RDB-PA_36BIT_SDCARD_defconfig         |    5 +-
 .../P1010RDB-PA_36BIT_SPIFLASH_SECBOOT_defconfig   |    5 +-
 configs/P1010RDB-PA_36BIT_SPIFLASH_defconfig       |    5 +-
 configs/P1010RDB-PA_NAND_SECBOOT_defconfig         |    5 +-
 configs/P1010RDB-PA_NAND_defconfig                 |    5 +-
 configs/P1010RDB-PA_NOR_SECBOOT_defconfig          |    5 +-
 configs/P1010RDB-PA_NOR_defconfig                  |    5 +-
 configs/P1010RDB-PA_SDCARD_defconfig               |    5 +-
 configs/P1010RDB-PA_SPIFLASH_SECBOOT_defconfig     |    5 +-
 configs/P1010RDB-PA_SPIFLASH_defconfig             |    5 +-
 configs/P1010RDB-PB_36BIT_NAND_SECBOOT_defconfig   |    5 +-
 configs/P1010RDB-PB_36BIT_NAND_defconfig           |    5 +-
 configs/P1010RDB-PB_36BIT_NOR_SECBOOT_defconfig    |    5 +-
 configs/P1010RDB-PB_36BIT_NOR_defconfig            |    5 +-
 configs/P1010RDB-PB_36BIT_SDCARD_defconfig         |    5 +-
 .../P1010RDB-PB_36BIT_SPIFLASH_SECBOOT_defconfig   |    5 +-
 configs/P1010RDB-PB_36BIT_SPIFLASH_defconfig       |    5 +-
 configs/P1010RDB-PB_NAND_SECBOOT_defconfig         |    5 +-
 configs/P1010RDB-PB_NAND_defconfig                 |    5 +-
 configs/P1010RDB-PB_NOR_SECBOOT_defconfig          |    5 +-
 configs/P1010RDB-PB_NOR_defconfig                  |    5 +-
 configs/P1010RDB-PB_SDCARD_defconfig               |    5 +-
 configs/P1010RDB-PB_SPIFLASH_SECBOOT_defconfig     |    5 +-
 configs/P1010RDB-PB_SPIFLASH_defconfig             |    5 +-
 configs/P1020RDB-PC_36BIT_NAND_defconfig           |    5 +-
 configs/P1020RDB-PC_36BIT_SDCARD_defconfig         |    5 +-
 configs/P1020RDB-PC_36BIT_SPIFLASH_defconfig       |    5 +-
 configs/P1020RDB-PC_36BIT_defconfig                |    5 +-
 configs/P1020RDB-PC_NAND_defconfig                 |    5 +-
 configs/P1020RDB-PC_SDCARD_defconfig               |    5 +-
 configs/P1020RDB-PC_SPIFLASH_defconfig             |    5 +-
 configs/P1020RDB-PC_defconfig                      |    5 +-
 configs/P1020RDB-PD_NAND_defconfig                 |    5 +-
 configs/P1020RDB-PD_SDCARD_defconfig               |    5 +-
 configs/P1020RDB-PD_SPIFLASH_defconfig             |    5 +-
 configs/P1020RDB-PD_defconfig                      |    5 +-
 configs/P1021RDB-PC_36BIT_NAND_defconfig           |    5 +-
 configs/P1021RDB-PC_36BIT_SDCARD_defconfig         |    5 +-
 configs/P1021RDB-PC_36BIT_SPIFLASH_defconfig       |    5 +-
 configs/P1021RDB-PC_36BIT_defconfig                |    5 +-
 configs/P1021RDB-PC_NAND_defconfig                 |    5 +-
 configs/P1021RDB-PC_SDCARD_defconfig               |    5 +-
 configs/P1021RDB-PC_SPIFLASH_defconfig             |    5 +-
 configs/P1021RDB-PC_defconfig                      |    5 +-
 configs/P1022DS_36BIT_NAND_defconfig               |    5 +-
 configs/P1022DS_36BIT_SDCARD_defconfig             |    5 +-
 configs/P1022DS_36BIT_SPIFLASH_defconfig           |    5 +-
 configs/P1022DS_36BIT_defconfig                    |    5 +-
 configs/P1022DS_NAND_defconfig                     |    5 +-
 configs/P1022DS_SDCARD_defconfig                   |    5 +-
 configs/P1022DS_SPIFLASH_defconfig                 |    5 +-
 configs/P1022DS_defconfig                          |    5 +-
 configs/P1024RDB_36BIT_defconfig                   |    5 +-
 configs/P1024RDB_NAND_defconfig                    |    5 +-
 configs/P1024RDB_SDCARD_defconfig                  |    5 +-
 configs/P1024RDB_SPIFLASH_defconfig                |    5 +-
 configs/P1024RDB_defconfig                         |    5 +-
 configs/P1025RDB_36BIT_defconfig                   |    5 +-
 configs/P1025RDB_NAND_defconfig                    |    5 +-
 configs/P1025RDB_SDCARD_defconfig                  |    5 +-
 configs/P1025RDB_SPIFLASH_defconfig                |    5 +-
 configs/P1025RDB_defconfig                         |    5 +-
 configs/P2020RDB-PC_36BIT_NAND_defconfig           |    5 +-
 configs/P2020RDB-PC_36BIT_SDCARD_defconfig         |    5 +-
 configs/P2020RDB-PC_36BIT_SPIFLASH_defconfig       |    5 +-
 configs/P2020RDB-PC_36BIT_defconfig                |    5 +-
 configs/P2020RDB-PC_NAND_defconfig                 |    5 +-
 configs/P2020RDB-PC_SDCARD_defconfig               |    5 +-
 configs/P2020RDB-PC_SPIFLASH_defconfig             |    5 +-
 configs/P2020RDB-PC_defconfig                      |    5 +-
 configs/P2041RDB_NAND_defconfig                    |    5 +-
 configs/P2041RDB_SDCARD_defconfig                  |    5 +-
 configs/P2041RDB_SECURE_BOOT_defconfig             |    5 +-
 configs/P2041RDB_SPIFLASH_defconfig                |    5 +-
 configs/P2041RDB_SRIO_PCIE_BOOT_defconfig          |    5 +-
 configs/P2041RDB_defconfig                         |    5 +-
 configs/P3041DS_NAND_SECURE_BOOT_defconfig         |    5 +-
 configs/P3041DS_NAND_defconfig                     |    5 +-
 configs/P3041DS_SDCARD_defconfig                   |    5 +-
 configs/P3041DS_SECURE_BOOT_defconfig              |    5 +-
 configs/P3041DS_SPIFLASH_defconfig                 |    5 +-
 configs/P3041DS_SRIO_PCIE_BOOT_defconfig           |    5 +-
 configs/P3041DS_defconfig                          |    5 +-
 configs/P4080DS_SDCARD_defconfig                   |    5 +-
 configs/P4080DS_SECURE_BOOT_defconfig              |    5 +-
 configs/P4080DS_SPIFLASH_defconfig                 |    5 +-
 configs/P4080DS_SRIO_PCIE_BOOT_defconfig           |    5 +-
 configs/P4080DS_defconfig                          |    5 +-
 configs/P5020DS_NAND_SECURE_BOOT_defconfig         |    5 +-
 configs/P5020DS_NAND_defconfig                     |    5 +-
 configs/P5020DS_SDCARD_defconfig                   |    5 +-
 configs/P5020DS_SECURE_BOOT_defconfig              |    5 +-
 configs/P5020DS_SPIFLASH_defconfig                 |    5 +-
 configs/P5020DS_SRIO_PCIE_BOOT_defconfig           |    5 +-
 configs/P5020DS_defconfig                          |    5 +-
 configs/P5040DS_NAND_SECURE_BOOT_defconfig         |    5 +-
 configs/P5040DS_NAND_defconfig                     |    5 +-
 configs/P5040DS_SDCARD_defconfig                   |    5 +-
 configs/P5040DS_SECURE_BOOT_defconfig              |    5 +-
 configs/P5040DS_SPIFLASH_defconfig                 |    5 +-
 configs/P5040DS_defconfig                          |    5 +-
 configs/T1023RDB_NAND_defconfig                    |    5 +-
 configs/T1023RDB_SDCARD_defconfig                  |    5 +-
 configs/T1023RDB_SECURE_BOOT_defconfig             |    5 +-
 configs/T1023RDB_SPIFLASH_defconfig                |    5 +-
 configs/T1023RDB_defconfig                         |    5 +-
 configs/T1024QDS_DDR4_SECURE_BOOT_defconfig        |    9 +-
 configs/T1024QDS_DDR4_defconfig                    |    9 +-
 configs/T1024QDS_NAND_defconfig                    |    9 +-
 configs/T1024QDS_SDCARD_defconfig                  |    9 +-
 configs/T1024QDS_SECURE_BOOT_defconfig             |    9 +-
 configs/T1024QDS_SPIFLASH_defconfig                |    9 +-
 configs/T1024QDS_defconfig                         |    9 +-
 configs/T1024RDB_NAND_defconfig                    |    5 +-
 configs/T1024RDB_SDCARD_defconfig                  |    5 +-
 configs/T1024RDB_SECURE_BOOT_defconfig             |    5 +-
 configs/T1024RDB_SPIFLASH_defconfig                |    5 +-
 configs/T1024RDB_defconfig                         |    5 +-
 configs/T1040D4RDB_NAND_defconfig                  |    5 +-
 configs/T1040D4RDB_SDCARD_defconfig                |    5 +-
 configs/T1040D4RDB_SECURE_BOOT_defconfig           |    5 +-
 configs/T1040D4RDB_SPIFLASH_defconfig              |    5 +-
 configs/T1040D4RDB_defconfig                       |    5 +-
 configs/T1040QDS_DDR4_defconfig                    |    9 +-
 configs/T1040QDS_SECURE_BOOT_defconfig             |    9 +-
 configs/T1040QDS_defconfig                         |    9 +-
 configs/T1040RDB_NAND_defconfig                    |    5 +-
 configs/T1040RDB_SDCARD_defconfig                  |    5 +-
 configs/T1040RDB_SECURE_BOOT_defconfig             |    5 +-
 configs/T1040RDB_SPIFLASH_defconfig                |    5 +-
 configs/T1040RDB_defconfig                         |    5 +-
 configs/T1042D4RDB_NAND_defconfig                  |    5 +-
 configs/T1042D4RDB_SDCARD_defconfig                |    5 +-
 configs/T1042D4RDB_SECURE_BOOT_defconfig           |    5 +-
 configs/T1042D4RDB_SPIFLASH_defconfig              |    5 +-
 configs/T1042D4RDB_defconfig                       |    5 +-
 configs/T1042RDB_PI_NAND_defconfig                 |    5 +-
 configs/T1042RDB_PI_SDCARD_defconfig               |    5 +-
 configs/T1042RDB_PI_SPIFLASH_defconfig             |    5 +-
 configs/T1042RDB_PI_defconfig                      |    5 +-
 configs/T1042RDB_SECURE_BOOT_defconfig             |    5 +-
 configs/T1042RDB_defconfig                         |    5 +-
 configs/T2080QDS_NAND_defconfig                    |    9 +-
 configs/T2080QDS_SDCARD_defconfig                  |    9 +-
 configs/T2080QDS_SECURE_BOOT_defconfig             |    9 +-
 configs/T2080QDS_SPIFLASH_defconfig                |    9 +-
 configs/T2080QDS_SRIO_PCIE_BOOT_defconfig          |    9 +-
 configs/T2080QDS_defconfig                         |    9 +-
 configs/T2080RDB_NAND_defconfig                    |    5 +-
 configs/T2080RDB_SDCARD_defconfig                  |    5 +-
 configs/T2080RDB_SECURE_BOOT_defconfig             |    5 +-
 configs/T2080RDB_SPIFLASH_defconfig                |    5 +-
 configs/T2080RDB_SRIO_PCIE_BOOT_defconfig          |    5 +-
 configs/T2080RDB_defconfig                         |    5 +-
 configs/T2081QDS_NAND_defconfig                    |    9 +-
 configs/T2081QDS_SDCARD_defconfig                  |    9 +-
 configs/T2081QDS_SPIFLASH_defconfig                |    9 +-
 configs/T2081QDS_SRIO_PCIE_BOOT_defconfig          |    9 +-
 configs/T2081QDS_defconfig                         |    9 +-
 configs/T4160QDS_NAND_defconfig                    |    5 +-
 configs/T4160QDS_SDCARD_defconfig                  |    5 +-
 configs/T4160QDS_SECURE_BOOT_defconfig             |    5 +-
 configs/T4160QDS_defconfig                         |    5 +-
 configs/T4160RDB_defconfig                         |    5 +-
 configs/T4240QDS_NAND_defconfig                    |    5 +-
 configs/T4240QDS_SDCARD_defconfig                  |    5 +-
 configs/T4240QDS_SECURE_BOOT_defconfig             |    5 +-
 configs/T4240QDS_SRIO_PCIE_BOOT_defconfig          |    5 +-
 configs/T4240QDS_defconfig                         |    5 +-
 configs/T4240RDB_SDCARD_defconfig                  |    5 +-
 configs/T4240RDB_defconfig                         |    5 +-
 configs/UCP1020_SPIFLASH_defconfig                 |    9 +-
 configs/UCP1020_defconfig                          |    9 +-
 configs/alt_defconfig                              |    7 +-
 configs/am335x_boneblack_defconfig                 |    5 +-
 configs/am335x_boneblack_vboot_defconfig           |    5 +-
 configs/am335x_evm_defconfig                       |    5 +-
 configs/am335x_evm_nor_defconfig                   |    5 +-
 configs/am335x_evm_norboot_defconfig               |    5 +-
 configs/am335x_evm_spiboot_defconfig               |    5 +-
 configs/am335x_evm_usbspl_defconfig                |    5 +-
 configs/am335x_gp_evm_defconfig                    |    5 +-
 configs/am437x_gp_evm_defconfig                    |    5 +-
 configs/am437x_sk_evm_defconfig                    |    9 +-
 configs/am43xx_evm_defconfig                       |    7 +-
 configs/am43xx_evm_ethboot_defconfig               |    5 +-
 configs/am43xx_evm_qspiboot_defconfig              |    5 +-
 configs/am43xx_evm_usbhost_boot_defconfig          |    5 +-
 configs/am57xx_evm_defconfig                       |    5 +-
 configs/aristainetos2_defconfig                    |    5 +-
 configs/aristainetos2b_defconfig                   |    5 +-
 configs/aristainetos_defconfig                     |    5 +-
 configs/at91sam9n12ek_mmc_defconfig                |    5 +-
 configs/at91sam9n12ek_nandflash_defconfig          |    5 +-
 configs/at91sam9n12ek_spiflash_defconfig           |    5 +-
 configs/at91sam9x5ek_dataflash_defconfig           |    5 +-
 configs/at91sam9x5ek_mmc_defconfig                 |    5 +-
 configs/at91sam9x5ek_nandflash_defconfig           |    5 +-
 configs/at91sam9x5ek_spiflash_defconfig            |    5 +-
 configs/atngw100_defconfig                         |    5 +-
 configs/atngw100mkii_defconfig                     |    5 +-
 configs/axm_defconfig                              |    5 +-
 configs/bayleybay_defconfig                        |    9 +-
 configs/beaver_defconfig                           |    5 +-
 configs/bf518f-ezbrd_defconfig                     |    7 +-
 configs/bf525-ucr2_defconfig                       |    5 +-
 configs/bf526-ezbrd_defconfig                      |    5 +-
 configs/bf527-ad7160-eval_defconfig                |    5 +-
 configs/bf527-ezkit-v2_defconfig                   |    5 +-
 configs/bf527-ezkit_defconfig                      |    5 +-
 configs/bf527-sdp_defconfig                        |   16 +-
 configs/bf537-minotaur_defconfig                   |    5 +-
 configs/bf537-pnav_defconfig                       |    5 +-
 configs/bf537-srv1_defconfig                       |    5 +-
 configs/bf537-stamp_defconfig                      |   16 +-
 configs/bf548-ezkit_defconfig                      |    5 +-
 configs/bf561-acvilon_defconfig                    |    5 +-
 configs/bf609-ezkit_defconfig                      |   16 +-
 configs/bg0900_defconfig                           |    7 +-
 configs/birdland_bav335a_defconfig                 |    5 +-
 configs/birdland_bav335b_defconfig                 |    5 +-
 configs/blackstamp_defconfig                       |    5 +-
 configs/blackvme_defconfig                         |    5 +-
 configs/br4_defconfig                              |    5 +-
 configs/cardhu_defconfig                           |    5 +-
 configs/cgtqmx6eval_defconfig                      |    2 +
 configs/chromebook_jerry_defconfig                 |    2 +
 configs/chromebook_link_defconfig                  |    9 +-
 configs/chromebook_samus_defconfig                 |    9 +-
 configs/chromebox_panther_defconfig                |    9 +-
 configs/clearfog_defconfig                         |    3 +-
 configs/cm_fx6_defconfig                           |   17 +-
 configs/cm_t43_defconfig                           |   20 +-
 configs/conga-qeval20-qa3-e3845_defconfig          |   11 +-
 .../controlcenterd_36BIT_SDCARD_DEVELOP_defconfig  |    5 +-
 configs/controlcenterd_36BIT_SDCARD_defconfig      |    5 +-
 configs/coreboot-x86_defconfig                     |    9 +-
 configs/cougarcanyon2_defconfig                    |    5 +-
 configs/crownbay_defconfig                         |   11 +-
 configs/d2net_v2_defconfig                         |    5 +-
 configs/da850_am18xxevm_defconfig                  |    7 +-
 configs/da850evm_defconfig                         |    7 +-
 configs/da850evm_direct_nor_defconfig              |    7 +-
 configs/dalmore_defconfig                          |    5 +-
 configs/db-88f6820-gp_defconfig                    |    7 +-
 configs/db-mv784mp-gp_defconfig                    |    7 +-
 configs/dra72_evm_defconfig                        |    9 +-
 configs/dra74_evm_defconfig                        |    9 +-
 configs/dra7xx_evm_defconfig                       |    8 +-
 configs/dra7xx_evm_qspiboot_defconfig              |    6 +-
 configs/dra7xx_evm_uart3_defconfig                 |    6 +-
 configs/draco_defconfig                            |    5 +-
 configs/dreamplug_defconfig                        |    5 +-
 configs/ds414_defconfig                            |    7 +-
 configs/e2220-1170_defconfig                       |    5 +-
 configs/ea20_defconfig                             |    5 +-
 configs/ethernut5_defconfig                        |    5 +-
 configs/firefly-rk3288_defconfig                   |    2 +
 configs/galileo_defconfig                          |    9 +-
 configs/gose_defconfig                             |    7 +-
 configs/gplugd_defconfig                           |    7 +-
 configs/inetspace_v2_defconfig                     |    5 +-
 configs/ip04_defconfig                             |    7 +-
 configs/jetson-tk1_defconfig                       |    5 +-
 configs/k2e_evm_defconfig                          |    5 +-
 configs/k2g_evm_defconfig                          |    5 +-
 configs/k2hk_evm_defconfig                         |    5 +-
 configs/k2l_evm_defconfig                          |    5 +-
 configs/km_kirkwood_128m16_defconfig               |    5 +-
 configs/km_kirkwood_defconfig                      |    5 +-
 configs/km_kirkwood_pci_defconfig                  |    5 +-
 configs/kmcoge4_defconfig                          |    7 +-
 configs/kmcoge5un_defconfig                        |    5 +-
 configs/kmlion1_defconfig                          |    7 +-
 configs/kmnusa_defconfig                           |    5 +-
 configs/kmsugp1_defconfig                          |    5 +-
 configs/kmsuv31_defconfig                          |    5 +-
 configs/koelsch_defconfig                          |    7 +-
 configs/kylin-rk3036_defconfig                     |    2 +
 configs/lager_defconfig                            |    7 +-
 configs/legoev3_defconfig                          |    5 +-
 configs/ls1021aqds_qspi_defconfig                  |    7 +-
 configs/ls1021aqds_sdcard_qspi_defconfig           |    7 +-
 configs/ls1021atwr_qspi_defconfig                  |    8 +-
 configs/ls1021atwr_sdcard_qspi_defconfig           |    8 +-
 configs/ls1043aqds_defconfig                       |    4 +-
 configs/ls1043aqds_lpuart_defconfig                |    4 +-
 configs/ls1043aqds_nand_defconfig                  |    4 +-
 configs/ls1043aqds_nor_ddr3_defconfig              |    4 +-
 configs/ls1043aqds_qspi_defconfig                  |    4 +-
 configs/ls1043aqds_sdcard_ifc_defconfig            |    4 +-
 configs/ls1043aqds_sdcard_qspi_defconfig           |    4 +-
 configs/ls1043ardb_SECURE_BOOT_defconfig           |    4 +-
 configs/ls1043ardb_defconfig                       |    4 +-
 configs/ls1043ardb_nand_defconfig                  |    4 +-
 configs/ls1043ardb_sdcard_defconfig                |    4 +-
 configs/ls2080aqds_defconfig                       |    2 +-
 configs/ls2080ardb_defconfig                       |    2 +-
 configs/ls2085aqds_defconfig                       |    2 +-
 configs/ls2085ardb_defconfig                       |    2 +-
 configs/lschlv2_defconfig                          |    5 +-
 configs/lsxhl_defconfig                            |    5 +-
 configs/m28evk_defconfig                           |    5 +-
 configs/ma5d4evk_defconfig                         |    3 +-
 configs/marsboard_defconfig                        |    5 +-
 configs/maxbcm_defconfig                           |   11 +-
 configs/mgcoge3un_defconfig                        |    5 +-
 configs/minnowmax_defconfig                        |   11 +-
 configs/mx28evk_auart_console_defconfig            |    5 +-
 configs/mx28evk_defconfig                          |    5 +-
 configs/mx28evk_nand_defconfig                     |    5 +-
 configs/mx28evk_spi_defconfig                      |    5 +-
 configs/mx6dlsabreauto_defconfig                   |    5 +-
 configs/mx6dlsabresd_defconfig                     |    5 +-
 configs/mx6qpsabreauto_defconfig                   |    5 +-
 configs/mx6qsabreauto_defconfig                    |    5 +-
 configs/mx6qsabrelite_defconfig                    |    5 +-
 configs/mx6qsabresd_defconfig                      |    5 +-
 configs/mx6sabresd_spl_defconfig                   |    5 +-
 configs/mx6slevk_defconfig                         |    5 +-
 configs/mx6slevk_spinor_defconfig                  |    5 +-
 configs/mx6slevk_spl_defconfig                     |    5 +-
 configs/mx6sxsabreauto_defconfig                   |    7 +-
 configs/mx6sxsabresd_defconfig                     |    5 +-
 configs/mx6sxsabresd_spl_defconfig                 |    3 +-
 configs/net2big_v2_defconfig                       |    5 +-
 configs/netspace_lite_v2_defconfig                 |    5 +-
 configs/netspace_max_v2_defconfig                  |    5 +-
 configs/netspace_mini_v2_defconfig                 |    5 +-
 configs/netspace_v2_defconfig                      |    5 +-
 configs/nitrogen6dl2g_defconfig                    |    5 +-
 configs/nitrogen6dl_defconfig                      |    5 +-
 configs/nitrogen6q2g_defconfig                     |    5 +-
 configs/nitrogen6q_defconfig                       |    5 +-
 configs/nitrogen6s1g_defconfig                     |    5 +-
 configs/nitrogen6s_defconfig                       |    5 +-
 configs/nyan-big_defconfig                         |    5 +-
 configs/omapl138_lcdk_defconfig                    |    7 +-
 configs/ot1200_defconfig                           |   11 +-
 configs/ot1200_spl_defconfig                       |   11 +-
 configs/p2371-0000_defconfig                       |    5 +-
 configs/p2371-2180_defconfig                       |    5 +-
 configs/p2571_defconfig                            |    5 +-
 configs/pcm051_rev1_defconfig                      |    5 +-
 configs/pcm051_rev3_defconfig                      |    5 +-
 configs/peach-pi_defconfig                         |    7 +-
 configs/peach-pit_defconfig                        |    7 +-
 configs/porter_defconfig                           |    7 +-
 configs/portl2_defconfig                           |    5 +-
 configs/pr1_defconfig                              |    5 +-
 configs/pxm2_defconfig                             |    5 +-
 configs/qemu-x86_defconfig                         |    9 +-
 configs/rastaban_defconfig                         |    5 +-
 configs/riotboard_defconfig                        |    5 +-
 configs/rock2_defconfig                            |    2 +
 configs/rut_defconfig                              |    5 +-
 configs/sama5d2_xplained_mmc_defconfig             |    3 +-
 configs/sama5d2_xplained_spiflash_defconfig        |    3 +-
 configs/sama5d3xek_mmc_defconfig                   |    5 +-
 configs/sama5d3xek_nandflash_defconfig             |    5 +-
 configs/sama5d3xek_spiflash_defconfig              |    5 +-
 configs/sama5d4_xplained_mmc_defconfig             |    5 +-
 configs/sama5d4_xplained_nandflash_defconfig       |    5 +-
 configs/sama5d4_xplained_spiflash_defconfig        |    5 +-
 configs/sama5d4ek_mmc_defconfig                    |    5 +-
 configs/sama5d4ek_nandflash_defconfig              |    5 +-
 configs/sama5d4ek_spiflash_defconfig               |    5 +-
 configs/sandbox_defconfig                          |   19 +-
 configs/sh7752evb_defconfig                        |    7 +-
 configs/sh7753evb_defconfig                        |    7 +-
 configs/sh7757lcr_defconfig                        |    5 +-
 configs/silk_defconfig                             |    7 +-
 configs/smdk5250_defconfig                         |    7 +-
 configs/smdk5420_defconfig                         |    7 +-
 configs/snow_defconfig                             |    7 +-
 configs/socfpga_arria5_defconfig                   |    9 +-
 configs/socfpga_cyclone5_defconfig                 |    9 +-
 configs/socfpga_de0_nano_soc_defconfig             |    3 +
 configs/socfpga_mcvevk_defconfig                   |    2 +
 configs/socfpga_sockit_defconfig                   |    9 +-
 configs/socfpga_socrates_defconfig                 |    7 +-
 configs/socfpga_sr1500_defconfig                   |    7 +-
 configs/spring_defconfig                           |    7 +-
 configs/stout_defconfig                            |    7 +-
 configs/stv0991_defconfig                          |    4 +-
 configs/taurus_defconfig                           |    5 +-
 configs/tec-ng_defconfig                           |    5 +-
 configs/theadorable_debug_defconfig                |    7 +-
 configs/theadorable_defconfig                      |    7 +-
 configs/thuban_defconfig                           |    5 +-
 configs/tqma6q_mba6_mmc_defconfig                  |    5 +-
 configs/tqma6q_mba6_spi_defconfig                  |    5 +-
 configs/tqma6s_mba6_mmc_defconfig                  |    5 +-
 configs/tqma6s_mba6_spi_defconfig                  |    5 +-
 configs/trimslice_defconfig                        |    5 +-
 configs/tseries_spi_defconfig                      |    7 +-
 configs/venice2_defconfig                          |    5 +-
 configs/vf610twr_defconfig                         |    3 +-
 configs/vf610twr_nand_defconfig                    |    3 +-
 configs/vinco_defconfig                            |    3 +-
 configs/zynq_microzed_defconfig                    |    9 +-
 configs/zynq_zc702_defconfig                       |   11 +-
 configs/zynq_zc706_defconfig                       |   11 +-
 configs/zynq_zc770_xm010_defconfig                 |   13 +-
 configs/zynq_zc770_xm013_defconfig                 |    6 +-
 configs/zynq_zed_defconfig                         |   11 +-
 configs/zynq_zybo_defconfig                        |    5 +-
 doc/SPI/README.ti_qspi_dra_test                    |    2 +-
 doc/device-tree-bindings/mtd/jedec,spi-nor.txt     |   78 ++
 doc/mtd/spi-nor.txt                                |   81 ++
 drivers/Makefile                                   |    2 +-
 drivers/dfu/dfu_sf.c                               |   12 +-
 drivers/mtd/Kconfig                                |    2 +-
 drivers/mtd/spi-nor/Kconfig                        |  127 +++
 drivers/mtd/spi-nor/Makefile                       |   20 +
 drivers/mtd/{spi => spi-nor}/fsl_espi_spl.c        |   12 +-
 drivers/mtd/spi-nor/m25p80.c                       |  401 +++++++
 .../sf_dataflash.c => spi-nor/mtd_dataflash.c}     |  429 ++++---
 drivers/mtd/{spi => spi-nor}/sandbox.c             |   51 +-
 drivers/mtd/spi-nor/spi-nor-ids.c                  |  283 +++++
 drivers/mtd/spi-nor/spi-nor-probe.c                |   58 +
 drivers/mtd/spi-nor/spi-nor.c                      | 1095 ++++++++++++++++++
 drivers/mtd/{spi => spi-nor}/spi_spl_load.c        |    7 +-
 drivers/mtd/spi/Kconfig                            |  131 ---
 drivers/mtd/spi/Makefile                           |   18 -
 drivers/mtd/spi/sf-uclass.c                        |  103 --
 drivers/mtd/spi/sf.c                               |   58 -
 drivers/mtd/spi/sf_internal.h                      |  243 ----
 drivers/mtd/spi/sf_mtd.c                           |  104 --
 drivers/mtd/spi/sf_params.c                        |  146 ---
 drivers/mtd/spi/sf_probe.c                         |  179 ---
 drivers/mtd/spi/spi_flash.c                        | 1194 --------------------
 drivers/net/fm/fm.c                                |    2 +-
 drivers/net/phy/cortina.c                          |    2 +-
 drivers/spi/fsl_qspi.c                             |   18 +-
 drivers/spi/ich.c                                  |    6 +-
 drivers/spi/spi-uclass.c                           |   35 +-
 drivers/spi/spi.c                                  |   30 +
 drivers/spi/ti_qspi.c                              |    6 +-
 examples/standalone/Makefile                       |    2 +-
 include/configs/MPC8536DS.h                        |    2 +-
 include/configs/P1010RDB.h                         |    3 +-
 include/configs/P1022DS.h                          |    3 +-
 include/configs/T102xQDS.h                         |    5 +-
 include/configs/T102xRDB.h                         |    5 +-
 include/configs/T104xRDB.h                         |    5 +-
 include/configs/T208xQDS.h                         |    7 +-
 include/configs/T208xRDB.h                         |    7 +-
 include/configs/UCP1020.h                          |    4 +-
 include/configs/am335x_evm.h                       |    3 +-
 include/configs/am43xx_evm.h                       |    2 +-
 include/configs/aristainetos-common.h              |    1 -
 include/configs/at91sam9n12ek.h                    |    3 +-
 include/configs/at91sam9x5ek.h                     |    3 +-
 include/configs/bav335x.h                          |    3 +-
 include/configs/bfin_adi_common.h                  |    2 +-
 include/configs/cgtqmx6eval.h                      |    8 +-
 include/configs/chromebook_jerry.h                 |    5 +-
 include/configs/clearfog.h                         |    5 +-
 include/configs/cm_fx6.h                           |    3 +-
 include/configs/cm_t43.h                           |    3 +-
 include/configs/da850evm.h                         |    6 +-
 include/configs/db-88f6820-gp.h                    |    3 +-
 include/configs/db-mv784mp-gp.h                    |    3 +-
 include/configs/dra7xx_evm.h                       |    5 +-
 include/configs/dreamplug.h                        |    2 +-
 include/configs/ds414.h                            |    3 +-
 include/configs/exynos5-common.h                   |    2 +-
 include/configs/gw_ventana.h                       |   13 +-
 include/configs/km/kmp204x-common.h                |    2 +-
 include/configs/ls1021aqds.h                       |    2 -
 include/configs/ls1021atwr.h                       |    1 -
 include/configs/ls1043a_common.h                   |    7 +-
 include/configs/ls1043aqds.h                       |    2 +-
 include/configs/ls2080aqds.h                       |    3 +-
 include/configs/ls2080ardb.h                       |    5 +-
 include/configs/lsxl.h                             |    2 +-
 include/configs/ma5d4evk.h                         |    3 +-
 include/configs/maxbcm.h                           |    3 +-
 include/configs/mx6ul_14x14_evk.h                  |    7 +-
 include/configs/mx7dsabresd.h                      |    7 +-
 include/configs/omapl138_lcdk.h                    |    3 +-
 include/configs/ot1200.h                           |    3 +-
 include/configs/p1_p2_rdb_pc.h                     |    5 +-
 include/configs/pcm051.h                           |    3 +-
 include/configs/pcm052.h                           |    3 +-
 include/configs/rk3036_common.h                    |    3 +-
 include/configs/rk3288_common.h                    |    1 -
 include/configs/sama5d2_xplained.h                 |    5 +-
 include/configs/sama5d3xek.h                       |    3 +-
 include/configs/sama5d4_xplained.h                 |    3 +-
 include/configs/sama5d4ek.h                        |    3 +-
 include/configs/siemens-am33x-common.h             |    3 +-
 include/configs/socfpga_common.h                   |    8 +-
 include/configs/taurus.h                           |    3 +-
 include/configs/tegra-common-usb-gadget.h          |    2 +-
 include/configs/theadorable.h                      |    3 +-
 include/configs/ti_armv7_keystone2.h               |    3 +-
 include/configs/tseries.h                          |    3 +-
 include/configs/vinco.h                            |    2 +-
 include/configs/zynq-common.h                      |    5 +-
 include/dfu.h                                      |    2 +-
 include/dm/uclass-id.h                             |    1 -
 include/linux/err.h                                |    5 +
 include/linux/mtd/spi-nor.h                        |  257 +++++
 include/spi.h                                      |   33 +-
 include/spi_flash.h                                |  230 +---
 test/dm/Makefile                                   |    2 +-
 test/dm/spi.c                                      |    8 +-
 620 files changed, 4604 insertions(+), 3955 deletions(-)
 create mode 100644 doc/device-tree-bindings/mtd/jedec,spi-nor.txt
 create mode 100644 doc/mtd/spi-nor.txt
 create mode 100644 drivers/mtd/spi-nor/Kconfig
 create mode 100644 drivers/mtd/spi-nor/Makefile
 rename drivers/mtd/{spi => spi-nor}/fsl_espi_spl.c (92%)
 create mode 100644 drivers/mtd/spi-nor/m25p80.c
 rename drivers/mtd/{spi/sf_dataflash.c => spi-nor/mtd_dataflash.c} (61%)
 rename drivers/mtd/{spi => spi-nor}/sandbox.c (95%)
 create mode 100644 drivers/mtd/spi-nor/spi-nor-ids.c
 create mode 100644 drivers/mtd/spi-nor/spi-nor-probe.c
 create mode 100644 drivers/mtd/spi-nor/spi-nor.c
 rename drivers/mtd/{spi => spi-nor}/spi_spl_load.c (94%)
 delete mode 100644 drivers/mtd/spi/Kconfig
 delete mode 100644 drivers/mtd/spi/Makefile
 delete mode 100644 drivers/mtd/spi/sf-uclass.c
 delete mode 100644 drivers/mtd/spi/sf.c
 delete mode 100644 drivers/mtd/spi/sf_internal.h
 delete mode 100644 drivers/mtd/spi/sf_mtd.c
 delete mode 100644 drivers/mtd/spi/sf_params.c
 delete mode 100644 drivers/mtd/spi/sf_probe.c
 delete mode 100644 drivers/mtd/spi/spi_flash.c
 create mode 100644 include/linux/mtd/spi-nor.h
Signature · 1 line
1.9.1
author
#1 lore raw

v7 cover mtd: Add SPI-NOR core support

Quoted 83 lines · Jagan Teki

Some of the SPI device drivers at drivers/spi not a real spi controllers, Unlike normal/generic SPI controllers they operates only with SPI-NOR flash devices. these were technically termed as SPI-NOR controllers, Ex: drivers/spi/fsl_qspi.c

The problem with these were resides at drivers/spi is entire SPI layer becomes SPI-NOR flash oriented which is absolutely a wrong indication where SPI layer getting effected more with flash operations - So this SPI-NOR core will resolve this issue by separating all SPI-NOR flash operations from spi layer and creats a generic layer called SPI-NOR core which can be used to interact SPI-NOR to SPI driver interface layer and the SPI-NOR controller driver. The idea is taken from Linux spi-nor framework.

Before SPI-NOR:

-----------------------
cmd/sf.c
-----------------------
spi_flash.c
-----------------------
sf_probe.c
-----------------------
spi-uclass
-----------------------
spi drivers
-----------------------
SPI NOR chip
-----------------------

After SPI-NOR:

------------------------------
cmd/sf.c
------------------------------
spi-nor.c
-------------------------------
m25p80.c spi nor drivers
-------------------------------
spi-uclass SPI NOR chip
-------------------------------
spi drivers
-------------------------------
SPI NOR chip
-------------------------------

SPI-NOR with MTD:

------------------------------
cmd/sf.c
------------------------------
MTD core
------------------------------
spi-nor.c
-------------------------------
m25p80.c spi nor drivers
-------------------------------
spi-uclass SPI NOR chip
-------------------------------
spi drivers
-------------------------------
SPI NOR chip
-------------------------------

drivers/mtd/spi-nor/spi-nor.c: spi-nor core drivers/mtd/spi-nor/m25p80.c: mtd uclass driver
which is an interface layer b/w spi-nor core drivers/spi drivers/mtd/spi-nor/fsl_qspi.c: spi-nor controller driver(mtd uclass)

Changes for v7:
- Rebase to latest
- Fixed git bisectable issues, with buildman.
- Fixed spi-nor compilation issues
- newly designed changes.

Changes for v6:
- Fixed git bisectable issues, with buildman.
- Fixed spi-nor compilation issues
- newly designed changes.

Changes for v5:
- newly designed changes

Quoted 7 lines

Testing:

$ git clone git://git.denx.de/u-boot-spi.git
$ cd u-boot-spi
$ git checkout -b spi-nor-test origin/spi-nor-test

Alison Wang (1):
defconfig: ls1021atwr_sdcard_qspi: Enable CONFIG_MTD

Tested in hardware and sandbox [1]

[1] http://paste.ubuntu.com/15470696/

author
#2 lore raw

v7 cover mtd: Add SPI-NOR core support

Quoted 89 lines · Jagan Teki
Quoted 88 lines · Jagan Teki

Some of the SPI device drivers at drivers/spi not a real spi controllers, Unlike normal/generic SPI controllers they operates only with SPI-NOR flash devices. these were technically termed as SPI-NOR controllers, Ex: drivers/spi/fsl_qspi.c

The problem with these were resides at drivers/spi is entire SPI layer becomes SPI-NOR flash oriented which is absolutely a wrong indication where SPI layer getting effected more with flash operations - So this SPI-NOR core will resolve this issue by separating all SPI-NOR flash operations from spi layer and creats a generic layer called SPI-NOR core which can be used to interact SPI-NOR to SPI driver interface layer and the SPI-NOR controller driver. The idea is taken from Linux spi-nor framework.

Before SPI-NOR:

-----------------------
cmd/sf.c
-----------------------
spi_flash.c
-----------------------
sf_probe.c
-----------------------
spi-uclass
-----------------------
spi drivers
-----------------------
SPI NOR chip
-----------------------

After SPI-NOR:

------------------------------
cmd/sf.c
------------------------------
spi-nor.c
-------------------------------
m25p80.c spi nor drivers
-------------------------------
spi-uclass SPI NOR chip
-------------------------------
spi drivers
-------------------------------
SPI NOR chip
-------------------------------

SPI-NOR with MTD:

------------------------------
cmd/sf.c
------------------------------
MTD core
------------------------------
spi-nor.c
-------------------------------
m25p80.c spi nor drivers
-------------------------------
spi-uclass SPI NOR chip
-------------------------------
spi drivers
-------------------------------
SPI NOR chip
-------------------------------

drivers/mtd/spi-nor/spi-nor.c: spi-nor core drivers/mtd/spi-nor/m25p80.c: mtd uclass driver
which is an interface layer b/w spi-nor core drivers/spi drivers/mtd/spi-nor/fsl_qspi.c: spi-nor controller driver(mtd uclass)

Changes for v7:
- Rebase to latest
- Fixed git bisectable issues, with buildman.
- Fixed spi-nor compilation issues
- newly designed changes.

Changes for v6:
- Fixed git bisectable issues, with buildman.
- Fixed spi-nor compilation issues
- newly designed changes.

Changes for v5:
- newly designed changes

Testing:

$ git clone git://git.denx.de/u-boot-spi.git
$ cd u-boot-spi
$ git checkout -b spi-nor-test origin/spi-nor-test
Quoted 8 lines
Quoted 2 lines

Alison Wang (1):
defconfig: ls1021atwr_sdcard_qspi: Enable CONFIG_MTD

Tested in hardware and sandbox [1]

[1] http://paste.ubuntu.com/15470696/

Here is buildman logs:

$> ./tools/buildman/buildman -b master -c 87 -s boards.cfg is up to date. Nothing to do.
Summary of 87 commits for 1107 boards (32 threads, 1 job per thread) 01: mtd: Add m25p80 driver

       m68k:  +   M5329AFEE M5249EVB M5208EVBE astro_mcf5373l 

M54455EVB_intel M5282EVB M54455EVB_i66 M54455EVB_a66 M5253DEMO M54455EVB_stm33 M54455EVB M5272C3 M5329BFEE cobra5272 M5275EVB M5253EVBE M5235EVB_Flash32 M5373EVB M5235EVB
02: mtd: Add Kconfig entry for MTD_M25P80
03: mtd: Add SPI-NOR core support
04: doc: device-tree-bindings: jedec,spi-nor
05: mtd: spi-nor: Add Kconfig entry for MTD_SPI_NOR
06: mtd: spi-nor: Add kconfig for MTD_SPI_NOR_USE_4K_SECTORS 07: mtd: spi-nor: Add MTD support
08: mtd: spi-nor: Add spi_nor support in m25p80
09: mtd: spi-nor: Add dm spi-nor probing
10: mtd: spi-nor: Add spi_flash_probe for mtd-dm-spi-nor
11: mtd: spi-nor: Add spi_flash_free for mtd-dm-spi-nor
12: mtd: spi-nor: m25p80: Add spi_nor support for non-dm
13: sf: Rename erase_size to erasesize
14: sf: Use erasesize instead of sector_size
15: sf: Use uint64_t for flash->size
16: spi_flash: Use mtd_info operation for SPI-NOR
17: spi_flash: Use spi_flash_t instead of struct spi_flash 18: mtd: spi-nor: Move spi_read_then_write to spi layer
19: spi: Rename spi_read_then_write to spi_write_then_read 20: mtd: spi-nor: Rename SPI_FLASH_BAR to SPI_NOR_BAR
21: mtd: spi-nor: Add Kconfig entry for SPI_NOR_BAR
22: mtd: spi-nor: Copy spl files from drivers/mtd/spi
23: mtd: spi-nor: spl: Follow ascending order of include headers 24: mtd: spi-nor: fsl_espi_spl: Use mtd_info
25: mtd: spi-nor: fsl_espi_spl: Use writebufsize instead of page_size 26: mtd: spi-nor: spi_spl_load: Use mtd_info
27: spl: Add CONFIG_SPL_SPI_NOR_SUPPORT
28: mtd: spi-nor: Add flash vendor Kconfig entries
29: arm: zynq: Kconfig: Select MTD uclass
30: arm: zynq: Kconfig: Drop DM_SPI_FLASH
31: mtd: spi-nor: Copy sf_dataflash
32: mtd: dataflash: Remove unneeded spi data
33: mtd: dataflash: Move flash id detection into jedec_probe 34: mtd: dataflash: Fix add_dataflash return logic
35: mtd: dataflash: Add UCLASS_MTD support
36: mtd: dataflash: Use spi_write_then_read
37: mtd: dataflash: Drop sf_internal.h
38: mtd: dataflash: Minor cleanups
39: mtd: Rename sf_dataflash.c to mtd_dataflash.c
40: mtd: spi-nor: Add Kconfig entry for mtd_dataflash
41: mtd: dataflash: Add MTD_DATAFLASH_WRITE_VERIFY
42: mtd: spi-nor: Add kconfig MTD_DATAFLASH_WRITE_VERIFY
43: configs: ls1021aqds: Drop DM_SPI_FLASH and DATAFLASH
44: defconfig: ls1021aqds_qspi: Enable SPI-NOR
45: defconfig: ls1021aqds_qspi: Enable CONFIG_MTD_DATAFLASH 46: mtd: spi-nor: Copy sandbox
47: mtd: spi-nor: sandbox: Use spi-nor header
48: mtd: spi-nor: sandbox: Fix ID exctract from spi_nor_info 49: mtd: spi-nor: Add SPI_NOR_SANDBOX
50: test/dm: Makefile: Use CONFIG_DM_MTD_SPI_NOR
51: test/dm: spi: Use CONFIG_DM_MTD_SPI_NOR
52: configs: sandbox: Enable SPI-NOR sandbox driver
53: test/dm: spi: Use m25p80 as driver name
54: dts: sandbox: Use jedec,spi-nor compatible string
55: x86: Drop using spi_flash_dm_ops
56: spi_flash: Use spi_flash_t
57: defconfig: zynq_zc770_xm013: Enable ZYNQ_QSPI
58: configs: Drop CONFIG_SPI_FLASH_MTD
59: config: Enable SPI-NOR framework
arm: + dra72_evm nyan-big venice2 chromebook_jerry axm
trimslice jetson-tk1 tec-ng beaver dalmore dra74_evm cardhu taurus 60: spi-nor: Use CONFIG_MTD_SPI_NOR
61: configs: Use CONFIG_SPI_NOR_BAR
62: configs: spi-nor: Add new flash vendor configs
63: mtd: spi-nor: Add CONFIG_SPI_NOR_MISC
64: configs: Use CONFIG_SPI_NOR_MISC
65: powerpc/mpc85xx: Use spi.h instead of spi_flash.h
66: sf: Drop entire spi-flash framework

        arm:  +   kylin-rk3036 rock2 evb-rk3036 firefly-rk3288

67: uclass: Drop UCLASS_SPI_FLASH
68: spi: Drop mode_rx
69: spi: Drop SPI_RX_FAST
70: MAINTAINERS: Add myself as SPI NOR maintainer 71: configs: CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
72: dts: spi-nor: Use jedec,spi-nor compatible string 73: dts: spi-nor: Use spi-nor as node name
74: mtd: spi-nor: Add erase ops
75: mtd: spi-nor: Not required to memset dummy byte 76: mtd: spi-nor: Move opcode handling in m25p80 77: mtd: spi-nor: Rename spi_nor_addr to m25p_addr2cmd 78: mtd: spi-nor: Add addr_width
79: mtd: spi-nor: Add m25p_cmdsz
80: mtd: spi-nor: read_dummy refers to dummy cycles not bytes 81: mtd: spi-nor: Use to instead of offset in write 82: mtd: spi-nor: offset with addr
83: mtd: m25p80: Rename cmd with opcode
84: armv8/ls1043a: move CONFIG_MTD to defconfig
85: defconfig: ls1021atwr_sdcard_qspi: Enable CONFIG_MTD 86: defconfig: ls1021aqds_sdcard_qspi: Enable MTD 87: defconfig: ls1021aqds_sdcard_qspi: Enable MTD_DATAFLASH

Issues:
-------
1) undefined reference to `__aeabi_ldivmod'

59: config: Enable SPI-NOR framework
arm: + nyan-big
+drivers/mtd/spi-nor/built-in.o: In function `spi_nor_write':
+build/../drivers/mtd/spi-nor/spi-nor.c:585: undefined reference to `__aeabi_ldivmod'
+arm-unknown-linux-gnueabi-ld.bfd: BFD (GNU Binutils) 2.24 assertion fail /home/tony/buildall/src/binutils/bfd/elf32-arm.c:7696 +arm-unknown-linux-gnueabi-ld.bfd: error: required section '.rel.plt' not found in the linker script +arm-unknown-linux-gnueabi-ld.bfd: final link failed: Invalid operation +make[1]: *** [u-boot] Error 1
+make: *** [sub-make] Error 2

2) Build issues on dra72_evm, dra74_evm

3) SPL image too big

59: config: Enable SPI-NOR framework
arm: + axm
+arm-unknown-linux-gnueabi-ld.bfd: SPL image too big +arm-unknown-linux-gnueabi-ld.bfd: SPL image BSS too big +make[2]: *** [spl/u-boot-spl] Error 1 +make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2
60: spi-nor: Use CONFIG_MTD_SPI_NOR

Image size:
-----------
$> ./tools/buildman/buildman -b master -c 87 -sS boards.cfg is up to date. Nothing to do.
Summary of 87 commits for 1107 boards (32 threads, 1 job per thread) 01: mtd: Add m25p80 driver

       m68k:  +   M5329AFEE M5249EVB M5208EVBE astro_mcf5373l 

M54455EVB_intel M5282EVB M54455EVB_i66 M54455EVB_a66 M5253DEMO M54455EVB_stm33 M54455EVB M5272C3 M5329BFEE cobra5272 M5275EVB M5253EVBE M5235EVB_Flash32 M5373EVB M5235EVB
02: mtd: Add Kconfig entry for MTD_M25P80
03: mtd: Add SPI-NOR core support

    aarch64: (for 33/33 boards)  bss +0.2  data -0.2
        arm: (for 500/500 boards)  all +0.3  bss +0.3  data -0.0 

spl/u-boot-spl:all +0.0 spl/u-boot-spl:bss +0.0 04: doc: device-tree-bindings: jedec,spi-nor
05: mtd: spi-nor: Add Kconfig entry for MTD_SPI_NOR 06: mtd: spi-nor: Add kconfig for MTD_SPI_NOR_USE_4K_SECTORS 07: mtd: spi-nor: Add MTD support
08: mtd: spi-nor: Add spi_nor support in m25p80 09: mtd: spi-nor: Add dm spi-nor probing

    aarch64: (for 33/33 boards)  all -1.9  bss -1.9

10: mtd: spi-nor: Add spi_flash_probe for mtd-dm-spi-nor 11: mtd: spi-nor: Add spi_flash_free for mtd-dm-spi-nor 12: mtd: spi-nor: m25p80: Add spi_nor support for non-dm 13: sf: Rename erase_size to erasesize
14: sf: Use erasesize instead of sector_size

        x86: (for 12/12 boards)  all +1.7  bss +7.3  text -5.7
    aarch64: (for 33/33 boards)  all -4.6  text -4.6
    sandbox: (for 1/1 boards)  all -16.0  text -16.0
       m68k: (for 29/48 boards)  all -1.9  text -1.9
    powerpc: (for 412/412 boards)  all -4.0  spl/u-boot-spl:all -0.3 
spl/u-boot-spl:text -0.3  text -4.0
        arm: (for 500/500 boards)  all -2.0  bss +0.1  data +0.1 
spl/u-boot-spl:all -0.6  spl/u-boot-spl:text -0.6  text -2.2
15: sf: Use uint64_t for flash->size
        x86: (for 12/12 boards)  all +1.4  bss -86.3  rodata +1.8  text 
+85.9
    aarch64: (for 33/33 boards)  all +14.5  rodata +1.2  text +13.3
    sandbox: (for 1/1 boards)  all +144.0  text +144.0
       m68k: (for 29/48 boards)  all +24.8  rodata +0.7  text +24.1
    powerpc: (for 412/412 boards)  all +48.6  rodata +1.1 
spl/u-boot-spl:all +4.0  spl/u-boot-spl:text +4.0  text +47.6
        arm: (for 500/500 boards)  all +45.5  bss +0.0  data +7.4 
rodata +0.7  spl/u-boot-spl:all +13.7  spl/u-boot-spl:text +13.7  text 
+37.4
16: spi_flash: Use mtd_info operation for SPI-NOR
    aarch64: (for 33/33 boards)  all +1.9  bss +1.9
        arm: (for 500/500 boards)  all +0.3  bss +0.3  data -0.0
17: spi_flash: Use spi_flash_t instead of struct spi_flash
        arm: (for 500/500 boards)  all -0.2  bss -0.2
18: mtd: spi-nor: Move spi_read_then_write to spi layer
        x86: (for 12/12 boards)  all +9.0  text +9.0
    sandbox: (for 1/1 boards)  all +184.0  text +184.0
       m68k: (for 29/48 boards)  all +3.3  text +3.3
    powerpc: (for 412/412 boards)  all +4.3  spl/u-boot-spl:all +0.5 
spl/u-boot-spl:text +0.5  text +4.3
      sparc: (for 5/5 boards)  all +92.8  text +92.8
microblaze: (for 1/1 boards)  all +128.0  bss -64.0  text +192.0
       mips: (for 25/25 boards)  all +5.6  bss +1.1  data +4.5
        arm: (for 500/500 boards)  all +1.9  bss -0.1 

spl/u-boot-spl:all +0.4 spl/u-boot-spl:text +0.4 text +2.0 19: spi: Rename spi_read_then_write to spi_write_then_read 20: mtd: spi-nor: Rename SPI_FLASH_BAR to SPI_NOR_BAR
21: mtd: spi-nor: Add Kconfig entry for SPI_NOR_BAR
22: mtd: spi-nor: Copy spl files from drivers/mtd/spi
23: mtd: spi-nor: spl: Follow ascending order of include headers 24: mtd: spi-nor: fsl_espi_spl: Use mtd_info
25: mtd: spi-nor: fsl_espi_spl: Use writebufsize instead of page_size 26: mtd: spi-nor: spi_spl_load: Use mtd_info
27: spl: Add CONFIG_SPL_SPI_NOR_SUPPORT
28: mtd: spi-nor: Add flash vendor Kconfig entries
29: arm: zynq: Kconfig: Select MTD uclass

        arm: (for 500/500 boards)  all +1.5  bss -0.2  data +1.5  rodata 
+0.1  text +0.2
30: arm: zynq: Kconfig: Drop DM_SPI_FLASH
        arm: (for 500/500 boards)  all -18.8  bss +0.1  data -2.4 

rodata -3.0 spl/u-boot-spl:all -7.7 spl/u-boot-spl:data -1.7 spl/u-boot-spl:rodata -1.3 spl/u-boot-spl:text -4.7 text -13.6 31: mtd: spi-nor: Copy sf_dataflash
32: mtd: dataflash: Remove unneeded spi data
33: mtd: dataflash: Move flash id detection into jedec_probe 34: mtd: dataflash: Fix add_dataflash return logic
35: mtd: dataflash: Add UCLASS_MTD support
36: mtd: dataflash: Use spi_write_then_read
37: mtd: dataflash: Drop sf_internal.h
38: mtd: dataflash: Minor cleanups
39: mtd: Rename sf_dataflash.c to mtd_dataflash.c
40: mtd: spi-nor: Add Kconfig entry for mtd_dataflash 41: mtd: dataflash: Add MTD_DATAFLASH_WRITE_VERIFY
42: mtd: spi-nor: Add kconfig MTD_DATAFLASH_WRITE_VERIFY 43: configs: ls1021aqds: Drop DM_SPI_FLASH and DATAFLASH

        arm: (for 500/500 boards)  all -22.5  bss -0.1  data -7.4 

rodata -2.2 text -12.8
44: defconfig: ls1021aqds_qspi: Enable SPI-NOR
45: defconfig: ls1021aqds_qspi: Enable CONFIG_MTD_DATAFLASH 46: mtd: spi-nor: Copy sandbox
47: mtd: spi-nor: sandbox: Use spi-nor header
48: mtd: spi-nor: sandbox: Fix ID exctract from spi_nor_info 49: mtd: spi-nor: Add SPI_NOR_SANDBOX
50: test/dm: Makefile: Use CONFIG_DM_MTD_SPI_NOR

    sandbox: (for 1/1 boards)  all -368.0  data -24.0  rodata -208.0 
text -136.0
51: test/dm: spi: Use CONFIG_DM_MTD_SPI_NOR
    sandbox: (for 1/1 boards)  all -32.0  text -32.0
52: configs: sandbox: Enable SPI-NOR sandbox driver
    sandbox: (for 1/1 boards)  all +4984.0  data +24.0  rodata +4096.0 
text +864.0
        arm: (for 500/500 boards)  all +0.1  bss +0.1
53: test/dm: spi: Use m25p80 as driver name
    sandbox: (for 1/1 boards)  all -16.0  rodata -16.0
54: dts: sandbox: Use jedec,spi-nor compatible string
55: x86: Drop using spi_flash_dm_ops
        x86: (for 12/12 boards)  all +5.0  bss -1.7  text +6.7
        arm: (for 500/500 boards)  all -0.1  rodata -0.1
56: spi_flash: Use spi_flash_t
        arm: (for 500/500 boards)  all +0.1  rodata +0.1
57: defconfig: zynq_zc770_xm013: Enable ZYNQ_QSPI
58: configs: Drop CONFIG_SPI_FLASH_MTD
        arm: (for 500/500 boards)  all -9.6  bss -3.5  rodata -0.1  text 

-6.0
59: config: Enable SPI-NOR framework
arm: + dra72_evm nyan-big venice2 chromebook_jerry axm
trimslice jetson-tk1 tec-ng beaver dalmore dra74_evm cardhu taurus

        x86: (for 12/12 boards)  all +4490.9  bss +266.0  data +0.7 
rodata +1322.8  text +2901.4
    aarch64: (for 33/33 boards)  all +703.2  bss +256.2  data -52.8 
rodata +207.4  spl/u-boot-spl:all -0.5  spl/u-boot-spl:bss -0.5  text 
+292.4
    powerpc: (for 412/412 boards)  all -706.5  bss +5.0  data +58.4 
rodata -119.7  spl/u-boot-spl:all +385.7  spl/u-boot-spl:bss +31.1 
spl/u-boot-spl:data +136.4  spl/u-boot-spl:text +218.2  text -650.2
        arm: (for 491/500 boards)  all +542.9  bss +34.1  data -6.3 

rodata +188.6 spl/u-boot-spl:all +481.9 spl/u-boot-spl:bss +48.0 spl/u-boot-spl:data +2.0 spl/u-boot-spl:rodata +194.4 spl/u-boot-spl:text +237.5 text +326.4
60: spi-nor: Use CONFIG_MTD_SPI_NOR

        arm: (for 491/500 boards)  all +0.0  bss -0.1  rodata +0.1 
spl/u-boot-spl:all +0.2  spl/u-boot-spl:rodata +0.2  text +0.0
61: configs: Use CONFIG_SPI_NOR_BAR
    aarch64: (for 33/33 boards)  all +11.3  rodata -5.4  text +16.7
    powerpc: (for 412/412 boards)  all -6.6  rodata +4.7 
spl/u-boot-spl:all +4.6  spl/u-boot-spl:data -2.2  spl/u-boot-spl:text 
+6.8  text -11.4
        arm: (for 491/500 boards)  all -0.2  bss +0.0  rodata -2.0 
spl/u-boot-spl:all +0.3  spl/u-boot-spl:rodata -1.3  spl/u-boot-spl:text 
+1.5  text +1.7
62: configs: spi-nor: Add new flash vendor configs
    aarch64: (for 33/33 boards)  all -1562.4  rodata -522.8  text -1039.5
        arm: (for 491/500 boards)  all -3.5  bss -0.1  rodata -3.0 
spl/u-boot-spl:all +1.9  spl/u-boot-spl:rodata -1.5  spl/u-boot-spl:text 
+3.3  text -0.4
63: mtd: spi-nor: Add CONFIG_SPI_NOR_MISC
        x86: (for 12/12 boards)  all -1502.1  bss -666.7  rodata -698.8 
  text -136.7
    aarch64: (for 33/33 boards)  all -265.5  rodata -178.2  text -87.3
    sandbox: (for 1/1 boards)  all -2176.0  rodata -2176.0
    powerpc: (for 412/412 boards)  all -43.9  data -31.2  rodata -8.7 
spl/u-boot-spl:all -43.9  spl/u-boot-spl:data -40.0  spl/u-boot-spl:text 
-3.9  text -3.9
        arm: (for 491/500 boards)  all -110.1  bss +1.8  rodata -93.8 
spl/u-boot-spl:all -74.3  spl/u-boot-spl:rodata -74.3  text -18.2
64: configs: Use CONFIG_SPI_NOR_MISC
    aarch64: (for 33/33 boards)  all -86.3  rodata -54.3  text -32.0
        arm: (for 491/500 boards)  all +33.0  bss -0.1  rodata +27.8 
spl/u-boot-spl:all +28.4  spl/u-boot-spl:rodata +28.4  text +5.3
65: powerpc/mpc85xx: Use spi.h instead of spi_flash.h
66: sf: Drop entire spi-flash framework
        arm:  +   kylin-rk3036 rock2 evb-rk3036 firefly-rk3288
        x86: (for 12/12 boards)  all +15.8  text +15.8
    aarch64: (for 33/33 boards)  all +4948.0  bss +341.3  rodata +1894.5 
  text +2712.2
       m68k: (for 29/48 boards)  all +1595.9  bss +176.6  data +339.0 
rodata +109.1  text +971.2
    powerpc: (for 412/412 boards)  all +1383.5  bss +75.8  data +145.7 
rodata -31.2  text +1193.1
        arm: (for 487/500 boards)  all +823.7  bss +68.9  data -0.9 
rodata +166.8  text +588.9
67: uclass: Drop UCLASS_SPI_FLASH
    aarch64: (for 33/33 boards)  all -0.5  bss -0.5
        arm: (for 487/500 boards)  all +0.3  bss +0.3
68: spi: Drop mode_rx
        x86: (for 12/12 boards)  all +7.0  bss +20.3  text -13.3
    aarch64: (for 33/33 boards)  all -7.3  text -7.3
    sandbox: (for 1/1 boards)  all -16.0  text -16.0
       m68k: (for 29/48 boards)  all -2.9  text -2.9
    powerpc: (for 412/412 boards)  all +8.3  spl/u-boot-spl:all +1.1 
spl/u-boot-spl:text +1.1  text +8.3
        arm: (for 487/500 boards)  all -0.1  bss -0.8  data +0.1  rodata 
-0.0  spl/u-boot-spl:all +0.0  spl/u-boot-spl:text +0.0  text +0.6
69: spi: Drop SPI_RX_FAST
        arm: (for 487/500 boards)  all -0.0  bss +0.0  rodata -0.1
70: MAINTAINERS: Add myself as SPI NOR maintainer
        arm: (for 487/500 boards)  all +0.0  bss -0.0  rodata +0.1

71: configs: CONFIG_MTD_SPI_NOR_USE_4K_SECTORS 72: dts: spi-nor: Use jedec,spi-nor compatible string 73: dts: spi-nor: Use spi-nor as node name 74: mtd: spi-nor: Add erase ops

        x86: (for 12/12 boards)  all +340.3  bss +254.0  text +86.3
    aarch64: (for 33/33 boards)  all +81.0  text +81.0
    sandbox: (for 1/1 boards)  all +176.0  text +176.0
       m68k: (for 29/48 boards)  all +38.2  data +1.4  text +36.8
    powerpc: (for 412/412 boards)  all +60.1  spl/u-boot-spl:all +8.8 
spl/u-boot-spl:text +8.8  text +60.1
        arm: (for 487/500 boards)  all +42.7  bss -0.2  data +7.5 
spl/u-boot-spl:all +9.0  spl/u-boot-spl:text +9.0  text +35.4
75: mtd: spi-nor: Not required to memset dummy byte
        x86: (for 12/12 boards)  all -329.7  bss -289.3  text -40.3
    aarch64: (for 33/33 boards)  all -21.1  text -21.1
    sandbox: (for 1/1 boards)  all -72.0  text -72.0
       m68k: (for 29/48 boards)  all -13.5  text -13.5
    powerpc: (for 412/412 boards)  all -21.0  spl/u-boot-spl:all -3.1 
spl/u-boot-spl:text -3.1  text -21.0
        arm: (for 487/500 boards)  all -23.2  bss +1.8  data -8.0 
spl/u-boot-spl:all -4.8  spl/u-boot-spl:text -4.8  text -17.0
76: mtd: spi-nor: Move opcode handling in m25p80
        x86: (for 12/12 boards)  all -3.3  bss +58.7  text -62.0
    aarch64: (for 33/33 boards)  all -31.0  text -31.0
    sandbox: (for 1/1 boards)  all +40.0  text +40.0
       m68k: (for 29/48 boards)  all +13.5  text +13.5
    powerpc: (for 412/412 boards)  all -11.4  spl/u-boot-spl:all -1.5 
spl/u-boot-spl:text -1.5  text -11.4
        arm: (for 487/500 boards)  all -13.0  bss -1.6  data +0.4 
spl/u-boot-spl:all -2.7  spl/u-boot-spl:text -2.7  text -11.7
77: mtd: spi-nor: Rename spi_nor_addr to m25p_addr2cmd
78: mtd: spi-nor: Add addr_width
        x86: (for 12/12 boards)  all +340.7  bss +258.0  text +82.7
    aarch64: (for 33/33 boards)  all +65.0  text +65.0
    sandbox: (for 1/1 boards)  all +104.0  text +104.0
       m68k: (for 29/48 boards)  all +24.3  data +0.3  text +24.0
    powerpc: (for 412/412 boards)  all +40.1  spl/u-boot-spl:all +5.8 
spl/u-boot-spl:text +5.8  text +40.1
        arm: (for 487/500 boards)  all +34.2  bss +0.9  data +7.7 
spl/u-boot-spl:all +7.0  spl/u-boot-spl:text +7.0  text +25.6
79: mtd: spi-nor: Add m25p_cmdsz
        x86: (for 12/12 boards)  all -4.3  bss -22.7  text +18.3
    aarch64: (for 33/33 boards)  all +11.9  text +11.9
    sandbox: (for 1/1 boards)  all +16.0  text +16.0
       m68k: (for 29/48 boards)  all +6.1  text +6.1
    powerpc: (for 412/412 boards)  all +6.7  spl/u-boot-spl:all +1.0 
spl/u-boot-spl:text +1.0  text +6.7
        arm: (for 487/500 boards)  all +3.4  bss -0.8  data -0.1  rodata 
-0.0  spl/u-boot-spl:all +1.1  spl/u-boot-spl:text +1.1  text +4.3
80: mtd: spi-nor: read_dummy refers to dummy cycles not bytes
        x86: (for 12/12 boards)  all +2.3  bss -18.0  text +20.3
    aarch64: (for 33/33 boards)  all +1.9  text +1.9
    sandbox: (for 1/1 boards)  all +24.0  text +24.0
       m68k: (for 29/48 boards)  all +4.3  text +4.3
    powerpc: (for 412/412 boards)  all +1.7  spl/u-boot-spl:all +0.3 
spl/u-boot-spl:text +0.3  text +1.7
        arm: (for 487/500 boards)  all +1.6  bss +0.2  data -0.0  rodata 

+0.0 spl/u-boot-spl:all +0.4 spl/u-boot-spl:text +0.4 text +1.4 81: mtd: spi-nor: Use to instead of offset in write
82: mtd: spi-nor: offset with addr
83: mtd: m25p80: Rename cmd with opcode
84: armv8/ls1043a: move CONFIG_MTD to defconfig

    aarch64: (for 33/33 boards)  all -54.2  bss -0.5  data -44.4  rodata 

-1.3 spl/u-boot-spl:all +0.5 spl/u-boot-spl:bss +0.5 text -8.0 85: defconfig: ls1021atwr_sdcard_qspi: Enable CONFIG_MTD 86: defconfig: ls1021aqds_sdcard_qspi: Enable MTD
87: defconfig: ls1021aqds_sdcard_qspi: Enable MTD_DATAFLASH

thanks!

Signature · 1 line
Jagan
#3 lore raw

v7 cover mtd: Add SPI-NOR core support

Hi Heiko,

Quoted 231 lines · Jagan Teki
Quoted 95 lines · Jagan Teki
Quoted 84 lines · Jagan Teki

Some of the SPI device drivers at drivers/spi not a real spi controllers, Unlike normal/generic SPI controllers they operates only with SPI-NOR flash devices. these were technically termed as SPI-NOR controllers, Ex: drivers/spi/fsl_qspi.c

The problem with these were resides at drivers/spi is entire SPI layer becomes SPI-NOR flash oriented which is absolutely a wrong indication where SPI layer getting effected more with flash operations - So this SPI-NOR core will resolve this issue by separating all SPI-NOR flash operations from spi layer and creats a generic layer called SPI-NOR core which can be used to interact SPI-NOR to SPI driver interface layer and the SPI-NOR controller driver. The idea is taken from Linux spi-nor framework.

Before SPI-NOR:

-----------------------
cmd/sf.c
-----------------------
spi_flash.c
-----------------------
sf_probe.c
-----------------------
spi-uclass
-----------------------
spi drivers
-----------------------
SPI NOR chip
-----------------------

After SPI-NOR:

------------------------------
cmd/sf.c
------------------------------
spi-nor.c
-------------------------------
m25p80.c spi nor drivers
-------------------------------
spi-uclass SPI NOR chip
-------------------------------
spi drivers
-------------------------------
SPI NOR chip
-------------------------------

SPI-NOR with MTD:

------------------------------
cmd/sf.c
------------------------------
MTD core
------------------------------
spi-nor.c
-------------------------------
m25p80.c spi nor drivers
-------------------------------
spi-uclass SPI NOR chip
-------------------------------
spi drivers
-------------------------------
SPI NOR chip
-------------------------------

drivers/mtd/spi-nor/spi-nor.c: spi-nor core drivers/mtd/spi-nor/m25p80.c: mtd uclass driver
which is an interface layer b/w spi-nor core drivers/spi drivers/mtd/spi-nor/fsl_qspi.c: spi-nor controller driver(mtd uclass)

Changes for v7:
- Rebase to latest
- Fixed git bisectable issues, with buildman.
- Fixed spi-nor compilation issues
- newly designed changes.

Changes for v6:
- Fixed git bisectable issues, with buildman.
- Fixed spi-nor compilation issues
- newly designed changes.

Changes for v5:
- newly designed changes

Quoted 7 lines

Testing:

$ git clone git://git.denx.de/u-boot-spi.git
$ cd u-boot-spi
$ git checkout -b spi-nor-test origin/spi-nor-test

Alison Wang (1):
defconfig: ls1021atwr_sdcard_qspi: Enable CONFIG_MTD

Quoted 5 lines

Tested in hardware and sandbox [1]

[1] http://paste.ubuntu.com/15470696/

Here is buildman logs:

$> ./tools/buildman/buildman -b master -c 87 -s boards.cfg is up to date. Nothing to do.
Summary of 87 commits for 1107 boards (32 threads, 1 job per thread) 01: mtd: Add m25p80 driver

      m68k:  +   M5329AFEE M5249EVB M5208EVBE astro_mcf5373l M54455EVB_intel

M5282EVB M54455EVB_i66 M54455EVB_a66 M5253DEMO M54455EVB_stm33 M54455EVB M5272C3 M5329BFEE cobra5272 M5275EVB M5253EVBE M5235EVB_Flash32 M5373EVB M5235EVB
02: mtd: Add Kconfig entry for MTD_M25P80
03: mtd: Add SPI-NOR core support
04: doc: device-tree-bindings: jedec,spi-nor
05: mtd: spi-nor: Add Kconfig entry for MTD_SPI_NOR
06: mtd: spi-nor: Add kconfig for MTD_SPI_NOR_USE_4K_SECTORS 07: mtd: spi-nor: Add MTD support
08: mtd: spi-nor: Add spi_nor support in m25p80
09: mtd: spi-nor: Add dm spi-nor probing
10: mtd: spi-nor: Add spi_flash_probe for mtd-dm-spi-nor
11: mtd: spi-nor: Add spi_flash_free for mtd-dm-spi-nor
12: mtd: spi-nor: m25p80: Add spi_nor support for non-dm
13: sf: Rename erase_size to erasesize
14: sf: Use erasesize instead of sector_size
15: sf: Use uint64_t for flash->size
16: spi_flash: Use mtd_info operation for SPI-NOR
17: spi_flash: Use spi_flash_t instead of struct spi_flash 18: mtd: spi-nor: Move spi_read_then_write to spi layer
19: spi: Rename spi_read_then_write to spi_write_then_read 20: mtd: spi-nor: Rename SPI_FLASH_BAR to SPI_NOR_BAR
21: mtd: spi-nor: Add Kconfig entry for SPI_NOR_BAR
22: mtd: spi-nor: Copy spl files from drivers/mtd/spi
23: mtd: spi-nor: spl: Follow ascending order of include headers 24: mtd: spi-nor: fsl_espi_spl: Use mtd_info
25: mtd: spi-nor: fsl_espi_spl: Use writebufsize instead of page_size 26: mtd: spi-nor: spi_spl_load: Use mtd_info
27: spl: Add CONFIG_SPL_SPI_NOR_SUPPORT
28: mtd: spi-nor: Add flash vendor Kconfig entries
29: arm: zynq: Kconfig: Select MTD uclass
30: arm: zynq: Kconfig: Drop DM_SPI_FLASH
31: mtd: spi-nor: Copy sf_dataflash
32: mtd: dataflash: Remove unneeded spi data
33: mtd: dataflash: Move flash id detection into jedec_probe 34: mtd: dataflash: Fix add_dataflash return logic
35: mtd: dataflash: Add UCLASS_MTD support
36: mtd: dataflash: Use spi_write_then_read
37: mtd: dataflash: Drop sf_internal.h
38: mtd: dataflash: Minor cleanups
39: mtd: Rename sf_dataflash.c to mtd_dataflash.c
40: mtd: spi-nor: Add Kconfig entry for mtd_dataflash
41: mtd: dataflash: Add MTD_DATAFLASH_WRITE_VERIFY
42: mtd: spi-nor: Add kconfig MTD_DATAFLASH_WRITE_VERIFY
43: configs: ls1021aqds: Drop DM_SPI_FLASH and DATAFLASH
44: defconfig: ls1021aqds_qspi: Enable SPI-NOR
45: defconfig: ls1021aqds_qspi: Enable CONFIG_MTD_DATAFLASH 46: mtd: spi-nor: Copy sandbox
47: mtd: spi-nor: sandbox: Use spi-nor header
48: mtd: spi-nor: sandbox: Fix ID exctract from spi_nor_info 49: mtd: spi-nor: Add SPI_NOR_SANDBOX
50: test/dm: Makefile: Use CONFIG_DM_MTD_SPI_NOR
51: test/dm: spi: Use CONFIG_DM_MTD_SPI_NOR
52: configs: sandbox: Enable SPI-NOR sandbox driver
53: test/dm: spi: Use m25p80 as driver name
54: dts: sandbox: Use jedec,spi-nor compatible string
55: x86: Drop using spi_flash_dm_ops
56: spi_flash: Use spi_flash_t
57: defconfig: zynq_zc770_xm013: Enable ZYNQ_QSPI
58: configs: Drop CONFIG_SPI_FLASH_MTD
59: config: Enable SPI-NOR framework
arm: + dra72_evm nyan-big venice2 chromebook_jerry axm trimslice
jetson-tk1 tec-ng beaver dalmore dra74_evm cardhu taurus
60: spi-nor: Use CONFIG_MTD_SPI_NOR
61: configs: Use CONFIG_SPI_NOR_BAR
62: configs: spi-nor: Add new flash vendor configs
63: mtd: spi-nor: Add CONFIG_SPI_NOR_MISC
64: configs: Use CONFIG_SPI_NOR_MISC
65: powerpc/mpc85xx: Use spi.h instead of spi_flash.h
66: sf: Drop entire spi-flash framework

       arm:  +   kylin-rk3036 rock2 evb-rk3036 firefly-rk3288

67: uclass: Drop UCLASS_SPI_FLASH
68: spi: Drop mode_rx
69: spi: Drop SPI_RX_FAST
70: MAINTAINERS: Add myself as SPI NOR maintainer 71: configs: CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
72: dts: spi-nor: Use jedec,spi-nor compatible string 73: dts: spi-nor: Use spi-nor as node name
74: mtd: spi-nor: Add erase ops
75: mtd: spi-nor: Not required to memset dummy byte 76: mtd: spi-nor: Move opcode handling in m25p80 77: mtd: spi-nor: Rename spi_nor_addr to m25p_addr2cmd 78: mtd: spi-nor: Add addr_width
79: mtd: spi-nor: Add m25p_cmdsz
80: mtd: spi-nor: read_dummy refers to dummy cycles not bytes 81: mtd: spi-nor: Use to instead of offset in write 82: mtd: spi-nor: offset with addr
83: mtd: m25p80: Rename cmd with opcode
84: armv8/ls1043a: move CONFIG_MTD to defconfig
85: defconfig: ls1021atwr_sdcard_qspi: Enable CONFIG_MTD 86: defconfig: ls1021aqds_sdcard_qspi: Enable MTD 87: defconfig: ls1021aqds_sdcard_qspi: Enable MTD_DATAFLASH

Issues:
-------
1) undefined reference to `__aeabi_ldivmod'

59: config: Enable SPI-NOR framework
arm: + nyan-big

(quoted diff) +2 -0
+drivers/mtd/spi-nor/built-in.o: In function `spi_nor_write':
+build/../drivers/mtd/spi-nor/spi-nor.c:585: undefined reference to

`__aeabi_ldivmod'
+arm-unknown-linux-gnueabi-ld.bfd: BFD (GNU Binutils) 2.24 assertion fail /home/tony/buildall/src/binutils/bfd/elf32-arm.c:7696 +arm-unknown-linux-gnueabi-ld.bfd: error: required section '.rel.plt' not found in the linker script

(quoted diff) +3 -0
+arm-unknown-linux-gnueabi-ld.bfd: final link failed: Invalid operation
+make[1]: *** [u-boot] Error 1
+make: *** [sub-make] Error 2

2) Build issues on dra72_evm, dra74_evm

3) SPL image too big

59: config: Enable SPI-NOR framework
arm: + axm

(quoted diff) +5 -0
+arm-unknown-linux-gnueabi-ld.bfd: SPL image too big
+arm-unknown-linux-gnueabi-ld.bfd: SPL image BSS too big
+make[2]: *** [spl/u-boot-spl] Error 1
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2
Quoted 1 line

60: spi-nor: Use CONFIG_MTD_SPI_NOR

Any inputs on this buildman issue? I got it for axm and taurus.

Signature · 1 line
Jagan.
#4 lore raw

v7 cover mtd: Add SPI-NOR core support

In reply to Jagan Teki

On Tue, Mar 22, 2016 at 01:19:25PM +0530, Jagan Teki wrote:
[snip]

Quoted 13 lines

Issues:
-------
1) undefined reference to `__aeabi_ldivmod'

59: config: Enable SPI-NOR framework
arm: + nyan-big

(quoted diff) +2 -0
+drivers/mtd/spi-nor/built-in.o: In function `spi_nor_write':
+build/../drivers/mtd/spi-nor/spi-nor.c:585: undefined reference to

`__aeabi_ldivmod'
+arm-unknown-linux-gnueabi-ld.bfd: BFD (GNU Binutils) 2.24 assertion fail /home/tony/buildall/src/binutils/bfd/elf32-arm.c:7696 +arm-unknown-linux-gnueabi-ld.bfd: error: required section '.rel.plt' not found in the linker script

Review

Quoted 3 lines
(quoted diff) +3 -0
+arm-unknown-linux-gnueabi-ld.bfd: final link failed: Invalid operation
+make[1]: *** [u-boot] Error 1
+make: *** [sub-make] Error 2

So this is a 64bit division problem somewhere along the lines that needs to be using one of the normal helper functions.

Quoted 1 line

2) Build issues on dra72_evm, dra74_evm

What are they?

Review

Quoted 9 lines

3) SPL image too big

59: config: Enable SPI-NOR framework
arm: + axm

(quoted diff) +5 -0
+arm-unknown-linux-gnueabi-ld.bfd: SPL image too big
+arm-unknown-linux-gnueabi-ld.bfd: SPL image BSS too big
+make[2]: *** [spl/u-boot-spl] Error 1
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2

Sounds like you need to go back and take some care about how we do this in SPL. Given the current gcc issue wrt merging strings together, we may need to be more careful about what files we compile and link for SPL in this case and perhaps need to split a file or two up.

Quoted 6 lines

60: spi-nor: Use CONFIG_MTD_SPI_NOR

Image size:
-----------
$> ./tools/buildman/buildman -b master -c 87 -sS

Per commit is good for development but I really prefer to see the final totals, can you please report that too? Thanks.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160322/6abdee6d/attachment.sig>
#5 lore raw

v7 cover mtd: Add SPI-NOR core support

Quoted 22 lines · Tom Rini

On Tue, Mar 22, 2016 at 01:19:25PM +0530, Jagan Teki wrote:
[snip]

Quoted 13 lines

Issues:
-------
1) undefined reference to `__aeabi_ldivmod'

59: config: Enable SPI-NOR framework
arm: + nyan-big

(quoted diff) +2 -0
+drivers/mtd/spi-nor/built-in.o: In function `spi_nor_write':
+build/../drivers/mtd/spi-nor/spi-nor.c:585: undefined reference to

`__aeabi_ldivmod'
+arm-unknown-linux-gnueabi-ld.bfd: BFD (GNU Binutils) 2.24 assertion fail /home/tony/buildall/src/binutils/bfd/elf32-arm.c:7696 +arm-unknown-linux-gnueabi-ld.bfd: error: required section '.rel.plt' not found in the linker script

Review

Quoted 3 lines
(quoted diff) +3 -0
+arm-unknown-linux-gnueabi-ld.bfd: final link failed: Invalid operation
+make[1]: *** [u-boot] Error 1
+make: *** [sub-make] Error 2

So this is a 64bit division problem somewhere along the lines that needs to be using one of the normal helper functions.

Quoted 3 lines
Quoted 1 line

2) Build issues on dra72_evm, dra74_evm

What are they?

Build issue with spl, I guess this is because dm used for normal u-boot and not used for spl.

Mugunthan, can you look in to this?

Quoted 15 lines

Review

Quoted 10 lines

3) SPL image too big

59: config: Enable SPI-NOR framework
arm: + axm

(quoted diff) +5 -0
+arm-unknown-linux-gnueabi-ld.bfd: SPL image too big
+arm-unknown-linux-gnueabi-ld.bfd: SPL image BSS too big
+make[2]: *** [spl/u-boot-spl] Error 1
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2

Sounds like you need to go back and take some care about how we do this in SPL. Given the current gcc issue wrt merging strings together, we may need to be more careful about what files we compile and link for SPL in this case and perhaps need to split a file or two up.

With proper commenting code for SPL build on mtdcore and changes on SPL size macros, build look fine.

+++ b/include/configs/taurus.h
-#define CONFIG_SPL_MAX_SIZE (31 * SZ_512)
+#define CONFIG_SPL_MAX_SIZE (36 * SZ_512)
-#define CONFIG_SPL_BSS_MAX_SIZE (3 * SZ_512)
+#define CONFIG_SPL_BSS_MAX_SIZE (4 * SZ_512)

Quoted 10 lines
Quoted 7 lines

60: spi-nor: Use CONFIG_MTD_SPI_NOR

Image size:
-----------
$> ./tools/buildman/buildman -b master -c 87 -sS

Per commit is good for development but I really prefer to see the final totals, can you please report that too? Thanks.

thanks!

Signature · 1 line
Jagan.
#6 lore raw

v7 cover mtd: Add SPI-NOR core support

Quoted 23 lines · Jagan Teki
Quoted 22 lines · Tom Rini

On Tue, Mar 22, 2016 at 01:19:25PM +0530, Jagan Teki wrote:
[snip]

Quoted 13 lines

Issues:
-------
1) undefined reference to `__aeabi_ldivmod'

59: config: Enable SPI-NOR framework
arm: + nyan-big

(quoted diff) +2 -0
+drivers/mtd/spi-nor/built-in.o: In function `spi_nor_write':
+build/../drivers/mtd/spi-nor/spi-nor.c:585: undefined reference to

`__aeabi_ldivmod'
+arm-unknown-linux-gnueabi-ld.bfd: BFD (GNU Binutils) 2.24 assertion fail /home/tony/buildall/src/binutils/bfd/elf32-arm.c:7696 +arm-unknown-linux-gnueabi-ld.bfd: error: required section '.rel.plt' not found in the linker script

Review

Quoted 3 lines
(quoted diff) +3 -0
+arm-unknown-linux-gnueabi-ld.bfd: final link failed: Invalid operation
+make[1]: *** [u-boot] Error 1
+make: *** [sub-make] Error 2

So this is a 64bit division problem somewhere along the lines that needs to be using one of the normal helper functions.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

2) Build issues on dra72_evm, dra74_evm

What are they?

Build issue with spl, I guess this is because dm used for normal u-boot and not used for spl.

Yes, this is still true. It sounds like you need to make sure that the code continues to build for both cases?

Quoted 23 lines

Mugunthan, can you look in to this?

Quoted 15 lines

Review

Quoted 10 lines

3) SPL image too big

59: config: Enable SPI-NOR framework
arm: + axm

(quoted diff) +5 -0
+arm-unknown-linux-gnueabi-ld.bfd: SPL image too big
+arm-unknown-linux-gnueabi-ld.bfd: SPL image BSS too big
+make[2]: *** [spl/u-boot-spl] Error 1
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2

Sounds like you need to go back and take some care about how we do this in SPL. Given the current gcc issue wrt merging strings together, we may need to be more careful about what files we compile and link for SPL in this case and perhaps need to split a file or two up.

With proper commenting code for SPL build on mtdcore and changes on SPL size macros, build look fine.

+++ b/include/configs/taurus.h

Review

Quoted 4 lines
(quoted diff) +2 -2
-#define CONFIG_SPL_MAX_SIZE            (31 * SZ_512)
+#define CONFIG_SPL_MAX_SIZE            (36 * SZ_512)
-#define CONFIG_SPL_BSS_MAX_SIZE                (3 * SZ_512)
+#define CONFIG_SPL_BSS_MAX_SIZE                (4 * SZ_512)

OK, but we can't just increase the sizes here, these platforms have a small footprint we need to stick to. We need to see what can be trimmed out to make them continue to fit.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160328/ea69ef0f/attachment.sig>