All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/3] mtd: spi-nor: mx25l25635f: Use 4B opcodes
@ 2018-12-06 10:37 Boris Brezillon
  2018-12-06 10:37 ` [PATCH v5 1/3] mtd: spi-nor: Add the SNOR_F_4B_OPCODES flag Boris Brezillon
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Boris Brezillon @ 2018-12-06 10:37 UTC (permalink / raw)
  To: Tudor Ambarus, Marek Vasut
  Cc: Alexandre Belloni, David Woodhouse, Brian Norris,
	Boris Brezillon, Richard Weinberger, linux-mtd, Sverdlin,
	Alexander (Nokia - DE/Ulm)

Hello,

This is another attempt at fixing the bug reported by Alexandre and
impacting mx25l25635f flashes that do not have the reset line properly
wired. Since mx25l25635f and mx25l25635e share the same JEDEC-ID, and
only mx25l25635f supports 4B opcodes, the core decides to enter 4B
mode, and when a reset occurs, the NOR stays in this mode and the ROM
code (why only supports 3 byte addressing) can't read the flash
anymore.

Adding broken-flash-reset in the DT fixes the reboot issue but prints
a WARN_ON() backtrace at boot time. The proper solution is to use 4B
opcodes when available, but we need a way to flag the F variant of the
chip as supporting this feature.

This patchset paves the way for more SFDP-related fixups hooks by
adding a spi_nor_fixups struct which can be provided on a per-chip
basis (and soon on a per-manufacturer basis).

In this series we add a single hook called post_bfpt() to allow fixups
just after the BFPT parsing has occurred. Thanks to the BFPT array, we
are able to differentiate the F and E variant and add the 4B_OPCODE
flag when appropriate.

With this infrastructure in place, we'll be able to fix SFPD tables at
runtime instead setting the SKIP_SFDP on NORs with broken SFDP.

Feel free to comment on the general approach or implementation details.

Regards,

Boris

Boris Brezillon (3):
  mtd: spi-nor: Add the SNOR_F_4B_OPCODES flag
  mtd: spi-nor: Add a post BFPT parsing fixup hook
  mtd: spi-nor: Add a post BFPT fixup for MX25L25635E

 drivers/mtd/spi-nor/spi-nor.c | 437 +++++++++++++++++++---------------
 include/linux/mtd/spi-nor.h   |   1 +
 2 files changed, 249 insertions(+), 189 deletions(-)

-- 
2.17.1

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

end of thread, other threads:[~2018-12-07  9:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-06 10:37 [PATCH v5 0/3] mtd: spi-nor: mx25l25635f: Use 4B opcodes Boris Brezillon
2018-12-06 10:37 ` [PATCH v5 1/3] mtd: spi-nor: Add the SNOR_F_4B_OPCODES flag Boris Brezillon
2018-12-06 11:29   ` Tudor.Ambarus
2018-12-07  9:10   ` [v5,1/3] " Boris Brezillon
2018-12-06 10:37 ` [PATCH v5 2/3] mtd: spi-nor: Add a post BFPT parsing fixup hook Boris Brezillon
2018-12-06 11:29   ` Tudor.Ambarus
2018-12-07  9:10   ` [v5,2/3] " Boris Brezillon
2018-12-06 10:37 ` [PATCH v5 3/3] mtd: spi-nor: Add a post BFPT fixup for MX25L25635E Boris Brezillon
2018-12-06 11:33   ` Tudor.Ambarus
2018-12-07  9:10   ` [v5,3/3] " Boris Brezillon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.