Lines Matching full:oob
337 * nand_fill_oob - [INTERN] Transfer client buffer to oob
339 * @oob: oob data buffer
340 * @len: oob data write length
341 * @ops: oob ops structure
343 static uint8_t *nand_fill_oob(struct nand_chip *chip, uint8_t *oob, size_t len, in nand_fill_oob() argument
350 * Initialise to all 0xFF, to avoid the possibility of left over OOB in nand_fill_oob()
351 * data from a previous OOB read. in nand_fill_oob()
359 memcpy(chip->oob_poi + ops->ooboffs, oob, len); in nand_fill_oob()
360 return oob + len; in nand_fill_oob()
363 ret = mtd_ooblayout_set_databytes(mtd, oob, chip->oob_poi, in nand_fill_oob()
366 return oob + len; in nand_fill_oob()
378 * @ops: oob operation description structure
507 * specify how to write bad block markers to OOB (chip->legacy.block_markbad).
511 * (1) erase the affected block, to allow OOB marker to be written cleanly
512 * (2) write bad block marker to OOB area of affected block (unless flag
527 /* Attempt erase before marking OOB */ in nand_block_markbad_lowlevel()
533 /* Write bad block marker to OOB */ in nand_block_markbad_lowlevel()
972 * On small page NANDs, there's a dedicated command to access the OOB in nand_fill_column_cycles()
973 * area, and the column address is relative to the start of the OOB in nand_fill_column_cycles()
1238 * nand_read_oob_op - Do a READ OOB operation
1241 * @offset_in_oob: offset within the OOB area
1245 * This function issues a READ OOB operation.
2501 * @extraoob: extra OOB buffer
2502 * @extraooblen: extra OOB length
2505 * Check if a data buffer and its associated ECC and OOB data contains only
2524 * 3/ The extraoob argument is optional, and should be used if some of your OOB
2527 * extra OOB data to an ECC chunk.
2575 * @oob_required: caller requires OOB data read to chip->oob_poi
2590 * @oob_required: caller requires OOB data read to chip->oob_poi
2593 * Not for syndrome calculating ECC controllers, which use a special oob layout.
2620 * @oob_required: caller requires OOB data read to chip->oob_poi
2625 * eventually OOB) to be loaded in the NAND cache and sent over the
2628 * first reads the main data, and if the OOB data is requested too,
2661 * @oob_required: caller requires OOB data read to chip->oob_poi
2664 * We need a special oob layout and handling even when OOB isn't used.
2672 uint8_t *oob = chip->oob_poi; in nand_read_page_raw_syndrome() local
2687 ret = nand_read_data_op(chip, oob, chip->ecc.prepad, in nand_read_page_raw_syndrome()
2692 oob += chip->ecc.prepad; in nand_read_page_raw_syndrome()
2695 ret = nand_read_data_op(chip, oob, eccbytes, false, false); in nand_read_page_raw_syndrome()
2699 oob += eccbytes; in nand_read_page_raw_syndrome()
2702 ret = nand_read_data_op(chip, oob, chip->ecc.postpad, in nand_read_page_raw_syndrome()
2707 oob += chip->ecc.postpad; in nand_read_page_raw_syndrome()
2711 size = mtd->oobsize - (oob - chip->oob_poi); in nand_read_page_raw_syndrome()
2713 ret = nand_read_data_op(chip, oob, size, false, false); in nand_read_page_raw_syndrome()
2725 * @oob_required: caller requires OOB data read to chip->oob_poi
2882 * @oob_required: caller requires OOB data read to chip->oob_poi
2885 * Not for syndrome calculating ECC controllers which need a special oob layout.
2953 * @oob_required: caller requires OOB data read to chip->oob_poi
2957 * need a special oob layout and handling.
2968 uint8_t *oob = chip->oob_poi; in nand_read_page_syndrome() local
2985 ret = nand_read_data_op(chip, oob, chip->ecc.prepad, in nand_read_page_syndrome()
2990 oob += chip->ecc.prepad; in nand_read_page_syndrome()
2995 ret = nand_read_data_op(chip, oob, eccbytes, false, false); in nand_read_page_syndrome()
2999 stat = chip->ecc.correct(chip, p, oob, NULL); in nand_read_page_syndrome()
3001 oob += eccbytes; in nand_read_page_syndrome()
3004 ret = nand_read_data_op(chip, oob, chip->ecc.postpad, in nand_read_page_syndrome()
3009 oob += chip->ecc.postpad; in nand_read_page_syndrome()
3016 oob - eccpadbytes, in nand_read_page_syndrome()
3030 /* Calculate remaining oob bytes */ in nand_read_page_syndrome()
3031 i = mtd->oobsize - (oob - chip->oob_poi); in nand_read_page_syndrome()
3033 ret = nand_read_data_op(chip, oob, i, false, false); in nand_read_page_syndrome()
3042 * nand_transfer_oob - [INTERN] Transfer oob to client buffer
3044 * @oob: oob destination address
3045 * @ops: oob ops structure
3046 * @len: size of oob to transfer
3048 static uint8_t *nand_transfer_oob(struct nand_chip *chip, uint8_t *oob, in nand_transfer_oob() argument
3058 memcpy(oob, chip->oob_poi + ops->ooboffs, len); in nand_transfer_oob()
3059 return oob + len; in nand_transfer_oob()
3062 ret = mtd_ooblayout_get_databytes(mtd, oob, chip->oob_poi, in nand_transfer_oob()
3065 return oob + len; in nand_transfer_oob()
3110 * @ops: oob ops structure
3124 uint8_t *bufpoi, *oob, *buf; in nand_do_read_ops() local
3139 oob = ops->oobbuf; in nand_do_read_ops()
3140 oob_required = oob ? 1 : 0; in nand_do_read_ops()
3158 if (realpage != chip->pagecache.page || oob) { in nand_do_read_ops()
3175 !oob) in nand_do_read_ops()
3193 if (!NAND_HAS_SUBPAGE_READ(chip) && !oob && in nand_do_read_ops()
3205 if (unlikely(oob)) { in nand_do_read_ops()
3209 oob = nand_transfer_oob(chip, oob, ops, in nand_do_read_ops()
3272 if (oob) in nand_do_read_ops()
3285 * nand_read_oob_std - [REPLACEABLE] the most common OOB data read function
3298 * nand_read_oob_syndrome - [REPLACEABLE] OOB data read function for HW ECC
3352 * nand_write_oob_std - [REPLACEABLE] the most common OOB data write function
3366 * nand_write_oob_syndrome - [REPLACEABLE] OOB data write function for HW ECC
3380 * data-ecc-data-ecc ... ecc-oob in nand_write_oob_syndrome()
3382 * data-pad-ecc-pad-data-pad .... ecc-pad-oob in nand_write_oob_syndrome()
3442 * @ops: oob operations description structure
3520 * @ops: oob operation description structure
3554 * @oob_required: must write chip->oob_poi to OOB
3569 * @oob_required: must write chip->oob_poi to OOB
3572 * Not for syndrome calculating ECC controllers, which use a special oob layout.
3599 * @oob_required: must write chip->oob_poi to OOB
3604 * eventually OOB) to be sent over the bus and effectively programmed
3607 * data, then eventually send the OOB data by latching more data
3635 * @oob_required: must write chip->oob_poi to OOB
3638 * We need a special oob layout and handling even when ECC isn't checked.
3647 uint8_t *oob = chip->oob_poi; in nand_write_page_raw_syndrome() local
3662 ret = nand_write_data_op(chip, oob, chip->ecc.prepad, in nand_write_page_raw_syndrome()
3667 oob += chip->ecc.prepad; in nand_write_page_raw_syndrome()
3670 ret = nand_write_data_op(chip, oob, eccbytes, false); in nand_write_page_raw_syndrome()
3674 oob += eccbytes; in nand_write_page_raw_syndrome()
3677 ret = nand_write_data_op(chip, oob, chip->ecc.postpad, in nand_write_page_raw_syndrome()
3682 oob += chip->ecc.postpad; in nand_write_page_raw_syndrome()
3686 size = mtd->oobsize - (oob - chip->oob_poi); in nand_write_page_raw_syndrome()
3688 ret = nand_write_data_op(chip, oob, size, false); in nand_write_page_raw_syndrome()
3699 * @oob_required: must write chip->oob_poi to OOB
3728 * @oob_required: must write chip->oob_poi to OOB
3774 * @oob_required: must write chip->oob_poi to OOB
3811 /* mask OOB of un-touched subpages by padding 0xFF */ in nand_write_subpage_hwecc()
3812 /* if oob_required, preserve OOB metadata of written subpage */ in nand_write_subpage_hwecc()
3821 /* copy calculated ECC for whole page to chip->buffer->oob */ in nand_write_subpage_hwecc()
3829 /* write OOB buffer to NAND device */ in nand_write_subpage_hwecc()
3842 * @oob_required: must write chip->oob_poi to OOB
3846 * need a special oob layout and handling.
3856 uint8_t *oob = chip->oob_poi; in nand_write_page_syndrome() local
3871 ret = nand_write_data_op(chip, oob, chip->ecc.prepad, in nand_write_page_syndrome()
3876 oob += chip->ecc.prepad; in nand_write_page_syndrome()
3879 chip->ecc.calculate(chip, p, oob); in nand_write_page_syndrome()
3881 ret = nand_write_data_op(chip, oob, eccbytes, false); in nand_write_page_syndrome()
3885 oob += eccbytes; in nand_write_page_syndrome()
3888 ret = nand_write_data_op(chip, oob, chip->ecc.postpad, in nand_write_page_syndrome()
3893 oob += chip->ecc.postpad; in nand_write_page_syndrome()
3897 /* Calculate remaining oob bytes */ in nand_write_page_syndrome()
3898 i = mtd->oobsize - (oob - chip->oob_poi); in nand_write_page_syndrome()
3900 ret = nand_write_data_op(chip, oob, i, false); in nand_write_page_syndrome()
3914 * @oob_required: must write chip->oob_poi to OOB
3952 * @ops: oob operations description structure
3966 uint8_t *oob = ops->oobbuf; in nand_do_write_ops() local
3969 int oob_required = oob ? 1 : 0; in nand_do_write_ops()
4001 /* Don't allow multipage oob writes with offset */ in nand_do_write_ops()
4002 if (oob && ops->ooboffs && (ops->ooboffs + ops->ooblen > oobmaxlen)) { in nand_do_write_ops()
4036 if (unlikely(oob)) { in nand_do_write_ops()
4038 oob = nand_fill_oob(chip, oob, len, ops); in nand_do_write_ops()
4041 /* We still need to erase leftover OOB data */ in nand_do_write_ops()
4069 if (unlikely(oob)) in nand_do_write_ops()
4116 * @ops: oob operation description structure
4869 pr_info("%d MiB, %s, erase size: %d KiB, page size: %d, OOB size: %d\n", in nand_detect()
5266 WARN(1, "OOB layout is required when using software BCH on small pages\n"); in nand_set_ecc_soft_ops()
5310 * @oobavail: OOB size that the ECC engine can use
5313 * by the controller and the calculated ECC bytes fit within the chip's OOB.
5343 pr_err("ECC (step, strength) = (%d, %d) does not fit in OOB", in nand_check_ecc_caps()
5364 * @oobavail: OOB size that the ECC engine can use
5367 * number of ECC bytes (i.e. with the largest number of OOB-free bytes).
5448 * @oobavail: OOB size that the ECC engine can use
5451 * within the chip's OOB. On success, the chosen ECC settings are set.
5518 * @oobavail: OOB size that the ECC engine can use
5527 * to the chip's requirement. If available OOB size can't fit the chip
5612 /* New bad blocks should be marked in OOB, flash-based BBT, or both */ in nand_scan_tail()
5634 /* Set the internal oob buffer location, just after the page data */ in nand_scan_tail()
5655 * Expose the whole OOB area to users if ECC_NONE in nand_scan_tail()
5667 WARN(1, "No oob scheme defined for oobsize %d\n", in nand_scan_tail()
5745 /* For many systems, the standard OOB write also works for raw */ in nand_scan_tail()