summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nand_imx.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-11-10 15:07:31 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-11-10 15:07:31 +0100
commit0b0eada569b198aa3882cfec5874bc35a8a0fa14 (patch)
tree061ca4528bfaee38df3faae6ff1a6be6d4993fe6 /drivers/mtd/nand/nand_imx.c
parent34ea8b9317afad6ed2cb702c911cbcbad9d3bf23 (diff)
parent706ef1bf6fed8dd2c75c469ad4bc758da2cb4cf3 (diff)
downloadbarebox-0b0eada569b198aa3882cfec5874bc35a8a0fa14.tar.gz
barebox-0b0eada569b198aa3882cfec5874bc35a8a0fa14.tar.xz
Merge branch 'for-next/misc'
Diffstat (limited to 'drivers/mtd/nand/nand_imx.c')
-rw-r--r--drivers/mtd/nand/nand_imx.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/mtd/nand/nand_imx.c b/drivers/mtd/nand/nand_imx.c
index d69a012f01..f9d3c2e34a 100644
--- a/drivers/mtd/nand/nand_imx.c
+++ b/drivers/mtd/nand/nand_imx.c
@@ -996,14 +996,23 @@ static void imx_nand_command(struct mtd_info *mtd, unsigned command,
else
host->buf_start = column + mtd->writesize;
- command = NAND_CMD_READ0;
-
- host->send_cmd(host, command);
+ host->send_cmd(host, NAND_CMD_READ0);
mxc_do_addr_cycle(mtd, column, page_addr);
if (host->pagesize_2k)
/* send read confirm command */
host->send_cmd(host, NAND_CMD_READSTART);
+
+ /*
+ * After the core issued READOOB the result is read using
+ * .read_buf, so we have to make sure the data is actually
+ * there.
+ */
+ if (command == NAND_CMD_READOOB) {
+ host->send_page(host, NFC_OUTPUT);
+ copy_spare(mtd, 1, host->data_buf + mtd->writesize);
+ }
+
break;
case NAND_CMD_SEQIN: