Skip to content

Commit 1ea808b

Browse files
committed
mtd: spinand: winbond: Update the *JW chip definitions
W25N01JW and W25N02JW use a different technology with higher frequencies supported (up to 166MHz). There is one drawback though, the slowest READ_FROM_CACHE command cannot run above 54MHz. Because of that, we need to set a limit for these chips on the basic READ_FROM_CACHE variant. Duplicating this list is not a problem because these chips have DTR support, and the list of supported variants will diverge from all the other chips when adding support for it. Cc: stable+noautosel@kernel.org # New feature being added Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
1 parent 8586bc8 commit 1ea808b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

drivers/mtd/nand/spi/winbond.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,22 @@
1010
#include <linux/device.h>
1111
#include <linux/kernel.h>
1212
#include <linux/mtd/spinand.h>
13+
#include <linux/units.h>
1314

1415
#define SPINAND_MFR_WINBOND 0xEF
1516

1617
#define WINBOND_CFG_BUF_READ BIT(3)
1718

1819
#define W25N04KV_STATUS_ECC_5_8_BITFLIPS (3 << 4)
1920

21+
static SPINAND_OP_VARIANTS(read_cache_dtr_variants,
22+
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
23+
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
24+
SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
25+
SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
26+
SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(0, 1, NULL, 0),
27+
SPINAND_PAGE_READ_FROM_CACHE_OP(0, 1, NULL, 0, 54 * HZ_PER_MHZ));
28+
2029
static SPINAND_OP_VARIANTS(read_cache_variants,
2130
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
2231
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
@@ -194,7 +203,7 @@ static const struct spinand_info winbond_spinand_table[] = {
194203
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xbc, 0x21),
195204
NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
196205
NAND_ECCREQ(1, 512),
197-
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
206+
SPINAND_INFO_OP_VARIANTS(&read_cache_dtr_variants,
198207
&write_cache_variants,
199208
&update_cache_variants),
200209
0,
@@ -223,7 +232,7 @@ static const struct spinand_info winbond_spinand_table[] = {
223232
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xbf, 0x22),
224233
NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 2, 1),
225234
NAND_ECCREQ(1, 512),
226-
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
235+
SPINAND_INFO_OP_VARIANTS(&read_cache_dtr_variants,
227236
&write_cache_variants,
228237
&update_cache_variants),
229238
0,

0 commit comments

Comments
 (0)