[PATCH v4 11/11] mtd: spi-nand: winbond: Enable the DQS pin on W35N**JW series
From: Miquel Raynal
Date: Fri Nov 20 2026 - 12:16:14 EST
These chips have a DQS pin. Enable its output in DTR mode when the line is
reported as available by the spi-mem layer, which means the chip has DQS,
the line is wired to the controller and the controller supports DQS. There
is apparently no issue in setting it for lower frequencies, and the extra
power consumption seems very low compared to the current drawn by the NAND
array itself while operating, but keep it disabled when the line is not
wired or the controller cannot use it to avoid useless power consumption.
This setting will be required for high speed I/O transfers (with PHY
tuning).
Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
---
drivers/mtd/nand/spi/winbond.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c
index 810975808c97..336bf743778c 100644
--- a/drivers/mtd/nand/spi/winbond.c
+++ b/drivers/mtd/nand/spi/winbond.c
@@ -667,7 +667,9 @@ static int w35n0xjw_vcr_cfg(struct spinand_device *spinand,
else if (!single && !dtr)
io_mode = W35N01JW_VCR_IO_MODE_OCTAL_SDR;
else if (!single && dtr)
- io_mode = W35N01JW_VCR_IO_MODE_OCTAL_DDR;
+ io_mode = spi_mem_dqs_is_usable(spinand->spimem) ?
+ W35N01JW_VCR_IO_MODE_OCTAL_DDR_DS :
+ W35N01JW_VCR_IO_MODE_OCTAL_DDR;
else
return -EINVAL;
@@ -749,7 +751,7 @@ static const struct spinand_info winbond_spinand_table[] = {
&write_cache_octal_variants,
&update_cache_octal_variants,
&cont_read_cache_octal_variants),
- 0,
+ SPINAND_HAS_DQS,
SPINAND_INFO_VENDOR_OPS(&winbond_w35_ops),
SPINAND_ECCINFO(&w35n01jw_ooblayout, w25w35nxxjw_ecc_get_status),
SPINAND_CONFIGURE_CHIP(w35n0xjw_vcr_cfg),
@@ -804,7 +806,7 @@ static const struct spinand_info winbond_spinand_table[] = {
&write_cache_octal_variants,
&update_cache_octal_variants,
&cont_read_cache_octal_variants),
- SPINAND_ODTR_PACKED_PAGE_READ,
+ SPINAND_ODTR_PACKED_PAGE_READ | SPINAND_HAS_DQS,
SPINAND_INFO_VENDOR_OPS(&winbond_w35_ops),
SPINAND_ECCINFO(&w35n01jw_ooblayout, w25w35nxxjw_ecc_get_status),
SPINAND_CONFIGURE_CHIP(w35n0xjw_vcr_cfg),
@@ -845,7 +847,7 @@ static const struct spinand_info winbond_spinand_table[] = {
&write_cache_octal_variants,
&update_cache_octal_variants,
&cont_read_cache_octal_variants),
- SPINAND_ODTR_PACKED_PAGE_READ,
+ SPINAND_ODTR_PACKED_PAGE_READ | SPINAND_HAS_DQS,
SPINAND_INFO_VENDOR_OPS(&winbond_w35_ops),
SPINAND_ECCINFO(&w35n01jw_ooblayout, w25w35nxxjw_ecc_get_status),
SPINAND_CONFIGURE_CHIP(w35n0xjw_vcr_cfg),
--
2.56.0