devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] mtd: spi-nor: add an alternative method to support memory >16MiB
@ 2016-03-22 15:13 Cyrille Pitchen
       [not found] ` <cover.1458657802.git.cyrille.pitchen-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
  2016-03-22 15:13 ` [PATCH v2 2/2] doc: dt: mtd: add a DT property to enable the use of 4byte-address op codes Cyrille Pitchen
  0 siblings, 2 replies; 8+ messages in thread
From: Cyrille Pitchen @ 2016-03-22 15:13 UTC (permalink / raw)
  To: computersforpeace-Re5JQEeQqe8AvxtiuMwx3w,
	linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w,
	boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
	marex-ynQEQJNshbs, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	pawel.moll-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, Cyrille Pitchen

Hi all,

This patch was tested on a sama5d2 xplained board + Macronix mx25l25673g.

It provides us with an alternative method to support SPI NOR memory above
16MiB (128Mib). Indeed the previous method (still default) makes the
memory enter it's 4byte-address method. However this mode has some
annoying side effects for early bootloarders: it changes the internal
state of the memory hence when using regular (Fast) Read op codes
(0x03, 0x0b, 0x6b, ...) the memory now expects 4byte addresses whereas
some bootloaders still use these op codes with 3byte addresses.

The new method translates the 3byte address op codes into their 4byte
address version:
0x03 -> 0x13  Read
0x0b -> 0x0c  Fast Read
0x6b -> 0x6c  Fast Read 1-1-4
0x02 -> 0x12  Page Program
0xd8 -> 0xdc  Sector Erase
...

The internal state of the SPI NOR memory is left unchanged.

However the 4byte address op codes are not supported by all memories.
For instance Macronix mx25l25635e and mx25l25673g share the very same
JEDEC ID (C22019) with no additional ext_id bytes to differentiate them.
The 35e doesn't support the 4byte address op codes whereas the 73g does.
So there is no mean for the software to discover at runtime whether the
hardware supports these op codes. Hence this patch checks a new DT
property, "m25p,4byte-opcoes", to select the proper method to deal with
a >16MiB SPI NOR memory.


Best regards,

Cyrille


ChangeLog:

v1 -> v2:
- remove the Kconfig option and use the new "m25p,4byte-opcodes" DT
  property instead.

Cyrille Pitchen (2):
  mtd: spi-nor: add an alternative method to support memory >16MiB
  doc: dt: mtd: add a DT property to enable the use of 4byte-address op
    codes

 .../devicetree/bindings/mtd/jedec,spi-nor.txt      |  11 +++
 drivers/mtd/spi-nor/spi-nor.c                      | 100 ++++++++++++++++-----
 include/linux/mtd/spi-nor.h                        |  23 +++--
 3 files changed, 107 insertions(+), 27 deletions(-)

-- 
1.8.2.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2016-04-01 20:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-22 15:13 [PATCH v2 0/2] mtd: spi-nor: add an alternative method to support memory >16MiB Cyrille Pitchen
     [not found] ` <cover.1458657802.git.cyrille.pitchen-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2016-03-22 15:13   ` [PATCH v2 1/2] " Cyrille Pitchen
     [not found]     ` <75adc06e8766012b4cb9592ff286cc4a2b7fe9de.1458657802.git.cyrille.pitchen-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2016-03-22 16:57       ` kbuild test robot
2016-03-22 15:13 ` [PATCH v2 2/2] doc: dt: mtd: add a DT property to enable the use of 4byte-address op codes Cyrille Pitchen
2016-03-23 12:49   ` Rob Herring
2016-03-23 15:08     ` Cyrille Pitchen
     [not found]       ` <56F2B18A.3020107-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2016-03-25 14:44         ` Cyrille Pitchen
     [not found]           ` <56F54ED2.3030609-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2016-04-01 20:42             ` Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).