* [PATCH 00/21] mtd: spinand: Add octal support
@ 2025-03-07 15:08 Miquel Raynal
2025-03-07 15:08 ` [PATCH 01/21] mtd: spinand: Use more specific naming for the reset op Miquel Raynal
` (20 more replies)
0 siblings, 21 replies; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
spi-mem and SPI NOR already have octal support, but there are octal SPI
NAND chips as well, which will be supported after this series. For now
we focus on SDR modes or mixed modes, where the opcode indicates the
content of the operation.
Support for three Winbond chips is added: W35NxxJW (xx: 01, 02, 04).
The series is mostly split into two parts:
- Renaming the op macros to clearly indicate the number of lines and
whether each subpart of the operation is SDR or DTR, in order to
clarify them.
This has been discussed and agreed upon with Tudor in a
previous discussion:
https://lore.kernel.org/linux-mtd/4ca13ef9-062f-4952-9588-c14f22867bf3@linaro.org/
- Progressive support for the various octal operations which can be
supported.
---
Miquel Raynal (21):
mtd: spinand: Use more specific naming for the reset op
mtd: spinand: Use more specific naming for the write enable/disable op
mtd: spinand: Use more specific naming for the read ID op
mtd: spinand: Use more specific naming for the get/set feature ops
mtd: spinand: Use more specific naming for the erase op
mtd: spinand: Use more specific naming for the page read op
mtd: spinand: Use more specific naming for the (single) read from cache ops
mtd: spinand: Use more specific naming for the (dual output) read from cache ops
mtd: spinand: Use more specific naming for the (dual IO) read from cache ops
mtd: spinand: Use more specific naming for the (quad output) read from cache ops
mtd: spinand: Use more specific naming for the (quad IO) read from cache ops
mtd: spinand: Use more specific naming for the program execution op
mtd: spinand: Use more specific naming for the (single) program load op
mtd: spinand: Use more specific naming for the (quad) program load op
mtd: spinand: winbond: Rename DTR variants
mtd: spinand: winbond: Add support for W35N01JW in single mode
mtd: spinand: Define octal read from cache operations
mtd: spinand: winbond: Add octal read support
mtd: spinand: Define octal load to cache operations
mtd: spinand: winbond: Add octal program support
mtd: spinand: winbond: Add support for W35N02JW and W35N02JW chips
drivers/mtd/nand/spi/alliancememory.c | 20 +++---
drivers/mtd/nand/spi/ato.c | 14 ++--
drivers/mtd/nand/spi/core.c | 18 ++---
drivers/mtd/nand/spi/esmt.c | 16 ++---
drivers/mtd/nand/spi/foresee.c | 16 ++---
drivers/mtd/nand/spi/gigadevice.c | 60 ++++++++--------
drivers/mtd/nand/spi/macronix.c | 16 ++---
drivers/mtd/nand/spi/micron.c | 34 ++++-----
drivers/mtd/nand/spi/paragon.c | 20 +++---
drivers/mtd/nand/spi/skyhigh.c | 20 +++---
drivers/mtd/nand/spi/toshiba.c | 22 +++---
drivers/mtd/nand/spi/winbond.c | 128 +++++++++++++++++++++++++++-------
drivers/mtd/nand/spi/xtx.c | 20 +++---
include/linux/mtd/spinand.h | 121 ++++++++++++++++++++------------
14 files changed, 318 insertions(+), 207 deletions(-)
---
base-commit: 342664f6de706e46a26bc906b6e4f4537ecc8a95
change-id: 20250214-winbond-6-14-rc1-octal-6f7db6be0204
Best regards,
--
Miquel Raynal <miquel.raynal@bootlin.com>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* [PATCH 01/21] mtd: spinand: Use more specific naming for the reset op
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-03-07 15:38 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 02/21] mtd: spinand: Use more specific naming for the write enable/disable op Miquel Raynal
` (19 subsequent siblings)
20 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
SPI operations have been initially described through macros implicitly
implying the use of a single SPI SDR bus. Macros for supporting dual and
quad I/O transfers have been added on top, generally inspired by vendor
vendor naming, followed by DTR operations. Soon we might see octal
and even octal DTR operations as well (including the opcode byte).
Let's clarify what the macro really means by describing the expected bus
topology in the reset macro name.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/core.c | 2 +-
include/linux/mtd/spinand.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 7a578f3522be93d30a9132cf01831515db77ae38..ea6b48242ad4a4e51c713907ce5cc55022cdb569 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -586,7 +586,7 @@ static int spinand_read_id_op(struct spinand_device *spinand, u8 naddr,
static int spinand_reset_op(struct spinand_device *spinand)
{
- struct spi_mem_op op = SPINAND_RESET_OP;
+ struct spi_mem_op op = SPINAND_RESET_1S_0_0_OP;
int ret;
ret = spi_mem_exec_op(spinand->spimem, &op);
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 0da8a1c7740ef5cbbdb2a74858465136638224f4..4f47adbe4566d7813ffd8fbfaddd1a85d88d0208 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -20,7 +20,7 @@
* Standard SPI NAND flash operations
*/
-#define SPINAND_RESET_OP \
+#define SPINAND_RESET_1S_0_0_OP \
SPI_MEM_OP(SPI_MEM_OP_CMD(0xff, 1), \
SPI_MEM_OP_NO_ADDR, \
SPI_MEM_OP_NO_DUMMY, \
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 02/21] mtd: spinand: Use more specific naming for the write enable/disable op
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
2025-03-07 15:08 ` [PATCH 01/21] mtd: spinand: Use more specific naming for the reset op Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-03-07 15:39 ` Tudor Ambarus
2025-03-20 12:22 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 03/21] mtd: spinand: Use more specific naming for the read ID op Miquel Raynal
` (18 subsequent siblings)
20 siblings, 2 replies; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
SPI operations have been initially described through macros implicitly
implying the use of a single SPI SDR bus. Macros for supporting dual and
quad I/O transfers have been added on top, generally inspired by vendor
naming, followed by DTR operations. Soon we might see octal
and even octal DTR operations as well (including the opcode byte).
Let's clarify what the macro really means by describing the expected bus
topology in the write enable/disable macro names.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/core.c | 2 +-
include/linux/mtd/spinand.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index ea6b48242ad4a4e51c713907ce5cc55022cdb569..bbf0048104aac86e90b0706793db8503c8fc2a3b 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -362,7 +362,7 @@ static void spinand_ondie_ecc_save_status(struct nand_device *nand, u8 status)
static int spinand_write_enable_op(struct spinand_device *spinand)
{
- struct spi_mem_op op = SPINAND_WR_EN_DIS_OP(true);
+ struct spi_mem_op op = SPINAND_WR_EN_DIS_1S_0_0_OP(true);
return spi_mem_exec_op(spinand->spimem, &op);
}
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 4f47adbe4566d7813ffd8fbfaddd1a85d88d0208..0d2f92d0746e8079e46bac9402ddd22d3d2a86bf 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -26,7 +26,7 @@
SPI_MEM_OP_NO_DUMMY, \
SPI_MEM_OP_NO_DATA)
-#define SPINAND_WR_EN_DIS_OP(enable) \
+#define SPINAND_WR_EN_DIS_1S_0_0_OP(enable) \
SPI_MEM_OP(SPI_MEM_OP_CMD((enable) ? 0x06 : 0x04, 1), \
SPI_MEM_OP_NO_ADDR, \
SPI_MEM_OP_NO_DUMMY, \
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 03/21] mtd: spinand: Use more specific naming for the read ID op
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
2025-03-07 15:08 ` [PATCH 01/21] mtd: spinand: Use more specific naming for the reset op Miquel Raynal
2025-03-07 15:08 ` [PATCH 02/21] mtd: spinand: Use more specific naming for the write enable/disable op Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-03-07 15:40 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 04/21] mtd: spinand: Use more specific naming for the get/set feature ops Miquel Raynal
` (17 subsequent siblings)
20 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
SPI operations have been initially described through macros implicitly
implying the use of a single SPI SDR bus. Macros for supporting dual and
quad I/O transfers have been added on top, generally inspired by vendor
naming, followed by DTR operations. Soon we might see octal
and even octal DTR operations as well (including the opcode byte).
Let's clarify what the macro really means by describing the expected bus
topology in the read ID macro name.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/core.c | 2 +-
include/linux/mtd/spinand.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index bbf0048104aac86e90b0706793db8503c8fc2a3b..cde7f0f08c1e45106ebba3b027b620fb8bb7cc51 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -573,7 +573,7 @@ static int spinand_wait(struct spinand_device *spinand,
static int spinand_read_id_op(struct spinand_device *spinand, u8 naddr,
u8 ndummy, u8 *buf)
{
- struct spi_mem_op op = SPINAND_READID_OP(
+ struct spi_mem_op op = SPINAND_READID_1S_1S_1S_OP(
naddr, ndummy, spinand->scratchbuf, SPINAND_MAX_ID_LEN);
int ret;
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 0d2f92d0746e8079e46bac9402ddd22d3d2a86bf..8035b626cf7d8523e7df367bc2dec8b731d84d11 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -32,7 +32,7 @@
SPI_MEM_OP_NO_DUMMY, \
SPI_MEM_OP_NO_DATA)
-#define SPINAND_READID_OP(naddr, ndummy, buf, len) \
+#define SPINAND_READID_1S_1S_1S_OP(naddr, ndummy, buf, len) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x9f, 1), \
SPI_MEM_OP_ADDR(naddr, 0, 1), \
SPI_MEM_OP_DUMMY(ndummy, 1), \
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 04/21] mtd: spinand: Use more specific naming for the get/set feature ops
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
` (2 preceding siblings ...)
2025-03-07 15:08 ` [PATCH 03/21] mtd: spinand: Use more specific naming for the read ID op Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-03-07 15:42 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 05/21] mtd: spinand: Use more specific naming for the erase op Miquel Raynal
` (16 subsequent siblings)
20 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
SPI operations have been initially described through macros implicitly
implying the use of a single SPI SDR bus. Macros for supporting dual and
quad I/O transfers have been added on top, generally inspired by vendor
naming, followed by DTR operations. Soon we might see octal
and even octal DTR operations as well (including the opcode byte).
Let's clarify what the macro really mean by describing the expected bus
topology in the get/set feature macro names.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/core.c | 6 +++---
drivers/mtd/nand/spi/gigadevice.c | 4 ++--
drivers/mtd/nand/spi/micron.c | 2 +-
drivers/mtd/nand/spi/toshiba.c | 2 +-
drivers/mtd/nand/spi/winbond.c | 2 +-
include/linux/mtd/spinand.h | 4 ++--
6 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index cde7f0f08c1e45106ebba3b027b620fb8bb7cc51..b6c0993206ebab1dcee715ea6de33efe7d5af3a2 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -22,7 +22,7 @@
static int spinand_read_reg_op(struct spinand_device *spinand, u8 reg, u8 *val)
{
- struct spi_mem_op op = SPINAND_GET_FEATURE_OP(reg,
+ struct spi_mem_op op = SPINAND_GET_FEATURE_1S_1S_1S_OP(reg,
spinand->scratchbuf);
int ret;
@@ -36,7 +36,7 @@ static int spinand_read_reg_op(struct spinand_device *spinand, u8 reg, u8 *val)
int spinand_write_reg_op(struct spinand_device *spinand, u8 reg, u8 val)
{
- struct spi_mem_op op = SPINAND_SET_FEATURE_OP(reg,
+ struct spi_mem_op op = SPINAND_SET_FEATURE_1S_1S_1S_OP(reg,
spinand->scratchbuf);
*spinand->scratchbuf = val;
@@ -539,7 +539,7 @@ static int spinand_wait(struct spinand_device *spinand,
unsigned long poll_delay_us,
u8 *s)
{
- struct spi_mem_op op = SPINAND_GET_FEATURE_OP(REG_STATUS,
+ struct spi_mem_op op = SPINAND_GET_FEATURE_1S_1S_1S_OP(REG_STATUS,
spinand->scratchbuf);
u8 status;
int ret;
diff --git a/drivers/mtd/nand/spi/gigadevice.c b/drivers/mtd/nand/spi/gigadevice.c
index d620bb02a20a0df04e8d0af187ee277d6ef430f2..73a483227831518a480dc34de17efdaa398b5627 100644
--- a/drivers/mtd/nand/spi/gigadevice.c
+++ b/drivers/mtd/nand/spi/gigadevice.c
@@ -185,7 +185,7 @@ static int gd5fxgq4uexxg_ecc_get_status(struct spinand_device *spinand,
u8 status)
{
u8 status2;
- struct spi_mem_op op = SPINAND_GET_FEATURE_OP(GD5FXGQXXEXXG_REG_STATUS2,
+ struct spi_mem_op op = SPINAND_GET_FEATURE_1S_1S_1S_OP(GD5FXGQXXEXXG_REG_STATUS2,
spinand->scratchbuf);
int ret;
@@ -228,7 +228,7 @@ static int gd5fxgq5xexxg_ecc_get_status(struct spinand_device *spinand,
u8 status)
{
u8 status2;
- struct spi_mem_op op = SPINAND_GET_FEATURE_OP(GD5FXGQXXEXXG_REG_STATUS2,
+ struct spi_mem_op op = SPINAND_GET_FEATURE_1S_1S_1S_OP(GD5FXGQXXEXXG_REG_STATUS2,
spinand->scratchbuf);
int ret;
diff --git a/drivers/mtd/nand/spi/micron.c b/drivers/mtd/nand/spi/micron.c
index ad0bb9755a099dc668e4a0b0a56928f968fba824..6ec20fad837bc534cfa0bc7cc629622a7dfab5da 100644
--- a/drivers/mtd/nand/spi/micron.c
+++ b/drivers/mtd/nand/spi/micron.c
@@ -131,7 +131,7 @@ static const struct mtd_ooblayout_ops micron_4_ooblayout = {
static int micron_select_target(struct spinand_device *spinand,
unsigned int target)
{
- struct spi_mem_op op = SPINAND_SET_FEATURE_OP(MICRON_DIE_SELECT_REG,
+ struct spi_mem_op op = SPINAND_SET_FEATURE_1S_1S_1S_OP(MICRON_DIE_SELECT_REG,
spinand->scratchbuf);
if (target > 1)
diff --git a/drivers/mtd/nand/spi/toshiba.c b/drivers/mtd/nand/spi/toshiba.c
index 2e2106b2705f0852aa5b13263d29d8916c1a6e7d..a600aa771519fa04a1caafb8c8e636eab10359c4 100644
--- a/drivers/mtd/nand/spi/toshiba.c
+++ b/drivers/mtd/nand/spi/toshiba.c
@@ -73,7 +73,7 @@ static int tx58cxgxsxraix_ecc_get_status(struct spinand_device *spinand,
{
struct nand_device *nand = spinand_to_nand(spinand);
u8 mbf = 0;
- struct spi_mem_op op = SPINAND_GET_FEATURE_OP(0x30, spinand->scratchbuf);
+ struct spi_mem_op op = SPINAND_GET_FEATURE_1S_1S_1S_OP(0x30, spinand->scratchbuf);
switch (status & STATUS_ECC_MASK) {
case STATUS_ECC_NO_BITFLIPS:
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 8394a1b1fb0c125ddb614269069d107463e905a3..5816b489b57b0070ddeda745cf17c04efc5080cd 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -146,7 +146,7 @@ static int w25n02kv_ecc_get_status(struct spinand_device *spinand,
{
struct nand_device *nand = spinand_to_nand(spinand);
u8 mbf = 0;
- struct spi_mem_op op = SPINAND_GET_FEATURE_OP(0x30, spinand->scratchbuf);
+ struct spi_mem_op op = SPINAND_GET_FEATURE_1S_1S_1S_OP(0x30, spinand->scratchbuf);
switch (status & STATUS_ECC_MASK) {
case STATUS_ECC_NO_BITFLIPS:
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 8035b626cf7d8523e7df367bc2dec8b731d84d11..d041b1cc18de6add45800eaa7605bda1c64ca257 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -38,13 +38,13 @@
SPI_MEM_OP_DUMMY(ndummy, 1), \
SPI_MEM_OP_DATA_IN(len, buf, 1))
-#define SPINAND_SET_FEATURE_OP(reg, valptr) \
+#define SPINAND_SET_FEATURE_1S_1S_1S_OP(reg, valptr) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x1f, 1), \
SPI_MEM_OP_ADDR(1, reg, 1), \
SPI_MEM_OP_NO_DUMMY, \
SPI_MEM_OP_DATA_OUT(1, valptr, 1))
-#define SPINAND_GET_FEATURE_OP(reg, valptr) \
+#define SPINAND_GET_FEATURE_1S_1S_1S_OP(reg, valptr) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x0f, 1), \
SPI_MEM_OP_ADDR(1, reg, 1), \
SPI_MEM_OP_NO_DUMMY, \
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 05/21] mtd: spinand: Use more specific naming for the erase op
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
` (3 preceding siblings ...)
2025-03-07 15:08 ` [PATCH 04/21] mtd: spinand: Use more specific naming for the get/set feature ops Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-03-07 15:45 ` Tudor Ambarus
2025-03-20 12:23 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 06/21] mtd: spinand: Use more specific naming for the page read op Miquel Raynal
` (15 subsequent siblings)
20 siblings, 2 replies; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
SPI operations have been initially described through macros implicitly
implying the use of a single SPI SDR bus. Macros for supporting dual and
quad I/O transfers have been added on top, generally inspired by vendor
naming, followed by DTR operations. Soon we might see octal
and even octal DTR operations as well (including the opcode byte).
Let's clarify what the macro really means by describing the expected bus
topology in the erase macro name.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/core.c | 2 +-
include/linux/mtd/spinand.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index b6c0993206ebab1dcee715ea6de33efe7d5af3a2..1959e8d9c64be004c71a0d6ac6454fde08e708fa 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -529,7 +529,7 @@ static int spinand_erase_op(struct spinand_device *spinand,
{
struct nand_device *nand = spinand_to_nand(spinand);
unsigned int row = nanddev_pos_to_row(nand, pos);
- struct spi_mem_op op = SPINAND_BLK_ERASE_OP(row);
+ struct spi_mem_op op = SPINAND_BLK_ERASE_1S_1S_0_OP(row);
return spi_mem_exec_op(spinand->spimem, &op);
}
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index d041b1cc18de6add45800eaa7605bda1c64ca257..545531afe2dac593d112065483afd180226cc533 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -50,7 +50,7 @@
SPI_MEM_OP_NO_DUMMY, \
SPI_MEM_OP_DATA_IN(1, valptr, 1))
-#define SPINAND_BLK_ERASE_OP(addr) \
+#define SPINAND_BLK_ERASE_1S_1S_0_OP(addr) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0xd8, 1), \
SPI_MEM_OP_ADDR(3, addr, 1), \
SPI_MEM_OP_NO_DUMMY, \
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 06/21] mtd: spinand: Use more specific naming for the page read op
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
` (4 preceding siblings ...)
2025-03-07 15:08 ` [PATCH 05/21] mtd: spinand: Use more specific naming for the erase op Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-03-20 12:28 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 07/21] mtd: spinand: Use more specific naming for the (single) read from cache ops Miquel Raynal
` (14 subsequent siblings)
20 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
SPI operations have been initially described through macros implicitly
implying the use of a single SPI SDR bus. Macros for supporting dual and
quad I/O transfers have been added on top, generally inspired by vendor
naming, followed by DTR operations. Soon we might see octal
and even octal DTR operations as well (including the opcode byte).
Let's clarify what the macro really means by describing the expected bus
topology in the page read macro name.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/core.c | 2 +-
include/linux/mtd/spinand.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 1959e8d9c64be004c71a0d6ac6454fde08e708fa..2ebc802299068ef69068422d1ef6585f63365832 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -372,7 +372,7 @@ static int spinand_load_page_op(struct spinand_device *spinand,
{
struct nand_device *nand = spinand_to_nand(spinand);
unsigned int row = nanddev_pos_to_row(nand, &req->pos);
- struct spi_mem_op op = SPINAND_PAGE_READ_OP(row);
+ struct spi_mem_op op = SPINAND_PAGE_READ_1S_1S_0_OP(row);
return spi_mem_exec_op(spinand->spimem, &op);
}
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 545531afe2dac593d112065483afd180226cc533..882b635228860f45e52d516421c1fc3b2c723b9b 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -56,7 +56,7 @@
SPI_MEM_OP_NO_DUMMY, \
SPI_MEM_OP_NO_DATA)
-#define SPINAND_PAGE_READ_OP(addr) \
+#define SPINAND_PAGE_READ_1S_1S_0_OP(addr) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x13, 1), \
SPI_MEM_OP_ADDR(3, addr, 1), \
SPI_MEM_OP_NO_DUMMY, \
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 07/21] mtd: spinand: Use more specific naming for the (single) read from cache ops
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
` (5 preceding siblings ...)
2025-03-07 15:08 ` [PATCH 06/21] mtd: spinand: Use more specific naming for the page read op Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-04-02 15:05 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 08/21] mtd: spinand: Use more specific naming for the (dual output) " Miquel Raynal
` (13 subsequent siblings)
20 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
SPI operations have been initially described through macros implicitly
implying the use of a single SPI SDR bus. Macros for supporting dual and
quad I/O transfers have been added on top, generally inspired by vendor
naming, followed by DTR operations. Soon we might see octal
and even octal DTR operations as well (including the opcode byte).
Let's clarify what the macro really mean by describing the expected bus
topology in the (single) read from cache macro names.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/alliancememory.c | 4 ++--
drivers/mtd/nand/spi/ato.c | 4 ++--
drivers/mtd/nand/spi/esmt.c | 4 ++--
drivers/mtd/nand/spi/foresee.c | 4 ++--
drivers/mtd/nand/spi/gigadevice.c | 16 ++++++++--------
drivers/mtd/nand/spi/macronix.c | 4 ++--
drivers/mtd/nand/spi/micron.c | 8 ++++----
drivers/mtd/nand/spi/paragon.c | 4 ++--
drivers/mtd/nand/spi/skyhigh.c | 4 ++--
drivers/mtd/nand/spi/toshiba.c | 4 ++--
drivers/mtd/nand/spi/winbond.c | 10 +++++-----
drivers/mtd/nand/spi/xtx.c | 4 ++--
include/linux/mtd/spinand.h | 12 ++++++------
13 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/drivers/mtd/nand/spi/alliancememory.c b/drivers/mtd/nand/spi/alliancememory.c
index 6046c73f8424e9fb338ec3a1d35dc6fe30a2e1bc..723c740308d26e901fd3d9a402ddd48e8e69060f 100644
--- a/drivers/mtd/nand/spi/alliancememory.c
+++ b/drivers/mtd/nand/spi/alliancememory.c
@@ -21,8 +21,8 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_OP(0, 1, NULL, 0));
+ SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
diff --git a/drivers/mtd/nand/spi/ato.c b/drivers/mtd/nand/spi/ato.c
index bb5298911137f08c1793d244b33dddf1971e2fed..9026a14aca07ce011af151eb6dfe56797e0e70c0 100644
--- a/drivers/mtd/nand/spi/ato.c
+++ b/drivers/mtd/nand/spi/ato.c
@@ -15,8 +15,8 @@
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_OP(0, 1, NULL, 0));
+ SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
diff --git a/drivers/mtd/nand/spi/esmt.c b/drivers/mtd/nand/spi/esmt.c
index 323a20901fc9fcc252b8317d9434aabf5e30a495..aad751f95269b3f501aff01753c4bf0ff9484fbe 100644
--- a/drivers/mtd/nand/spi/esmt.c
+++ b/drivers/mtd/nand/spi/esmt.c
@@ -15,8 +15,8 @@
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_OP(0, 1, NULL, 0));
+ SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
diff --git a/drivers/mtd/nand/spi/foresee.c b/drivers/mtd/nand/spi/foresee.c
index ecd5f6bffa33423abddf750b34b823a640fa2c23..8a9725ea29bac5901d67304db95ed5573bd7fa40 100644
--- a/drivers/mtd/nand/spi/foresee.c
+++ b/drivers/mtd/nand/spi/foresee.c
@@ -14,8 +14,8 @@
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_OP(0, 1, NULL, 0));
+ SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
diff --git a/drivers/mtd/nand/spi/gigadevice.c b/drivers/mtd/nand/spi/gigadevice.c
index 73a483227831518a480dc34de17efdaa398b5627..76856f1de8fefc6404345e363b2c873cc3c02e52 100644
--- a/drivers/mtd/nand/spi/gigadevice.c
+++ b/drivers/mtd/nand/spi/gigadevice.c
@@ -28,32 +28,32 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_OP(0, 1, NULL, 0));
+ SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(read_cache_variants_f,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP_3A(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X2_OP_3A(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_FAST_OP_3A(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_OP_3A(0, 0, NULL, 0));
+ SPINAND_PAGE_READ_FROM_CACHE_FAST_3A_1S_1S_1S_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_3A_1S_1S_1S_OP(0, 0, NULL, 0));
static SPINAND_OP_VARIANTS(read_cache_variants_1gq5,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_OP(0, 1, NULL, 0));
+ SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(read_cache_variants_2gq5,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 4, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_OP(0, 1, NULL, 0));
+ SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
diff --git a/drivers/mtd/nand/spi/macronix.c b/drivers/mtd/nand/spi/macronix.c
index 3dc4d63d6832d0213387f335fd233f1c4306bfff..59bd476a29f03967a3f5a814872f9a6039b0a585 100644
--- a/drivers/mtd/nand/spi/macronix.c
+++ b/drivers/mtd/nand/spi/macronix.c
@@ -28,8 +28,8 @@ struct macronix_priv {
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_OP(0, 1, NULL, 0));
+ SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
diff --git a/drivers/mtd/nand/spi/micron.c b/drivers/mtd/nand/spi/micron.c
index 6ec20fad837bc534cfa0bc7cc629622a7dfab5da..d7dbd22db1a3f8457c8947f4044dd8442dc475cb 100644
--- a/drivers/mtd/nand/spi/micron.c
+++ b/drivers/mtd/nand/spi/micron.c
@@ -33,8 +33,8 @@ static SPINAND_OP_VARIANTS(quadio_read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_OP(0, 1, NULL, 0));
+ SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(x4_write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
@@ -48,8 +48,8 @@ static SPINAND_OP_VARIANTS(x4_update_cache_variants,
static SPINAND_OP_VARIANTS(x4_read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_OP(0, 1, NULL, 0));
+ SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(x1_write_cache_variants,
SPINAND_PROG_LOAD(true, 0, NULL, 0));
diff --git a/drivers/mtd/nand/spi/paragon.c b/drivers/mtd/nand/spi/paragon.c
index 6e7cc6995380c00ae40fe362f711a490ff463130..ae3527d6d5fa358be482eb8cf0ba4e1e2304e441 100644
--- a/drivers/mtd/nand/spi/paragon.c
+++ b/drivers/mtd/nand/spi/paragon.c
@@ -26,8 +26,8 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_OP(0, 1, NULL, 0));
+ SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
diff --git a/drivers/mtd/nand/spi/skyhigh.c b/drivers/mtd/nand/spi/skyhigh.c
index 961df0d74984a8dc8484ac5d7323d172012058e5..ffbedb8d92f659967f6aa0c80d5b0aa7d088929c 100644
--- a/drivers/mtd/nand/spi/skyhigh.c
+++ b/drivers/mtd/nand/spi/skyhigh.c
@@ -21,8 +21,8 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_OP(0, 1, NULL, 0));
+ SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
diff --git a/drivers/mtd/nand/spi/toshiba.c b/drivers/mtd/nand/spi/toshiba.c
index a600aa771519fa04a1caafb8c8e636eab10359c4..bc5adadf6084f48ff482d6846be1c6d2e9157e85 100644
--- a/drivers/mtd/nand/spi/toshiba.c
+++ b/drivers/mtd/nand/spi/toshiba.c
@@ -17,8 +17,8 @@
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_OP(0, 1, NULL, 0));
+ SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_x4_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 5816b489b57b0070ddeda745cf17c04efc5080cd..8379a1d12dd563e573c6d37cf099759088176da4 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -32,17 +32,17 @@ static SPINAND_OP_VARIANTS(read_cache_dtr_variants,
SPINAND_PAGE_READ_FROM_CACHE_X2_DTR_OP(0, 2, NULL, 0, 80 * HZ_PER_MHZ),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_DTR_OP(0, 2, NULL, 0, 80 * HZ_PER_MHZ),
- SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_OP(0, 1, NULL, 0, 54 * HZ_PER_MHZ));
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1D_1D_OP(0, 2, NULL, 0, 80 * HZ_PER_MHZ),
+ SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0, 54 * HZ_PER_MHZ));
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_OP(0, 1, NULL, 0));
+ SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
diff --git a/drivers/mtd/nand/spi/xtx.c b/drivers/mtd/nand/spi/xtx.c
index 3f539ca0de861c082217701607f96c2a6b7c5378..a0003f52ae8f52ab00374fedc457476136a78568 100644
--- a/drivers/mtd/nand/spi/xtx.c
+++ b/drivers/mtd/nand/spi/xtx.c
@@ -27,8 +27,8 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_OP(0, 1, NULL, 0));
+ SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 882b635228860f45e52d516421c1fc3b2c723b9b..9465fae82ceef773f729ab04661b30464df6b45b 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -62,32 +62,32 @@
SPI_MEM_OP_NO_DUMMY, \
SPI_MEM_OP_NO_DATA)
-#define SPINAND_PAGE_READ_FROM_CACHE_OP(addr, ndummy, buf, len, ...) \
+#define SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(addr, ndummy, buf, len, ...) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x03, 1), \
SPI_MEM_OP_ADDR(2, addr, 1), \
SPI_MEM_OP_DUMMY(ndummy, 1), \
SPI_MEM_OP_DATA_IN(len, buf, 1), \
__VA_OPT__(SPI_MEM_OP_MAX_FREQ(__VA_ARGS__)))
-#define SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(addr, ndummy, buf, len) \
- SPI_MEM_OP(SPI_MEM_OP_CMD(0x0b, 1), \
+#define SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(addr, ndummy, buf, len) \
+ SPI_MEM_OP(SPI_MEM_OP_CMD(0x0b, 1), \
SPI_MEM_OP_ADDR(2, addr, 1), \
SPI_MEM_OP_DUMMY(ndummy, 1), \
SPI_MEM_OP_DATA_IN(len, buf, 1))
-#define SPINAND_PAGE_READ_FROM_CACHE_OP_3A(addr, ndummy, buf, len) \
+#define SPINAND_PAGE_READ_FROM_CACHE_3A_1S_1S_1S_OP(addr, ndummy, buf, len) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x03, 1), \
SPI_MEM_OP_ADDR(3, addr, 1), \
SPI_MEM_OP_DUMMY(ndummy, 1), \
SPI_MEM_OP_DATA_IN(len, buf, 1))
-#define SPINAND_PAGE_READ_FROM_CACHE_FAST_OP_3A(addr, ndummy, buf, len) \
+#define SPINAND_PAGE_READ_FROM_CACHE_FAST_3A_1S_1S_1S_OP(addr, ndummy, buf, len) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x0b, 1), \
SPI_MEM_OP_ADDR(3, addr, 1), \
SPI_MEM_OP_DUMMY(ndummy, 1), \
SPI_MEM_OP_DATA_IN(len, buf, 1))
-#define SPINAND_PAGE_READ_FROM_CACHE_DTR_OP(addr, ndummy, buf, len, freq) \
+#define SPINAND_PAGE_READ_FROM_CACHE_1S_1D_1D_OP(addr, ndummy, buf, len, freq) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x0d, 1), \
SPI_MEM_DTR_OP_ADDR(2, addr, 1), \
SPI_MEM_DTR_OP_DUMMY(ndummy, 1), \
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 08/21] mtd: spinand: Use more specific naming for the (dual output) read from cache ops
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
` (6 preceding siblings ...)
2025-03-07 15:08 ` [PATCH 07/21] mtd: spinand: Use more specific naming for the (single) read from cache ops Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-04-02 15:06 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 09/21] mtd: spinand: Use more specific naming for the (dual IO) " Miquel Raynal
` (12 subsequent siblings)
20 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
SPI operations have been initially described through macros implicitly
implying the use of a single SPI SDR bus. Macros for supporting dual and
quad I/O transfers have been added on top, generally inspired by vendor
naming, followed by DTR operations. Soon we might see octal
and even octal DTR operations as well (including the opcode byte).
Let's clarify what the macro really mean by describing the expected bus
topology in the (dual output) read from cache macro names.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/alliancememory.c | 2 +-
drivers/mtd/nand/spi/esmt.c | 2 +-
drivers/mtd/nand/spi/foresee.c | 2 +-
drivers/mtd/nand/spi/gigadevice.c | 8 ++++----
drivers/mtd/nand/spi/macronix.c | 2 +-
drivers/mtd/nand/spi/micron.c | 4 ++--
drivers/mtd/nand/spi/paragon.c | 2 +-
drivers/mtd/nand/spi/skyhigh.c | 2 +-
drivers/mtd/nand/spi/toshiba.c | 2 +-
drivers/mtd/nand/spi/winbond.c | 6 +++---
drivers/mtd/nand/spi/xtx.c | 2 +-
include/linux/mtd/spinand.h | 6 +++---
12 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/drivers/mtd/nand/spi/alliancememory.c b/drivers/mtd/nand/spi/alliancememory.c
index 723c740308d26e901fd3d9a402ddd48e8e69060f..9709774dcf30be370c999f7ab445c1e684ef2210 100644
--- a/drivers/mtd/nand/spi/alliancememory.c
+++ b/drivers/mtd/nand/spi/alliancememory.c
@@ -20,7 +20,7 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/esmt.c b/drivers/mtd/nand/spi/esmt.c
index aad751f95269b3f501aff01753c4bf0ff9484fbe..41fb4173af34429265c8db60851747e147c5a36c 100644
--- a/drivers/mtd/nand/spi/esmt.c
+++ b/drivers/mtd/nand/spi/esmt.c
@@ -14,7 +14,7 @@
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/foresee.c b/drivers/mtd/nand/spi/foresee.c
index 8a9725ea29bac5901d67304db95ed5573bd7fa40..729dfde4292108fe588b317dbe8731b4f6535246 100644
--- a/drivers/mtd/nand/spi/foresee.c
+++ b/drivers/mtd/nand/spi/foresee.c
@@ -13,7 +13,7 @@
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/gigadevice.c b/drivers/mtd/nand/spi/gigadevice.c
index 76856f1de8fefc6404345e363b2c873cc3c02e52..d357f914765b294ec4288276cd826555bb50f735 100644
--- a/drivers/mtd/nand/spi/gigadevice.c
+++ b/drivers/mtd/nand/spi/gigadevice.c
@@ -27,7 +27,7 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
@@ -35,7 +35,7 @@ static SPINAND_OP_VARIANTS(read_cache_variants_f,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP_3A(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X2_OP_3A(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_3A_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_3A_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_3A_1S_1S_1S_OP(0, 0, NULL, 0));
@@ -43,7 +43,7 @@ static SPINAND_OP_VARIANTS(read_cache_variants_1gq5,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
@@ -51,7 +51,7 @@ static SPINAND_OP_VARIANTS(read_cache_variants_2gq5,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 4, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 2, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/macronix.c b/drivers/mtd/nand/spi/macronix.c
index 59bd476a29f03967a3f5a814872f9a6039b0a585..4d7820e8952871df2ccd9b17610fa403d347574f 100644
--- a/drivers/mtd/nand/spi/macronix.c
+++ b/drivers/mtd/nand/spi/macronix.c
@@ -27,7 +27,7 @@ struct macronix_priv {
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/micron.c b/drivers/mtd/nand/spi/micron.c
index d7dbd22db1a3f8457c8947f4044dd8442dc475cb..8d06091cef05365f58fa3f593f2c8de9413af099 100644
--- a/drivers/mtd/nand/spi/micron.c
+++ b/drivers/mtd/nand/spi/micron.c
@@ -32,7 +32,7 @@ static SPINAND_OP_VARIANTS(quadio_read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
@@ -47,7 +47,7 @@ static SPINAND_OP_VARIANTS(x4_update_cache_variants,
/* Micron MT29F2G01AAAED Device */
static SPINAND_OP_VARIANTS(x4_read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/paragon.c b/drivers/mtd/nand/spi/paragon.c
index ae3527d6d5fa358be482eb8cf0ba4e1e2304e441..b4daee6c9b2f4782bbb2ed3400c71406e34f0fdd 100644
--- a/drivers/mtd/nand/spi/paragon.c
+++ b/drivers/mtd/nand/spi/paragon.c
@@ -25,7 +25,7 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/skyhigh.c b/drivers/mtd/nand/spi/skyhigh.c
index ffbedb8d92f659967f6aa0c80d5b0aa7d088929c..e03343f0c404ad62d0567ef83045e4db7a675c46 100644
--- a/drivers/mtd/nand/spi/skyhigh.c
+++ b/drivers/mtd/nand/spi/skyhigh.c
@@ -20,7 +20,7 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 4, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 2, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/toshiba.c b/drivers/mtd/nand/spi/toshiba.c
index bc5adadf6084f48ff482d6846be1c6d2e9157e85..a497de9241b65f9fa6e8ae43f629b4a35977d375 100644
--- a/drivers/mtd/nand/spi/toshiba.c
+++ b/drivers/mtd/nand/spi/toshiba.c
@@ -16,7 +16,7 @@
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 8379a1d12dd563e573c6d37cf099759088176da4..66f272ed734a8f95d974153005a8fea637bef0d2 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -29,9 +29,9 @@ static SPINAND_OP_VARIANTS(read_cache_dtr_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_DTR_OP(0, 4, NULL, 0, 80 * HZ_PER_MHZ),
- SPINAND_PAGE_READ_FROM_CACHE_X2_DTR_OP(0, 2, NULL, 0, 80 * HZ_PER_MHZ),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1D_2D_OP(0, 2, NULL, 0, 80 * HZ_PER_MHZ),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1D_1D_OP(0, 2, NULL, 0, 80 * HZ_PER_MHZ),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0, 54 * HZ_PER_MHZ));
@@ -40,7 +40,7 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/xtx.c b/drivers/mtd/nand/spi/xtx.c
index a0003f52ae8f52ab00374fedc457476136a78568..08dc4a3efbb0238b21eaedcd2b76d4ed7b4b0294 100644
--- a/drivers/mtd/nand/spi/xtx.c
+++ b/drivers/mtd/nand/spi/xtx.c
@@ -26,7 +26,7 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 9465fae82ceef773f729ab04661b30464df6b45b..118dd16dd3298c9cd586dad1b36fb624c7c08d01 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -94,19 +94,19 @@
SPI_MEM_DTR_OP_DATA_IN(len, buf, 1), \
SPI_MEM_OP_MAX_FREQ(freq))
-#define SPINAND_PAGE_READ_FROM_CACHE_X2_OP(addr, ndummy, buf, len) \
+#define SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(addr, ndummy, buf, len) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x3b, 1), \
SPI_MEM_OP_ADDR(2, addr, 1), \
SPI_MEM_OP_DUMMY(ndummy, 1), \
SPI_MEM_OP_DATA_IN(len, buf, 2))
-#define SPINAND_PAGE_READ_FROM_CACHE_X2_OP_3A(addr, ndummy, buf, len) \
+#define SPINAND_PAGE_READ_FROM_CACHE_3A_1S_1S_2S_OP(addr, ndummy, buf, len) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x3b, 1), \
SPI_MEM_OP_ADDR(3, addr, 1), \
SPI_MEM_OP_DUMMY(ndummy, 1), \
SPI_MEM_OP_DATA_IN(len, buf, 2))
-#define SPINAND_PAGE_READ_FROM_CACHE_X2_DTR_OP(addr, ndummy, buf, len, freq) \
+#define SPINAND_PAGE_READ_FROM_CACHE_1S_1D_2D_OP(addr, ndummy, buf, len, freq) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x3d, 1), \
SPI_MEM_DTR_OP_ADDR(2, addr, 1), \
SPI_MEM_DTR_OP_DUMMY(ndummy, 1), \
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 09/21] mtd: spinand: Use more specific naming for the (dual IO) read from cache ops
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
` (7 preceding siblings ...)
2025-03-07 15:08 ` [PATCH 08/21] mtd: spinand: Use more specific naming for the (dual output) " Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-04-02 15:07 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 10/21] mtd: spinand: Use more specific naming for the (quad output) " Miquel Raynal
` (11 subsequent siblings)
20 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
SPI operations have been initially described through macros implicitly
implying the use of a single SPI SDR bus. Macros for supporting dual and
quad I/O transfers have been added on top, generally inspired by vendor
naming, followed by DTR operations. Soon we might see octal
and even octal DTR operations as well (including the opcode byte).
Let's clarify what the macro really mean by describing the expected bus
topology in the (dual IO) read from cache macro names. While at
modifying them, better reordering the macros to group them all by bus
topology which now feels more intuitive.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/alliancememory.c | 2 +-
drivers/mtd/nand/spi/gigadevice.c | 8 ++++----
drivers/mtd/nand/spi/micron.c | 2 +-
drivers/mtd/nand/spi/paragon.c | 2 +-
drivers/mtd/nand/spi/skyhigh.c | 2 +-
drivers/mtd/nand/spi/winbond.c | 6 +++---
drivers/mtd/nand/spi/xtx.c | 2 +-
include/linux/mtd/spinand.h | 38 +++++++++++++++++------------------
8 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/drivers/mtd/nand/spi/alliancememory.c b/drivers/mtd/nand/spi/alliancememory.c
index 9709774dcf30be370c999f7ab445c1e684ef2210..c83e83d85d5b2703df90b0fc2ebc84056c45ab11 100644
--- a/drivers/mtd/nand/spi/alliancememory.c
+++ b/drivers/mtd/nand/spi/alliancememory.c
@@ -19,7 +19,7 @@
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/gigadevice.c b/drivers/mtd/nand/spi/gigadevice.c
index d357f914765b294ec4288276cd826555bb50f735..13fdb44b945ff4d4ee5b614c7b50112ed69bcc24 100644
--- a/drivers/mtd/nand/spi/gigadevice.c
+++ b/drivers/mtd/nand/spi/gigadevice.c
@@ -26,7 +26,7 @@
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
@@ -34,7 +34,7 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
static SPINAND_OP_VARIANTS(read_cache_variants_f,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP_3A(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_3A_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_3A_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_3A_1S_1S_1S_OP(0, 0, NULL, 0));
@@ -42,7 +42,7 @@ static SPINAND_OP_VARIANTS(read_cache_variants_f,
static SPINAND_OP_VARIANTS(read_cache_variants_1gq5,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
@@ -50,7 +50,7 @@ static SPINAND_OP_VARIANTS(read_cache_variants_1gq5,
static SPINAND_OP_VARIANTS(read_cache_variants_2gq5,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 4, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 2, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/micron.c b/drivers/mtd/nand/spi/micron.c
index 8d06091cef05365f58fa3f593f2c8de9413af099..9cdaf2fed92b8cca4d02c85bd1ff8b80da3eb318 100644
--- a/drivers/mtd/nand/spi/micron.c
+++ b/drivers/mtd/nand/spi/micron.c
@@ -31,7 +31,7 @@
static SPINAND_OP_VARIANTS(quadio_read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/paragon.c b/drivers/mtd/nand/spi/paragon.c
index b4daee6c9b2f4782bbb2ed3400c71406e34f0fdd..f3545b28124b341ebd030895eba06c35604b500c 100644
--- a/drivers/mtd/nand/spi/paragon.c
+++ b/drivers/mtd/nand/spi/paragon.c
@@ -24,7 +24,7 @@
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/skyhigh.c b/drivers/mtd/nand/spi/skyhigh.c
index e03343f0c404ad62d0567ef83045e4db7a675c46..2f414815a035e3ea479dfa58a19457eb239ee348 100644
--- a/drivers/mtd/nand/spi/skyhigh.c
+++ b/drivers/mtd/nand/spi/skyhigh.c
@@ -19,7 +19,7 @@
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 4, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 2, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 66f272ed734a8f95d974153005a8fea637bef0d2..90db8216722d59e3d1fc8c9568e72b59f0baaada 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -28,9 +28,9 @@ static SPINAND_OP_VARIANTS(read_cache_dtr_variants,
SPINAND_PAGE_READ_FROM_CACHE_X4_DTR_OP(0, 2, NULL, 0, 80 * HZ_PER_MHZ),
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_DUALIO_DTR_OP(0, 4, NULL, 0, 80 * HZ_PER_MHZ),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_2D_2D_OP(0, 4, NULL, 0, 80 * HZ_PER_MHZ),
SPINAND_PAGE_READ_FROM_CACHE_1S_1D_2D_OP(0, 2, NULL, 0, 80 * HZ_PER_MHZ),
- SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1D_1D_OP(0, 2, NULL, 0, 80 * HZ_PER_MHZ),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
@@ -39,7 +39,7 @@ static SPINAND_OP_VARIANTS(read_cache_dtr_variants,
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/xtx.c b/drivers/mtd/nand/spi/xtx.c
index 08dc4a3efbb0238b21eaedcd2b76d4ed7b4b0294..d4c7cbd4c9851c0f4763ccaf3cdb7bce5fdd37ff 100644
--- a/drivers/mtd/nand/spi/xtx.c
+++ b/drivers/mtd/nand/spi/xtx.c
@@ -25,7 +25,7 @@
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 118dd16dd3298c9cd586dad1b36fb624c7c08d01..a147e39ee8836335546f83a5e02d025e28865782 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -113,6 +113,25 @@
SPI_MEM_DTR_OP_DATA_IN(len, buf, 2), \
SPI_MEM_OP_MAX_FREQ(freq))
+#define SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(addr, ndummy, buf, len) \
+ SPI_MEM_OP(SPI_MEM_OP_CMD(0xbb, 1), \
+ SPI_MEM_OP_ADDR(2, addr, 2), \
+ SPI_MEM_OP_DUMMY(ndummy, 2), \
+ SPI_MEM_OP_DATA_IN(len, buf, 2))
+
+#define SPINAND_PAGE_READ_FROM_CACHE_3A_1S_2S_2S_OP(addr, ndummy, buf, len) \
+ SPI_MEM_OP(SPI_MEM_OP_CMD(0xbb, 1), \
+ SPI_MEM_OP_ADDR(3, addr, 2), \
+ SPI_MEM_OP_DUMMY(ndummy, 2), \
+ SPI_MEM_OP_DATA_IN(len, buf, 2))
+
+#define SPINAND_PAGE_READ_FROM_CACHE_1S_2D_2D_OP(addr, ndummy, buf, len, freq) \
+ SPI_MEM_OP(SPI_MEM_OP_CMD(0xbd, 1), \
+ SPI_MEM_DTR_OP_ADDR(2, addr, 2), \
+ SPI_MEM_DTR_OP_DUMMY(ndummy, 2), \
+ SPI_MEM_DTR_OP_DATA_IN(len, buf, 2), \
+ SPI_MEM_OP_MAX_FREQ(freq))
+
#define SPINAND_PAGE_READ_FROM_CACHE_X4_OP(addr, ndummy, buf, len) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x6b, 1), \
SPI_MEM_OP_ADDR(2, addr, 1), \
@@ -132,25 +151,6 @@
SPI_MEM_DTR_OP_DATA_IN(len, buf, 4), \
SPI_MEM_OP_MAX_FREQ(freq))
-#define SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(addr, ndummy, buf, len) \
- SPI_MEM_OP(SPI_MEM_OP_CMD(0xbb, 1), \
- SPI_MEM_OP_ADDR(2, addr, 2), \
- SPI_MEM_OP_DUMMY(ndummy, 2), \
- SPI_MEM_OP_DATA_IN(len, buf, 2))
-
-#define SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP_3A(addr, ndummy, buf, len) \
- SPI_MEM_OP(SPI_MEM_OP_CMD(0xbb, 1), \
- SPI_MEM_OP_ADDR(3, addr, 2), \
- SPI_MEM_OP_DUMMY(ndummy, 2), \
- SPI_MEM_OP_DATA_IN(len, buf, 2))
-
-#define SPINAND_PAGE_READ_FROM_CACHE_DUALIO_DTR_OP(addr, ndummy, buf, len, freq) \
- SPI_MEM_OP(SPI_MEM_OP_CMD(0xbd, 1), \
- SPI_MEM_DTR_OP_ADDR(2, addr, 2), \
- SPI_MEM_DTR_OP_DUMMY(ndummy, 2), \
- SPI_MEM_DTR_OP_DATA_IN(len, buf, 2), \
- SPI_MEM_OP_MAX_FREQ(freq))
-
#define SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(addr, ndummy, buf, len) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0xeb, 1), \
SPI_MEM_OP_ADDR(2, addr, 4), \
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 10/21] mtd: spinand: Use more specific naming for the (quad output) read from cache ops
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
` (8 preceding siblings ...)
2025-03-07 15:08 ` [PATCH 09/21] mtd: spinand: Use more specific naming for the (dual IO) " Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-04-02 15:07 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 11/21] mtd: spinand: Use more specific naming for the (quad IO) " Miquel Raynal
` (10 subsequent siblings)
20 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
SPI operations have been initially described through macros implicitly
implying the use of a single SPI SDR bus. Macros for supporting dual and
quad I/O transfers have been added on top, generally inspired by vendor
naming, followed by DTR operations. Soon we might see octal
and even octal DTR operations as well (including the opcode byte).
Let's clarify what the macro really mean by describing the expected bus
topology in the (quad output) read from cache macro names.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/alliancememory.c | 2 +-
drivers/mtd/nand/spi/ato.c | 2 +-
drivers/mtd/nand/spi/esmt.c | 2 +-
drivers/mtd/nand/spi/foresee.c | 2 +-
drivers/mtd/nand/spi/gigadevice.c | 8 ++++----
drivers/mtd/nand/spi/macronix.c | 2 +-
drivers/mtd/nand/spi/micron.c | 4 ++--
drivers/mtd/nand/spi/paragon.c | 2 +-
drivers/mtd/nand/spi/skyhigh.c | 2 +-
drivers/mtd/nand/spi/toshiba.c | 2 +-
drivers/mtd/nand/spi/winbond.c | 6 +++---
drivers/mtd/nand/spi/xtx.c | 2 +-
include/linux/mtd/spinand.h | 6 +++---
13 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/drivers/mtd/nand/spi/alliancememory.c b/drivers/mtd/nand/spi/alliancememory.c
index c83e83d85d5b2703df90b0fc2ebc84056c45ab11..66df707c8370bdf7b2583f021076d1d277010de4 100644
--- a/drivers/mtd/nand/spi/alliancememory.c
+++ b/drivers/mtd/nand/spi/alliancememory.c
@@ -18,7 +18,7 @@
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
diff --git a/drivers/mtd/nand/spi/ato.c b/drivers/mtd/nand/spi/ato.c
index 9026a14aca07ce011af151eb6dfe56797e0e70c0..88dc51308e1b84dd8abb3fd32297c9fd43a131f5 100644
--- a/drivers/mtd/nand/spi/ato.c
+++ b/drivers/mtd/nand/spi/ato.c
@@ -14,7 +14,7 @@
static SPINAND_OP_VARIANTS(read_cache_variants,
- SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/esmt.c b/drivers/mtd/nand/spi/esmt.c
index 41fb4173af34429265c8db60851747e147c5a36c..8b409a418b1c16914cfd6ba1c588f58d76388d59 100644
--- a/drivers/mtd/nand/spi/esmt.c
+++ b/drivers/mtd/nand/spi/esmt.c
@@ -13,7 +13,7 @@
#define SPINAND_MFR_ESMT_C8 0xc8
static SPINAND_OP_VARIANTS(read_cache_variants,
- SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/foresee.c b/drivers/mtd/nand/spi/foresee.c
index 729dfde4292108fe588b317dbe8731b4f6535246..21ad44032286ffb7c98f1944624fe9ecb507d6ce 100644
--- a/drivers/mtd/nand/spi/foresee.c
+++ b/drivers/mtd/nand/spi/foresee.c
@@ -12,7 +12,7 @@
#define SPINAND_MFR_FORESEE 0xCD
static SPINAND_OP_VARIANTS(read_cache_variants,
- SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/gigadevice.c b/drivers/mtd/nand/spi/gigadevice.c
index 13fdb44b945ff4d4ee5b614c7b50112ed69bcc24..f808a14d26e6ecb223a4b185b34fb03b876f5576 100644
--- a/drivers/mtd/nand/spi/gigadevice.c
+++ b/drivers/mtd/nand/spi/gigadevice.c
@@ -25,7 +25,7 @@
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
@@ -33,7 +33,7 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
static SPINAND_OP_VARIANTS(read_cache_variants_f,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X4_OP_3A(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_3A_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_3A_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_3A_1S_1S_1S_OP(0, 1, NULL, 0),
@@ -41,7 +41,7 @@ static SPINAND_OP_VARIANTS(read_cache_variants_f,
static SPINAND_OP_VARIANTS(read_cache_variants_1gq5,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
@@ -49,7 +49,7 @@ static SPINAND_OP_VARIANTS(read_cache_variants_1gq5,
static SPINAND_OP_VARIANTS(read_cache_variants_2gq5,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 4, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
diff --git a/drivers/mtd/nand/spi/macronix.c b/drivers/mtd/nand/spi/macronix.c
index 4d7820e8952871df2ccd9b17610fa403d347574f..aaee30b64abe6061c0a83525ff3de1307278581c 100644
--- a/drivers/mtd/nand/spi/macronix.c
+++ b/drivers/mtd/nand/spi/macronix.c
@@ -26,7 +26,7 @@ struct macronix_priv {
};
static SPINAND_OP_VARIANTS(read_cache_variants,
- SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/micron.c b/drivers/mtd/nand/spi/micron.c
index 9cdaf2fed92b8cca4d02c85bd1ff8b80da3eb318..79c5dcba5fa6923c6cf2aacbf8be7ba84cb14bb6 100644
--- a/drivers/mtd/nand/spi/micron.c
+++ b/drivers/mtd/nand/spi/micron.c
@@ -30,7 +30,7 @@
static SPINAND_OP_VARIANTS(quadio_read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
@@ -46,7 +46,7 @@ static SPINAND_OP_VARIANTS(x4_update_cache_variants,
/* Micron MT29F2G01AAAED Device */
static SPINAND_OP_VARIANTS(x4_read_cache_variants,
- SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/paragon.c b/drivers/mtd/nand/spi/paragon.c
index f3545b28124b341ebd030895eba06c35604b500c..dc84e70bb132381992859b3379c1afd38f1a161c 100644
--- a/drivers/mtd/nand/spi/paragon.c
+++ b/drivers/mtd/nand/spi/paragon.c
@@ -23,7 +23,7 @@
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
diff --git a/drivers/mtd/nand/spi/skyhigh.c b/drivers/mtd/nand/spi/skyhigh.c
index 2f414815a035e3ea479dfa58a19457eb239ee348..c179a067db809a5f92ec21d69ac6e030bd0dcd1a 100644
--- a/drivers/mtd/nand/spi/skyhigh.c
+++ b/drivers/mtd/nand/spi/skyhigh.c
@@ -18,7 +18,7 @@
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 4, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
diff --git a/drivers/mtd/nand/spi/toshiba.c b/drivers/mtd/nand/spi/toshiba.c
index a497de9241b65f9fa6e8ae43f629b4a35977d375..8bba0d4011ce239c8fa6f1fc453bc0b610c76f9c 100644
--- a/drivers/mtd/nand/spi/toshiba.c
+++ b/drivers/mtd/nand/spi/toshiba.c
@@ -15,7 +15,7 @@
#define TOSH_STATUS_ECC_HAS_BITFLIPS_T (3 << 4)
static SPINAND_OP_VARIANTS(read_cache_variants,
- SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 90db8216722d59e3d1fc8c9568e72b59f0baaada..2b9bba6931887bf549f12d55fe84578edb81dbcf 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -25,9 +25,9 @@
static SPINAND_OP_VARIANTS(read_cache_dtr_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_DTR_OP(0, 8, NULL, 0, 80 * HZ_PER_MHZ),
- SPINAND_PAGE_READ_FROM_CACHE_X4_DTR_OP(0, 2, NULL, 0, 80 * HZ_PER_MHZ),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1D_4D_OP(0, 2, NULL, 0, 80 * HZ_PER_MHZ),
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2D_2D_OP(0, 4, NULL, 0, 80 * HZ_PER_MHZ),
SPINAND_PAGE_READ_FROM_CACHE_1S_1D_2D_OP(0, 2, NULL, 0, 80 * HZ_PER_MHZ),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
@@ -38,7 +38,7 @@ static SPINAND_OP_VARIANTS(read_cache_dtr_variants,
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
diff --git a/drivers/mtd/nand/spi/xtx.c b/drivers/mtd/nand/spi/xtx.c
index d4c7cbd4c9851c0f4763ccaf3cdb7bce5fdd37ff..4e38b2e0ca7323e5d2ffe5292e8f67f6318b7f7b 100644
--- a/drivers/mtd/nand/spi/xtx.c
+++ b/drivers/mtd/nand/spi/xtx.c
@@ -24,7 +24,7 @@
static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
- SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index a147e39ee8836335546f83a5e02d025e28865782..49083dadfbec7b951aadf4a245b59014122407fc 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -132,19 +132,19 @@
SPI_MEM_DTR_OP_DATA_IN(len, buf, 2), \
SPI_MEM_OP_MAX_FREQ(freq))
-#define SPINAND_PAGE_READ_FROM_CACHE_X4_OP(addr, ndummy, buf, len) \
+#define SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(addr, ndummy, buf, len) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x6b, 1), \
SPI_MEM_OP_ADDR(2, addr, 1), \
SPI_MEM_OP_DUMMY(ndummy, 1), \
SPI_MEM_OP_DATA_IN(len, buf, 4))
-#define SPINAND_PAGE_READ_FROM_CACHE_X4_OP_3A(addr, ndummy, buf, len) \
+#define SPINAND_PAGE_READ_FROM_CACHE_3A_1S_1S_4S_OP(addr, ndummy, buf, len) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x6b, 1), \
SPI_MEM_OP_ADDR(3, addr, 1), \
SPI_MEM_OP_DUMMY(ndummy, 1), \
SPI_MEM_OP_DATA_IN(len, buf, 4))
-#define SPINAND_PAGE_READ_FROM_CACHE_X4_DTR_OP(addr, ndummy, buf, len, freq) \
+#define SPINAND_PAGE_READ_FROM_CACHE_1S_1D_4D_OP(addr, ndummy, buf, len, freq) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x6d, 1), \
SPI_MEM_DTR_OP_ADDR(2, addr, 1), \
SPI_MEM_DTR_OP_DUMMY(ndummy, 1), \
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 11/21] mtd: spinand: Use more specific naming for the (quad IO) read from cache ops
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
` (9 preceding siblings ...)
2025-03-07 15:08 ` [PATCH 10/21] mtd: spinand: Use more specific naming for the (quad output) " Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-04-02 15:08 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 12/21] mtd: spinand: Use more specific naming for the program execution op Miquel Raynal
` (9 subsequent siblings)
20 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
SPI operations have been initially described through macros implicitly
implying the use of a single SPI SDR bus. Macros for supporting dual and
quad I/O transfers have been added on top, generally inspired by vendor
naming, followed by DTR operations. Soon we might see octal
and even octal DTR operations as well (including the opcode byte).
Let's clarify what the macro really mean by describing the expected bus
topology in the (quad IO) read from cache macro names.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/alliancememory.c | 2 +-
drivers/mtd/nand/spi/gigadevice.c | 8 ++++----
drivers/mtd/nand/spi/micron.c | 2 +-
drivers/mtd/nand/spi/paragon.c | 2 +-
drivers/mtd/nand/spi/skyhigh.c | 2 +-
drivers/mtd/nand/spi/winbond.c | 6 +++---
drivers/mtd/nand/spi/xtx.c | 2 +-
include/linux/mtd/spinand.h | 6 +++---
8 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/mtd/nand/spi/alliancememory.c b/drivers/mtd/nand/spi/alliancememory.c
index 66df707c8370bdf7b2583f021076d1d277010de4..0f9522009843bc11750de87be000d209cbf1ca5c 100644
--- a/drivers/mtd/nand/spi/alliancememory.c
+++ b/drivers/mtd/nand/spi/alliancememory.c
@@ -17,7 +17,7 @@
#define AM_STATUS_ECC_MAX_CORRECTED (3 << 4)
static SPINAND_OP_VARIANTS(read_cache_variants,
- SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_4S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
diff --git a/drivers/mtd/nand/spi/gigadevice.c b/drivers/mtd/nand/spi/gigadevice.c
index f808a14d26e6ecb223a4b185b34fb03b876f5576..2e87c89a86d61944c6b18653c3ab3b5b49d29529 100644
--- a/drivers/mtd/nand/spi/gigadevice.c
+++ b/drivers/mtd/nand/spi/gigadevice.c
@@ -24,7 +24,7 @@
#define GD5FXGQ4UXFXXG_STATUS_ECC_UNCOR_ERROR (7 << 4)
static SPINAND_OP_VARIANTS(read_cache_variants,
- SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_4S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
@@ -32,7 +32,7 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(read_cache_variants_f,
- SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_4S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_3A_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_3A_1S_1S_2S_OP(0, 1, NULL, 0),
@@ -40,7 +40,7 @@ static SPINAND_OP_VARIANTS(read_cache_variants_f,
SPINAND_PAGE_READ_FROM_CACHE_3A_1S_1S_1S_OP(0, 0, NULL, 0));
static SPINAND_OP_VARIANTS(read_cache_variants_1gq5,
- SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_4S_4S_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
@@ -48,7 +48,7 @@ static SPINAND_OP_VARIANTS(read_cache_variants_1gq5,
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(read_cache_variants_2gq5,
- SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 4, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_4S_4S_OP(0, 4, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
diff --git a/drivers/mtd/nand/spi/micron.c b/drivers/mtd/nand/spi/micron.c
index 79c5dcba5fa6923c6cf2aacbf8be7ba84cb14bb6..5af50c13bd372a86d8883e2f15dbbb0fc5e0799c 100644
--- a/drivers/mtd/nand/spi/micron.c
+++ b/drivers/mtd/nand/spi/micron.c
@@ -29,7 +29,7 @@
#define MICRON_SELECT_DIE(x) ((x) << 6)
static SPINAND_OP_VARIANTS(quadio_read_cache_variants,
- SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_4S_4S_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
diff --git a/drivers/mtd/nand/spi/paragon.c b/drivers/mtd/nand/spi/paragon.c
index dc84e70bb132381992859b3379c1afd38f1a161c..b5ea248618036d2b4d5758ec752e29c2088a6750 100644
--- a/drivers/mtd/nand/spi/paragon.c
+++ b/drivers/mtd/nand/spi/paragon.c
@@ -22,7 +22,7 @@
static SPINAND_OP_VARIANTS(read_cache_variants,
- SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_4S_4S_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
diff --git a/drivers/mtd/nand/spi/skyhigh.c b/drivers/mtd/nand/spi/skyhigh.c
index c179a067db809a5f92ec21d69ac6e030bd0dcd1a..ac73f43e9365c7922cb531e8edb95f763480d50e 100644
--- a/drivers/mtd/nand/spi/skyhigh.c
+++ b/drivers/mtd/nand/spi/skyhigh.c
@@ -17,7 +17,7 @@
#define SKYHIGH_CONFIG_PROTECT_EN BIT(1)
static SPINAND_OP_VARIANTS(read_cache_variants,
- SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 4, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_4S_4S_OP(0, 4, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 2b9bba6931887bf549f12d55fe84578edb81dbcf..dd0bc95a723e4f4d67d0247cbb3f869f823b9001 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -24,9 +24,9 @@
*/
static SPINAND_OP_VARIANTS(read_cache_dtr_variants,
- SPINAND_PAGE_READ_FROM_CACHE_QUADIO_DTR_OP(0, 8, NULL, 0, 80 * HZ_PER_MHZ),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_4D_4D_OP(0, 8, NULL, 0, 80 * HZ_PER_MHZ),
SPINAND_PAGE_READ_FROM_CACHE_1S_1D_4D_OP(0, 2, NULL, 0, 80 * HZ_PER_MHZ),
- SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_4S_4S_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2D_2D_OP(0, 4, NULL, 0, 80 * HZ_PER_MHZ),
SPINAND_PAGE_READ_FROM_CACHE_1S_1D_2D_OP(0, 2, NULL, 0, 80 * HZ_PER_MHZ),
@@ -37,7 +37,7 @@ static SPINAND_OP_VARIANTS(read_cache_dtr_variants,
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0, 54 * HZ_PER_MHZ));
static SPINAND_OP_VARIANTS(read_cache_variants,
- SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_4S_4S_OP(0, 2, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
diff --git a/drivers/mtd/nand/spi/xtx.c b/drivers/mtd/nand/spi/xtx.c
index 4e38b2e0ca7323e5d2ffe5292e8f67f6318b7f7b..abbbcd594c2c1fcaf68ca5244ed89508348244a3 100644
--- a/drivers/mtd/nand/spi/xtx.c
+++ b/drivers/mtd/nand/spi/xtx.c
@@ -23,7 +23,7 @@
#define XT26XXXD_STATUS_ECC_UNCOR_ERROR (2)
static SPINAND_OP_VARIANTS(read_cache_variants,
- SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_4S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0),
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 49083dadfbec7b951aadf4a245b59014122407fc..fe3194c97411d1b7d42ff4a28a831ffc60e570b0 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -151,19 +151,19 @@
SPI_MEM_DTR_OP_DATA_IN(len, buf, 4), \
SPI_MEM_OP_MAX_FREQ(freq))
-#define SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(addr, ndummy, buf, len) \
+#define SPINAND_PAGE_READ_FROM_CACHE_1S_4S_4S_OP(addr, ndummy, buf, len) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0xeb, 1), \
SPI_MEM_OP_ADDR(2, addr, 4), \
SPI_MEM_OP_DUMMY(ndummy, 4), \
SPI_MEM_OP_DATA_IN(len, buf, 4))
-#define SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP_3A(addr, ndummy, buf, len) \
+#define SPINAND_PAGE_READ_FROM_CACHE_3A_1S_4S_4S_OP(addr, ndummy, buf, len) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0xeb, 1), \
SPI_MEM_OP_ADDR(3, addr, 4), \
SPI_MEM_OP_DUMMY(ndummy, 4), \
SPI_MEM_OP_DATA_IN(len, buf, 4))
-#define SPINAND_PAGE_READ_FROM_CACHE_QUADIO_DTR_OP(addr, ndummy, buf, len, freq) \
+#define SPINAND_PAGE_READ_FROM_CACHE_1S_4D_4D_OP(addr, ndummy, buf, len, freq) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0xed, 1), \
SPI_MEM_DTR_OP_ADDR(2, addr, 4), \
SPI_MEM_DTR_OP_DUMMY(ndummy, 4), \
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 12/21] mtd: spinand: Use more specific naming for the program execution op
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
` (10 preceding siblings ...)
2025-03-07 15:08 ` [PATCH 11/21] mtd: spinand: Use more specific naming for the (quad IO) " Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-04-02 15:12 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 13/21] mtd: spinand: Use more specific naming for the (single) program load op Miquel Raynal
` (8 subsequent siblings)
20 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
SPI operations have been initially described through macros implicitly
implying the use of a single SPI SDR bus. Macros for supporting dual and
quad I/O transfers have been added on top, generally inspired by vendor
naming, followed by DTR operations. Soon we might see octal
and even octal DTR operations as well (including the opcode byte).
Let's clarify what the macro really means by describing the expected bus
topology in the program execution macro name.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/core.c | 2 +-
include/linux/mtd/spinand.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 2ebc802299068ef69068422d1ef6585f63365832..854d56f87de5ba2c61bba52a7573d8e2d465bc20 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -519,7 +519,7 @@ static int spinand_program_op(struct spinand_device *spinand,
{
struct nand_device *nand = spinand_to_nand(spinand);
unsigned int row = nanddev_pos_to_row(nand, &req->pos);
- struct spi_mem_op op = SPINAND_PROG_EXEC_OP(row);
+ struct spi_mem_op op = SPINAND_PROG_EXEC_1S_1S_0_OP(row);
return spi_mem_exec_op(spinand->spimem, &op);
}
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index fe3194c97411d1b7d42ff4a28a831ffc60e570b0..e1578e896609c4a43c75635fd4f5bbb82e29b7c6 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -170,7 +170,7 @@
SPI_MEM_DTR_OP_DATA_IN(len, buf, 4), \
SPI_MEM_OP_MAX_FREQ(freq))
-#define SPINAND_PROG_EXEC_OP(addr) \
+#define SPINAND_PROG_EXEC_1S_1S_0_OP(addr) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x10, 1), \
SPI_MEM_OP_ADDR(3, addr, 1), \
SPI_MEM_OP_NO_DUMMY, \
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 13/21] mtd: spinand: Use more specific naming for the (single) program load op
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
` (11 preceding siblings ...)
2025-03-07 15:08 ` [PATCH 12/21] mtd: spinand: Use more specific naming for the program execution op Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-04-02 15:13 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 14/21] mtd: spinand: Use more specific naming for the (quad) " Miquel Raynal
` (7 subsequent siblings)
20 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
SPI operations have been initially described through macros implicitly
implying the use of a single SPI SDR bus. Macros for supporting dual and
quad I/O transfers have been added on top, generally inspired by vendor
naming, followed by DTR operations. Soon we might see octal
and even octal DTR operations as well (including the opcode byte).
Let's clarify what the macro really means by describing the expected bus
topology in the (single) program load macro name.
While at modifying it, better add the missing_ OP suffix to align with
all the other macros of the same kind.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/alliancememory.c | 4 ++--
drivers/mtd/nand/spi/ato.c | 4 ++--
drivers/mtd/nand/spi/esmt.c | 4 ++--
drivers/mtd/nand/spi/foresee.c | 4 ++--
drivers/mtd/nand/spi/gigadevice.c | 4 ++--
drivers/mtd/nand/spi/macronix.c | 4 ++--
drivers/mtd/nand/spi/micron.c | 8 ++++----
drivers/mtd/nand/spi/paragon.c | 4 ++--
drivers/mtd/nand/spi/skyhigh.c | 4 ++--
drivers/mtd/nand/spi/toshiba.c | 8 ++++----
drivers/mtd/nand/spi/winbond.c | 4 ++--
drivers/mtd/nand/spi/xtx.c | 4 ++--
include/linux/mtd/spinand.h | 2 +-
13 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/drivers/mtd/nand/spi/alliancememory.c b/drivers/mtd/nand/spi/alliancememory.c
index 0f9522009843bc11750de87be000d209cbf1ca5c..437e935aefab57f80876e0eb84a9c37d11211864 100644
--- a/drivers/mtd/nand/spi/alliancememory.c
+++ b/drivers/mtd/nand/spi/alliancememory.c
@@ -26,11 +26,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
- SPINAND_PROG_LOAD(true, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
- SPINAND_PROG_LOAD(false, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static int am_get_eccsize(struct mtd_info *mtd)
{
diff --git a/drivers/mtd/nand/spi/ato.c b/drivers/mtd/nand/spi/ato.c
index 88dc51308e1b84dd8abb3fd32297c9fd43a131f5..cf51cc6ae66d3d35a4e912472fef80f7a8e3eeb9 100644
--- a/drivers/mtd/nand/spi/ato.c
+++ b/drivers/mtd/nand/spi/ato.c
@@ -20,11 +20,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
- SPINAND_PROG_LOAD(true, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
- SPINAND_PROG_LOAD(false, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static int ato25d1ga_ooblayout_ecc(struct mtd_info *mtd, int section,
diff --git a/drivers/mtd/nand/spi/esmt.c b/drivers/mtd/nand/spi/esmt.c
index 8b409a418b1c16914cfd6ba1c588f58d76388d59..64dd54181c8feb48a531a203e1b6437db490363a 100644
--- a/drivers/mtd/nand/spi/esmt.c
+++ b/drivers/mtd/nand/spi/esmt.c
@@ -20,11 +20,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
- SPINAND_PROG_LOAD(true, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
- SPINAND_PROG_LOAD(false, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
/*
* OOB spare area map (64 bytes)
diff --git a/drivers/mtd/nand/spi/foresee.c b/drivers/mtd/nand/spi/foresee.c
index 21ad44032286ffb7c98f1944624fe9ecb507d6ce..dba8ea5142eef8a109d66f3262f264b8a16680b2 100644
--- a/drivers/mtd/nand/spi/foresee.c
+++ b/drivers/mtd/nand/spi/foresee.c
@@ -19,11 +19,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
- SPINAND_PROG_LOAD(true, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
- SPINAND_PROG_LOAD(false, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static int f35sqa002g_ooblayout_ecc(struct mtd_info *mtd, int section,
struct mtd_oob_region *region)
diff --git a/drivers/mtd/nand/spi/gigadevice.c b/drivers/mtd/nand/spi/gigadevice.c
index 2e87c89a86d61944c6b18653c3ab3b5b49d29529..44ef38cddc900e86c1a7a52a7c7fb68c42d82a43 100644
--- a/drivers/mtd/nand/spi/gigadevice.c
+++ b/drivers/mtd/nand/spi/gigadevice.c
@@ -57,11 +57,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants_2gq5,
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
- SPINAND_PROG_LOAD(true, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
- SPINAND_PROG_LOAD(false, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static int gd5fxgq4xa_ooblayout_ecc(struct mtd_info *mtd, int section,
struct mtd_oob_region *region)
diff --git a/drivers/mtd/nand/spi/macronix.c b/drivers/mtd/nand/spi/macronix.c
index aaee30b64abe6061c0a83525ff3de1307278581c..577437107ec5fc1d8771dc7899731c88bd3e55b6 100644
--- a/drivers/mtd/nand/spi/macronix.c
+++ b/drivers/mtd/nand/spi/macronix.c
@@ -33,11 +33,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
- SPINAND_PROG_LOAD(false, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
- SPINAND_PROG_LOAD(false, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static int mx35lfxge4ab_ooblayout_ecc(struct mtd_info *mtd, int section,
struct mtd_oob_region *region)
diff --git a/drivers/mtd/nand/spi/micron.c b/drivers/mtd/nand/spi/micron.c
index 5af50c13bd372a86d8883e2f15dbbb0fc5e0799c..56bbd7e7843faeb34cc8fb3ec16aa2dc98196ebb 100644
--- a/drivers/mtd/nand/spi/micron.c
+++ b/drivers/mtd/nand/spi/micron.c
@@ -38,11 +38,11 @@ static SPINAND_OP_VARIANTS(quadio_read_cache_variants,
static SPINAND_OP_VARIANTS(x4_write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
- SPINAND_PROG_LOAD(true, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(x4_update_cache_variants,
SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
- SPINAND_PROG_LOAD(false, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
/* Micron MT29F2G01AAAED Device */
static SPINAND_OP_VARIANTS(x4_read_cache_variants,
@@ -52,10 +52,10 @@ static SPINAND_OP_VARIANTS(x4_read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(x1_write_cache_variants,
- SPINAND_PROG_LOAD(true, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(x1_update_cache_variants,
- SPINAND_PROG_LOAD(false, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static int micron_8_ooblayout_ecc(struct mtd_info *mtd, int section,
struct mtd_oob_region *region)
diff --git a/drivers/mtd/nand/spi/paragon.c b/drivers/mtd/nand/spi/paragon.c
index b5ea248618036d2b4d5758ec752e29c2088a6750..eaddb12d6e9a15365470c1a695a55c009794daca 100644
--- a/drivers/mtd/nand/spi/paragon.c
+++ b/drivers/mtd/nand/spi/paragon.c
@@ -31,11 +31,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
- SPINAND_PROG_LOAD(true, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
- SPINAND_PROG_LOAD(false, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static int pn26g0xa_ooblayout_ecc(struct mtd_info *mtd, int section,
diff --git a/drivers/mtd/nand/spi/skyhigh.c b/drivers/mtd/nand/spi/skyhigh.c
index ac73f43e9365c7922cb531e8edb95f763480d50e..3b9b83d499a2f86c0bd9387d1d94bedd0eccc108 100644
--- a/drivers/mtd/nand/spi/skyhigh.c
+++ b/drivers/mtd/nand/spi/skyhigh.c
@@ -26,11 +26,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
- SPINAND_PROG_LOAD(true, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
- SPINAND_PROG_LOAD(false, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static int skyhigh_spinand_ooblayout_ecc(struct mtd_info *mtd, int section,
struct mtd_oob_region *region)
diff --git a/drivers/mtd/nand/spi/toshiba.c b/drivers/mtd/nand/spi/toshiba.c
index 8bba0d4011ce239c8fa6f1fc453bc0b610c76f9c..cb1157fb34e3c9365d0cb47e1f37d8b745aa975e 100644
--- a/drivers/mtd/nand/spi/toshiba.c
+++ b/drivers/mtd/nand/spi/toshiba.c
@@ -22,21 +22,21 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
static SPINAND_OP_VARIANTS(write_cache_x4_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
- SPINAND_PROG_LOAD(true, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_x4_variants,
SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
- SPINAND_PROG_LOAD(false, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
/*
* Backward compatibility for 1st generation Serial NAND devices
* which don't support Quad Program Load operation.
*/
static SPINAND_OP_VARIANTS(write_cache_variants,
- SPINAND_PROG_LOAD(true, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
- SPINAND_PROG_LOAD(false, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static int tx58cxgxsxraix_ooblayout_ecc(struct mtd_info *mtd, int section,
struct mtd_oob_region *region)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index dd0bc95a723e4f4d67d0247cbb3f869f823b9001..adc20b4f28adb339ce81c5c1de5d28cfa3c36b31 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -46,11 +46,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
- SPINAND_PROG_LOAD(true, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
- SPINAND_PROG_LOAD(false, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static int w25m02gv_ooblayout_ecc(struct mtd_info *mtd, int section,
struct mtd_oob_region *region)
diff --git a/drivers/mtd/nand/spi/xtx.c b/drivers/mtd/nand/spi/xtx.c
index abbbcd594c2c1fcaf68ca5244ed89508348244a3..931b85e82ac5811dc2ce668270157a73ab9b5474 100644
--- a/drivers/mtd/nand/spi/xtx.c
+++ b/drivers/mtd/nand/spi/xtx.c
@@ -32,11 +32,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
static SPINAND_OP_VARIANTS(write_cache_variants,
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
- SPINAND_PROG_LOAD(true, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
- SPINAND_PROG_LOAD(false, 0, NULL, 0));
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static int xt26g0xa_ooblayout_ecc(struct mtd_info *mtd, int section,
struct mtd_oob_region *region)
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index e1578e896609c4a43c75635fd4f5bbb82e29b7c6..b564825d13b711b7a8403d8cf1f3af178c68847f 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -176,7 +176,7 @@
SPI_MEM_OP_NO_DUMMY, \
SPI_MEM_OP_NO_DATA)
-#define SPINAND_PROG_LOAD(reset, addr, buf, len) \
+#define SPINAND_PROG_LOAD_1S_1S_1S_OP(reset, addr, buf, len) \
SPI_MEM_OP(SPI_MEM_OP_CMD(reset ? 0x02 : 0x84, 1), \
SPI_MEM_OP_ADDR(2, addr, 1), \
SPI_MEM_OP_NO_DUMMY, \
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 14/21] mtd: spinand: Use more specific naming for the (quad) program load op
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
` (12 preceding siblings ...)
2025-03-07 15:08 ` [PATCH 13/21] mtd: spinand: Use more specific naming for the (single) program load op Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-04-02 15:13 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 15/21] mtd: spinand: winbond: Rename DTR variants Miquel Raynal
` (6 subsequent siblings)
20 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
SPI operations have been initially described through macros implicitly
implying the use of a single SPI SDR bus. Macros for supporting dual and
quad I/O transfers have been added on top, generally inspired by vendor
naming, followed by DTR operations. Soon we might see octal
and even octal DTR operations as well (including the opcode byte).
Let's clarify what the macro really means by describing the expected bus
topology in the (quad) program load macro name.
While at modifying it, better add the missing_ OP suffix to align with
all the other macros of the same kind.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/alliancememory.c | 4 ++--
drivers/mtd/nand/spi/ato.c | 4 ++--
drivers/mtd/nand/spi/esmt.c | 4 ++--
drivers/mtd/nand/spi/foresee.c | 4 ++--
drivers/mtd/nand/spi/gigadevice.c | 4 ++--
drivers/mtd/nand/spi/macronix.c | 4 ++--
drivers/mtd/nand/spi/micron.c | 4 ++--
drivers/mtd/nand/spi/paragon.c | 4 ++--
drivers/mtd/nand/spi/skyhigh.c | 4 ++--
drivers/mtd/nand/spi/toshiba.c | 4 ++--
drivers/mtd/nand/spi/winbond.c | 4 ++--
drivers/mtd/nand/spi/xtx.c | 4 ++--
include/linux/mtd/spinand.h | 2 +-
13 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/drivers/mtd/nand/spi/alliancememory.c b/drivers/mtd/nand/spi/alliancememory.c
index 437e935aefab57f80876e0eb84a9c37d11211864..2ee498230ec1be23d77d975b2a4cc972f0f6e258 100644
--- a/drivers/mtd/nand/spi/alliancememory.c
+++ b/drivers/mtd/nand/spi/alliancememory.c
@@ -25,11 +25,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
- SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(true, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
- SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(false, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static int am_get_eccsize(struct mtd_info *mtd)
diff --git a/drivers/mtd/nand/spi/ato.c b/drivers/mtd/nand/spi/ato.c
index cf51cc6ae66d3d35a4e912472fef80f7a8e3eeb9..2b4df1d917ac8581f30079356b98eeba06da9687 100644
--- a/drivers/mtd/nand/spi/ato.c
+++ b/drivers/mtd/nand/spi/ato.c
@@ -19,11 +19,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
- SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(true, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
- SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(false, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
diff --git a/drivers/mtd/nand/spi/esmt.c b/drivers/mtd/nand/spi/esmt.c
index 64dd54181c8feb48a531a203e1b6437db490363a..3e5ed066a16483f8ddf38f750e6fc1f9b7c1fb27 100644
--- a/drivers/mtd/nand/spi/esmt.c
+++ b/drivers/mtd/nand/spi/esmt.c
@@ -19,11 +19,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
- SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(true, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
- SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(false, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
/*
diff --git a/drivers/mtd/nand/spi/foresee.c b/drivers/mtd/nand/spi/foresee.c
index dba8ea5142eef8a109d66f3262f264b8a16680b2..7c61644bfb109d2960a8b3065f98f348bd23e162 100644
--- a/drivers/mtd/nand/spi/foresee.c
+++ b/drivers/mtd/nand/spi/foresee.c
@@ -18,11 +18,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
- SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(true, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
- SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(false, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static int f35sqa002g_ooblayout_ecc(struct mtd_info *mtd, int section,
diff --git a/drivers/mtd/nand/spi/gigadevice.c b/drivers/mtd/nand/spi/gigadevice.c
index 44ef38cddc900e86c1a7a52a7c7fb68c42d82a43..cb1d316fc4d8326ac79a32919d4c41260d8f1b59 100644
--- a/drivers/mtd/nand/spi/gigadevice.c
+++ b/drivers/mtd/nand/spi/gigadevice.c
@@ -56,11 +56,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants_2gq5,
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
- SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(true, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
- SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(false, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static int gd5fxgq4xa_ooblayout_ecc(struct mtd_info *mtd, int section,
diff --git a/drivers/mtd/nand/spi/macronix.c b/drivers/mtd/nand/spi/macronix.c
index 577437107ec5fc1d8771dc7899731c88bd3e55b6..c32366663ce33fe92885bf9c44969012c8582747 100644
--- a/drivers/mtd/nand/spi/macronix.c
+++ b/drivers/mtd/nand/spi/macronix.c
@@ -32,11 +32,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
- SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(true, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
- SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(false, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static int mx35lfxge4ab_ooblayout_ecc(struct mtd_info *mtd, int section,
diff --git a/drivers/mtd/nand/spi/micron.c b/drivers/mtd/nand/spi/micron.c
index 56bbd7e7843faeb34cc8fb3ec16aa2dc98196ebb..a2770f9a8a14f985f380e3daad656363b60423c7 100644
--- a/drivers/mtd/nand/spi/micron.c
+++ b/drivers/mtd/nand/spi/micron.c
@@ -37,11 +37,11 @@ static SPINAND_OP_VARIANTS(quadio_read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(x4_write_cache_variants,
- SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(true, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(x4_update_cache_variants,
- SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(false, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
/* Micron MT29F2G01AAAED Device */
diff --git a/drivers/mtd/nand/spi/paragon.c b/drivers/mtd/nand/spi/paragon.c
index eaddb12d6e9a15365470c1a695a55c009794daca..4670bac41245e1f357727d2855c2249bb420cac4 100644
--- a/drivers/mtd/nand/spi/paragon.c
+++ b/drivers/mtd/nand/spi/paragon.c
@@ -30,11 +30,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
- SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(true, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
- SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(false, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
diff --git a/drivers/mtd/nand/spi/skyhigh.c b/drivers/mtd/nand/spi/skyhigh.c
index 3b9b83d499a2f86c0bd9387d1d94bedd0eccc108..51d61785df61cdc987c1c330f7fa50f4389855e9 100644
--- a/drivers/mtd/nand/spi/skyhigh.c
+++ b/drivers/mtd/nand/spi/skyhigh.c
@@ -25,11 +25,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
- SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(true, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
- SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(false, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static int skyhigh_spinand_ooblayout_ecc(struct mtd_info *mtd, int section,
diff --git a/drivers/mtd/nand/spi/toshiba.c b/drivers/mtd/nand/spi/toshiba.c
index cb1157fb34e3c9365d0cb47e1f37d8b745aa975e..4c6923047aeb84fa59369aced6d30ad6e9b6350d 100644
--- a/drivers/mtd/nand/spi/toshiba.c
+++ b/drivers/mtd/nand/spi/toshiba.c
@@ -21,11 +21,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_x4_variants,
- SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(true, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_x4_variants,
- SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(false, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
/*
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index adc20b4f28adb339ce81c5c1de5d28cfa3c36b31..861fb8d59760c83c3fa31879cb6ff027e7dc92ff 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -45,11 +45,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
- SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(true, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
- SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(false, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static int w25m02gv_ooblayout_ecc(struct mtd_info *mtd, int section,
diff --git a/drivers/mtd/nand/spi/xtx.c b/drivers/mtd/nand/spi/xtx.c
index 931b85e82ac5811dc2ce668270157a73ab9b5474..37336d5958a95377aa40bcbf81ebdda4907e2385 100644
--- a/drivers/mtd/nand/spi/xtx.c
+++ b/drivers/mtd/nand/spi/xtx.c
@@ -31,11 +31,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_variants,
- SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(true, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_variants,
- SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_4S_OP(false, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static int xt26g0xa_ooblayout_ecc(struct mtd_info *mtd, int section,
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index b564825d13b711b7a8403d8cf1f3af178c68847f..148e2cddeed4fad6b71e74e3a343b5409814b177 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -182,7 +182,7 @@
SPI_MEM_OP_NO_DUMMY, \
SPI_MEM_OP_DATA_OUT(len, buf, 1))
-#define SPINAND_PROG_LOAD_X4(reset, addr, buf, len) \
+#define SPINAND_PROG_LOAD_1S_1S_4S_OP(reset, addr, buf, len) \
SPI_MEM_OP(SPI_MEM_OP_CMD(reset ? 0x32 : 0x34, 1), \
SPI_MEM_OP_ADDR(2, addr, 1), \
SPI_MEM_OP_NO_DUMMY, \
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 15/21] mtd: spinand: winbond: Rename DTR variants
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
` (13 preceding siblings ...)
2025-03-07 15:08 ` [PATCH 14/21] mtd: spinand: Use more specific naming for the (quad) " Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-04-02 15:19 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 16/21] mtd: spinand: winbond: Add support for W35N01JW in single mode Miquel Raynal
` (5 subsequent siblings)
20 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
So far all the chips supported in the driver apparently have support for
the same kind of operation (typically, single, dual and quad). The
future introduction of W35N chips will change that as these chips only
support single and octal modes. Let's rename the variants accordingly to
make these future additions more understandable.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/winbond.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 861fb8d59760c83c3fa31879cb6ff027e7dc92ff..99b9f333eb3142999d8f73d43537f1ed9789c975 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -23,7 +23,7 @@
* "X4" in the core is equivalent to "quad output" in the datasheets.
*/
-static SPINAND_OP_VARIANTS(read_cache_dtr_variants,
+static SPINAND_OP_VARIANTS(read_cache_dual_quad_dtr_variants,
SPINAND_PAGE_READ_FROM_CACHE_1S_4D_4D_OP(0, 8, NULL, 0, 80 * HZ_PER_MHZ),
SPINAND_PAGE_READ_FROM_CACHE_1S_1D_4D_OP(0, 2, NULL, 0, 80 * HZ_PER_MHZ),
SPINAND_PAGE_READ_FROM_CACHE_1S_4S_4S_OP(0, 2, NULL, 0),
@@ -213,7 +213,7 @@ static const struct spinand_info winbond_spinand_table[] = {
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xbc, 0x21),
NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
NAND_ECCREQ(1, 512),
- SPINAND_INFO_OP_VARIANTS(&read_cache_dtr_variants,
+ SPINAND_INFO_OP_VARIANTS(&read_cache_dual_quad_dtr_variants,
&write_cache_variants,
&update_cache_variants),
0,
@@ -242,7 +242,7 @@ static const struct spinand_info winbond_spinand_table[] = {
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xbf, 0x22),
NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 2, 1),
NAND_ECCREQ(1, 512),
- SPINAND_INFO_OP_VARIANTS(&read_cache_dtr_variants,
+ SPINAND_INFO_OP_VARIANTS(&read_cache_dual_quad_dtr_variants,
&write_cache_variants,
&update_cache_variants),
0,
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 16/21] mtd: spinand: winbond: Add support for W35N01JW in single mode
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
` (14 preceding siblings ...)
2025-03-07 15:08 ` [PATCH 15/21] mtd: spinand: winbond: Rename DTR variants Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-04-02 15:22 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 17/21] mtd: spinand: Define octal read from cache operations Miquel Raynal
` (4 subsequent siblings)
20 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
Add support for the W35N series by describing the smaller (single die)
chip. It has 1b/512B ECC support and its own OOB layout.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/winbond.c | 54 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 99b9f333eb3142999d8f73d43537f1ed9789c975..9b0369a077efadac8bd6be632f15b822d42a7227 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -23,6 +23,16 @@
* "X4" in the core is equivalent to "quad output" in the datasheets.
*/
+static SPINAND_OP_VARIANTS(read_cache_octal_variants,
+ SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
+
+static SPINAND_OP_VARIANTS(write_cache_octal_variants,
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
+
+static SPINAND_OP_VARIANTS(update_cache_octal_variants,
+ SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
+
static SPINAND_OP_VARIANTS(read_cache_dual_quad_dtr_variants,
SPINAND_PAGE_READ_FROM_CACHE_1S_4D_4D_OP(0, 8, NULL, 0, 80 * HZ_PER_MHZ),
SPINAND_PAGE_READ_FROM_CACHE_1S_1D_4D_OP(0, 2, NULL, 0, 80 * HZ_PER_MHZ),
@@ -141,6 +151,41 @@ static const struct mtd_ooblayout_ops w25n02kv_ooblayout = {
.free = w25n02kv_ooblayout_free,
};
+static int w35n01jw_ooblayout_ecc(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *region)
+{
+ if (section > 7)
+ return -ERANGE;
+
+ region->offset = (16 * section) + 12;
+ region->length = 4;
+
+ return 0;
+}
+
+static int w35n01jw_ooblayout_free(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *region)
+{
+ if (section > 7)
+ return -ERANGE;
+
+ region->offset = 16 * section;
+ region->length = 12;
+
+ /* Extract BBM */
+ if (!section) {
+ region->offset += 2;
+ region->length -= 2;
+ }
+
+ return 0;
+}
+
+static const struct mtd_ooblayout_ops w35n01jw_ooblayout = {
+ .ecc = w35n01jw_ooblayout_ecc,
+ .free = w35n01jw_ooblayout_free,
+};
+
static int w25n02kv_ecc_get_status(struct spinand_device *spinand,
u8 status)
{
@@ -227,6 +272,15 @@ static const struct spinand_info winbond_spinand_table[] = {
&update_cache_variants),
0,
SPINAND_ECCINFO(&w25n01kv_ooblayout, w25n02kv_ecc_get_status)),
+ SPINAND_INFO("W35N01JW", /* 1.8V */
+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xdc, 0x21),
+ NAND_MEMORG(1, 4096, 128, 64, 512, 10, 1, 1, 1),
+ NAND_ECCREQ(1, 512),
+ SPINAND_INFO_OP_VARIANTS(&read_cache_octal_variants,
+ &write_cache_octal_variants,
+ &update_cache_octal_variants),
+ 0,
+ SPINAND_ECCINFO(&w35n01jw_ooblayout, NULL)),
/* 2G-bit densities */
SPINAND_INFO("W25M02GV", /* 2x1G-bit 3.3V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xab, 0x21),
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 17/21] mtd: spinand: Define octal read from cache operations
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
` (15 preceding siblings ...)
2025-03-07 15:08 ` [PATCH 16/21] mtd: spinand: winbond: Add support for W35N01JW in single mode Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-03-07 15:08 ` [PATCH 18/21] mtd: spinand: winbond: Add octal read support Miquel Raynal
` (3 subsequent siblings)
20 siblings, 0 replies; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
SPI NAND chips may support octal read from cache transfers. List the
opcodes by defining the relevant macros describing these operations.
Controllers supporting operations mixing SDR and DTR operations might even
leverage octal DTR data I/O transfers.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
include/linux/mtd/spinand.h | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 148e2cddeed4fad6b71e74e3a343b5409814b177..ed02fa891d946c71e73d349c605447cbea48ebf9 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -170,6 +170,27 @@
SPI_MEM_DTR_OP_DATA_IN(len, buf, 4), \
SPI_MEM_OP_MAX_FREQ(freq))
+#define SPINAND_PAGE_READ_FROM_CACHE_1S_1S_8S_OP(addr, ndummy, buf, len, freq) \
+ SPI_MEM_OP(SPI_MEM_OP_CMD(0x8b, 1), \
+ SPI_MEM_OP_ADDR(2, addr, 1), \
+ SPI_MEM_OP_DUMMY(ndummy, 1), \
+ SPI_MEM_OP_DATA_IN(len, buf, 8), \
+ SPI_MEM_OP_MAX_FREQ(freq))
+
+#define SPINAND_PAGE_READ_FROM_CACHE_1S_8S_8S_OP(addr, ndummy, buf, len, freq) \
+ SPI_MEM_OP(SPI_MEM_OP_CMD(0xcb, 1), \
+ SPI_MEM_OP_ADDR(2, addr, 8), \
+ SPI_MEM_OP_DUMMY(ndummy, 8), \
+ SPI_MEM_OP_DATA_IN(len, buf, 8), \
+ SPI_MEM_OP_MAX_FREQ(freq))
+
+#define SPINAND_PAGE_READ_FROM_CACHE_1S_1D_8D_OP(addr, ndummy, buf, len, freq) \
+ SPI_MEM_OP(SPI_MEM_OP_CMD(0x9d, 1), \
+ SPI_MEM_DTR_OP_ADDR(2, addr, 1), \
+ SPI_MEM_DTR_OP_DUMMY(ndummy, 1), \
+ SPI_MEM_DTR_OP_DATA_IN(len, buf, 8), \
+ SPI_MEM_OP_MAX_FREQ(freq))
+
#define SPINAND_PROG_EXEC_1S_1S_0_OP(addr) \
SPI_MEM_OP(SPI_MEM_OP_CMD(0x10, 1), \
SPI_MEM_OP_ADDR(3, addr, 1), \
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 18/21] mtd: spinand: winbond: Add octal read support
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
` (16 preceding siblings ...)
2025-03-07 15:08 ` [PATCH 17/21] mtd: spinand: Define octal read from cache operations Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-03-07 15:08 ` [PATCH 19/21] mtd: spinand: Define octal load to cache operations Miquel Raynal
` (2 subsequent siblings)
20 siblings, 0 replies; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
Describe the octal read from cache operations (1S_1S_8S, 1S_8S_8S and
1S_1D_8D_OP) supported by the W35N01JW chip.
There is no observable improvement between the two octal SDR modes,
which anyway offered a great read speed improvement compared to single
mode.
flash_speed test results ran on the TI AM62A7 LP SK using a 25MHz SPI bus:
* Single mode:
eraseblock read speed is 2346 KiB/s
page read speed is 2342 KiB/s
* Octal modes:
eraseblock read speed is 10801 KiB/s
page read speed is 10711 KiB/s
However, testing on the cadence qspi controller driver did not allow
mixed modes (where SDR and DTR cycles are mixed in the same operation),
thus 1S-1D-8D mode could not be tested and is provided for reference (it
is anyway skipped on platforms not supporting this).
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/winbond.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 9b0369a077efadac8bd6be632f15b822d42a7227..4b1bfc15588ad3ffc8f2cb7615db6c14d0b62903 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -24,6 +24,9 @@
*/
static SPINAND_OP_VARIANTS(read_cache_octal_variants,
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1D_8D_OP(0, 2, NULL, 0, 105 * HZ_PER_MHZ),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_8S_8S_OP(0, 16, NULL, 0, 86 * HZ_PER_MHZ),
+ SPINAND_PAGE_READ_FROM_CACHE_1S_1S_8S_OP(0, 1, NULL, 0, 133 * HZ_PER_MHZ),
SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 19/21] mtd: spinand: Define octal load to cache operations
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
` (17 preceding siblings ...)
2025-03-07 15:08 ` [PATCH 18/21] mtd: spinand: winbond: Add octal read support Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-03-07 15:08 ` [PATCH 20/21] mtd: spinand: winbond: Add octal program support Miquel Raynal
2025-03-07 15:08 ` [PATCH 21/21] mtd: spinand: winbond: Add support for W35N02JW and W35N02JW chips Miquel Raynal
20 siblings, 0 replies; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
SPI NAND chips may support octal "program load" transfers. List the
opcodes by defining the relevant macros describing these operations.
Unfortunately, due to the hardware available I had, 0x82 and 0xc2 are
untested and given as reference, only 0xc4 could be (successfully)
tested.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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 ed02fa891d946c71e73d349c605447cbea48ebf9..d74557319331e76a0c5124e4b3104cf400c2fa4c 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -209,6 +209,18 @@
SPI_MEM_OP_NO_DUMMY, \
SPI_MEM_OP_DATA_OUT(len, buf, 4))
+#define SPINAND_PROG_LOAD_1S_1S_8S_OP(addr, buf, len) \
+ SPI_MEM_OP(SPI_MEM_OP_CMD(0x82, 1), \
+ SPI_MEM_OP_ADDR(2, addr, 1), \
+ SPI_MEM_OP_NO_DUMMY, \
+ SPI_MEM_OP_DATA_OUT(len, buf, 8))
+
+#define SPINAND_PROG_LOAD_1S_8S_8S_OP(reset, addr, buf, len) \
+ SPI_MEM_OP(SPI_MEM_OP_CMD(reset ? 0xc2 : 0xc4, 1), \
+ SPI_MEM_OP_ADDR(2, addr, 8), \
+ SPI_MEM_OP_NO_DUMMY, \
+ SPI_MEM_OP_DATA_OUT(len, buf, 8))
+
/**
* Standard SPI NAND flash commands
*/
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 20/21] mtd: spinand: winbond: Add octal program support
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
` (18 preceding siblings ...)
2025-03-07 15:08 ` [PATCH 19/21] mtd: spinand: Define octal load to cache operations Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-03-07 15:08 ` [PATCH 21/21] mtd: spinand: winbond: Add support for W35N02JW and W35N02JW chips Miquel Raynal
20 siblings, 0 replies; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
Describe the octal read from cache operations (1S_1S_8S and 1S_8S_8S)
supported by the W35N01JW chip.
flash_speed test results ran on the TI AM62A7 LP SK using a 25MHz SPI bus:
* Single mode:
eraseblock write speed is 2028 KiB/s
page write speed is 2028 KiB/s
* Octal modes:
eraseblock write speed is 7335 KiB/s
page write speed is 7293 KiB/s
However, testing on the cadence qspi controller driver did not allow
easy "update cache" tests so these macros are untested and given as-is.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/winbond.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 4b1bfc15588ad3ffc8f2cb7615db6c14d0b62903..c263c9b5affe79a14466bc0e2ef2da53ecfd48cf 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -31,9 +31,12 @@ static SPINAND_OP_VARIANTS(read_cache_octal_variants,
SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
static SPINAND_OP_VARIANTS(write_cache_octal_variants,
+ SPINAND_PROG_LOAD_1S_8S_8S_OP(true, 0, NULL, 0),
+ SPINAND_PROG_LOAD_1S_1S_8S_OP(0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
static SPINAND_OP_VARIANTS(update_cache_octal_variants,
+ SPINAND_PROG_LOAD_1S_8S_8S_OP(false, 0, NULL, 0),
SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
static SPINAND_OP_VARIANTS(read_cache_dual_quad_dtr_variants,
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* [PATCH 21/21] mtd: spinand: winbond: Add support for W35N02JW and W35N02JW chips
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
` (19 preceding siblings ...)
2025-03-07 15:08 ` [PATCH 20/21] mtd: spinand: winbond: Add octal program support Miquel Raynal
@ 2025-03-07 15:08 ` Miquel Raynal
2025-04-02 15:25 ` Tudor Ambarus
20 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:08 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K
Cc: Tudor Ambarus, Pratyush Yadav, Michael Walle, Thomas Petazzoni,
Steam Lin, linux-mtd, linux-kernel, Miquel Raynal
These chips support single SPI, octal SPI and octal DDR SPI.
For now, only the SDR protocols are supported.
Tested with the W35N02JW variant, but the 04 one just has twice more
dies and is described in the same datasheet, so we can reasonably expect
that it will behave identically.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/spi/winbond.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index c263c9b5affe79a14466bc0e2ef2da53ecfd48cf..19f8dd4a63707e6599068a43fd80dabcd9dd3a57 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -287,6 +287,24 @@ static const struct spinand_info winbond_spinand_table[] = {
&update_cache_octal_variants),
0,
SPINAND_ECCINFO(&w35n01jw_ooblayout, NULL)),
+ SPINAND_INFO("W35N02JW", /* 1.8V */
+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xdf, 0x22),
+ NAND_MEMORG(1, 4096, 128, 64, 512, 10, 2, 1, 1),
+ NAND_ECCREQ(1, 512),
+ SPINAND_INFO_OP_VARIANTS(&read_cache_octal_variants,
+ &write_cache_octal_variants,
+ &update_cache_octal_variants),
+ 0,
+ SPINAND_ECCINFO(&w35n01jw_ooblayout, NULL)),
+ SPINAND_INFO("W35N04JW", /* 1.8V */
+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xdf, 0x23),
+ NAND_MEMORG(1, 4096, 128, 64, 512, 10, 4, 1, 1),
+ NAND_ECCREQ(1, 512),
+ SPINAND_INFO_OP_VARIANTS(&read_cache_octal_variants,
+ &write_cache_octal_variants,
+ &update_cache_octal_variants),
+ 0,
+ SPINAND_ECCINFO(&w35n01jw_ooblayout, NULL)),
/* 2G-bit densities */
SPINAND_INFO("W25M02GV", /* 2x1G-bit 3.3V */
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xab, 0x21),
--
2.48.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 54+ messages in thread
* Re: [PATCH 01/21] mtd: spinand: Use more specific naming for the reset op
2025-03-07 15:08 ` [PATCH 01/21] mtd: spinand: Use more specific naming for the reset op Miquel Raynal
@ 2025-03-07 15:38 ` Tudor Ambarus
2025-03-07 15:45 ` Miquel Raynal
0 siblings, 1 reply; 54+ messages in thread
From: Tudor Ambarus @ 2025-03-07 15:38 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Santhosh Kumar K
Cc: Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
On 3/7/25 3:08 PM, Miquel Raynal wrote:
> SPI operations have been initially described through macros implicitly
> implying the use of a single SPI SDR bus. Macros for supporting dual and
> quad I/O transfers have been added on top, generally inspired by vendor
> vendor naming, followed by DTR operations. Soon we might see octal
> and even octal DTR operations as well (including the opcode byte).
>
> Let's clarify what the macro really means by describing the expected bus
> topology in the reset macro name.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
> drivers/mtd/nand/spi/core.c | 2 +-
> include/linux/mtd/spinand.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> index 7a578f3522be93d30a9132cf01831515db77ae38..ea6b48242ad4a4e51c713907ce5cc55022cdb569 100644
> --- a/drivers/mtd/nand/spi/core.c
> +++ b/drivers/mtd/nand/spi/core.c
> @@ -586,7 +586,7 @@ static int spinand_read_id_op(struct spinand_device *spinand, u8 naddr,
>
> static int spinand_reset_op(struct spinand_device *spinand)
> {
> - struct spi_mem_op op = SPINAND_RESET_OP;
> + struct spi_mem_op op = SPINAND_RESET_1S_0_0_OP;
> int ret;
>
> ret = spi_mem_exec_op(spinand->spimem, &op);
> diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
> index 0da8a1c7740ef5cbbdb2a74858465136638224f4..4f47adbe4566d7813ffd8fbfaddd1a85d88d0208 100644
> --- a/include/linux/mtd/spinand.h
> +++ b/include/linux/mtd/spinand.h
> @@ -20,7 +20,7 @@
> * Standard SPI NAND flash operations
> */
>
> -#define SPINAND_RESET_OP \
> +#define SPINAND_RESET_1S_0_0_OP \
Hi, Miquel,
Have you seen any reset op with address or data? If not, I'm not really
sure whether we shall change the name for these basic operations.
Changing them to 1S-0-0 may also indicate that there are resets with
address or data fields, which I find confusing.
I think the change is good for reads and writes. I'll check further in
the series and let you know.
Cheers,
ta
> SPI_MEM_OP(SPI_MEM_OP_CMD(0xff, 1), \
> SPI_MEM_OP_NO_ADDR, \
> SPI_MEM_OP_NO_DUMMY, \
>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 02/21] mtd: spinand: Use more specific naming for the write enable/disable op
2025-03-07 15:08 ` [PATCH 02/21] mtd: spinand: Use more specific naming for the write enable/disable op Miquel Raynal
@ 2025-03-07 15:39 ` Tudor Ambarus
2025-03-07 15:49 ` Miquel Raynal
2025-03-20 12:22 ` Tudor Ambarus
1 sibling, 1 reply; 54+ messages in thread
From: Tudor Ambarus @ 2025-03-07 15:39 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Santhosh Kumar K
Cc: Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
On 3/7/25 3:08 PM, Miquel Raynal wrote:
> -#define SPINAND_WR_EN_DIS_OP(enable) \
> +#define SPINAND_WR_EN_DIS_1S_0_0_OP(enable) \
> SPI_MEM_OP(SPI_MEM_OP_CMD((enable) ? 0x06 : 0x04, 1), \
> SPI_MEM_OP_NO_ADDR, \
> SPI_MEM_OP_NO_DUMMY, \
here too, I lean towards keeping the name as it was, but maybe others
can jump in.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 03/21] mtd: spinand: Use more specific naming for the read ID op
2025-03-07 15:08 ` [PATCH 03/21] mtd: spinand: Use more specific naming for the read ID op Miquel Raynal
@ 2025-03-07 15:40 ` Tudor Ambarus
0 siblings, 0 replies; 54+ messages in thread
From: Tudor Ambarus @ 2025-03-07 15:40 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Santhosh Kumar K
Cc: Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
On 3/7/25 3:08 PM, Miquel Raynal wrote:
> -#define SPINAND_READID_OP(naddr, ndummy, buf, len) \
> +#define SPINAND_READID_1S_1S_1S_OP(naddr, ndummy, buf, len) \
> SPI_MEM_OP(SPI_MEM_OP_CMD(0x9f, 1), \
> SPI_MEM_OP_ADDR(naddr, 0, 1), \
> SPI_MEM_OP_DUMMY(ndummy, 1), \
I think there are 8d-8d-8d read id ops, so:
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 04/21] mtd: spinand: Use more specific naming for the get/set feature ops
2025-03-07 15:08 ` [PATCH 04/21] mtd: spinand: Use more specific naming for the get/set feature ops Miquel Raynal
@ 2025-03-07 15:42 ` Tudor Ambarus
0 siblings, 0 replies; 54+ messages in thread
From: Tudor Ambarus @ 2025-03-07 15:42 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Santhosh Kumar K
Cc: Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
On 3/7/25 3:08 PM, Miquel Raynal wrote:
> SPI operations have been initially described through macros implicitly
> implying the use of a single SPI SDR bus. Macros for supporting dual and
> quad I/O transfers have been added on top, generally inspired by vendor
> naming, followed by DTR operations. Soon we might see octal
> and even octal DTR operations as well (including the opcode byte).
>
> Let's clarify what the macro really mean by describing the expected bus
> topology in the get/set feature macro names.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
this op is likely to extend, so:
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 01/21] mtd: spinand: Use more specific naming for the reset op
2025-03-07 15:38 ` Tudor Ambarus
@ 2025-03-07 15:45 ` Miquel Raynal
2025-03-10 10:14 ` Tudor Ambarus
0 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:45 UTC (permalink / raw)
To: Tudor Ambarus
Cc: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K,
Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
Hi Tudor,
>> -#define SPINAND_RESET_OP \
>> +#define SPINAND_RESET_1S_0_0_OP \
> Hi, Miquel,
>
> Have you seen any reset op with address or data? If not, I'm not really
> sure whether we shall change the name for these basic operations.
>
> Changing them to 1S-0-0 may also indicate that there are resets with
> address or data fields, which I find confusing.
>
> I think the change is good for reads and writes. I'll check further in
> the series and let you know.
I want to rename this macro for two reasons:
- We might see in the near future the addition of 8D-0-0 ops (I plan on
working on it).
- I would like some kind of harmony among these macros.
Now, whether is should be named like I proposed or just
SPINAND_RESET_OP_1S, I have no strong preference and I can change that
in an upcoming version.
Which one would you prefer?
Cheers,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 05/21] mtd: spinand: Use more specific naming for the erase op
2025-03-07 15:08 ` [PATCH 05/21] mtd: spinand: Use more specific naming for the erase op Miquel Raynal
@ 2025-03-07 15:45 ` Tudor Ambarus
2025-03-07 16:03 ` Miquel Raynal
2025-03-20 12:23 ` Tudor Ambarus
1 sibling, 1 reply; 54+ messages in thread
From: Tudor Ambarus @ 2025-03-07 15:45 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Santhosh Kumar K
Cc: Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
If there's no chip erase for SPI NANDs, then keeping the name as it was
makes more sense to me.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 02/21] mtd: spinand: Use more specific naming for the write enable/disable op
2025-03-07 15:39 ` Tudor Ambarus
@ 2025-03-07 15:49 ` Miquel Raynal
0 siblings, 0 replies; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 15:49 UTC (permalink / raw)
To: Tudor Ambarus
Cc: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K,
Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
On 07/03/2025 at 15:39:43 GMT, Tudor Ambarus <tudor.ambarus@linaro.org> wrote:
> On 3/7/25 3:08 PM, Miquel Raynal wrote:
>> -#define SPINAND_WR_EN_DIS_OP(enable) \
>> +#define SPINAND_WR_EN_DIS_1S_0_0_OP(enable) \
>> SPI_MEM_OP(SPI_MEM_OP_CMD((enable) ? 0x06 : 0x04, 1), \
>> SPI_MEM_OP_NO_ADDR, \
>> SPI_MEM_OP_NO_DUMMY, \
>
> here too, I lean towards keeping the name as it was, but maybe others
> can jump in.
These are indeed the three commands with just a command cycle. But then
we have eg. page data reads which have no data: 1s-1s-0 (or 8d-8d-0)
makes sense to me because it is clear that there is no data cycle. Or
even worse, a read ID instruction can be 1s-0-1s (or, again,
8d-0-8d). Removing the 0 in the middle would definitely not make sense,
and to keep something clear I would actually prefer to keep these three
members for clarity, even though in this case they will remain 0.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 05/21] mtd: spinand: Use more specific naming for the erase op
2025-03-07 15:45 ` Tudor Ambarus
@ 2025-03-07 16:03 ` Miquel Raynal
0 siblings, 0 replies; 54+ messages in thread
From: Miquel Raynal @ 2025-03-07 16:03 UTC (permalink / raw)
To: Tudor Ambarus
Cc: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K,
Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
On 07/03/2025 at 15:45:03 GMT, Tudor Ambarus <tudor.ambarus@linaro.org> wrote:
> If there's no chip erase for SPI NANDs, then keeping the name as it was
> makes more sense to me.
There is no chip erase indeed, but my goal is to mostly clarify the bus
topology here. Specifically the 1s-1s-0 vs. 8d-8d-0 operations.
It is true that this series only uses the data-oriented commands because
that is where the time penalty really is, but I figured renaming all ops
would be nicer to keep the harmony among them and prepare for the next
step (octal dtr).
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 01/21] mtd: spinand: Use more specific naming for the reset op
2025-03-07 15:45 ` Miquel Raynal
@ 2025-03-10 10:14 ` Tudor Ambarus
2025-03-19 17:32 ` Miquel Raynal
0 siblings, 1 reply; 54+ messages in thread
From: Tudor Ambarus @ 2025-03-10 10:14 UTC (permalink / raw)
To: Miquel Raynal
Cc: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K,
Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
On 07.03.2025 17:45, Miquel Raynal wrote:
> Hi Tudor,
Hi!
>
>>> -#define SPINAND_RESET_OP \
>>> +#define SPINAND_RESET_1S_0_0_OP \
>> Hi, Miquel,
>>
>> Have you seen any reset op with address or data? If not, I'm not really
>> sure whether we shall change the name for these basic operations.
>>
>> Changing them to 1S-0-0 may also indicate that there are resets with
>> address or data fields, which I find confusing.
>>
>> I think the change is good for reads and writes. I'll check further in
>> the series and let you know.
>
> I want to rename this macro for two reasons:
> - We might see in the near future the addition of 8D-0-0 ops (I plan on
> working on it).
> - I would like some kind of harmony among these macros.
>
> Now, whether is should be named like I proposed or just
> SPINAND_RESET_OP_1S, I have no strong preference and I can change that
> in an upcoming version.
>
> Which one would you prefer?
I don't know. Which one is backed up by a standard?
JESD216F defines
"(An-Bn-Cn): Command mode nomenclature used to indicate the number of
active pins used for the instruction (A), address (B), and data (C), and
the data rate used for each. Data rates(n) can be single (S) and dual (D)."
Also, "(x-y-z) nomenclature is equivalent to(AS-BS-CS) unless otherwise
noted."
What's an "active pin"?
Then if I look at JESD251-1.01 and JESD251C, (An-Bn-Cn) is referred to
as "protocol mode". Write Enable, which is just an instruction command
with no address or data, is seen as a required command in both 4D-4D-4D
and 8D-8D-8D protocol modes, and it's defined as a "1.A" transaction
format command. And the transaction format is:
'''
The following transaction formats are used in Profile 1.0 mode 8D-8D-8D:
Format 1.A: Command and Command Extension
Format 1.B: Command, Command Extension, 4-byte Address, ‘n’ Latency
Cycles, and Read Data
Format 1.C: Command, Command Extension, and 4-byte Address
Format 1.D: Command, Command Extension, 4-byte Address, and Write Data
'''
So according to these standards maybe we shall refer to it as:
WREN-8D-8D-8D-1A? This seems less intuitive than 8D-0-0, but I think it
all depends on what's an "active pin". I think it describes the protocol
mode, and not what's actually sent on the line. As we saw, WREN is
considered an 8D-8D-8D command, and not an 8D-0-0 command.
For dual mode, which is not covered by xSPI, I guess we can use the
single spi transaction formats 0.{A,B,C,...}.
How do you feel about a OP-An-Bn-Cn-transaction-format,
where A, B, C is {1, 2, 4, 8}
n is {S, D}
transaction format is {0,1,2,3}{A,B,C,...}
Care must be taken care of at the transaction format, as I see there are
a few, depending on the xSPI profile and protocol mode.
Cheers,
ta
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 01/21] mtd: spinand: Use more specific naming for the reset op
2025-03-10 10:14 ` Tudor Ambarus
@ 2025-03-19 17:32 ` Miquel Raynal
2025-03-20 8:08 ` Tudor Ambarus
0 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-03-19 17:32 UTC (permalink / raw)
To: Tudor Ambarus
Cc: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K,
Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
Hello Tudor,
On 10/03/2025 at 12:14:06 +02, Tudor Ambarus <tudor.ambarus@linaro.org> wrote:
> On 07.03.2025 17:45, Miquel Raynal wrote:
>> Hi Tudor,
>
> Hi!
>
>>
>>>> -#define SPINAND_RESET_OP \
>>>> +#define SPINAND_RESET_1S_0_0_OP \
>>> Hi, Miquel,
>>>
>>> Have you seen any reset op with address or data? If not, I'm not really
>>> sure whether we shall change the name for these basic operations.
>>>
>>> Changing them to 1S-0-0 may also indicate that there are resets with
>>> address or data fields, which I find confusing.
>>>
>>> I think the change is good for reads and writes. I'll check further in
>>> the series and let you know.
>>
>> I want to rename this macro for two reasons:
>> - We might see in the near future the addition of 8D-0-0 ops (I plan on
>> working on it).
>> - I would like some kind of harmony among these macros.
>>
>> Now, whether is should be named like I proposed or just
>> SPINAND_RESET_OP_1S, I have no strong preference and I can change that
>> in an upcoming version.
>>
>> Which one would you prefer?
>
> I don't know. Which one is backed up by a standard?
Well, as far as I know, none of the SPI NAND devices follow a very
specific standard. Most vendors in practice follow similar conventions,
but they all deviate a bit from it.
> JESD216F defines
> "(An-Bn-Cn): Command mode nomenclature used to indicate the number of
> active pins used for the instruction (A), address (B), and data (C), and
> the data rate used for each. Data rates(n) can be single (S) and dual (D)."
>
> Also, "(x-y-z) nomenclature is equivalent to(AS-BS-CS) unless otherwise
> noted."
>
> What's an "active pin"?
>
> Then if I look at JESD251-1.01 and JESD251C, (An-Bn-Cn) is referred to
> as "protocol mode". Write Enable, which is just an instruction command
> with no address or data, is seen as a required command in both 4D-4D-4D
> and 8D-8D-8D protocol modes, and it's defined as a "1.A" transaction
> format command. And the transaction format is:
> '''
> The following transaction formats are used in Profile 1.0 mode 8D-8D-8D:
> Format 1.A: Command and Command Extension
> Format 1.B: Command, Command Extension, 4-byte Address, ‘n’ Latency
> Cycles, and Read Data
> Format 1.C: Command, Command Extension, and 4-byte Address
> Format 1.D: Command, Command Extension, 4-byte Address, and Write Data
> '''
>
> So according to these standards maybe we shall refer to it as:
> WREN-8D-8D-8D-1A? This seems less intuitive than 8D-0-0, but I think it
> all depends on what's an "active pin". I think it describes the protocol
> mode, and not what's actually sent on the line. As we saw, WREN is
> considered an 8D-8D-8D command, and not an 8D-0-0 command.
>
> For dual mode, which is not covered by xSPI, I guess we can use the
> single spi transaction formats 0.{A,B,C,...}.
>
> How do you feel about a OP-An-Bn-Cn-transaction-format,
> where A, B, C is {1, 2, 4, 8}
> n is {S, D}
> transaction format is {0,1,2,3}{A,B,C,...}
>
> Care must be taken care of at the transaction format, as I see there are
> a few, depending on the xSPI profile and protocol mode.
I must admit I really dislike the transaction format abbreviation because
it is specific to a spec we do not follow and is not explicit. I have a
strong preference towards keeping just "An-Bn-Cn", like I did in this
series. If people are in doubt, they can check what is in the op, it is
self explanatory. I chose this in the first place because it is more
explicit than just "An" which may feel like a cropped
acronym. Furthermore, most octal capable datasheets I've looked at seem
to use the "An-Bn-Cn" format, even for single opcodes.
So unless there are strong arguments against, I'd prefer to keep the
current formatting. TBH, it is not set in stone and can still evolve
later if that's needed.
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 01/21] mtd: spinand: Use more specific naming for the reset op
2025-03-19 17:32 ` Miquel Raynal
@ 2025-03-20 8:08 ` Tudor Ambarus
2025-03-20 11:31 ` Miquel Raynal
0 siblings, 1 reply; 54+ messages in thread
From: Tudor Ambarus @ 2025-03-20 8:08 UTC (permalink / raw)
To: Miquel Raynal
Cc: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K,
Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
Hi, Miquel,
On 3/19/25 5:32 PM, Miquel Raynal wrote:
>>>>> -#define SPINAND_RESET_OP \
>>>>> +#define SPINAND_RESET_1S_0_0_OP \
>>>> Hi, Miquel,
>>>>
>>>> Have you seen any reset op with address or data? If not, I'm not really
>>>> sure whether we shall change the name for these basic operations.
>>>>
>>>> Changing them to 1S-0-0 may also indicate that there are resets with
>>>> address or data fields, which I find confusing.
>>>>
>>>> I think the change is good for reads and writes. I'll check further in
>>>> the series and let you know.
>>>
>>> I want to rename this macro for two reasons:
>>> - We might see in the near future the addition of 8D-0-0 ops (I plan on
>>> working on it).
>>> - I would like some kind of harmony among these macros.
>>>
>>> Now, whether is should be named like I proposed or just
>>> SPINAND_RESET_OP_1S, I have no strong preference and I can change that
>>> in an upcoming version.
>>>
>>> Which one would you prefer?
>>
>> I don't know. Which one is backed up by a standard?
>
> Well, as far as I know, none of the SPI NAND devices follow a very
> specific standard. Most vendors in practice follow similar conventions,
> but they all deviate a bit from it.
>
>> JESD216F defines
>> "(An-Bn-Cn): Command mode nomenclature used to indicate the number of
>> active pins used for the instruction (A), address (B), and data (C), and
>> the data rate used for each. Data rates(n) can be single (S) and dual (D)."
>>
>> Also, "(x-y-z) nomenclature is equivalent to(AS-BS-CS) unless otherwise
>> noted."
>>
>> What's an "active pin"?
>>
>> Then if I look at JESD251-1.01 and JESD251C, (An-Bn-Cn) is referred to
>> as "protocol mode". Write Enable, which is just an instruction command
>> with no address or data, is seen as a required command in both 4D-4D-4D
>> and 8D-8D-8D protocol modes, and it's defined as a "1.A" transaction
>> format command. And the transaction format is:
>> '''
>> The following transaction formats are used in Profile 1.0 mode 8D-8D-8D:
>> Format 1.A: Command and Command Extension
>> Format 1.B: Command, Command Extension, 4-byte Address, ‘n’ Latency
>> Cycles, and Read Data
>> Format 1.C: Command, Command Extension, and 4-byte Address
>> Format 1.D: Command, Command Extension, 4-byte Address, and Write Data
>> '''
>>
>> So according to these standards maybe we shall refer to it as:
>> WREN-8D-8D-8D-1A? This seems less intuitive than 8D-0-0, but I think it
>> all depends on what's an "active pin". I think it describes the protocol
>> mode, and not what's actually sent on the line. As we saw, WREN is
>> considered an 8D-8D-8D command, and not an 8D-0-0 command.
>>
>> For dual mode, which is not covered by xSPI, I guess we can use the
>> single spi transaction formats 0.{A,B,C,...}.
>>
>> How do you feel about a OP-An-Bn-Cn-transaction-format,
>> where A, B, C is {1, 2, 4, 8}
>> n is {S, D}
>> transaction format is {0,1,2,3}{A,B,C,...}
>>
>> Care must be taken care of at the transaction format, as I see there are
>> a few, depending on the xSPI profile and protocol mode.
>
> I must admit I really dislike the transaction format abbreviation because
I'm not in love with the "transaction format" either.
> it is specific to a spec we do not follow and is not explicit. I have a
> strong preference towards keeping just "An-Bn-Cn", like I did in this
Okay.
> series. If people are in doubt, they can check what is in the op, it is
> self explanatory. I chose this in the first place because it is more
> explicit than just "An" which may feel like a cropped
> acronym. Furthermore, most octal capable datasheets I've looked at seem
> to use the "An-Bn-Cn" format, even for single opcodes.
So for RESET, WREN, WRDI and other opcodes that don't require address
and data, are those datasheets referring to these opcodes as 1-1-1 commands?
Can you point me to one of these datasheets, please?
In SPI NOR, WREN is just WREN, regardless of the number of lines it is
sent on, 1, 4, or 8. How would you model it here, 1-0-0, 4-0-0, 8-0-0
using the same opcode?
>
> So unless there are strong arguments against, I'd prefer to keep the
> current formatting. TBH, it is not set in stone and can still evolve
> later if that's needed.
I find the naming scheme An-Bn-Cn good, I'm arguing that it's not needed
everywhere, opcode only commands are better off with it, I think.
Cheers,
ta
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 01/21] mtd: spinand: Use more specific naming for the reset op
2025-03-20 8:08 ` Tudor Ambarus
@ 2025-03-20 11:31 ` Miquel Raynal
2025-03-20 12:03 ` Tudor Ambarus
0 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-03-20 11:31 UTC (permalink / raw)
To: Tudor Ambarus
Cc: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K,
Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
>>> How do you feel about a OP-An-Bn-Cn-transaction-format,
>>> where A, B, C is {1, 2, 4, 8}
>>> n is {S, D}
>>> transaction format is {0,1,2,3}{A,B,C,...}
>>>
>>> Care must be taken care of at the transaction format, as I see there are
>>> a few, depending on the xSPI profile and protocol mode.
>>
>> I must admit I really dislike the transaction format abbreviation because
>
> I'm not in love with the "transaction format" either.
>
>> it is specific to a spec we do not follow and is not explicit. I have a
>> strong preference towards keeping just "An-Bn-Cn", like I did in this
>
> Okay.
>
>> series. If people are in doubt, they can check what is in the op, it is
>> self explanatory. I chose this in the first place because it is more
>> explicit than just "An" which may feel like a cropped
>> acronym. Furthermore, most octal capable datasheets I've looked at seem
>> to use the "An-Bn-Cn" format, even for single opcodes.
>
> So for RESET, WREN, WRDI and other opcodes that don't require address
> and data, are those datasheets referring to these opcodes as 1-1-1 commands?
> Can you point me to one of these datasheets, please?
All Winbond datasheets use this convention:
https://www.winbond.com/export/sites/winbond/datasheet/W35N01JW_Datasheet_Brief.pdf
See 7.1.2 Instruction Set Table p.25.
I checked Macronix and Gigadevice datasheets, they simply never "name"
these opcodes clearly.
> In SPI NOR, WREN is just WREN, regardless of the number of lines it is
> sent on, 1, 4, or 8. How would you model it here, 1-0-0, 4-0-0, 8-0-0
> using the same opcode?
I guess, yes.
>> So unless there are strong arguments against, I'd prefer to keep the
>> current formatting. TBH, it is not set in stone and can still evolve
>> later if that's needed.
>
> I find the naming scheme An-Bn-Cn good, I'm arguing that it's not needed
> everywhere, opcode only commands are better off with it, I think.
Ok, I can drop the -0-0 in this case if you prefer.
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 01/21] mtd: spinand: Use more specific naming for the reset op
2025-03-20 11:31 ` Miquel Raynal
@ 2025-03-20 12:03 ` Tudor Ambarus
0 siblings, 0 replies; 54+ messages in thread
From: Tudor Ambarus @ 2025-03-20 12:03 UTC (permalink / raw)
To: Miquel Raynal
Cc: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K,
Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
On 3/20/25 11:31 AM, Miquel Raynal wrote:
>
>>>> How do you feel about a OP-An-Bn-Cn-transaction-format,
>>>> where A, B, C is {1, 2, 4, 8}
>>>> n is {S, D}
>>>> transaction format is {0,1,2,3}{A,B,C,...}
>>>>
>>>> Care must be taken care of at the transaction format, as I see there are
>>>> a few, depending on the xSPI profile and protocol mode.
>>>
>>> I must admit I really dislike the transaction format abbreviation because
>>
>> I'm not in love with the "transaction format" either.
>>
>>> it is specific to a spec we do not follow and is not explicit. I have a
>>> strong preference towards keeping just "An-Bn-Cn", like I did in this
>>
>> Okay.
>>
>>> series. If people are in doubt, they can check what is in the op, it is
>>> self explanatory. I chose this in the first place because it is more
>>> explicit than just "An" which may feel like a cropped
>>> acronym. Furthermore, most octal capable datasheets I've looked at seem
>>> to use the "An-Bn-Cn" format, even for single opcodes.
>>
>> So for RESET, WREN, WRDI and other opcodes that don't require address
>> and data, are those datasheets referring to these opcodes as 1-1-1 commands?
>> Can you point me to one of these datasheets, please?
>
> All Winbond datasheets use this convention:
> https://www.winbond.com/export/sites/winbond/datasheet/W35N01JW_Datasheet_Brief.pdf
> See 7.1.2 Instruction Set Table p.25.
>
Nice, thanks!
> I checked Macronix and Gigadevice datasheets, they simply never "name"
> these opcodes clearly.
okay
>
>> In SPI NOR, WREN is just WREN, regardless of the number of lines it is
>> sent on, 1, 4, or 8. How would you model it here, 1-0-0, 4-0-0, 8-0-0
>> using the same opcode?
>
> I guess, yes.
>
>>> So unless there are strong arguments against, I'd prefer to keep the
>>> current formatting. TBH, it is not set in stone and can still evolve
>>> later if that's needed.
>>
>> I find the naming scheme An-Bn-Cn good, I'm arguing that it's not needed
>> everywhere, opcode only commands are better off with it, I think.
>
> Ok, I can drop the -0-0 in this case if you prefer.
Not needed. Just wanted to make sure we have a unified way of dealing
with the protocol modes. Having WREN-1-0-0 and WREN-8d-0-0 is not that
bad after all, it allows you to specify the number of lines directly,
without mangling the op afterwards.
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Thanks for the patience. I'll check the other patches next week.
Cheers,
ta
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 02/21] mtd: spinand: Use more specific naming for the write enable/disable op
2025-03-07 15:08 ` [PATCH 02/21] mtd: spinand: Use more specific naming for the write enable/disable op Miquel Raynal
2025-03-07 15:39 ` Tudor Ambarus
@ 2025-03-20 12:22 ` Tudor Ambarus
1 sibling, 0 replies; 54+ messages in thread
From: Tudor Ambarus @ 2025-03-20 12:22 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Santhosh Kumar K
Cc: Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
On 3/7/25 3:08 PM, Miquel Raynal wrote:
> SPI operations have been initially described through macros implicitly
> implying the use of a single SPI SDR bus. Macros for supporting dual and
> quad I/O transfers have been added on top, generally inspired by vendor
> naming, followed by DTR operations. Soon we might see octal
> and even octal DTR operations as well (including the opcode byte).
>
> Let's clarify what the macro really means by describing the expected bus
> topology in the write enable/disable macro names.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
> drivers/mtd/nand/spi/core.c | 2 +-
> include/linux/mtd/spinand.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> index ea6b48242ad4a4e51c713907ce5cc55022cdb569..bbf0048104aac86e90b0706793db8503c8fc2a3b 100644
> --- a/drivers/mtd/nand/spi/core.c
> +++ b/drivers/mtd/nand/spi/core.c
> @@ -362,7 +362,7 @@ static void spinand_ondie_ecc_save_status(struct nand_device *nand, u8 status)
>
> static int spinand_write_enable_op(struct spinand_device *spinand)
> {
> - struct spi_mem_op op = SPINAND_WR_EN_DIS_OP(true);
> + struct spi_mem_op op = SPINAND_WR_EN_DIS_1S_0_0_OP(true);
>
> return spi_mem_exec_op(spinand->spimem, &op);
> }
> diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
> index 4f47adbe4566d7813ffd8fbfaddd1a85d88d0208..0d2f92d0746e8079e46bac9402ddd22d3d2a86bf 100644
> --- a/include/linux/mtd/spinand.h
> +++ b/include/linux/mtd/spinand.h
> @@ -26,7 +26,7 @@
> SPI_MEM_OP_NO_DUMMY, \
> SPI_MEM_OP_NO_DATA)
>
> -#define SPINAND_WR_EN_DIS_OP(enable) \
> +#define SPINAND_WR_EN_DIS_1S_0_0_OP(enable) \
> SPI_MEM_OP(SPI_MEM_OP_CMD((enable) ? 0x06 : 0x04, 1), \
> SPI_MEM_OP_NO_ADDR, \
> SPI_MEM_OP_NO_DUMMY, \
>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 05/21] mtd: spinand: Use more specific naming for the erase op
2025-03-07 15:08 ` [PATCH 05/21] mtd: spinand: Use more specific naming for the erase op Miquel Raynal
2025-03-07 15:45 ` Tudor Ambarus
@ 2025-03-20 12:23 ` Tudor Ambarus
1 sibling, 0 replies; 54+ messages in thread
From: Tudor Ambarus @ 2025-03-20 12:23 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Santhosh Kumar K
Cc: Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
On 3/7/25 3:08 PM, Miquel Raynal wrote:
> SPI operations have been initially described through macros implicitly
> implying the use of a single SPI SDR bus. Macros for supporting dual and
> quad I/O transfers have been added on top, generally inspired by vendor
> naming, followed by DTR operations. Soon we might see octal
> and even octal DTR operations as well (including the opcode byte).
>
> Let's clarify what the macro really means by describing the expected bus
> topology in the erase macro name.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
> drivers/mtd/nand/spi/core.c | 2 +-
> include/linux/mtd/spinand.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> index b6c0993206ebab1dcee715ea6de33efe7d5af3a2..1959e8d9c64be004c71a0d6ac6454fde08e708fa 100644
> --- a/drivers/mtd/nand/spi/core.c
> +++ b/drivers/mtd/nand/spi/core.c
> @@ -529,7 +529,7 @@ static int spinand_erase_op(struct spinand_device *spinand,
> {
> struct nand_device *nand = spinand_to_nand(spinand);
> unsigned int row = nanddev_pos_to_row(nand, pos);
> - struct spi_mem_op op = SPINAND_BLK_ERASE_OP(row);
> + struct spi_mem_op op = SPINAND_BLK_ERASE_1S_1S_0_OP(row);
>
> return spi_mem_exec_op(spinand->spimem, &op);
> }
> diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
> index d041b1cc18de6add45800eaa7605bda1c64ca257..545531afe2dac593d112065483afd180226cc533 100644
> --- a/include/linux/mtd/spinand.h
> +++ b/include/linux/mtd/spinand.h
> @@ -50,7 +50,7 @@
> SPI_MEM_OP_NO_DUMMY, \
> SPI_MEM_OP_DATA_IN(1, valptr, 1))
>
> -#define SPINAND_BLK_ERASE_OP(addr) \
> +#define SPINAND_BLK_ERASE_1S_1S_0_OP(addr) \
> SPI_MEM_OP(SPI_MEM_OP_CMD(0xd8, 1), \
> SPI_MEM_OP_ADDR(3, addr, 1), \
> SPI_MEM_OP_NO_DUMMY, \
>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 06/21] mtd: spinand: Use more specific naming for the page read op
2025-03-07 15:08 ` [PATCH 06/21] mtd: spinand: Use more specific naming for the page read op Miquel Raynal
@ 2025-03-20 12:28 ` Tudor Ambarus
0 siblings, 0 replies; 54+ messages in thread
From: Tudor Ambarus @ 2025-03-20 12:28 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Santhosh Kumar K
Cc: Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
On 3/7/25 3:08 PM, Miquel Raynal wrote:
> SPI operations have been initially described through macros implicitly
> implying the use of a single SPI SDR bus. Macros for supporting dual and
> quad I/O transfers have been added on top, generally inspired by vendor
> naming, followed by DTR operations. Soon we might see octal
> and even octal DTR operations as well (including the opcode byte).
>
> Let's clarify what the macro really means by describing the expected bus
> topology in the page read macro name.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
> drivers/mtd/nand/spi/core.c | 2 +-
> include/linux/mtd/spinand.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> index 1959e8d9c64be004c71a0d6ac6454fde08e708fa..2ebc802299068ef69068422d1ef6585f63365832 100644
> --- a/drivers/mtd/nand/spi/core.c
> +++ b/drivers/mtd/nand/spi/core.c
> @@ -372,7 +372,7 @@ static int spinand_load_page_op(struct spinand_device *spinand,
> {
> struct nand_device *nand = spinand_to_nand(spinand);
> unsigned int row = nanddev_pos_to_row(nand, &req->pos);
> - struct spi_mem_op op = SPINAND_PAGE_READ_OP(row);
> + struct spi_mem_op op = SPINAND_PAGE_READ_1S_1S_0_OP(row);
>
> return spi_mem_exec_op(spinand->spimem, &op);
> }
> diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
> index 545531afe2dac593d112065483afd180226cc533..882b635228860f45e52d516421c1fc3b2c723b9b 100644
> --- a/include/linux/mtd/spinand.h
> +++ b/include/linux/mtd/spinand.h
> @@ -56,7 +56,7 @@
> SPI_MEM_OP_NO_DUMMY, \
> SPI_MEM_OP_NO_DATA)
>
> -#define SPINAND_PAGE_READ_OP(addr) \
> +#define SPINAND_PAGE_READ_1S_1S_0_OP(addr) \
I now see that when all STR you chose to still put S next to the op
fields. 1_1_0_OP is alright too, it's equivalent to 1S-1S-0. Both are
fine for me:
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> SPI_MEM_OP(SPI_MEM_OP_CMD(0x13, 1), \
> SPI_MEM_OP_ADDR(3, addr, 1), \
> SPI_MEM_OP_NO_DUMMY, \
>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 07/21] mtd: spinand: Use more specific naming for the (single) read from cache ops
2025-03-07 15:08 ` [PATCH 07/21] mtd: spinand: Use more specific naming for the (single) read from cache ops Miquel Raynal
@ 2025-04-02 15:05 ` Tudor Ambarus
0 siblings, 0 replies; 54+ messages in thread
From: Tudor Ambarus @ 2025-04-02 15:05 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Santhosh Kumar K
Cc: Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 08/21] mtd: spinand: Use more specific naming for the (dual output) read from cache ops
2025-03-07 15:08 ` [PATCH 08/21] mtd: spinand: Use more specific naming for the (dual output) " Miquel Raynal
@ 2025-04-02 15:06 ` Tudor Ambarus
0 siblings, 0 replies; 54+ messages in thread
From: Tudor Ambarus @ 2025-04-02 15:06 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Santhosh Kumar K
Cc: Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 09/21] mtd: spinand: Use more specific naming for the (dual IO) read from cache ops
2025-03-07 15:08 ` [PATCH 09/21] mtd: spinand: Use more specific naming for the (dual IO) " Miquel Raynal
@ 2025-04-02 15:07 ` Tudor Ambarus
0 siblings, 0 replies; 54+ messages in thread
From: Tudor Ambarus @ 2025-04-02 15:07 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Santhosh Kumar K
Cc: Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 10/21] mtd: spinand: Use more specific naming for the (quad output) read from cache ops
2025-03-07 15:08 ` [PATCH 10/21] mtd: spinand: Use more specific naming for the (quad output) " Miquel Raynal
@ 2025-04-02 15:07 ` Tudor Ambarus
0 siblings, 0 replies; 54+ messages in thread
From: Tudor Ambarus @ 2025-04-02 15:07 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Santhosh Kumar K
Cc: Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 11/21] mtd: spinand: Use more specific naming for the (quad IO) read from cache ops
2025-03-07 15:08 ` [PATCH 11/21] mtd: spinand: Use more specific naming for the (quad IO) " Miquel Raynal
@ 2025-04-02 15:08 ` Tudor Ambarus
0 siblings, 0 replies; 54+ messages in thread
From: Tudor Ambarus @ 2025-04-02 15:08 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Santhosh Kumar K
Cc: Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 12/21] mtd: spinand: Use more specific naming for the program execution op
2025-03-07 15:08 ` [PATCH 12/21] mtd: spinand: Use more specific naming for the program execution op Miquel Raynal
@ 2025-04-02 15:12 ` Tudor Ambarus
0 siblings, 0 replies; 54+ messages in thread
From: Tudor Ambarus @ 2025-04-02 15:12 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Santhosh Kumar K
Cc: Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 13/21] mtd: spinand: Use more specific naming for the (single) program load op
2025-03-07 15:08 ` [PATCH 13/21] mtd: spinand: Use more specific naming for the (single) program load op Miquel Raynal
@ 2025-04-02 15:13 ` Tudor Ambarus
0 siblings, 0 replies; 54+ messages in thread
From: Tudor Ambarus @ 2025-04-02 15:13 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Santhosh Kumar K
Cc: Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 14/21] mtd: spinand: Use more specific naming for the (quad) program load op
2025-03-07 15:08 ` [PATCH 14/21] mtd: spinand: Use more specific naming for the (quad) " Miquel Raynal
@ 2025-04-02 15:13 ` Tudor Ambarus
0 siblings, 0 replies; 54+ messages in thread
From: Tudor Ambarus @ 2025-04-02 15:13 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Santhosh Kumar K
Cc: Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 15/21] mtd: spinand: winbond: Rename DTR variants
2025-03-07 15:08 ` [PATCH 15/21] mtd: spinand: winbond: Rename DTR variants Miquel Raynal
@ 2025-04-02 15:19 ` Tudor Ambarus
2025-04-02 16:57 ` Miquel Raynal
0 siblings, 1 reply; 54+ messages in thread
From: Tudor Ambarus @ 2025-04-02 15:19 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Santhosh Kumar K
Cc: Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
Hi, Miquel,
On 3/7/25 3:08 PM, Miquel Raynal wrote:
> -static SPINAND_OP_VARIANTS(read_cache_dtr_variants,
> +static SPINAND_OP_VARIANTS(read_cache_dual_quad_dtr_variants,
why not read_cache_single_dual_quad_dtr_variants? I see single dtr too
in the supported ops.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 16/21] mtd: spinand: winbond: Add support for W35N01JW in single mode
2025-03-07 15:08 ` [PATCH 16/21] mtd: spinand: winbond: Add support for W35N01JW in single mode Miquel Raynal
@ 2025-04-02 15:22 ` Tudor Ambarus
2025-04-02 17:06 ` Miquel Raynal
0 siblings, 1 reply; 54+ messages in thread
From: Tudor Ambarus @ 2025-04-02 15:22 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Santhosh Kumar K
Cc: Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
On 3/7/25 3:08 PM, Miquel Raynal wrote:
> Add support for the W35N series by describing the smaller (single die)
> chip. It has 1b/512B ECC support and its own OOB layout.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
> drivers/mtd/nand/spi/winbond.c | 54 ++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 54 insertions(+)
>
> diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
> index 99b9f333eb3142999d8f73d43537f1ed9789c975..9b0369a077efadac8bd6be632f15b822d42a7227 100644
> --- a/drivers/mtd/nand/spi/winbond.c
> +++ b/drivers/mtd/nand/spi/winbond.c
> @@ -23,6 +23,16 @@
> * "X4" in the core is equivalent to "quad output" in the datasheets.
> */
>
> +static SPINAND_OP_VARIANTS(read_cache_octal_variants,
> + SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
> + SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
strange to see octal variants name, but just single SPI ops defined. I
see you define octal in the next two patches. How about squashing all 3?
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 21/21] mtd: spinand: winbond: Add support for W35N02JW and W35N02JW chips
2025-03-07 15:08 ` [PATCH 21/21] mtd: spinand: winbond: Add support for W35N02JW and W35N02JW chips Miquel Raynal
@ 2025-04-02 15:25 ` Tudor Ambarus
0 siblings, 0 replies; 54+ messages in thread
From: Tudor Ambarus @ 2025-04-02 15:25 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Santhosh Kumar K
Cc: Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
I'd consider squashing all patches from 16 to 21. But not a strong
requirement. I guess it's a master of preference.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 15/21] mtd: spinand: winbond: Rename DTR variants
2025-04-02 15:19 ` Tudor Ambarus
@ 2025-04-02 16:57 ` Miquel Raynal
2025-04-03 6:19 ` Tudor Ambarus
0 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-04-02 16:57 UTC (permalink / raw)
To: Tudor Ambarus
Cc: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K,
Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
Hello Tudor,
First, thanks a lot for the time spent reviewing, much appreciated.
On 02/04/2025 at 16:19:00 +01, Tudor Ambarus <tudor.ambarus@linaro.org> wrote:
> Hi, Miquel,
>
> On 3/7/25 3:08 PM, Miquel Raynal wrote:
>> -static SPINAND_OP_VARIANTS(read_cache_dtr_variants,
>> +static SPINAND_OP_VARIANTS(read_cache_dual_quad_dtr_variants,
>
> why not read_cache_single_dual_quad_dtr_variants? I see single dtr too
> in the supported ops.
That's true, but single modes are literally always supported, so it is
not very discriminant, and here my goal is to differentiate the variants
supported by the dual/quad chips vs. the variants supported by the octal
chips (which are not capable of dual/quad transfers). What do you think?
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 16/21] mtd: spinand: winbond: Add support for W35N01JW in single mode
2025-04-02 15:22 ` Tudor Ambarus
@ 2025-04-02 17:06 ` Miquel Raynal
0 siblings, 0 replies; 54+ messages in thread
From: Miquel Raynal @ 2025-04-02 17:06 UTC (permalink / raw)
To: Tudor Ambarus
Cc: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K,
Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
On 02/04/2025 at 16:22:41 +01, Tudor Ambarus <tudor.ambarus@linaro.org> wrote:
> On 3/7/25 3:08 PM, Miquel Raynal wrote:
>> Add support for the W35N series by describing the smaller (single die)
>> chip. It has 1b/512B ECC support and its own OOB layout.
>>
>> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
>> ---
>> drivers/mtd/nand/spi/winbond.c | 54 ++++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 54 insertions(+)
>>
>> diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
>> index 99b9f333eb3142999d8f73d43537f1ed9789c975..9b0369a077efadac8bd6be632f15b822d42a7227 100644
>> --- a/drivers/mtd/nand/spi/winbond.c
>> +++ b/drivers/mtd/nand/spi/winbond.c
>> @@ -23,6 +23,16 @@
>> * "X4" in the core is equivalent to "quad output" in the datasheets.
>> */
>>
>> +static SPINAND_OP_VARIANTS(read_cache_octal_variants,
>> + SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0),
>> + SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0));
>
> strange to see octal variants name, but just single SPI ops defined. I
> see you define octal in the next two patches.
Octal is what supports the chip, even though at this stage it is not
pictured. I could rename the variant somewhere later, but I don't like
that as it makes git-blames more difficult and the result is the same
anyway.
> How about squashing all 3?
I prefer to keep core changes separated from manufacturer driver changes
when possible. And for the introduction of the features, it felt correct
to introduce a first level of feature, show the performance, and then a
second level, show again the performance improvement. Maybe I can
re-shuffle the patches to sort core vs. manufacturer changes and squash
patches 17-19 and 18-20 though.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 15/21] mtd: spinand: winbond: Rename DTR variants
2025-04-02 16:57 ` Miquel Raynal
@ 2025-04-03 6:19 ` Tudor Ambarus
2025-04-03 8:53 ` Miquel Raynal
0 siblings, 1 reply; 54+ messages in thread
From: Tudor Ambarus @ 2025-04-03 6:19 UTC (permalink / raw)
To: Miquel Raynal
Cc: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K,
Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
On 4/2/25 5:57 PM, Miquel Raynal wrote:
> Hello Tudor,
>
> First, thanks a lot for the time spent reviewing, much appreciated.
>
> On 02/04/2025 at 16:19:00 +01, Tudor Ambarus <tudor.ambarus@linaro.org> wrote:
>
>> Hi, Miquel,
>>
>> On 3/7/25 3:08 PM, Miquel Raynal wrote:
>>> -static SPINAND_OP_VARIANTS(read_cache_dtr_variants,
>>> +static SPINAND_OP_VARIANTS(read_cache_dual_quad_dtr_variants,
>>
>> why not read_cache_single_dual_quad_dtr_variants? I see single dtr too
>> in the supported ops.
>
> That's true, but single modes are literally always supported, so it is
literally, meaning from experience I guess, or is it mandatory that
dual, quad or octal dtr to imply single dtr as well? That's fine either
way, just curious.
Does quad dtr imply dual dtr? And octal dtr imply quad dtr and dual dtr?
If so, then maybe name it by the maximum IO dtr supported.
btw, not strictly related to this patch, but for the overall
architecture picture, why do the SPI NAND flashes need to define their
supported ops? SPI NORs for example are capable of discovering their
supported ops by parsing at runtime some SFDP tables that describe most
of the flash parameters and setting. I see SFDP standard (jesd216g)
mentions SPI NAND devices as well. Have you or anybody else played with
SPI NANDs SFDP?
> not very discriminant, and here my goal is to differentiate the variants
> supported by the dual/quad chips vs. the variants supported by the octal
> chips (which are not capable of dual/quad transfers). What do you think?
I find it fine to differentiate between the variants.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 15/21] mtd: spinand: winbond: Rename DTR variants
2025-04-03 6:19 ` Tudor Ambarus
@ 2025-04-03 8:53 ` Miquel Raynal
2025-04-03 9:48 ` Tudor Ambarus
0 siblings, 1 reply; 54+ messages in thread
From: Miquel Raynal @ 2025-04-03 8:53 UTC (permalink / raw)
To: Tudor Ambarus
Cc: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K,
Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
Hello Tudor,
On 03/04/2025 at 07:19:15 +01, Tudor Ambarus <tudor.ambarus@linaro.org> wrote:
> On 4/2/25 5:57 PM, Miquel Raynal wrote:
>> Hello Tudor,
>>
>> First, thanks a lot for the time spent reviewing, much appreciated.
>>
>> On 02/04/2025 at 16:19:00 +01, Tudor Ambarus <tudor.ambarus@linaro.org> wrote:
>>
>>> Hi, Miquel,
>>>
>>> On 3/7/25 3:08 PM, Miquel Raynal wrote:
>>>> -static SPINAND_OP_VARIANTS(read_cache_dtr_variants,
>>>> +static SPINAND_OP_VARIANTS(read_cache_dual_quad_dtr_variants,
>>>
>>> why not read_cache_single_dual_quad_dtr_variants? I see single dtr too
>>> in the supported ops.
>>
>> That's true, but single modes are literally always supported, so it is
>
> literally, meaning from experience I guess, or is it mandatory that
> dual, quad or octal dtr to imply single dtr as well? That's fine either
> way, just curious.
Yes, I do not know any chip not supporting single SDR mode, just because
we need a common ground to perform the discovery? The core would anyway
not be ready for such chips if they were about to come.
> Does quad dtr imply dual dtr? And octal dtr imply quad dtr and dual dtr?
> If so, then maybe name it by the maximum IO dtr supported.
Unfortunately not. Chips supporting quad may also support dual, but not
always. These chips flagged 'dual_quad' indeed support both. However in
this particular case, octal chips do not support dual or quad
opcodes. Hence my idea to name the variants about what is supported,
behind 1S opcodes.
> btw, not strictly related to this patch, but for the overall
> architecture picture, why do the SPI NAND flashes need to define their
> supported ops? SPI NORs for example are capable of discovering their
> supported ops by parsing at runtime some SFDP tables that describe most
> of the flash parameters and setting. I see SFDP standard (jesd216g)
> mentions SPI NAND devices as well. Have you or anybody else played with
> SPI NANDs SFDP?
Not at all! SPI NANDs commonly advertise a parameter page which is way
more succinct, but no SFDP table.
>> not very discriminant, and here my goal is to differentiate the variants
>> supported by the dual/quad chips vs. the variants supported by the octal
>> chips (which are not capable of dual/quad transfers). What do you think?
>
> I find it fine to differentiate between the variants.
Ok, thanks.
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
* Re: [PATCH 15/21] mtd: spinand: winbond: Rename DTR variants
2025-04-03 8:53 ` Miquel Raynal
@ 2025-04-03 9:48 ` Tudor Ambarus
0 siblings, 0 replies; 54+ messages in thread
From: Tudor Ambarus @ 2025-04-03 9:48 UTC (permalink / raw)
To: Miquel Raynal
Cc: Richard Weinberger, Vignesh Raghavendra, Santhosh Kumar K,
Pratyush Yadav, Michael Walle, Thomas Petazzoni, Steam Lin,
linux-mtd, linux-kernel
On 4/3/25 9:53 AM, Miquel Raynal wrote:
> Hello Tudor,
>
Hi, Miquel!
> On 03/04/2025 at 07:19:15 +01, Tudor Ambarus <tudor.ambarus@linaro.org> wrote:
>
>> On 4/2/25 5:57 PM, Miquel Raynal wrote:
>>> Hello Tudor,
>>>
>>> First, thanks a lot for the time spent reviewing, much appreciated.
>>>
>>> On 02/04/2025 at 16:19:00 +01, Tudor Ambarus <tudor.ambarus@linaro.org> wrote:
>>>
>>>> Hi, Miquel,
>>>>
>>>> On 3/7/25 3:08 PM, Miquel Raynal wrote:
>>>>> -static SPINAND_OP_VARIANTS(read_cache_dtr_variants,
>>>>> +static SPINAND_OP_VARIANTS(read_cache_dual_quad_dtr_variants,
>>>>
>>>> why not read_cache_single_dual_quad_dtr_variants? I see single dtr too
>>>> in the supported ops.
>>>
>>> That's true, but single modes are literally always supported, so it is
>>
>> literally, meaning from experience I guess, or is it mandatory that
>> dual, quad or octal dtr to imply single dtr as well? That's fine either
>> way, just curious.
>
> Yes, I do not know any chip not supporting single SDR mode, just because
> we need a common ground to perform the discovery? The core would anyway
> not be ready for such chips if they were about to come.
okay
>
>> Does quad dtr imply dual dtr? And octal dtr imply quad dtr and dual dtr?
>> If so, then maybe name it by the maximum IO dtr supported.
>
> Unfortunately not. Chips supporting quad may also support dual, but not
> always. These chips flagged 'dual_quad' indeed support both. However in
> this particular case, octal chips do not support dual or quad
> opcodes. Hence my idea to name the variants about what is supported,
> behind 1S opcodes.
sounds good. It's common in SPI NOR too to have octal/single dtr but no
dual or quad dtr.
>
>> btw, not strictly related to this patch, but for the overall
>> architecture picture, why do the SPI NAND flashes need to define their
>> supported ops? SPI NORs for example are capable of discovering their
>> supported ops by parsing at runtime some SFDP tables that describe most
>> of the flash parameters and setting. I see SFDP standard (jesd216g)
>> mentions SPI NAND devices as well. Have you or anybody else played with
>> SPI NANDs SFDP?
>
> Not at all! SPI NANDs commonly advertise a parameter page which is way
> more succinct, but no SFDP table.
okay, the ONFI table I guess.
Cheers,
ta
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 54+ messages in thread
end of thread, other threads:[~2025-04-03 10:18 UTC | newest]
Thread overview: 54+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-07 15:08 [PATCH 00/21] mtd: spinand: Add octal support Miquel Raynal
2025-03-07 15:08 ` [PATCH 01/21] mtd: spinand: Use more specific naming for the reset op Miquel Raynal
2025-03-07 15:38 ` Tudor Ambarus
2025-03-07 15:45 ` Miquel Raynal
2025-03-10 10:14 ` Tudor Ambarus
2025-03-19 17:32 ` Miquel Raynal
2025-03-20 8:08 ` Tudor Ambarus
2025-03-20 11:31 ` Miquel Raynal
2025-03-20 12:03 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 02/21] mtd: spinand: Use more specific naming for the write enable/disable op Miquel Raynal
2025-03-07 15:39 ` Tudor Ambarus
2025-03-07 15:49 ` Miquel Raynal
2025-03-20 12:22 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 03/21] mtd: spinand: Use more specific naming for the read ID op Miquel Raynal
2025-03-07 15:40 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 04/21] mtd: spinand: Use more specific naming for the get/set feature ops Miquel Raynal
2025-03-07 15:42 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 05/21] mtd: spinand: Use more specific naming for the erase op Miquel Raynal
2025-03-07 15:45 ` Tudor Ambarus
2025-03-07 16:03 ` Miquel Raynal
2025-03-20 12:23 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 06/21] mtd: spinand: Use more specific naming for the page read op Miquel Raynal
2025-03-20 12:28 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 07/21] mtd: spinand: Use more specific naming for the (single) read from cache ops Miquel Raynal
2025-04-02 15:05 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 08/21] mtd: spinand: Use more specific naming for the (dual output) " Miquel Raynal
2025-04-02 15:06 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 09/21] mtd: spinand: Use more specific naming for the (dual IO) " Miquel Raynal
2025-04-02 15:07 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 10/21] mtd: spinand: Use more specific naming for the (quad output) " Miquel Raynal
2025-04-02 15:07 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 11/21] mtd: spinand: Use more specific naming for the (quad IO) " Miquel Raynal
2025-04-02 15:08 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 12/21] mtd: spinand: Use more specific naming for the program execution op Miquel Raynal
2025-04-02 15:12 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 13/21] mtd: spinand: Use more specific naming for the (single) program load op Miquel Raynal
2025-04-02 15:13 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 14/21] mtd: spinand: Use more specific naming for the (quad) " Miquel Raynal
2025-04-02 15:13 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 15/21] mtd: spinand: winbond: Rename DTR variants Miquel Raynal
2025-04-02 15:19 ` Tudor Ambarus
2025-04-02 16:57 ` Miquel Raynal
2025-04-03 6:19 ` Tudor Ambarus
2025-04-03 8:53 ` Miquel Raynal
2025-04-03 9:48 ` Tudor Ambarus
2025-03-07 15:08 ` [PATCH 16/21] mtd: spinand: winbond: Add support for W35N01JW in single mode Miquel Raynal
2025-04-02 15:22 ` Tudor Ambarus
2025-04-02 17:06 ` Miquel Raynal
2025-03-07 15:08 ` [PATCH 17/21] mtd: spinand: Define octal read from cache operations Miquel Raynal
2025-03-07 15:08 ` [PATCH 18/21] mtd: spinand: winbond: Add octal read support Miquel Raynal
2025-03-07 15:08 ` [PATCH 19/21] mtd: spinand: Define octal load to cache operations Miquel Raynal
2025-03-07 15:08 ` [PATCH 20/21] mtd: spinand: winbond: Add octal program support Miquel Raynal
2025-03-07 15:08 ` [PATCH 21/21] mtd: spinand: winbond: Add support for W35N02JW and W35N02JW chips Miquel Raynal
2025-04-02 15:25 ` Tudor Ambarus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).