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()
1099 * On small page NANDs, there's a dedicated command to access the OOB in nand_fill_column_cycles()
1100 * area, and the column address is relative to the start of the OOB in nand_fill_column_cycles()
1366 * nand_read_oob_op - Do a READ OOB operation
1369 * @offset_in_oob: offset within the OOB area
1373 * This function issues a READ OOB operation.
2717 * @extraoob: extra OOB buffer
2718 * @extraooblen: extra OOB length
2721 * Check if a data buffer and its associated ECC and OOB data contains only
2740 * 3/ The extraoob argument is optional, and should be used if some of your OOB
2743 * extra OOB data to an ECC chunk.
2791 * @oob_required: caller requires OOB data read to chip->oob_poi
2806 * @oob_required: caller requires OOB data read to chip->oob_poi
2809 * Not for syndrome calculating ECC controllers, which use a special oob layout.
2836 * @oob_required: caller requires OOB data read to chip->oob_poi
2841 * eventually OOB) to be loaded in the NAND cache and sent over the
2844 * first reads the main data, and if the OOB data is requested too,
2877 * @oob_required: caller requires OOB data read to chip->oob_poi
2880 * We need a special oob layout and handling even when OOB isn't used.
2888 uint8_t *oob = chip->oob_poi; in nand_read_page_raw_syndrome() local
2903 ret = nand_read_data_op(chip, oob, chip->ecc.prepad, in nand_read_page_raw_syndrome()
2908 oob += chip->ecc.prepad; in nand_read_page_raw_syndrome()
2911 ret = nand_read_data_op(chip, oob, eccbytes, false, false); in nand_read_page_raw_syndrome()
2915 oob += eccbytes; in nand_read_page_raw_syndrome()
2918 ret = nand_read_data_op(chip, oob, chip->ecc.postpad, in nand_read_page_raw_syndrome()
2923 oob += chip->ecc.postpad; in nand_read_page_raw_syndrome()
2927 size = mtd->oobsize - (oob - chip->oob_poi); in nand_read_page_raw_syndrome()
2929 ret = nand_read_data_op(chip, oob, size, false, false); in nand_read_page_raw_syndrome()
2941 * @oob_required: caller requires OOB data read to chip->oob_poi
3098 * @oob_required: caller requires OOB data read to chip->oob_poi
3101 * Not for syndrome calculating ECC controllers which need a special oob layout.
3167 * data read from OOB area
3170 * @oob_required: caller requires OOB data read to chip->oob_poi
3174 * extracted from the OOB before the actual data is read.
3187 /* Read the OOB area first */ in nand_read_page_hwecc_oob_first()
3236 * @oob_required: caller requires OOB data read to chip->oob_poi
3240 * need a special oob layout and handling.
3251 uint8_t *oob = chip->oob_poi; in nand_read_page_syndrome() local
3268 ret = nand_read_data_op(chip, oob, chip->ecc.prepad, in nand_read_page_syndrome()
3273 oob += chip->ecc.prepad; in nand_read_page_syndrome()
3278 ret = nand_read_data_op(chip, oob, eccbytes, false, false); in nand_read_page_syndrome()
3282 stat = chip->ecc.correct(chip, p, oob, NULL); in nand_read_page_syndrome()
3284 oob += eccbytes; in nand_read_page_syndrome()
3287 ret = nand_read_data_op(chip, oob, chip->ecc.postpad, in nand_read_page_syndrome()
3292 oob += chip->ecc.postpad; in nand_read_page_syndrome()
3299 oob - eccpadbytes, in nand_read_page_syndrome()
3313 /* Calculate remaining oob bytes */ in nand_read_page_syndrome()
3314 i = mtd->oobsize - (oob - chip->oob_poi); in nand_read_page_syndrome()
3316 ret = nand_read_data_op(chip, oob, i, false, false); in nand_read_page_syndrome()
3325 * nand_transfer_oob - [INTERN] Transfer oob to client buffer
3327 * @oob: oob destination address
3328 * @ops: oob ops structure
3329 * @len: size of oob to transfer
3331 static uint8_t *nand_transfer_oob(struct nand_chip *chip, uint8_t *oob, in nand_transfer_oob() argument
3341 memcpy(oob, chip->oob_poi + ops->ooboffs, len); in nand_transfer_oob()
3342 return oob + len; in nand_transfer_oob()
3345 ret = mtd_ooblayout_get_databytes(mtd, oob, chip->oob_poi, in nand_transfer_oob()
3348 return oob + len; in nand_transfer_oob()
3393 * @ops: oob ops structure
3407 uint8_t *bufpoi, *oob, *buf; in nand_do_read_ops() local
3426 oob = ops->oobbuf; in nand_do_read_ops()
3427 oob_required = oob ? 1 : 0; in nand_do_read_ops()
3445 if (realpage != chip->pagecache.page || oob) { in nand_do_read_ops()
3462 !oob) in nand_do_read_ops()
3480 if (!NAND_HAS_SUBPAGE_READ(chip) && !oob && in nand_do_read_ops()
3492 if (unlikely(oob)) { in nand_do_read_ops()
3496 oob = nand_transfer_oob(chip, oob, ops, in nand_do_read_ops()
3559 if (oob) in nand_do_read_ops()
3572 * nand_read_oob_std - [REPLACEABLE] the most common OOB data read function
3585 * nand_read_oob_syndrome - [REPLACEABLE] OOB data read function for HW ECC
3639 * nand_write_oob_std - [REPLACEABLE] the most common OOB data write function
3653 * nand_write_oob_syndrome - [REPLACEABLE] OOB data write function for HW ECC
3667 * data-ecc-data-ecc ... ecc-oob in nand_write_oob_syndrome()
3669 * data-pad-ecc-pad-data-pad .... ecc-pad-oob in nand_write_oob_syndrome()
3729 * @ops: oob operations description structure
3811 * @ops: oob operation description structure
3853 * @oob_required: must write chip->oob_poi to OOB
3868 * @oob_required: must write chip->oob_poi to OOB
3871 * Not for syndrome calculating ECC controllers, which use a special oob layout.
3898 * @oob_required: must write chip->oob_poi to OOB
3903 * eventually OOB) to be sent over the bus and effectively programmed
3906 * data, then eventually send the OOB data by latching more data
3934 * @oob_required: must write chip->oob_poi to OOB
3937 * We need a special oob layout and handling even when ECC isn't checked.
3946 uint8_t *oob = chip->oob_poi; in nand_write_page_raw_syndrome() local
3961 ret = nand_write_data_op(chip, oob, chip->ecc.prepad, in nand_write_page_raw_syndrome()
3966 oob += chip->ecc.prepad; in nand_write_page_raw_syndrome()
3969 ret = nand_write_data_op(chip, oob, eccbytes, false); in nand_write_page_raw_syndrome()
3973 oob += eccbytes; in nand_write_page_raw_syndrome()
3976 ret = nand_write_data_op(chip, oob, chip->ecc.postpad, in nand_write_page_raw_syndrome()
3981 oob += chip->ecc.postpad; in nand_write_page_raw_syndrome()
3985 size = mtd->oobsize - (oob - chip->oob_poi); in nand_write_page_raw_syndrome()
3987 ret = nand_write_data_op(chip, oob, size, false); in nand_write_page_raw_syndrome()
3998 * @oob_required: must write chip->oob_poi to OOB
4027 * @oob_required: must write chip->oob_poi to OOB
4073 * @oob_required: must write chip->oob_poi to OOB
4110 /* mask OOB of un-touched subpages by padding 0xFF */ in nand_write_subpage_hwecc()
4111 /* if oob_required, preserve OOB metadata of written subpage */ in nand_write_subpage_hwecc()
4120 /* copy calculated ECC for whole page to chip->buffer->oob */ in nand_write_subpage_hwecc()
4128 /* write OOB buffer to NAND device */ in nand_write_subpage_hwecc()
4141 * @oob_required: must write chip->oob_poi to OOB
4145 * need a special oob layout and handling.
4155 uint8_t *oob = chip->oob_poi; in nand_write_page_syndrome() local
4170 ret = nand_write_data_op(chip, oob, chip->ecc.prepad, in nand_write_page_syndrome()
4175 oob += chip->ecc.prepad; in nand_write_page_syndrome()
4178 chip->ecc.calculate(chip, p, oob); in nand_write_page_syndrome()
4180 ret = nand_write_data_op(chip, oob, eccbytes, false); in nand_write_page_syndrome()
4184 oob += eccbytes; in nand_write_page_syndrome()
4187 ret = nand_write_data_op(chip, oob, chip->ecc.postpad, in nand_write_page_syndrome()
4192 oob += chip->ecc.postpad; in nand_write_page_syndrome()
4196 /* Calculate remaining oob bytes */ in nand_write_page_syndrome()
4197 i = mtd->oobsize - (oob - chip->oob_poi); in nand_write_page_syndrome()
4199 ret = nand_write_data_op(chip, oob, i, false); in nand_write_page_syndrome()
4213 * @oob_required: must write chip->oob_poi to OOB
4251 * @ops: oob operations description structure
4265 uint8_t *oob = ops->oobbuf; in nand_do_write_ops() local
4268 int oob_required = oob ? 1 : 0; in nand_do_write_ops()
4304 /* Don't allow multipage oob writes with offset */ in nand_do_write_ops()
4305 if (oob && ops->ooboffs && (ops->ooboffs + ops->ooblen > oobmaxlen)) { in nand_do_write_ops()
4339 if (unlikely(oob)) { in nand_do_write_ops()
4341 oob = nand_fill_oob(chip, oob, len, ops); in nand_do_write_ops()
4344 /* We still need to erase leftover OOB data */ in nand_do_write_ops()
4372 if (unlikely(oob)) in nand_do_write_ops()
4419 * @ops: oob operation description structure
5173 pr_info("%d MiB, %s, erase size: %d KiB, page size: %d, OOB size: %d\n", in nand_detect()
5766 * @oobavail: OOB size that the ECC engine can use
5769 * by the controller and the calculated ECC bytes fit within the chip's OOB.
5799 pr_err("ECC (step, strength) = (%d, %d) does not fit in OOB", in nand_check_ecc_caps()
5820 * @oobavail: OOB size that the ECC engine can use
5823 * number of ECC bytes (i.e. with the largest number of OOB-free bytes).
5904 * @oobavail: OOB size that the ECC engine can use
5907 * within the chip's OOB. On success, the chosen ECC settings are set.
5974 * @oobavail: OOB size that the ECC engine can use
5983 * to the chip's requirement. If available OOB size can't fit the chip
6068 /* New bad blocks should be marked in OOB, flash-based BBT, or both */ in nand_scan_tail()
6090 /* Set the internal oob buffer location, just after the page data */ in nand_scan_tail()
6113 * Expose the whole OOB area to users if ECC_NONE in nand_scan_tail()
6125 WARN(1, "No oob scheme defined for oobsize %d\n", in nand_scan_tail()
6203 /* For many systems, the standard OOB write also works for raw */ in nand_scan_tail()