linux/Documentation/devicetree/bindings/mtd
Brian Norris bb276262e8 mtd: spi-nor: only apply reset hacks to broken hardware
Commit 59b356ffd0 ("mtd: m25p80: restore the status of SPI flash when
exiting") is the latest from a long history of attempts to add reboot
handling to handle stateful addressing modes on SPI flash. Some prior
mostly-related discussions:

http://lists.infradead.org/pipermail/linux-mtd/2013-March/046343.html
[PATCH 1/3] mtd: m25p80: utilize dedicated 4-byte addressing commands

http://lists.infradead.org/pipermail/barebox/2014-September/020682.html
[RFC] MTD m25p80 3-byte addressing and boot problem

http://lists.infradead.org/pipermail/linux-mtd/2015-February/057683.html
[PATCH 2/2] m25p80: if supported put chip to deep power down if not used

Previously, attempts to add reboot-time software reset handling were
rejected, but the latest attempt was not.

Quick summary of the problem:
Some systems (e.g., boot ROM or bootloader) assume that they can read
initial boot code from their SPI flash using 3-byte addressing. If the
flash is left in 4-byte mode after reset, these systems won't boot. The
above patch provided a shutdown/remove hook to attempt to reset the
addressing mode before we reboot. Notably, this patch misses out on
huge classes of unexpected reboots (e.g., crashes, watchdog resets).

Unfortunately, it is essentially impossible to solve this problem 100%:
if your system doesn't know how to reset the SPI flash to power-on
defaults at initialization time, no amount of software can really rescue
you -- there will always be a chance of some unexpected reset that
leaves your flash in an addressing mode that your boot sequence didn't
expect.

While it is not directly harmful to perform hacks like the
aforementioned commit on all 4-byte addressing flash, a
properly-designed system should not need the hack -- and in fact,
providing this hack may mask the fact that a given system is indeed
broken. So this patch attempts to apply this unsound hack more narrowly,
providing a strong suggestion to developers and system designers that
this is truly a hack. With luck, system designers can catch their errors
early on in their development cycle, rather than applying this hack long
term. But apparently enough systems are out in the wild that we still
have to provide this hack.

Document a new device tree property to denote systems that do not have a
proper hardware (or software) reset mechanism, and apply the hack (with
a loud warning) only in this case.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
2018-08-01 09:27:38 +02:00
..
partitions dt-bindings: mtd: document Broadcom's BCM47xx partitions 2018-05-23 10:08:44 +02:00
arm-versatile.txt mtd: augment the "arm,versatile-flash" bindings 2016-04-04 10:33:16 +02:00
aspeed-smc.txt mtd: spi-nor: bindings for the Aspeed memory controllers 2017-02-10 13:54:54 +01:00
atmel-dataflash.txt
atmel-nand.txt dt-bindings: mtd: atmel-nand: Document the nfc-io bindings 2017-05-31 11:55:33 +02:00
atmel-quadspi.txt dt-bindings: Remove "status" from examples 2017-09-05 10:03:06 -05:00
brcm,brcmnand.txt mtd: brcmnand: Add v7.2 controller support 2016-06-03 09:45:50 +02:00
cadence-quadspi.txt mtd: spi-nor: cadence-quadspi: Add new binding to enable loop-back circuit 2017-10-17 20:39:33 +02:00
common.txt dt-bindings: mtd: add a common label property to all mtd devices 2017-02-10 10:16:49 -08:00
cortina,gemini-flash.txt mtd: add DT bindings for the Cortina Systems Gemini Flash 2017-02-08 11:36:10 -08:00
davinci-nand.txt
denali-nand.txt dt-bindings: nand: denali: reduce the register space in the example 2017-09-22 09:04:42 +02:00
diskonchip.txt
elm.txt dt-bindings: mtd: elm: Correct compatible string requirement 2017-06-22 21:10:47 +02:00
flctl-nand.txt
fsl-quadspi.txt dt-bindings: fsl-quadspi: Add the example of two SPI NOR 2018-03-30 10:05:08 +02:00
fsl-upm-nand.txt
fsmc-nand.txt mtd: fsmc_nand: Add BCH4 SW ECC support for SPEAr600 2015-10-26 13:19:40 -07:00
gpio-control-nand.txt mtd: nand: gpio: update binding 2017-05-10 18:18:55 -07:00
gpmc-nand.txt dt-bindings: gpmc: Correct location of generic gpmc binding 2017-06-22 21:12:15 +02:00
gpmc-nor.txt dt-bindings: Remove leading 0x from bindings notation 2017-12-06 14:56:33 -06:00
gpmc-onenand.txt dt-bindings: mtd: gpmc-onenand: Update properties description 2018-01-12 15:34:02 +01:00
gpmi-nand.txt dt-bindings: mtd: rawnand: gpmi: document specific ECC strength 2018-04-29 08:56:40 +02:00
hisi504-nand.txt
hisilicon,fmc-spi-nor.txt mtd: spi-nor: add hisilicon spi-nor flash controller driver 2016-07-13 17:49:45 -07:00
ibm,ndfc.txt dt-bindings: powerpc/4xx: move 4xx NDFC and EMAC bindings to subsystem directories 2018-04-27 16:56:56 -05:00
ingenic,jz4780-nand.txt doc: dt: mtd: new binding for jz4780-{nand,bch} 2016-01-06 17:24:29 -08:00
jedec,spi-nor.txt mtd: spi-nor: only apply reset hacks to broken hardware 2018-08-01 09:27:38 +02:00
lpc32xx-mlc.txt dt-bindings: Use lower case hex in unit-addresses 2017-12-26 10:37:05 -06:00
lpc32xx-slc.txt
marvell-nand.txt mtd: rawnand: marvell: Fix clock resource by adding a register clock 2018-03-29 09:38:10 +02:00
microchip,mchp23k256.txt mtd: mchp23k256: Add support for mchp23lcv1024 2017-06-08 16:32:11 -07:00
mtd-physmap.txt dt-bindings: mtd-physmap: Add endianness supports 2018-03-29 09:30:08 +02:00
mtk-nand.txt MTD changes: 2018-06-08 10:39:20 -07:00
mtk-quadspi.txt dt-bindings: mtd: add new compatible strings and improve description 2017-10-24 23:57:18 +02:00
mxc-nand.txt
nand.txt dt-bindings: mtd: document new nand-rb property 2018-01-12 15:10:08 +01:00
nxp-spifi.txt
orion-nand.txt
oxnas-nand.txt mtd: nand: Add OX820 NAND Support 2016-10-22 14:24:21 +02:00
partition.txt dt-bindings: mtd: document Broadcom's BCM47xx partitions 2018-05-23 10:08:44 +02:00
qcom_nandc.txt dt-bindings: qcom_nandc: IPQ8074 QPIC NAND documentation 2017-08-23 16:49:30 +02:00
samsung-s3c2410.txt dt-bindings: mtd: add DT binding for s3c2410 flash controller 2016-11-07 14:48:36 +01:00
spear_smi.txt
st-fsm.txt dt-bindings: Remove "status" from examples 2017-09-05 10:03:06 -05:00
stm32-quadspi.txt dt-bindings: mtd: Document the STM32 QSPI bindings 2017-05-01 18:08:03 -07:00
sunxi-nand.txt mtd: rawnand: sunxi: Remove support for GPIO-based Ready/Busy polling 2018-04-29 08:56:41 +02:00
tango-nand.txt mtd: nand: tango: Update DT binding description 2017-01-03 09:51:13 +01:00
vf610-nfc.txt mtd: nand: vf610_nfc: add device tree bindings 2015-09-29 13:54:54 -07:00