Lines Matching full:oob
382 * nand_fill_oob - [INTERN] Transfer client buffer to oob
384 * @oob: oob data buffer
385 * @len: oob data write length
386 * @ops: oob ops structure
388 static uint8_t *nand_fill_oob(struct nand_chip *chip, uint8_t *oob, size_t len, in nand_fill_oob() argument
395 * Initialise to all 0xFF, to avoid the possibility of left over OOB in nand_fill_oob()
396 * data from a previous OOB read. in nand_fill_oob()
404 memcpy(chip->oob_poi + ops->ooboffs, oob, len); in nand_fill_oob()
405 return oob + len; in nand_fill_oob()
408 ret = mtd_ooblayout_set_databytes(mtd, oob, chip->oob_poi, in nand_fill_oob()
411 return oob + len; in nand_fill_oob()
423 * @ops: oob operation description structure
556 * specify how to write bad block markers to OOB (chip->legacy.block_markbad).
560 * (1) erase the affected block, to allow OOB marker to be written cleanly
561 * (2) write bad block marker to OOB area of affected block (unless flag
576 /* Attempt erase before marking OOB */ in nand_block_markbad_lowlevel()
582 /* Write bad block marker to OOB */ in nand_block_markbad_lowlevel()
1105 * On small page NANDs, there's a dedicated command to access the OOB in nand_fill_column_cycles()
1106 * area, and the column address is relative to the start of the OOB in nand_fill_column_cycles()
1493 * nand_read_oob_op - Do a READ OOB operation
1496 * @offset_in_oob: offset within the OOB area
1500 * This function issues a READ OOB operation.
2847 * @extraoob: extra OOB buffer
2848 * @extraooblen: extra OOB length
2851 * Check if a data buffer and its associated ECC and OOB data contains only
2870 * 3/ The extraoob argument is optional, and should be used if some of your OOB
2873 * extra OOB data to an ECC chunk.
2921 * @oob_required: caller requires OOB data read to chip->oob_poi
2936 * @oob_required: caller requires OOB data read to chip->oob_poi
2939 * Not for syndrome calculating ECC controllers, which use a special oob layout.
2966 * @oob_required: caller requires OOB data read to chip->oob_poi
2971 * eventually OOB) to be loaded in the NAND cache and sent over the
2974 * first reads the main data, and if the OOB data is requested too,
3007 * @oob_required: caller requires OOB data read to chip->oob_poi
3010 * We need a special oob layout and handling even when OOB isn't used.
3018 uint8_t *oob = chip->oob_poi; in nand_read_page_raw_syndrome() local
3033 ret = nand_read_data_op(chip, oob, chip->ecc.prepad, in nand_read_page_raw_syndrome()
3038 oob += chip->ecc.prepad; in nand_read_page_raw_syndrome()
3041 ret = nand_read_data_op(chip, oob, eccbytes, false, false); in nand_read_page_raw_syndrome()
3045 oob += eccbytes; in nand_read_page_raw_syndrome()
3048 ret = nand_read_data_op(chip, oob, chip->ecc.postpad, in nand_read_page_raw_syndrome()
3053 oob += chip->ecc.postpad; in nand_read_page_raw_syndrome()
3057 size = mtd->oobsize - (oob - chip->oob_poi); in nand_read_page_raw_syndrome()
3059 ret = nand_read_data_op(chip, oob, size, false, false); in nand_read_page_raw_syndrome()
3071 * @oob_required: caller requires OOB data read to chip->oob_poi
3228 * @oob_required: caller requires OOB data read to chip->oob_poi
3231 * Not for syndrome calculating ECC controllers which need a special oob layout.
3297 * data read from OOB area
3300 * @oob_required: caller requires OOB data read to chip->oob_poi
3304 * extracted from the OOB before the actual data is read.
3317 /* Read the OOB area first */ in nand_read_page_hwecc_oob_first()
3366 * @oob_required: caller requires OOB data read to chip->oob_poi
3370 * need a special oob layout and handling.
3381 uint8_t *oob = chip->oob_poi; in nand_read_page_syndrome() local
3398 ret = nand_read_data_op(chip, oob, chip->ecc.prepad, in nand_read_page_syndrome()
3403 oob += chip->ecc.prepad; in nand_read_page_syndrome()
3408 ret = nand_read_data_op(chip, oob, eccbytes, false, false); in nand_read_page_syndrome()
3412 stat = chip->ecc.correct(chip, p, oob, NULL); in nand_read_page_syndrome()
3414 oob += eccbytes; in nand_read_page_syndrome()
3417 ret = nand_read_data_op(chip, oob, chip->ecc.postpad, in nand_read_page_syndrome()
3422 oob += chip->ecc.postpad; in nand_read_page_syndrome()
3429 oob - eccpadbytes, in nand_read_page_syndrome()
3443 /* Calculate remaining oob bytes */ in nand_read_page_syndrome()
3444 i = mtd->oobsize - (oob - chip->oob_poi); in nand_read_page_syndrome()
3446 ret = nand_read_data_op(chip, oob, i, false, false); in nand_read_page_syndrome()
3455 * nand_transfer_oob - [INTERN] Transfer oob to client buffer
3457 * @oob: oob destination address
3458 * @ops: oob ops structure
3459 * @len: size of oob to transfer
3461 static uint8_t *nand_transfer_oob(struct nand_chip *chip, uint8_t *oob, in nand_transfer_oob() argument
3471 memcpy(oob, chip->oob_poi + ops->ooboffs, len); in nand_transfer_oob()
3472 return oob + len; in nand_transfer_oob()
3475 ret = mtd_ooblayout_get_databytes(mtd, oob, chip->oob_poi, in nand_transfer_oob()
3478 return oob + len; in nand_transfer_oob()
3568 * @ops: oob ops structure
3582 uint8_t *bufpoi, *oob, *buf; in nand_do_read_ops() local
3601 oob = ops->oobbuf; in nand_do_read_ops()
3602 oob_required = oob ? 1 : 0; in nand_do_read_ops()
3623 if (realpage != chip->pagecache.page || oob) { in nand_do_read_ops()
3640 !oob) in nand_do_read_ops()
3658 if (!NAND_HAS_SUBPAGE_READ(chip) && !oob && in nand_do_read_ops()
3670 if (unlikely(oob)) { in nand_do_read_ops()
3674 oob = nand_transfer_oob(chip, oob, ops, in nand_do_read_ops()
3742 if (oob) in nand_do_read_ops()
3755 * nand_read_oob_std - [REPLACEABLE] the most common OOB data read function
3768 * nand_read_oob_syndrome - [REPLACEABLE] OOB data read function for HW ECC
3822 * nand_write_oob_std - [REPLACEABLE] the most common OOB data write function
3836 * nand_write_oob_syndrome - [REPLACEABLE] OOB data write function for HW ECC
3850 * data-ecc-data-ecc ... ecc-oob in nand_write_oob_syndrome()
3852 * data-pad-ecc-pad-data-pad .... ecc-pad-oob in nand_write_oob_syndrome()
3912 * @ops: oob operations description structure
3994 * @ops: oob operation description structure
4036 * @oob_required: must write chip->oob_poi to OOB
4051 * @oob_required: must write chip->oob_poi to OOB
4054 * Not for syndrome calculating ECC controllers, which use a special oob layout.
4081 * @oob_required: must write chip->oob_poi to OOB
4086 * eventually OOB) to be sent over the bus and effectively programmed
4089 * data, then eventually send the OOB data by latching more data
4117 * @oob_required: must write chip->oob_poi to OOB
4120 * We need a special oob layout and handling even when ECC isn't checked.
4129 uint8_t *oob = chip->oob_poi; in nand_write_page_raw_syndrome() local
4144 ret = nand_write_data_op(chip, oob, chip->ecc.prepad, in nand_write_page_raw_syndrome()
4149 oob += chip->ecc.prepad; in nand_write_page_raw_syndrome()
4152 ret = nand_write_data_op(chip, oob, eccbytes, false); in nand_write_page_raw_syndrome()
4156 oob += eccbytes; in nand_write_page_raw_syndrome()
4159 ret = nand_write_data_op(chip, oob, chip->ecc.postpad, in nand_write_page_raw_syndrome()
4164 oob += chip->ecc.postpad; in nand_write_page_raw_syndrome()
4168 size = mtd->oobsize - (oob - chip->oob_poi); in nand_write_page_raw_syndrome()
4170 ret = nand_write_data_op(chip, oob, size, false); in nand_write_page_raw_syndrome()
4181 * @oob_required: must write chip->oob_poi to OOB
4210 * @oob_required: must write chip->oob_poi to OOB
4256 * @oob_required: must write chip->oob_poi to OOB
4293 /* mask OOB of un-touched subpages by padding 0xFF */ in nand_write_subpage_hwecc()
4294 /* if oob_required, preserve OOB metadata of written subpage */ in nand_write_subpage_hwecc()
4303 /* copy calculated ECC for whole page to chip->buffer->oob */ in nand_write_subpage_hwecc()
4311 /* write OOB buffer to NAND device */ in nand_write_subpage_hwecc()
4324 * @oob_required: must write chip->oob_poi to OOB
4328 * need a special oob layout and handling.
4338 uint8_t *oob = chip->oob_poi; in nand_write_page_syndrome() local
4353 ret = nand_write_data_op(chip, oob, chip->ecc.prepad, in nand_write_page_syndrome()
4358 oob += chip->ecc.prepad; in nand_write_page_syndrome()
4361 chip->ecc.calculate(chip, p, oob); in nand_write_page_syndrome()
4363 ret = nand_write_data_op(chip, oob, eccbytes, false); in nand_write_page_syndrome()
4367 oob += eccbytes; in nand_write_page_syndrome()
4370 ret = nand_write_data_op(chip, oob, chip->ecc.postpad, in nand_write_page_syndrome()
4375 oob += chip->ecc.postpad; in nand_write_page_syndrome()
4379 /* Calculate remaining oob bytes */ in nand_write_page_syndrome()
4380 i = mtd->oobsize - (oob - chip->oob_poi); in nand_write_page_syndrome()
4382 ret = nand_write_data_op(chip, oob, i, false); in nand_write_page_syndrome()
4396 * @oob_required: must write chip->oob_poi to OOB
4434 * @ops: oob operations description structure
4448 uint8_t *oob = ops->oobbuf; in nand_do_write_ops() local
4451 int oob_required = oob ? 1 : 0; in nand_do_write_ops()
4487 /* Don't allow multipage oob writes with offset */ in nand_do_write_ops()
4488 if (oob && ops->ooboffs && (ops->ooboffs + ops->ooblen > oobmaxlen)) { in nand_do_write_ops()
4522 if (unlikely(oob)) { in nand_do_write_ops()
4524 oob = nand_fill_oob(chip, oob, len, ops); in nand_do_write_ops()
4527 /* We still need to erase leftover OOB data */ in nand_do_write_ops()
4555 if (unlikely(oob)) in nand_do_write_ops()
4602 * @ops: oob operation description structure
5419 pr_info("%d MiB, %s, erase size: %d KiB, page size: %d, OOB size: %d\n", in nand_detect()
6012 * @oobavail: OOB size that the ECC engine can use
6015 * by the controller and the calculated ECC bytes fit within the chip's OOB.
6045 pr_err("ECC (step, strength) = (%d, %d) does not fit in OOB", in nand_check_ecc_caps()
6066 * @oobavail: OOB size that the ECC engine can use
6069 * number of ECC bytes (i.e. with the largest number of OOB-free bytes).
6150 * @oobavail: OOB size that the ECC engine can use
6153 * within the chip's OOB. On success, the chosen ECC settings are set.
6220 * @oobavail: OOB size that the ECC engine can use
6229 * to the chip's requirement. If available OOB size can't fit the chip
6315 /* New bad blocks should be marked in OOB, flash-based BBT, or both */ in nand_scan_tail()
6337 /* Set the internal oob buffer location, just after the page data */ in nand_scan_tail()
6360 * Expose the whole OOB area to users if ECC_NONE in nand_scan_tail()
6372 WARN(1, "No oob scheme defined for oobsize %d\n", in nand_scan_tail()
6450 /* For many systems, the standard OOB write also works for raw */ in nand_scan_tail()