[U-Boot] [PATCH RFC v8 00/16] SPI-NOR/MTD addition

Jagan Teki jteki at openedev.com
Wed Oct 5 18:57:46 CEST 2016


On-top-of u-boot-spi/next,

The previous series [1] [2] are added SPI-NOR on top of
mtd/spi where it bypassing DM_SPI_FLASH and use the existing
mtd core (which is non-dm), I feel this is moving in a reverse
direction where adding new feature with the help of non-dm mtd
core support and also few of the spi drivers are not fully dm-driven.

So this new design will keep the mtd/spi as it is and start adding
spi-nor features separately. The idea here is to add the dm features
to MTD first and then add UCLASS_MTD spi-nor drivers so-that the commands
are interfacing to spi-nor through dm-driven MTD core to spi-nor.
And this could also be a generic solutions for all MTD flash's like NAND, NOR and etc.

About this series:

------------------------------
	cmd_sf.c
------------------------------
	mtd-uclass
-------------------------------
	SPI-NOR	Core
-------------------------------
m25p80.c 	zynq_qspi
-------------------------------
spi-uclass	SPI NOR chip
-------------------------------
spi drivers
-------------------------------
SPI NOR chip
-------------------------------

drivers/mtd/spi-nor/

- Add dm mtd operations
- spi-nor.c:   Add basic SPI-NOR core like erase/read/write ops and lock's will add later
- m25p80.c:    spi-nor to spi divers interface layer drivers/spi-nor
- zynq_qspi.c: zynq qspi spi-nor controller driver.

CONFIG_SPI_FLASH_BAR and DUAL_FLASH code shouldn't be part of spi-nor core
as these are strictly controller features. and 4-byte address width in spi-nor
will handle > 16MiB flash devices.

What need to be add:
1) 'sf probe' interface:
   Need to probe the chips in two directions A) one is for direct spi-nor driver
   (zynq_qspi here) and other B) one is for interface driver(m25p80.c). the later
   is bit tricky as it will also probe the UCLASS_SPI.

   A) 
   qspi1: spi at e000d000 {
	compatible = "xlnx,zynq-qspi-1.0";
        status = "disabled";
    };

   
   B)
   spi0: spi at e0006000 {
        compatible = "xlnx,zynq-spi-r1p6";
        status = "disabled";
   };

   alias {
	mtd0 = &qspi1;
	spi1 = &spi0;
   };

2) sf env:
   same as 1)

Any ideas about this probe interface are 'Welcome'

[1] http://lists.denx.de/pipermail/u-boot/2016-March/249286.html
[2] http://lists.denx.de/pipermail/u-boot/2016-February/245418.html

Jagan Teki (16):
  dm: mtd: Add dm mtd core ops
  mtd: Add SPI-NOR core support
  mtd: spi-nor: Kconfig: Add MTD_SPI_NOR entry
  mtd: spi-nor: Kconfig: Add MTD_SPI_NOR_USE_4K_SECTORS
  mtd: spi-nor: Kconfig: Add SPI_NOR_MISC entry
  mtd: spi-nor: Kconfig: Add SPI_NOR_MACRONIX entry
  mtd: spi-nor: Kconfig: Add SPI_NOR_SPANSION entry
  mtd: spi-nor: Kconfig: Add SPI_NOR_STMICRO entry
  mtd: spi-nor: Kconfig: Add SPI_NOR_SST entry
  mtd: spi-nor: Kconfig: Add SPI_NOR_WINBOND entry
  spi: Add spi_write_then_read
  mtd: spi-nor: Add m25p80 driver
  mtd: spi-nor: Kconfig: Add MTD_M25P80 entry
  mtd: spi-nor: Add zynq qspi driver
  mtd: spi-nor: zynq_qspi: Kconfig: Add MTD_ZYNQ
  mtd: spi-nor: Add 4-byte address width support

 Makefile                          |   1 +
 drivers/mtd/Kconfig               |   2 +
 drivers/mtd/mtd-uclass.c          |  72 ++++
 drivers/mtd/spi-nor/Kconfig       |  89 +++++
 drivers/mtd/spi-nor/Makefile      |  15 +
 drivers/mtd/spi-nor/m25p80.c      | 218 ++++++++++++
 drivers/mtd/spi-nor/spi-nor-ids.c | 176 ++++++++++
 drivers/mtd/spi-nor/spi-nor.c     | 685 ++++++++++++++++++++++++++++++++++++++
 drivers/mtd/spi-nor/zynq_qspi.c   | 638 +++++++++++++++++++++++++++++++++++
 drivers/spi/spi-uclass.c          |  24 ++
 include/linux/err.h               |   5 +
 include/linux/mtd/mtd.h           |  58 ++++
 include/linux/mtd/spi-nor.h       | 211 ++++++++++++
 include/spi.h                     |  20 ++
 14 files changed, 2214 insertions(+)
 create mode 100644 drivers/mtd/spi-nor/Kconfig
 create mode 100644 drivers/mtd/spi-nor/Makefile
 create mode 100644 drivers/mtd/spi-nor/m25p80.c
 create mode 100644 drivers/mtd/spi-nor/spi-nor-ids.c
 create mode 100644 drivers/mtd/spi-nor/spi-nor.c
 create mode 100644 drivers/mtd/spi-nor/zynq_qspi.c
 create mode 100644 include/linux/mtd/spi-nor.h

-- 
2.7.4



More information about the U-Boot mailing list