Lines Matching defs:chunk

21  * or 4) and each chunk will have its own ECC "digest" of 6B at the
24 * corrects up to 1 bit per chunk and detects reliably an error if
36 * 30B per ECC chunk. Here is the page layout used by the controller
238 * chunk smaller that the others.
241 * @chunk: Desired ECC chunk size on which the layout applies
242 * @strength: Desired ECC strength (per chunk size bytes) on which the
248 * @data_bytes: Number of data bytes per chunk
249 * @spare_bytes: Number of spare bytes per chunk
250 * @ecc_bytes: Number of ecc bytes per chunk
251 * @last_data_bytes: Number of data bytes in the last chunk
252 * @last_spare_bytes: Number of spare bytes in the last chunk
253 * @last_ecc_bytes: Number of ecc bytes in the last chunk
258 int chunk;
274 .chunk = dc, \
986 * Check if a chunk is correct or not according to the hardware ECC engine.
1008 * non-zero value to indicate that this chunk was apparently
1010 * the chunk (with ECC bytes) is not declared empty, the calling
1268 int chunk;
1277 for (chunk = 0; chunk < lt->nchunks; chunk++) {
1278 /* Update last chunk length */
1279 if (chunk >= lt->full_chunk_cnt) {
1286 nand_change_read_column_op(chip, chunk * chunk_size,
1287 buf + (lt->data_bytes * chunk),
1291 nand_read_data_op(chip, oob + (lt->spare_bytes * chunk),
1296 (ALIGN(lt->ecc_bytes, 32) * chunk),
1303 static void marvell_nfc_hw_ecc_bch_read_chunk(struct nand_chip *chip, int chunk,
1325 if (chunk == 0)
1331 * Trigger the monolithic read on the first chunk, then naked read on
1332 * intermediate chunks and finally a last naked read on the last chunk.
1334 if (chunk == 0)
1336 else if (chunk < lt->nchunks - 1)
1380 int chunk, ret;
1394 for (chunk = 0; chunk < lt->nchunks; chunk++) {
1395 /* Update length for the last chunk */
1396 if (chunk >= lt->full_chunk_cnt) {
1401 /* Read the chunk and detect number of bitflips */
1402 marvell_nfc_hw_ecc_bch_read_chunk(chip, chunk, data, data_len,
1406 failure_mask |= BIT(chunk);
1431 * 2k page, 8b strength per 512B chunk), the controller tries to correct
1436 for (chunk = 0; chunk < lt->nchunks; chunk++) {
1441 /* No failure reported for this chunk, move to the next one */
1442 if (!(failure_mask & BIT(chunk)))
1445 data_off_in_page = chunk * (lt->data_bytes + lt->spare_bytes +
1448 (chunk < lt->full_chunk_cnt ? lt->data_bytes :
1451 (chunk < lt->full_chunk_cnt ? lt->spare_bytes :
1454 data_off = chunk * lt->data_bytes;
1455 spare_off = chunk * lt->spare_bytes;
1458 (chunk * (lt->ecc_bytes + 2));
1460 data_len = chunk < lt->full_chunk_cnt ? lt->data_bytes :
1462 spare_len = chunk < lt->full_chunk_cnt ? lt->spare_bytes :
1464 ecc_len = chunk < lt->full_chunk_cnt ? lt->ecc_bytes :
1486 /* Check the entire chunk (data + spare + ecc) for emptyness */
1523 int chunk;
1529 for (chunk = 0; chunk < lt->nchunks; chunk++) {
1530 if (chunk >= lt->full_chunk_cnt) {
1536 /* Point to the column of the next chunk */
1537 nand_change_write_column_op(chip, chunk * full_chunk_size,
1541 nand_write_data_op(chip, buf + (chunk * lt->data_bytes),
1565 marvell_nfc_hw_ecc_bch_write_chunk(struct nand_chip *chip, int chunk,
1582 * cycles and asks for the first chunk of data.
1585 * Last operation (if any) asks for the last chunk of data through a
1588 if (chunk == 0) {
1599 } else if (chunk < lt->nchunks - 1) {
1605 /* Always dispatch the PAGEPROG command on the last chunk */
1606 if (chunk == lt->nchunks - 1)
1638 int chunk, ret;
1649 for (chunk = 0; chunk < lt->nchunks; chunk++) {
1650 if (chunk >= lt->full_chunk_cnt) {
1655 marvell_nfc_hw_ecc_bch_write_chunk(chip, chunk, data, data_len,
2255 "NFCv1: writesize (%d) cannot be bigger than a chunk (%d)\n",
2264 ecc->size == l->chunk && ecc->strength == l->strength) {