summaryrefslogtreecommitdiff
path: root/include/linux/mtd/jedec.h
diff options
context:
space:
mode:
authorRouven Czerwinski <r.czerwinski@pengutronix.de>2023-09-22 16:17:16 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2023-10-16 10:47:22 +0200
commitf6ca3fb6978f94d95ee79f95085fc22e71ca17cc (patch)
tree5904d4b049c27abd5fc1e9f0f5147d5e2b105383 /include/linux/mtd/jedec.h
parent5279f4a9eed3ee7d222b76511ea7a22c89e7eefd (diff)
mtd: rawnand: Ensure the nand chip supports cached reads
Both the JEDEC and ONFI specification say that read cache sequential support is an optional command. This means that we not only need to check whether the individual controller supports the command, we also need to check the parameter pages for both ONFI and JEDEC NAND flashes before enabling sequential cache reads. This fixes support for NAND flashes which don't support enabling cache reads, i.e. Samsung K9F4G08U0F or Toshiba TC58NVG0S3HTA00. Sequential cache reads are now only available for ONFI and JEDEC devices, if individual vendors implement this, it needs to be enabled per vendor. Tested on i.MX6Q with a Samsung NAND flash chip that doesn't support sequential reads. Fixes: 003fe4b9545b ("mtd: rawnand: Support for sequential cache reads") Cc: stable@vger.kernel.org Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230922141717.35977-1-r.czerwinski@pengutronix.de
Diffstat (limited to 'include/linux/mtd/jedec.h')
-rw-r--r--include/linux/mtd/jedec.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/mtd/jedec.h b/include/linux/mtd/jedec.h
index 0b6b59f7cfbd..56047a4e54c9 100644
--- a/include/linux/mtd/jedec.h
+++ b/include/linux/mtd/jedec.h
@@ -21,6 +21,9 @@ struct jedec_ecc_info {
/* JEDEC features */
#define JEDEC_FEATURE_16_BIT_BUS (1 << 0)
+/* JEDEC Optional Commands */
+#define JEDEC_OPT_CMD_READ_CACHE BIT(1)
+
struct nand_jedec_params {
/* rev info and features block */
/* 'J' 'E' 'S' 'D' */