Lines Matching +full:- +full:section

1 // SPDX-License-Identifier: GPL-2.0
47 static int gd5fxgq4xa_ooblayout_ecc(struct mtd_info *mtd, int section, in gd5fxgq4xa_ooblayout_ecc() argument
50 if (section > 3) in gd5fxgq4xa_ooblayout_ecc()
51 return -ERANGE; in gd5fxgq4xa_ooblayout_ecc()
53 region->offset = (16 * section) + 8; in gd5fxgq4xa_ooblayout_ecc()
54 region->length = 8; in gd5fxgq4xa_ooblayout_ecc()
59 static int gd5fxgq4xa_ooblayout_free(struct mtd_info *mtd, int section, in gd5fxgq4xa_ooblayout_free() argument
62 if (section > 3) in gd5fxgq4xa_ooblayout_free()
63 return -ERANGE; in gd5fxgq4xa_ooblayout_free()
65 if (section) { in gd5fxgq4xa_ooblayout_free()
66 region->offset = 16 * section; in gd5fxgq4xa_ooblayout_free()
67 region->length = 8; in gd5fxgq4xa_ooblayout_free()
69 /* section 0 has one byte reserved for bad block mark */ in gd5fxgq4xa_ooblayout_free()
70 region->offset = 1; in gd5fxgq4xa_ooblayout_free()
71 region->length = 7; in gd5fxgq4xa_ooblayout_free()
89 /* 1-7 bits are flipped. return the maximum. */ in gd5fxgq4xa_ecc_get_status()
96 return -EBADMSG; in gd5fxgq4xa_ecc_get_status()
102 return -EINVAL; in gd5fxgq4xa_ecc_get_status()
105 static int gd5fxgq4_variant2_ooblayout_ecc(struct mtd_info *mtd, int section, in gd5fxgq4_variant2_ooblayout_ecc() argument
108 if (section) in gd5fxgq4_variant2_ooblayout_ecc()
109 return -ERANGE; in gd5fxgq4_variant2_ooblayout_ecc()
111 region->offset = 64; in gd5fxgq4_variant2_ooblayout_ecc()
112 region->length = 64; in gd5fxgq4_variant2_ooblayout_ecc()
117 static int gd5fxgq4_variant2_ooblayout_free(struct mtd_info *mtd, int section, in gd5fxgq4_variant2_ooblayout_free() argument
120 if (section) in gd5fxgq4_variant2_ooblayout_free()
121 return -ERANGE; in gd5fxgq4_variant2_ooblayout_free()
124 region->offset = 1; in gd5fxgq4_variant2_ooblayout_free()
125 region->length = 63; in gd5fxgq4_variant2_ooblayout_free()
135 static int gd5fxgq4xc_ooblayout_256_ecc(struct mtd_info *mtd, int section, in gd5fxgq4xc_ooblayout_256_ecc() argument
138 if (section) in gd5fxgq4xc_ooblayout_256_ecc()
139 return -ERANGE; in gd5fxgq4xc_ooblayout_256_ecc()
141 oobregion->offset = 128; in gd5fxgq4xc_ooblayout_256_ecc()
142 oobregion->length = 128; in gd5fxgq4xc_ooblayout_256_ecc()
147 static int gd5fxgq4xc_ooblayout_256_free(struct mtd_info *mtd, int section, in gd5fxgq4xc_ooblayout_256_free() argument
150 if (section) in gd5fxgq4xc_ooblayout_256_free()
151 return -ERANGE; in gd5fxgq4xc_ooblayout_256_free()
153 oobregion->offset = 1; in gd5fxgq4xc_ooblayout_256_free()
154 oobregion->length = 127; in gd5fxgq4xc_ooblayout_256_free()
181 ret = spi_mem_exec_op(spinand->spimem, &op); in gd5fxgq4uexxg_ecc_get_status()
197 return -EBADMSG; in gd5fxgq4uexxg_ecc_get_status()
203 return -EINVAL; in gd5fxgq4uexxg_ecc_get_status()
217 return -EBADMSG; in gd5fxgq4ufxxg_ecc_get_status()
219 default: /* (2 << 4) through (6 << 4) are 4-8 corrected errors */ in gd5fxgq4ufxxg_ecc_get_status()
223 return -EINVAL; in gd5fxgq4ufxxg_ecc_get_status()