Skip to content

RFC SPI-NOR/MTD addition

Jagan Teki u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v8 RFC Latest16 patches 0 repliesNew

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16dm: mtd: Add dm mtd core opsdrivers/mtd/mtd-uclass.c include/linux/mtd/mtd.h+130 -00 replies
2/16mtd: Add SPI-NOR core supportMakefile drivers/mtd/spi-nor/Makefile drivers/mtd/spi-nor/spi-nor-ids.c +3 more+1047 -00 replies
3/16mtd: spi-nor: Kconfig: Add MTD_SPI_NOR entrydrivers/mtd/Kconfig drivers/mtd/spi-nor/Kconfig+16 -00 replies
4/16mtd: spi-nor: Kconfig: Add MTD_SPI_NOR_USE_4K_SECTORSdrivers/mtd/spi-nor/Kconfig+18 -00 replies
5/16mtd: spi-nor: Kconfig: Add SPI_NOR_MISC entrydrivers/mtd/spi-nor/Kconfig+6 -00 replies
6/16mtd: spi-nor: Kconfig: Add SPI_NOR_MACRONIX entrydrivers/mtd/spi-nor/Kconfig+5 -00 replies
7/16mtd: spi-nor: Kconfig: Add SPI_NOR_SPANSION entrydrivers/mtd/spi-nor/Kconfig+5 -00 replies
8/16mtd: spi-nor: Kconfig: Add SPI_NOR_STMICRO entrydrivers/mtd/spi-nor/Kconfig+5 -00 replies
9/16mtd: spi-nor: Kconfig: Add SPI_NOR_SST entrydrivers/mtd/spi-nor/Kconfig+5 -00 replies
10/16mtd: spi-nor: Kconfig: Add SPI_NOR_WINBOND entrydrivers/mtd/spi-nor/Kconfig+5 -00 replies
11/16spi: Add spi_write_then_readdrivers/spi/spi-uclass.c include/spi.h+44 -00 replies
12/16mtd: spi-nor: Add m25p80 driverdrivers/mtd/spi-nor/Makefile drivers/mtd/spi-nor/m25p80.c+220 -00 replies
13/16mtd: spi-nor: Kconfig: Add MTD_M25P80 entrydrivers/mtd/spi-nor/Kconfig+17 -00 replies
14/16mtd: spi-nor: Add zynq qspi driverdrivers/mtd/spi-nor/Makefile drivers/mtd/spi-nor/zynq_qspi.c+641 -00 replies
15/16mtd: spi-nor: zynq_qspi: Kconfig: Add MTD_ZYNQdrivers/mtd/spi-nor/Kconfig+9 -00 replies
16/16mtd: spi-nor: Add 4-byte address width supportdrivers/mtd/spi-nor/m25p80.c drivers/mtd/spi-nor/spi-nor.c include/linux/mtd/spi-nor.h+42 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v8 yet.

Read the v8 thread

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

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
Signature · 1 line
2.7.4