
Hi Heiko,
On 22 March 2016 at 13:19, Jagan Teki jteki@openedev.com wrote:
On Tuesday 22 March 2016 01:17 PM, Jagan Teki wrote:
On Tuesday 22 March 2016 01:07 PM, Jagan Teki wrote:
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
Tested in hardware and sandbox [1]
Tested-by: Jagan Teki jteki@openedev.com
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:
- 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
Build issues on dra72_evm, dra74_evm
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
Any inputs on this buildman issue? I got it for axm and taurus.