]> git.baikalelectronics.ru Git - uboot.git/commit
mtd: mxs_nand_spl: fix nand_command protocol violation
authorAndrea Scian <andrea.scian@dave.eu>
Tue, 21 Jun 2022 20:05:10 +0000 (22:05 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 29 Jun 2022 13:26:44 +0000 (09:26 -0400)
commit08e9b47e6d588f86d7fc5cb340a43ca8286b3b86
tree54a7a9f4786fab29a5da14f40313d3e3a4c455fc
parentd73c17f9db5bf5b2f6eb330a78244ce80d25876e
mtd: mxs_nand_spl: fix nand_command protocol violation

mxs_nand_command() implementation assume that it's working with a
LP NAND, which is a common case nowadays and thus uses two bytes
for column address.

However this is wrong for NAND_CMD_READID and NAND_CMD_PARAM, which
expects only one byte of column address, even for LP NANDs.
This leads to ONFI detection problem with some NAND manufacturer (like
Winbond) but not with others (like Samsung and Spansion)

We fix this with a simple workaround to avoid the 2nd byte column address
for those two commands.

Also align the code with nand_base to support 16 bit devices.

Tested on an iMX6SX device with:
* Winbond W29N04GVSIAA
* Spansion S34ML04G100TF100
* Samsung K9F4G08U00

Tested on imx8mn device with:
* Windbond W29N04GV

Signed-off-by: Andrea Scian <andrea.scian@dave.eu>
CC: Stefano Babic <sbabic@denx.de>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
drivers/mtd/nand/raw/mxs_nand_spl.c