Lines Matching +full:wear +full:- +full:leveling
1 // SPDX-License-Identifier: GPL-2.0
94 return -ERANGE; in w25m02gv_ooblayout_ecc()
96 region->offset = (16 * section) + 8; in w25m02gv_ooblayout_ecc()
97 region->length = 8; in w25m02gv_ooblayout_ecc()
106 return -ERANGE; in w25m02gv_ooblayout_free()
108 region->offset = (16 * section) + 2; in w25m02gv_ooblayout_free()
109 region->length = 6; in w25m02gv_ooblayout_free()
126 spinand->scratchbuf, in w25m02gv_select_target()
129 *spinand->scratchbuf = target; in w25m02gv_select_target()
130 return spi_mem_exec_op(spinand->spimem, &op); in w25m02gv_select_target()
137 return -ERANGE; in w25n01kv_ooblayout_ecc()
139 region->offset = 64 + (8 * section); in w25n01kv_ooblayout_ecc()
140 region->length = 7; in w25n01kv_ooblayout_ecc()
149 return -ERANGE; in w25n02kv_ooblayout_ecc()
151 region->offset = 64 + (16 * section); in w25n02kv_ooblayout_ecc()
152 region->length = 13; in w25n02kv_ooblayout_ecc()
161 return -ERANGE; in w25n02kv_ooblayout_free()
163 region->offset = (16 * section) + 2; in w25n02kv_ooblayout_free()
164 region->length = 14; in w25n02kv_ooblayout_free()
183 return -ERANGE; in w25n01jw_ooblayout_ecc()
185 region->offset = (16 * section) + 12; in w25n01jw_ooblayout_ecc()
186 region->length = 4; in w25n01jw_ooblayout_ecc()
195 return -ERANGE; in w25n01jw_ooblayout_free()
197 region->offset = (16 * section); in w25n01jw_ooblayout_free()
198 region->length = 12; in w25n01jw_ooblayout_free()
202 region->offset += 2; in w25n01jw_ooblayout_free()
203 region->length -= 2; in w25n01jw_ooblayout_free()
213 return -ERANGE; in w35n01jw_ooblayout_ecc()
215 region->offset = (16 * section) + 12; in w35n01jw_ooblayout_ecc()
216 region->length = 4; in w35n01jw_ooblayout_ecc()
225 return -ERANGE; in w35n01jw_ooblayout_free()
227 region->offset = 16 * section; in w35n01jw_ooblayout_free()
228 region->length = 12; in w35n01jw_ooblayout_free()
232 region->offset += 2; in w35n01jw_ooblayout_free()
233 region->length -= 2; in w35n01jw_ooblayout_free()
254 struct spi_mem_op op = SPINAND_GET_FEATURE_1S_1S_1S_OP(0x30, spinand->scratchbuf); in w25n02kv_ecc_get_status()
261 return -EBADMSG; in w25n02kv_ecc_get_status()
267 * in order to avoid forcing the wear-leveling layer to move in w25n02kv_ecc_get_status()
270 if (spi_mem_exec_op(spinand->spimem, &op)) in w25n02kv_ecc_get_status()
271 return nanddev_get_ecc_conf(nand)->strength; in w25n02kv_ecc_get_status()
273 mbf = *(spinand->scratchbuf) >> 4; in w25n02kv_ecc_get_status()
275 if (WARN_ON(mbf > nanddev_get_ecc_conf(nand)->strength || !mbf)) in w25n02kv_ecc_get_status()
276 return nanddev_get_ecc_conf(nand)->strength; in w25n02kv_ecc_get_status()
284 return -EINVAL; in w25n02kv_ecc_get_status()
294 op = spinand->op_templates.read_cache; in w25n0xjw_hs_cfg()
295 if (op->cmd.dtr || op->addr.dtr || op->dummy.dtr || op->data.dtr) in w25n0xjw_hs_cfg()
297 else if (op->cmd.buswidth == 1 && op->addr.buswidth == 1 && in w25n0xjw_hs_cfg()
298 op->dummy.buswidth == 1 && op->data.buswidth == 1) in w25n0xjw_hs_cfg()
300 else if (!op->max_freq) in w25n0xjw_hs_cfg()
327 SPI_MEM_OP_DATA_OUT(1, spinand->scratchbuf, 1)); in w35n0xjw_write_vcr()
330 *spinand->scratchbuf = val; in w35n0xjw_write_vcr()
336 ret = spi_mem_exec_op(spinand->spimem, &op); in w35n0xjw_write_vcr()
358 op = spinand->op_templates.read_cache; in w35n0xjw_vcr_cfg()
360 single = (op->cmd.buswidth == 1 && op->addr.buswidth == 1 && op->data.buswidth == 1); in w35n0xjw_vcr_cfg()
361 dtr = (op->cmd.dtr || op->addr.dtr || op->data.dtr); in w35n0xjw_vcr_cfg()
369 return -EINVAL; in w35n0xjw_vcr_cfg()
375 dummy_cycles = ((op->dummy.nbytes * 8) / op->dummy.buswidth) / (op->dummy.dtr ? 2 : 1); in w35n0xjw_vcr_cfg()
385 return -EINVAL; in w35n0xjw_vcr_cfg()
395 /* 512M-bit densities */
405 /* 1G-bit densities */
424 SPINAND_INFO("W25N01JW", /* high-speed 1.8V */
473 /* 2G-bit densities */
474 SPINAND_INFO("W25M02GV", /* 2x1G-bit 3.3V */
484 SPINAND_INFO("W25N02JW", /* high-speed 1.8V */
512 /* 4G-bit densities */
542 for (i = 0; i < nand->memorg.ntargets; i++) { in winbond_spinand_init()