Lines Matching full:oob
379 * nand_fill_oob - [INTERN] Transfer client buffer to oob
381 * @oob: oob data buffer
382 * @len: oob data write length
383 * @ops: oob ops structure
385 static uint8_t *nand_fill_oob(struct nand_chip *chip, uint8_t *oob, size_t len, in nand_fill_oob() argument
392 * Initialise to all 0xFF, to avoid the possibility of left over OOB in nand_fill_oob()
393 * data from a previous OOB read. in nand_fill_oob()
401 memcpy(chip->oob_poi + ops->ooboffs, oob, len); in nand_fill_oob()
402 return oob + len; in nand_fill_oob()
405 ret = mtd_ooblayout_set_databytes(mtd, oob, chip->oob_poi, in nand_fill_oob()
408 return oob + len; in nand_fill_oob()
420 * @ops: oob operation description structure
553 * specify how to write bad block markers to OOB (chip->legacy.block_markbad).
557 * (1) erase the affected block, to allow OOB marker to be written cleanly
558 * (2) write bad block marker to OOB area of affected block (unless flag
573 /* Attempt erase before marking OOB */ in nand_block_markbad_lowlevel()
579 /* Write bad block marker to OOB */ in nand_block_markbad_lowlevel()
1102 * On small page NANDs, there's a dedicated command to access the OOB in nand_fill_column_cycles()
1103 * area, and the column address is relative to the start of the OOB in nand_fill_column_cycles()
1476 * nand_read_oob_op - Do a READ OOB operation
1479 * @offset_in_oob: offset within the OOB area
1483 * This function issues a READ OOB operation.
2828 * @extraoob: extra OOB buffer
2829 * @extraooblen: extra OOB length
2832 * Check if a data buffer and its associated ECC and OOB data contains only
2851 * 3/ The extraoob argument is optional, and should be used if some of your OOB
2854 * extra OOB data to an ECC chunk.
2902 * @oob_required: caller requires OOB data read to chip->oob_poi
2917 * @oob_required: caller requires OOB data read to chip->oob_poi
2920 * Not for syndrome calculating ECC controllers, which use a special oob layout.
2947 * @oob_required: caller requires OOB data read to chip->oob_poi
2952 * eventually OOB) to be loaded in the NAND cache and sent over the
2955 * first reads the main data, and if the OOB data is requested too,
2988 * @oob_required: caller requires OOB data read to chip->oob_poi
2991 * We need a special oob layout and handling even when OOB isn't used.
2999 uint8_t *oob = chip->oob_poi; in nand_read_page_raw_syndrome() local
3014 ret = nand_read_data_op(chip, oob, chip->ecc.prepad, in nand_read_page_raw_syndrome()
3019 oob += chip->ecc.prepad; in nand_read_page_raw_syndrome()
3022 ret = nand_read_data_op(chip, oob, eccbytes, false, false); in nand_read_page_raw_syndrome()
3026 oob += eccbytes; in nand_read_page_raw_syndrome()
3029 ret = nand_read_data_op(chip, oob, chip->ecc.postpad, in nand_read_page_raw_syndrome()
3034 oob += chip->ecc.postpad; in nand_read_page_raw_syndrome()
3038 size = mtd->oobsize - (oob - chip->oob_poi); in nand_read_page_raw_syndrome()
3040 ret = nand_read_data_op(chip, oob, size, false, false); in nand_read_page_raw_syndrome()
3052 * @oob_required: caller requires OOB data read to chip->oob_poi
3209 * @oob_required: caller requires OOB data read to chip->oob_poi
3212 * Not for syndrome calculating ECC controllers which need a special oob layout.
3278 * data read from OOB area
3281 * @oob_required: caller requires OOB data read to chip->oob_poi
3285 * extracted from the OOB before the actual data is read.
3298 /* Read the OOB area first */ in nand_read_page_hwecc_oob_first()
3347 * @oob_required: caller requires OOB data read to chip->oob_poi
3351 * need a special oob layout and handling.
3362 uint8_t *oob = chip->oob_poi; in nand_read_page_syndrome() local
3379 ret = nand_read_data_op(chip, oob, chip->ecc.prepad, in nand_read_page_syndrome()
3384 oob += chip->ecc.prepad; in nand_read_page_syndrome()
3389 ret = nand_read_data_op(chip, oob, eccbytes, false, false); in nand_read_page_syndrome()
3393 stat = chip->ecc.correct(chip, p, oob, NULL); in nand_read_page_syndrome()
3395 oob += eccbytes; in nand_read_page_syndrome()
3398 ret = nand_read_data_op(chip, oob, chip->ecc.postpad, in nand_read_page_syndrome()
3403 oob += chip->ecc.postpad; in nand_read_page_syndrome()
3410 oob - eccpadbytes, in nand_read_page_syndrome()
3424 /* Calculate remaining oob bytes */ in nand_read_page_syndrome()
3425 i = mtd->oobsize - (oob - chip->oob_poi); in nand_read_page_syndrome()
3427 ret = nand_read_data_op(chip, oob, i, false, false); in nand_read_page_syndrome()
3436 * nand_transfer_oob - [INTERN] Transfer oob to client buffer
3438 * @oob: oob destination address
3439 * @ops: oob ops structure
3440 * @len: size of oob to transfer
3442 static uint8_t *nand_transfer_oob(struct nand_chip *chip, uint8_t *oob, in nand_transfer_oob() argument
3452 memcpy(oob, chip->oob_poi + ops->ooboffs, len); in nand_transfer_oob()
3453 return oob + len; in nand_transfer_oob()
3456 ret = mtd_ooblayout_get_databytes(mtd, oob, chip->oob_poi, in nand_transfer_oob()
3459 return oob + len; in nand_transfer_oob()
3552 * @ops: oob ops structure
3566 uint8_t *bufpoi, *oob, *buf; in nand_do_read_ops() local
3585 oob = ops->oobbuf; in nand_do_read_ops()
3586 oob_required = oob ? 1 : 0; in nand_do_read_ops()
3607 if (realpage != chip->pagecache.page || oob) { in nand_do_read_ops()
3624 !oob) in nand_do_read_ops()
3642 if (!NAND_HAS_SUBPAGE_READ(chip) && !oob && in nand_do_read_ops()
3654 if (unlikely(oob)) { in nand_do_read_ops()
3658 oob = nand_transfer_oob(chip, oob, ops, in nand_do_read_ops()
3723 if (oob) in nand_do_read_ops()
3736 * nand_read_oob_std - [REPLACEABLE] the most common OOB data read function
3749 * nand_read_oob_syndrome - [REPLACEABLE] OOB data read function for HW ECC
3803 * nand_write_oob_std - [REPLACEABLE] the most common OOB data write function
3817 * nand_write_oob_syndrome - [REPLACEABLE] OOB data write function for HW ECC
3831 * data-ecc-data-ecc ... ecc-oob in nand_write_oob_syndrome()
3833 * data-pad-ecc-pad-data-pad .... ecc-pad-oob in nand_write_oob_syndrome()
3893 * @ops: oob operations description structure
3975 * @ops: oob operation description structure
4017 * @oob_required: must write chip->oob_poi to OOB
4032 * @oob_required: must write chip->oob_poi to OOB
4035 * Not for syndrome calculating ECC controllers, which use a special oob layout.
4062 * @oob_required: must write chip->oob_poi to OOB
4067 * eventually OOB) to be sent over the bus and effectively programmed
4070 * data, then eventually send the OOB data by latching more data
4098 * @oob_required: must write chip->oob_poi to OOB
4101 * We need a special oob layout and handling even when ECC isn't checked.
4110 uint8_t *oob = chip->oob_poi; in nand_write_page_raw_syndrome() local
4125 ret = nand_write_data_op(chip, oob, chip->ecc.prepad, in nand_write_page_raw_syndrome()
4130 oob += chip->ecc.prepad; in nand_write_page_raw_syndrome()
4133 ret = nand_write_data_op(chip, oob, eccbytes, false); in nand_write_page_raw_syndrome()
4137 oob += eccbytes; in nand_write_page_raw_syndrome()
4140 ret = nand_write_data_op(chip, oob, chip->ecc.postpad, in nand_write_page_raw_syndrome()
4145 oob += chip->ecc.postpad; in nand_write_page_raw_syndrome()
4149 size = mtd->oobsize - (oob - chip->oob_poi); in nand_write_page_raw_syndrome()
4151 ret = nand_write_data_op(chip, oob, size, false); in nand_write_page_raw_syndrome()
4162 * @oob_required: must write chip->oob_poi to OOB
4191 * @oob_required: must write chip->oob_poi to OOB
4237 * @oob_required: must write chip->oob_poi to OOB
4274 /* mask OOB of un-touched subpages by padding 0xFF */ in nand_write_subpage_hwecc()
4275 /* if oob_required, preserve OOB metadata of written subpage */ in nand_write_subpage_hwecc()
4284 /* copy calculated ECC for whole page to chip->buffer->oob */ in nand_write_subpage_hwecc()
4292 /* write OOB buffer to NAND device */ in nand_write_subpage_hwecc()
4305 * @oob_required: must write chip->oob_poi to OOB
4309 * need a special oob layout and handling.
4319 uint8_t *oob = chip->oob_poi; in nand_write_page_syndrome() local
4334 ret = nand_write_data_op(chip, oob, chip->ecc.prepad, in nand_write_page_syndrome()
4339 oob += chip->ecc.prepad; in nand_write_page_syndrome()
4342 chip->ecc.calculate(chip, p, oob); in nand_write_page_syndrome()
4344 ret = nand_write_data_op(chip, oob, eccbytes, false); in nand_write_page_syndrome()
4348 oob += eccbytes; in nand_write_page_syndrome()
4351 ret = nand_write_data_op(chip, oob, chip->ecc.postpad, in nand_write_page_syndrome()
4356 oob += chip->ecc.postpad; in nand_write_page_syndrome()
4360 /* Calculate remaining oob bytes */ in nand_write_page_syndrome()
4361 i = mtd->oobsize - (oob - chip->oob_poi); in nand_write_page_syndrome()
4363 ret = nand_write_data_op(chip, oob, i, false); in nand_write_page_syndrome()
4377 * @oob_required: must write chip->oob_poi to OOB
4415 * @ops: oob operations description structure
4429 uint8_t *oob = ops->oobbuf; in nand_do_write_ops() local
4432 int oob_required = oob ? 1 : 0; in nand_do_write_ops()
4468 /* Don't allow multipage oob writes with offset */ in nand_do_write_ops()
4469 if (oob && ops->ooboffs && (ops->ooboffs + ops->ooblen > oobmaxlen)) { in nand_do_write_ops()
4503 if (unlikely(oob)) { in nand_do_write_ops()
4505 oob = nand_fill_oob(chip, oob, len, ops); in nand_do_write_ops()
4508 /* We still need to erase leftover OOB data */ in nand_do_write_ops()
4536 if (unlikely(oob)) in nand_do_write_ops()
4583 * @ops: oob operation description structure
5400 pr_info("%d MiB, %s, erase size: %d KiB, page size: %d, OOB size: %d\n", in nand_detect()
5993 * @oobavail: OOB size that the ECC engine can use
5996 * by the controller and the calculated ECC bytes fit within the chip's OOB.
6026 pr_err("ECC (step, strength) = (%d, %d) does not fit in OOB", in nand_check_ecc_caps()
6047 * @oobavail: OOB size that the ECC engine can use
6050 * number of ECC bytes (i.e. with the largest number of OOB-free bytes).
6131 * @oobavail: OOB size that the ECC engine can use
6134 * within the chip's OOB. On success, the chosen ECC settings are set.
6201 * @oobavail: OOB size that the ECC engine can use
6210 * to the chip's requirement. If available OOB size can't fit the chip
6296 /* New bad blocks should be marked in OOB, flash-based BBT, or both */ in nand_scan_tail()
6318 /* Set the internal oob buffer location, just after the page data */ in nand_scan_tail()
6341 * Expose the whole OOB area to users if ECC_NONE in nand_scan_tail()
6353 WARN(1, "No oob scheme defined for oobsize %d\n", in nand_scan_tail()
6431 /* For many systems, the standard OOB write also works for raw */ in nand_scan_tail()