diff mbox series

[06/13] mtd: spinand: Add macros for Octal DTR page read and write operations

Message ID 20210713130538.646-7-a-nandan@ti.com
State New
Headers show
Series [01/13] spi: spi-mem: Add DTR templates for cmd, address, dummy and data phase | expand

Commit Message

Apurva Nandan July 13, 2021, 1:05 p.m. UTC
Define new PAGE_READ_FROM_CACHE and PROG_LOAD op templates for Octal
DTR SPI mode. These templates would used in op_variants and
op_templates for defining Octal DTR read from cache and write to
cache operations.

Datasheet: https://www.winbond.com/export/sites/winbond/datasheet/W35N01JW_Datasheet_Brief.pdf

Signed-off-by: Apurva Nandan <a-nandan@ti.com>
---
 include/linux/mtd/spinand.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Miquel Raynal Aug. 6, 2021, 6:54 p.m. UTC | #1
Hi Apurva,

Apurva Nandan <a-nandan@ti.com> wrote on Tue, 13 Jul 2021 13:05:31
+0000:

> Define new PAGE_READ_FROM_CACHE and PROG_LOAD op templates for Octal

> DTR SPI mode. These templates would used in op_variants and


                                will be

> op_templates for defining Octal DTR read from cache and write to

> cache operations.

> 

> Datasheet: https://www.winbond.com/export/sites/winbond/datasheet/W35N01JW_Datasheet_Brief.pdf

> 

> Signed-off-by: Apurva Nandan <a-nandan@ti.com>

> ---

>  include/linux/mtd/spinand.h | 12 ++++++++++++

>  1 file changed, 12 insertions(+)

> 

> diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h

> index ebb19b2cec84..35816b8cfe81 100644

> --- a/include/linux/mtd/spinand.h

> +++ b/include/linux/mtd/spinand.h

> @@ -122,6 +122,12 @@

>  		   SPI_MEM_OP_DUMMY(ndummy, 4),				\

>  		   SPI_MEM_OP_DATA_IN(len, buf, 4))

>  

> +#define SPINAND_PAGE_READ_FROM_CACHE_OCTALIO_DTR_OP(addr, ndummy, buf, len) \

> +	SPI_MEM_OP(SPI_MEM_OP_CMD_DTR(2, 0x9d9d, 8),			\

> +		   SPI_MEM_OP_ADDR_DTR(2, addr, 8),			\

> +		   SPI_MEM_OP_DUMMY_DTR(ndummy, 8),			\

> +		   SPI_MEM_OP_DATA_IN_DTR(len, buf, 8))

> +

>  #define SPINAND_PROG_EXEC_OP(addr)					\

>  	SPI_MEM_OP(SPI_MEM_OP_CMD(0x10, 1),				\

>  		   SPI_MEM_OP_ADDR(3, addr, 1),				\

> @@ -140,6 +146,12 @@

>  		   SPI_MEM_OP_NO_DUMMY,					\

>  		   SPI_MEM_OP_DATA_OUT(len, buf, 4))

>  

> +#define SPINAND_PROG_LOAD_OCTALIO_DTR(reset, addr, buf, len)		\

> +	SPI_MEM_OP(SPI_MEM_OP_CMD_DTR(2, reset ? 0x0202 : 0x8484, 8),	\

> +		   SPI_MEM_OP_ADDR_DTR(2, addr, 8),			\

> +		   SPI_MEM_OP_NO_DUMMY,					\

> +		   SPI_MEM_OP_DATA_OUT_DTR(len, buf, 8))

> +

>  #define SPINAND_PROTO_BUSWIDTH_MASK	GENMASK(6, 0)

>  #define SPINAND_PROTO_DTR_BIT		BIT(7)

>  


Thanks,
Miquèl
Apurva Nandan Aug. 20, 2021, 10:35 a.m. UTC | #2
Hi Miquèl,

On 07/08/21 12:24 am, Miquel Raynal wrote:
> Hi Apurva,

> 

> Apurva Nandan <a-nandan@ti.com> wrote on Tue, 13 Jul 2021 13:05:31

> +0000:

> 

>> Define new PAGE_READ_FROM_CACHE and PROG_LOAD op templates for Octal

>> DTR SPI mode. These templates would used in op_variants and

> 

>                                  will be

> 


Yeah, ok!

>> op_templates for defining Octal DTR read from cache and write to

>> cache operations.

>>

>> Datasheet: https://www.winbond.com/export/sites/winbond/datasheet/W35N01JW_Datasheet_Brief.pdf

>>

>> Signed-off-by: Apurva Nandan <a-nandan@ti.com>

>> ---

>>   include/linux/mtd/spinand.h | 12 ++++++++++++

>>   1 file changed, 12 insertions(+)

>>

>> diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h

>> index ebb19b2cec84..35816b8cfe81 100644

>> --- a/include/linux/mtd/spinand.h

>> +++ b/include/linux/mtd/spinand.h

>> @@ -122,6 +122,12 @@

>>   		   SPI_MEM_OP_DUMMY(ndummy, 4),				\

>>   		   SPI_MEM_OP_DATA_IN(len, buf, 4))

>>   

>> +#define SPINAND_PAGE_READ_FROM_CACHE_OCTALIO_DTR_OP(addr, ndummy, buf, len) \

>> +	SPI_MEM_OP(SPI_MEM_OP_CMD_DTR(2, 0x9d9d, 8),			\

>> +		   SPI_MEM_OP_ADDR_DTR(2, addr, 8),			\

>> +		   SPI_MEM_OP_DUMMY_DTR(ndummy, 8),			\

>> +		   SPI_MEM_OP_DATA_IN_DTR(len, buf, 8))

>> +

>>   #define SPINAND_PROG_EXEC_OP(addr)					\

>>   	SPI_MEM_OP(SPI_MEM_OP_CMD(0x10, 1),				\

>>   		   SPI_MEM_OP_ADDR(3, addr, 1),				\

>> @@ -140,6 +146,12 @@

>>   		   SPI_MEM_OP_NO_DUMMY,					\

>>   		   SPI_MEM_OP_DATA_OUT(len, buf, 4))

>>   

>> +#define SPINAND_PROG_LOAD_OCTALIO_DTR(reset, addr, buf, len)		\

>> +	SPI_MEM_OP(SPI_MEM_OP_CMD_DTR(2, reset ? 0x0202 : 0x8484, 8),	\

>> +		   SPI_MEM_OP_ADDR_DTR(2, addr, 8),			\

>> +		   SPI_MEM_OP_NO_DUMMY,					\

>> +		   SPI_MEM_OP_DATA_OUT_DTR(len, buf, 8))

>> +

>>   #define SPINAND_PROTO_BUSWIDTH_MASK	GENMASK(6, 0)

>>   #define SPINAND_PROTO_DTR_BIT		BIT(7)

>>   

> 

> Thanks,

> Miquèl

> 

> ______________________________________________________

> Linux MTD discussion mailing list

> http://lists.infradead.org/mailman/listinfo/linux-mtd/

> 


Thanks,
Apurva Nandan
diff mbox series

Patch

diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index ebb19b2cec84..35816b8cfe81 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -122,6 +122,12 @@ 
 		   SPI_MEM_OP_DUMMY(ndummy, 4),				\
 		   SPI_MEM_OP_DATA_IN(len, buf, 4))
 
+#define SPINAND_PAGE_READ_FROM_CACHE_OCTALIO_DTR_OP(addr, ndummy, buf, len) \
+	SPI_MEM_OP(SPI_MEM_OP_CMD_DTR(2, 0x9d9d, 8),			\
+		   SPI_MEM_OP_ADDR_DTR(2, addr, 8),			\
+		   SPI_MEM_OP_DUMMY_DTR(ndummy, 8),			\
+		   SPI_MEM_OP_DATA_IN_DTR(len, buf, 8))
+
 #define SPINAND_PROG_EXEC_OP(addr)					\
 	SPI_MEM_OP(SPI_MEM_OP_CMD(0x10, 1),				\
 		   SPI_MEM_OP_ADDR(3, addr, 1),				\
@@ -140,6 +146,12 @@ 
 		   SPI_MEM_OP_NO_DUMMY,					\
 		   SPI_MEM_OP_DATA_OUT(len, buf, 4))
 
+#define SPINAND_PROG_LOAD_OCTALIO_DTR(reset, addr, buf, len)		\
+	SPI_MEM_OP(SPI_MEM_OP_CMD_DTR(2, reset ? 0x0202 : 0x8484, 8),	\
+		   SPI_MEM_OP_ADDR_DTR(2, addr, 8),			\
+		   SPI_MEM_OP_NO_DUMMY,					\
+		   SPI_MEM_OP_DATA_OUT_DTR(len, buf, 8))
+
 #define SPINAND_PROTO_BUSWIDTH_MASK	GENMASK(6, 0)
 #define SPINAND_PROTO_DTR_BIT		BIT(7)