alistair23-linux/drivers/mtd/devices
Brian Norris 87c9511fba mtd: m25p80: utilize dedicated 4-byte addressing commands
Traditionally, the command set used by SPI flash only supported a 3-byte
address. However, large SPI flash (>= 32MiB, or 256Mib) require 4 bytes
to address the entire flash. Most manufacturers have supplied a mode
switch (via a "bank register writer", or a "enable 4-byte mode"
command), which tells the flash to expect 4 address cycles from now on,
instead of 3. This mode remains until power is cut, the reset line is
triggered (on packages where present), or a command is sent to reset the
flash or to reset the 3-byte addressing mode.

As an alternative, some flash manufacturers have developed a new command
set that accept a full 4-byte address. They can be used orthogonally to
any of the modes; that is, they can be used when the flash is in either
3-byte or 4-byte address mode.

Now, there are a number of reasons why the "stateful" 4-byte address
mode switch may not be acceptable. For instance, some SoC's perform a
dumb boot sequence in which they only send 3-byte read commands to the
flash. However, if an unexpected reset occurs, the flash chip cannot be
guaranteed to return to its 3-byte mode. Thus, the SoC controller and
flash will not understand each other. (One might consider hooking up the
aforementioned reset pin to the system reset line so that any system
reset will reset the flash to 3-byte mode, but some packages do not
provide this pin. And in some other packages, one must choose between
having a reset pin and having enough pins for 4-output QSPI support.
It is an error prone process choosing a flash that will support a
hardware reset pin!)

This patch provides support for the new stateless command set, so that
we can avoid the problems that come with a stateful addressing mode
change. The flash can be left in "3-byte mode" while still accessing the
entire flash.

Note that Spansion supports this command set on all its large flash
(e.g, S25FL512S), and Macronix has begun supporting this command set on
some new flash (e.g., MX25L25635F). For the moment, I don't know how to
differentiate the Macronix that don't support this command set (e.g.,
MX25L25635E) from those that do, so this patch only supports Spansion.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2013-08-05 20:43:51 +01:00
..
bcm47xxsflash.c mtd: bcm47xxsflash: implement polling chip status 2013-08-05 18:20:54 +01:00
bcm47xxsflash.h mtd: bcm47xxsflash: implement ChipCommon R/W ops 2013-08-05 18:20:32 +01:00
block2mtd.c mtd: block2mtd: throttle writes by calling balance_dirty_pages_ratelimited. 2012-12-13 13:39:44 +02:00
docg3.c mtd: doc: use module_platform_driver_probe() 2013-04-05 13:14:24 +01:00
docg3.h mtd: docg3 add protection against concurrency 2012-03-27 01:03:27 +01:00
elm.c mtd: devices: convert OMAP BCH to devm_ioremap_resource() 2013-08-05 19:09:16 +01:00
Kconfig mtd: merge mtdchar module with mtdcore 2013-04-05 13:16:54 +01:00
lart.c mtd: move zero length verification to MTD API functions 2012-03-27 00:32:19 +01:00
m25p80.c mtd: m25p80: utilize dedicated 4-byte addressing commands 2013-08-05 20:43:51 +01:00
Makefile mtd: doc: remove support for DoC 2000/2001/2001+ 2013-04-05 12:04:31 +01:00
ms02-nv.c mtd: do not duplicate length and offset checks in drivers 2012-03-27 00:28:18 +01:00
ms02-nv.h MTD/JFFS2: remove CVS keywords 2008-06-04 17:50:17 +01:00
mtd_dataflash.c mtd: dataflash: use spi_get_drvdata() and spi_set_drvdata() 2013-08-05 19:05:42 +01:00
mtdram.c mtd: harmonize mtd_point interface implementation 2012-03-27 00:32:11 +01:00
phram.c mtd: phram: fix section mismatch for phram_setup 2012-03-27 01:02:29 +01:00
pmc551.c MTD merge for 3.4 2012-03-30 17:31:56 -07:00
slram.c mtd: slram: invalid checking of absolute end address 2012-11-09 17:02:50 +02:00
spear_smi.c mtd: spear_smi: add CONFIG_PM_SLEEP to suspend/resume functions 2013-08-05 19:00:24 +01:00
sst25l.c mtd: sst25l: use spi_get_drvdata() and spi_set_drvdata() 2013-08-05 19:05:37 +01:00