Lines Matching defs:to

23  *	Check, if mtd->ecctype should be set to MTD_ECC_HW
27 * BBT table is not serialized, has to be fixed
99 static int nand_do_write_oob(struct mtd_info *mtd, loff_t to,
191 * @chipnr: chipnumber to select, -1 for deselect
212 * nand_write_buf - [DEFAULT] write buffer to chip
215 * @len: number of bytes to write
231 * @buf: buffer to store date
232 * @len: number of bytes to read
248 * @buf: buffer containing the data to compare
249 * @len: number of bytes to compare
265 * nand_write_buf16 - [DEFAULT] write buffer to chip
268 * @len: number of bytes to write
287 * @buf: buffer to store date
288 * @len: number of bytes to read
306 * @buf: buffer containing the data to compare
307 * @len: number of bytes to compare
389 * specific driver. We try operations in the following order, according to our
391 * (1) erase the affected block, to allow OOB marker to be written cleanly
393 * (3) write bad block marker to OOB area of affected block
422 /* Write bad block marker to OOB */
440 /* Write to first/last page(s) if necessary */
493 * @allowbbt: 1, if its allowed to access the bbt area
515 * Helper function for nand_wait_ready used when needing to wait in interrupt
523 /* Wait for the device to get ready */
554 * nand_command - [DEFAULT] Send command to NAND device
556 * @command: the command to be sent
560 * Send command to NAND device. This function is used for small page devices
569 /* Write out the command to the device */
634 /* This applies to read commands */
637 * If we don't have access to the busy pin, we apply the given
646 * Apply this short delay always to ensure that we do wait tWB in
655 * nand_command_lp - [DEFAULT] Send command to NAND large page device
657 * @command: the command to be sent
661 * Send command to NAND device. This is the version for the new large page
663 * devices. We must emulate NAND_CMD_READOOB to keep the code compatible.
755 /* This applies to read commands */
758 * If we don't have access to the busy pin, we apply the given
768 * Apply this short delay always to ensure that we do wait tWB in
840 * we are in interrupt context. May happen when in panic and trying to write
864 * Wait for command done. This applies to erase and program only. Erase can
865 * take up to 400ms and program up to 20ms according to general NAND and
882 * Apply this short delay always to ensure that we do wait tWB in any
915 * @ofs: offset to start unlock from
916 * @len: length to unlock
931 /* Submit address of first page to unlock */
935 /* Submit address of last page to unlock */
955 * @ofs: offset to start unlock from
956 * @len: length to unlock
972 /* Align to last block address if size addresses end of the device */
978 /* Shift to get chip number */
1003 * @ofs: offset to start unlock from
1004 * @len: length to unlock
1007 * have this feature, but it allows only to lock all blocks, not for specified
1027 /* Shift to get chip number */
1041 /* Submit address of first page to lock */
1068 * @buf: buffer to store read data
1069 * @page: page number to read
1085 * @buf: buffer to store read data
1086 * @page: page number to read
1128 * @buf: buffer to store read data
1129 * @page: page number to read
1171 * @bufpoi: buffer to store read data
1184 /* Column address within the page aligned to ECC size (256bytes) */
1189 /* Data size aligned to ECC ecc.size */
1206 * The performance is faster if we position offsets according to
1221 * Send the command to read the particular ECC bytes take care
1259 * @buf: buffer to store read data
1260 * @page: page number to read
1304 * @buf: buffer to store read data
1305 * @page: page number to read
1307 * Hardware ECC for large page chips, require OOB to be read first. For this
1352 * @buf: buffer to store read data
1353 * @page: page number to read
1404 * nand_transfer_oob - [INTERN] Transfer oob to client buffer
1408 * @len: size of oob to transfer
1454 * @from: offset to read from
1566 /* For subsequent reads align to page boundary */
1603 * @from: offset to read from
1604 * @len: number of bytes to read
1605 * @retlen: pointer to variable to store the number of read bytes
1606 * @buf: the databuffer to put data
1632 * @page: page number to read
1633 * @sndcmd: flag whether to issue read command or not
1651 * @page: page number to read
1652 * @sndcmd: flag whether to issue read command or not
1689 * @page: page number to write
1700 /* Send command to program the OOB data */
1713 * @page: page number to write
1770 * @from: offset to read from
1797 pr_debug("%s: attempt to start read outside oob\n",
1806 pr_debug("%s: attempt to read beyond end of device\n",
1814 /* Shift to get page */
1874 * @from: offset to read from
1889 pr_debug("%s: attempt to read beyond end of device\n",
2073 * @buf: the data to write
2074 * @page: page number to write
2116 /* Send command to read back the data */
2126 * nand_fill_oob - [INTERN] Transfer client buffer to oob
2138 * Initialise to all 0xFF, to avoid the possibility of left over OOB
2186 * @to: offset to write to
2191 static int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
2211 if (NOTALIGNED(to) || NOTALIGNED(ops->len)) {
2212 pr_notice("%s: attempt to write non page aligned data\n",
2217 column = to & (mtd->writesize - 1);
2223 chipnr = (int)(to >> chip->chip_shift);
2230 realpage = (int)(to >> chip->page_shift);
2234 /* Invalidate the page cache, when we write to the cached page */
2235 if (to <= (chip->pagebuf << chip->page_shift) &&
2236 (chip->pagebuf << chip->page_shift) < (to + ops->len))
2263 /* We still need to erase leftover OOB data */
2298 * @to: offset to write to
2299 * @len: number of bytes to write
2300 * @retlen: pointer to variable to store the number of written bytes
2301 * @buf: the data to write
2306 static int panic_nand_write(struct mtd_info *mtd, loff_t to, size_t len,
2313 /* Wait for the device to get ready */
2324 ret = nand_do_write_ops(mtd, to, &ops);
2333 * @to: offset to write to
2334 * @len: number of bytes to write
2335 * @retlen: pointer to variable to store the number of written bytes
2336 * @buf: the data to write
2340 static int nand_write(struct mtd_info *mtd, loff_t to, size_t len,
2352 ret = nand_do_write_ops(mtd, to, &ops);
2361 * @to: offset to write to
2366 static int nand_do_write_oob(struct mtd_info *mtd, loff_t to,
2372 pr_debug("%s: to = 0x%08x, len = %i\n",
2373 __func__, (unsigned int)to, (int)ops->ooblen);
2382 pr_debug("%s: attempt to write past end of page\n",
2388 pr_debug("%s: attempt to start write outside oob\n",
2394 if (unlikely(to >= mtd->size ||
2397 (to >> chip->page_shift)) * len)) {
2398 pr_debug("%s: attempt to write beyond end of device\n",
2403 chipnr = (int)(to >> chip->chip_shift);
2406 /* Shift to get page */
2407 page = (int)(to >> chip->page_shift);
2412 * if we don't do this. I have no clue why, but I seem to have 'fixed'
2421 /* Invalidate the page cache, if we write to the cached page */
2443 * @to: offset to write to
2446 static int nand_write_oob(struct mtd_info *mtd, loff_t to,
2455 if (ops->datbuf && (to + ops->len) > mtd->size) {
2456 pr_debug("%s: attempt to write beyond end of device\n",
2474 ret = nand_do_write_oob(mtd, to, ops);
2476 ret = nand_do_write_ops(mtd, to, ops);
2493 /* Send commands to erase a block */
2508 /* Send commands to erase a block */
2556 /* Shift to get first page */
2575 * If BBT requires refresh, set the BBT page mask to see if the BBT
2576 * should be rewritten. Otherwise the mask is set to 0xffffffff which
2578 * erased to avoid recursive updates.
2592 pr_warn("%s: attempt to erase a bad block at page 0x%08x\n",
2629 * If BBT requires refresh, set the BBT rewrite flag to the
2649 * page mask to see if this BBT should be rewritten.
2712 * @offs: offset relative to mtd start
2722 * @ofs: offset relative to mtd start
2938 * Try again to make sure, as some systems the bus-hold or other
2940 * possibly credible NAND flash to appear. If the two results do
3002 * to decide what to do.
3084 /* Try to identify manufacturer */
3106 /* Convert chipsize to number of pages per chip -1 */
3168 * @maxchips: number of chips to scan for
3174 * The mtd->owner field must be set to the module of the caller.
3183 /* Get buswidth to select the correct functions */
3276 * Check ECC mode, default to software if 3byte/512byte hardware ECC is
3277 * selected and we have 256 byte pagesize fallback to software ECC
3282 /* Similar to NAND_ECC_HW, but a separate read_page handle */
3335 "%d byte page size, fallback to SW ECC\n",
3370 * Board driver should supply ecc.size and ecc.bytes values to
3372 * for details. Otherwise, default to 4 bits for large page
3417 * The number of bytes available for a client to place data into
3438 /* Allow subpage writes up to ecc.steps. Not possible for MLC flash */
3484 /* propagate ecc info to mtd_info */
3499 * test if this is a module _anyway_ -- they'd have to try _really_ hard
3500 * to call us from in-kernel code if the core NAND support is modular.
3512 * @maxchips: number of chips to scan for
3516 * appropriate values. The mtd->owner field must be set to the module of the