Lines Matching +full:0 +full:- +full:64
1 // SPDX-License-Identifier: GPL-2.0
13 #define SPINAND_MFR_MACRONIX 0xC2
14 #define MACRONIX_ECCSR_BF_LAST_PAGE(eccsr) FIELD_GET(GENMASK(3, 0), eccsr)
21 #define REG_CFG_BFT 0x10
29 SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
30 SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
31 SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(0, 1, NULL, 0),
32 SPINAND_PAGE_READ_FROM_CACHE_OP(0, 1, NULL, 0));
35 SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
36 SPINAND_PROG_LOAD(false, 0, NULL, 0));
39 SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
40 SPINAND_PROG_LOAD(false, 0, NULL, 0));
45 return -ERANGE; in mx35lfxge4ab_ooblayout_ecc()
52 return -ERANGE; in mx35lfxge4ab_ooblayout_free()
54 region->offset = 2; in mx35lfxge4ab_ooblayout_free()
55 region->length = mtd->oobsize - 2; in mx35lfxge4ab_ooblayout_free()
57 return 0; in mx35lfxge4ab_ooblayout_free()
67 struct macronix_priv *priv = spinand->priv; in macronix_get_eccsr()
68 struct spi_mem_op op = SPI_MEM_OP(SPI_MEM_OP_CMD(0x7c, 1), in macronix_get_eccsr()
73 int ret = spi_mem_exec_op(spinand->spimem, &op); in macronix_get_eccsr()
78 * ECCSR exposes the number of bitflips for the last read page in bits [3:0]. in macronix_get_eccsr()
82 if (!priv->cont_read) in macronix_get_eccsr()
87 return 0; in macronix_get_eccsr()
98 return 0; in macronix_ecc_get_status()
101 return -EBADMSG; in macronix_ecc_get_status()
106 * in order to avoid forcing the wear-leveling layer to move in macronix_ecc_get_status()
109 if (macronix_get_eccsr(spinand, spinand->scratchbuf)) in macronix_ecc_get_status()
110 return nanddev_get_ecc_conf(nand)->strength; in macronix_ecc_get_status()
112 eccsr = *spinand->scratchbuf; in macronix_ecc_get_status()
113 if (WARN_ON(eccsr > nanddev_get_ecc_conf(nand)->strength || !eccsr)) in macronix_ecc_get_status()
114 return nanddev_get_ecc_conf(nand)->strength; in macronix_ecc_get_status()
121 return -EINVAL; in macronix_ecc_get_status()
126 struct macronix_priv *priv = spinand->priv; in macronix_set_cont_read()
130 enable ? MACRONIX_CFG_CONT_READ : 0); in macronix_set_cont_read()
134 priv->cont_read = enable; in macronix_set_cont_read()
136 return 0; in macronix_set_cont_read()
141 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x12),
142 NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
151 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x22),
152 NAND_MEMORG(1, 2048, 64, 64, 2048, 40, 2, 1, 1),
162 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x26, 0x03),
163 NAND_MEMORG(1, 2048, 64, 64, 2048, 40, 1, 1, 1),
173 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x37, 0x03),
174 NAND_MEMORG(1, 4096, 128, 64, 2048, 40, 1, 1, 1),
184 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x14, 0x03),
185 NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
193 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x24, 0x03),
194 NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 2, 1, 1),
202 SPINAND_INFO("MX35LF2G24AD-Z4I8",
203 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x64, 0x03),
204 NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
212 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x35, 0x03),
213 NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 2, 1, 1),
221 SPINAND_INFO("MX35LF4G24AD-Z4I8",
222 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x75, 0x03),
223 NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
231 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x1e),
232 NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
241 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x9e),
242 NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
252 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x20),
253 NAND_MEMORG(1, 2048, 64, 64, 2048, 40, 2, 1, 1),
264 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xb5, 0x03),
265 NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 2, 1, 1),
274 SPINAND_INFO("MX35UF4G24AD-Z4I8",
275 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xf5, 0x03),
276 NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
285 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xb7, 0x03),
286 NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
296 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xa0),
297 NAND_MEMORG(1, 2048, 64, 64, 2048, 40, 2, 1, 1),
308 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xa4, 0x03),
309 NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 2, 1, 1),
318 SPINAND_INFO("MX35UF2G24AD-Z4I8",
319 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xe4, 0x03),
320 NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
329 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xa6, 0x03),
330 NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
340 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xa2, 0x01),
341 NAND_MEMORG(1, 2048, 64, 64, 2048, 40, 1, 1, 1),
351 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x90),
352 NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
361 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x94, 0x03),
362 NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
371 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x96, 0x03),
372 NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
382 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x92, 0x01),
383 NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
393 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x2e),
394 NAND_MEMORG(1, 2048, 64, 64, 2048, 40, 1, 1, 1),
403 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xae),
404 NAND_MEMORG(1, 2048, 64, 64, 2048, 40, 1, 1, 1),
420 return -ENOMEM; in macronix_spinand_init()
422 spinand->priv = priv; in macronix_spinand_init()
424 return 0; in macronix_spinand_init()
429 kfree(spinand->priv); in macronix_spinand_cleanup()