summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorApurva Nandan <a-nandan@ti.com>2023-01-23 23:13:16 +0530
committerPraneeth Bajjuri <praneeth@ti.com>2023-01-25 14:10:19 -0600
commitf3182e1ac682da4afeb498701ab47ba1e2daa6f4 (patch)
tree95f89fd1d7ccb9804eb09d07fc188c24313e3d3e /include
parenteea457a4ac4f4d7c8bd7607089803ee0ef81c36e (diff)
mtd: spinand: Add enum spinand_protocol to indicate current SPI IO mode
Unlike Dual and Quad SPI modes flashes, Octal DTR SPI NAND flashes require all instructions to be made in 8D-8D-8D protocol when the flash is in Octal DTR mode. Hence, storing the current SPI IO mode becomes necessary for operating the flash and switching between modes. Store the current SPI IO mode in the spinand struct using a spinand_protocol enum. This would act as a flag, denoting that the core should use the given SPI protocol all types of flash operations. Signed-off-by: Apurva Nandan <a-nandan@ti.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mtd/spinand.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 9befcc1047..dc153518e4 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -174,6 +174,18 @@
SPI_MEM_OP_DATA_OUT(len, buf, 4))
/**
+ * enum spinand_protocol - List of SPI protocols to denote the op protocol and
+ * SPI NAND flash IO modes.
+ */
+enum spinand_protocol {
+ SPINAND_1S,
+ SPINAND_2S,
+ SPINAND_4S,
+ SPINAND_8S,
+ SPINAND_8D,
+};
+
+/**
* Standard SPI NAND flash commands
*/
#define SPINAND_CMD_PROG_LOAD_X4 0x32
@@ -382,6 +394,8 @@ struct spinand_info {
* this die. Only required if your chip exposes several dies
* @cur_target: currently selected target/die
* @eccinfo: on-die ECC information
+ * @protocol: SPI IO protocol in operation. Update on successful transition into
+ * a different SPI IO protocol.
* @cfg_cache: config register cache. One entry per die
* @databuf: bounce buffer for data
* @oobbuf: bounce buffer for OOB data
@@ -415,6 +429,8 @@ struct spinand_device {
struct spinand_ecc_info eccinfo;
+ enum spinand_protocol protocol;
+
u8 *cfg_cache;
u8 *databuf;
u8 *oobbuf;