mtd: spi-nor: add a stateless method to support memory size above 128Mib
authorCyrille Pitchen <cyrille.pitchen@atmel.com>
Thu, 27 Oct 2016 10:03:57 +0000 (12:03 +0200)
committerCyrille Pitchen <cyrille.pitchen@atmel.com>
Fri, 10 Feb 2017 12:56:06 +0000 (13:56 +0100)
commitba3ae6a1d4c78fce3b352b8bf026ada40b22117c
tree69845167df86890cf0b5730247d59743ba2ba396
parent902cc69a0820252c84c6f7caed350882cea166ba
mtd: spi-nor: add a stateless method to support memory size above 128Mib

This patch provides an alternative mean to support memory above 16MiB
(128Mib) by replacing 3byte address op codes by their associated 4byte
address versions.

Using the dedicated 4byte address op codes doesn't change the internal
state of the SPI NOR memory as opposed to using other means such as
updating a Base Address Register (BAR) and sending command to enter/leave
the 4byte mode.

Hence when a CPU reset occurs, early bootloaders don't need to be aware
of BAR value or 4byte mode being enabled: they can still access the first
16MiB of the SPI NOR memory using the regular 3byte address op codes.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
Tested-by: Vignesh R <vigneshr@ti.com>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
drivers/mtd/spi-nor/spi-nor.c