mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/9] mtd: spi-nor: parse SFDP tables to setup (Q)SPI memories
@ 2016-10-04 16:37 Cyrille Pitchen
  2016-10-04 16:37 ` [PATCH 1/9] mtd: spi-nor: improve macronix_quad_enable() Cyrille Pitchen
                   ` (8 more replies)
  0 siblings, 9 replies; 14+ messages in thread
From: Cyrille Pitchen @ 2016-10-04 16:37 UTC (permalink / raw)
  To: computersforpeace, linux-mtd
  Cc: nicolas.ferre, boris.brezillon, marex, linux-kernel, Cyrille Pitchen

Hi all,

This series extends support of SPI protocols to new protocols such as
SPI x-2-2 and SPI x-4-4. Also spi_nor_scan() tries now to select the right
op codes, timing parameters (number of mode and dummy cycles) and erase
sector size by parsing the Serial Flash Discoverable Parameter (SFDP)
tables, when available, as defined in the JEDEC JESD216 specifications.

When SFDP tables are not available, legacy settings are still used for
backward compatibility (SPI and earlier QSPI memories).

Support of SPI memories >128Mbits is also improved by using the 4byte
address instruction set, when available. Using those dedicated op codes
is stateless as opposed to enter the 4byte address mode, hence a better
compatibility with some boot loaders which expect to use 3byte address
op codes.


This series was tested on a Atmel sama5d2 xplained board with the
atmel-qspi.c driver. Except for SST memories, the SPI bus clock was set
to 83MHz. The config MTD_SPI_NOR_USE_4K_SECTORS was selected.

For my tests, I used some shell scripts using mtd_debug and sha1sum to
check the data integrity.

e.g:
#!/bin/sh

mtd_debug erase /dev/mtd5 0 0x780000
mtd_debug write /dev/mtd5 0 7674703 sama5d4_doc11238.pdf
mtd_debug read /dev/mtd5 0 7674703 sam5d4_tmp.pdf

sha1sum sama5d4_doc11238.pdf sam5d4_tmp.pdf


The series was tested with the following QSPI memories:

Spansion/Cypress:
- s25fl127s	OK
- s25fl512s	OK
- s25fl164k	OK

Micron:
- n25q128a	OK

Macronix:
- mx25l6433f	OK
- mx25l6473f	OK
- mx25l12835f	OK
- mx25l12845g	OK
- mx25l12873g	OK
- mx25l25645g	OK
- mx25l25673g	OK
- mx25l51245g	OK
- mx66l1g45g	OK (1)

SST:
- sst26vf016b	OK (2)
- sst26vf032b	OK (2)
- sst26vf064b	OK (2)

(1): requires patch 8
(2): requires patch 9, the SPI bus clock frequency was decreased down to 55.3MHz


Best regards,

Cyrille

Depending on the actual memory size, I may have used other partitions
(/dev/mtd4) and input file size (2880044 and 320044 bytes).

Cyrille Pitchen (9):
  mtd: spi-nor: improve macronix_quad_enable()
  mtd: spi-nor: add an alternative method to support memory >16MiB
  mtd: spi-nor: add support of SPI protocols like SPI 1-2-2 and SPI
    1-4-4
  mtd: spi-nor: remove unused set_quad_mode() function
  mtd: m25p80: add support of dual and quad spi protocols to all
    commands
  mtd: spi-nor: parse Serial Flash Discoverable Parameters (SFDP) tables
  mtd: spi-nor: parse SFDP 4-byte Address Instruction Table
  mtd: spi-nor: add support to Macronix mx66l1g45g
  mtd: spi-nor: add support to SST sst26* QSPI memories

 drivers/mtd/devices/m25p80.c            |  204 +++++--
 drivers/mtd/devices/serial_flash_cmds.h |    7 -
 drivers/mtd/devices/st_spi_fsm.c        |   28 +-
 drivers/mtd/spi-nor/atmel-quadspi.c     |   83 ++-
 drivers/mtd/spi-nor/cadence-quadspi.c   |    8 +-
 drivers/mtd/spi-nor/fsl-quadspi.c       |    8 +-
 drivers/mtd/spi-nor/hisi-sfc.c          |    8 +-
 drivers/mtd/spi-nor/mtk-quadspi.c       |   16 +-
 drivers/mtd/spi-nor/nxp-spifi.c         |   21 +-
 drivers/mtd/spi-nor/spi-nor.c           | 1013 ++++++++++++++++++++++++++++---
 include/linux/mtd/spi-nor.h             |  165 ++++-
 11 files changed, 1337 insertions(+), 224 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH 0/9] mtd: spi-nor: parse SFDP tables as defined by JESD216B
@ 2016-06-20 16:49 Cyrille Pitchen
  2016-06-20 16:50 ` [PATCH 2/9] mtd: spi-nor: add an alternative method to support memory >16MiB Cyrille Pitchen
  0 siblings, 1 reply; 14+ messages in thread
From: Cyrille Pitchen @ 2016-06-20 16:49 UTC (permalink / raw)
  To: computersforpeace, linux-mtd
  Cc: nicolas.ferre, boris.brezillon, marex, linux-kernel, Cyrille Pitchen

Hi all,

This series of patches adds support SPI x-y-z protocols other than
SPI 1-1-1, 1-1-2 and 1-1-4. When available, the Serial Flash Discoverable
Parameter (SFDP) tables are parsed to dynamically configure the SPI
protocols, op codes, number of dummy cycles or erase block size used
during Fast Read, Page Program and Sector Erase operation.
Otherwise, when SFDP tables are not available, the legacy settings are
used: we only use SPI 1-1-1, 1-1-2 or 1-1-4 protocols.

Also the 3rd parameter of spi_nor_scan() is changed so the caller can
provide the spi-nor framework with a more accurate list of SPI protocols
supported by the SPI controller. Using both this list and the SFDP
settings, the spi-nor framework can now select the best match for SPI
protocols supported by both the memory and the controller.


This series of patches is based onto next-20160620.
It was tested on a sama5d2 xplained board + Macronix mx25l25673g.

Best regards,

Cyrille

Cyrille Pitchen (9):
  mtd: spi-nor: improve macronix_quad_enable()
  mtd: spi-nor: add an alternative method to support memory >16MiB
  Documentation: atmel-quadspi: add binding file for Atmel QSPI driver
  mtd: atmel-quadspi: add driver for Atmel QSPI controller
  mtd: spi-nor: add support of SPI protocols like SPI 1-2-2 and SPI
    1-4-4
  mtd: spi-nor: remove unused set_quad_mode() function
  mtd: m25p80: add support of dual and quad spi protocols to all
    commands
  mtd: spi-nor: parse Serial Flash Discoverable Parameters (SFDP) tables
  mtd: spi-nor: parse SFDP 4-byte Address Instruction Table

 .../devicetree/bindings/mtd/atmel-quadspi.txt      |  32 +
 drivers/mtd/devices/m25p80.c                       | 204 ++++-
 drivers/mtd/devices/serial_flash_cmds.h            |   7 -
 drivers/mtd/devices/st_spi_fsm.c                   |  28 +-
 drivers/mtd/spi-nor/Kconfig                        |   9 +
 drivers/mtd/spi-nor/Makefile                       |   1 +
 drivers/mtd/spi-nor/atmel-quadspi.c                | 770 +++++++++++++++++
 drivers/mtd/spi-nor/fsl-quadspi.c                  |   8 +-
 drivers/mtd/spi-nor/mtk-quadspi.c                  |  16 +-
 drivers/mtd/spi-nor/nxp-spifi.c                    |  21 +-
 drivers/mtd/spi-nor/spi-nor.c                      | 962 +++++++++++++++++++--
 include/linux/mtd/spi-nor.h                        | 159 +++-
 12 files changed, 2021 insertions(+), 196 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mtd/atmel-quadspi.txt
 create mode 100644 drivers/mtd/spi-nor/atmel-quadspi.c

-- 
1.8.2.2

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-10-06 10:07 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-04 16:37 [PATCH 0/9] mtd: spi-nor: parse SFDP tables to setup (Q)SPI memories Cyrille Pitchen
2016-10-04 16:37 ` [PATCH 1/9] mtd: spi-nor: improve macronix_quad_enable() Cyrille Pitchen
2016-10-04 16:37 ` [PATCH 2/9] mtd: spi-nor: add an alternative method to support memory >16MiB Cyrille Pitchen
2016-10-05 12:12   ` Vignesh R
2016-10-05 12:53     ` Cyrille Pitchen
2016-10-06 10:03       ` Vignesh R
2016-10-04 16:37 ` [PATCH 3/9] mtd: spi-nor: add support of SPI protocols like SPI 1-2-2 and SPI 1-4-4 Cyrille Pitchen
2016-10-04 16:37 ` [PATCH 4/9] mtd: spi-nor: remove unused set_quad_mode() function Cyrille Pitchen
2016-10-04 16:37 ` [PATCH 5/9] mtd: m25p80: add support of dual and quad spi protocols to all commands Cyrille Pitchen
2016-10-04 16:37 ` [PATCH 6/9] mtd: spi-nor: parse Serial Flash Discoverable Parameters (SFDP) tables Cyrille Pitchen
2016-10-04 16:37 ` [PATCH 7/9] mtd: spi-nor: parse SFDP 4-byte Address Instruction Table Cyrille Pitchen
2016-10-04 16:37 ` [PATCH 8/9] mtd: spi-nor: add support to Macronix mx66l1g45g Cyrille Pitchen
2016-10-04 16:37 ` [PATCH 9/9] mtd: spi-nor: add support to SST sst26* QSPI memories Cyrille Pitchen
  -- strict thread matches above, loose matches on Subject: below --
2016-06-20 16:49 [PATCH 0/9] mtd: spi-nor: parse SFDP tables as defined by JESD216B Cyrille Pitchen
2016-06-20 16:50 ` [PATCH 2/9] mtd: spi-nor: add an alternative method to support memory >16MiB Cyrille Pitchen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®