Lines Matching defs:to

39  * Multiblock erase if number of blocks to erase is 2 or more.
168 * @param addr address to read
179 * @param value value to write
180 * @param addr address to write
348 * @param addr address whose erase region needs to be identified
362 * onenand_command - [DEFAULT] Send command to OneNAND device
364 * @param cmd the command to be sent
365 * @param addr offset to read from or write to
366 * @param len number of bytes to read or write
368 * Send command to OneNAND device. This function is used for middle/large page
436 /* Switch to the next data buffer */
520 * @param state state to select the max. timeout value
522 * Wait for command done. This applies to all OneNAND command
523 * Read can take up to 30us, erase up to 2ms and program up to 350us
524 * according to general OneNAND specs
620 * @param state state to select the max. timeout value
636 * @param state state to select the max. timeout value
667 * There's two method to wait onenand work
725 * @param buffer the databuffer to put/get data
726 * @param offset offset to read from or write to
727 * @param count number of bytes to read/write
761 * @param buffer the databuffer to put/get data
762 * @param offset offset to read from or write to
763 * @param count number of bytes to read/write
801 * @param buffer the databuffer to put/get data
802 * @param offset offset to read from or write to
803 * @param count number of bytes to read/write
841 * @param addr address to check
865 * @param addr address to check
907 * @param addr address to update
940 * @param addr start address to invalidate
941 * @param len length to invalidate
1021 * @param column oob offset to read from
1022 * @param thislen oob length to read
1062 * @param addr address to recover
1068 * become corrupt. LSB page recovery read is a way to read LSB page though page
1081 /* check if we failed due to uncorrectable error */
1090 /* We are attempting to reread, so decrement stats.failed
1091 * which was incremented by onenand_wait due to read failure
1093 printk(KERN_INFO "%s: Attempting to recover from uncorrectable read\n",
1105 * @param from offset to read from
1210 * @param from offset to read from
1252 /* Do first load to bufferRAM */
1269 /* If there is more to load then start next load */
1276 * bufferram so we have to point chip 0 bufferram.
1342 * @param from offset to read from
1374 printk(KERN_ERR "%s: Attempted to start read outside oob\n",
1383 printk(KERN_ERR "%s: Attempted to read beyond end of device\n",
1446 * @param from offset to read from
1447 * @param len number of bytes to read
1448 * @param retlen pointer to variable to store the number of read bytes
1449 * @param buf the databuffer to put data
1478 * @param from: offset to read from
1514 * @param state state to select the max. timeout value
1565 * @param from offset to read from
1642 * @param buf the databuffer to verify
1643 * @param to offset to read from
1645 static int onenand_verify_oob(struct mtd_info *mtd, const u_char *buf, loff_t to)
1653 this->command(mtd, readcmd, to, mtd->oobsize);
1654 onenand_update_bufferram(mtd, to, 0);
1670 * @param buf the databuffer to verify
1671 * @param addr offset to read from
1672 * @param len number of bytes to read and compare
1730 * onenand_panic_write - [MTD Interface] write buffer to FLASH in a panic context
1732 * @param to offset to write to
1733 * @param len number of bytes to write
1734 * @param retlen pointer to variable to store the number of written bytes
1735 * @param buf the data to write
1739 static int onenand_panic_write(struct mtd_info *mtd, loff_t to, size_t len,
1750 /* Wait for any existing operation to clear */
1753 pr_debug("%s: to = 0x%08x, len = %i\n", __func__, (unsigned int)to,
1757 if (unlikely(NOTALIGNED(to) || NOTALIGNED(len))) {
1758 printk(KERN_ERR "%s: Attempt to write not page aligned data\n",
1763 column = to & (mtd->writesize - 1);
1770 this->command(mtd, ONENAND_CMD_BUFFERRAM, to, thislen);
1783 this->command(mtd, ONENAND_CMD_PROG, to, mtd->writesize);
1788 onenand_update_bufferram(mtd, to, !ret && !subpage);
1791 onenand_update_bufferram(mtd, to + this->writesize, !ret && !subpage);
1805 to += thislen;
1818 * @param column oob offset to write to
1819 * @param thislen oob length to write
1857 * @param to offset to write to
1862 static int onenand_write_ops_nolock(struct mtd_info *mtd, loff_t to,
1876 pr_debug("%s: to = 0x%08x, len = %i\n", __func__, (unsigned int)to,
1884 if (unlikely(NOTALIGNED(to) || NOTALIGNED(len))) {
1885 printk(KERN_ERR "%s: Attempt to write not page aligned data\n",
1899 oobcolumn = to & (mtd->oobsize - 1);
1901 column = to & (mtd->writesize - 1);
1913 this->command(mtd, ONENAND_CMD_BUFFERRAM, to, thislen);
1928 /* We send data to spare ram with oobsize
1929 * to prevent byte access */
1966 ret = onenand_verify(mtd, buf - len, to - len, len);
1981 likely(onenand_block(this, to) != 0) &&
1988 this->command(mtd, cmd, to, mtd->writesize);
1997 onenand_update_bufferram(mtd, to, !ret && !subpage);
2005 ret = onenand_verify(mtd, buf, to, thislen);
2022 prev = to;
2024 to += thislen;
2043 * @param to offset to write to
2044 * @param len number of bytes to write
2045 * @param retlen pointer to variable to store the number of written bytes
2046 * @param buf the data to write
2051 static int onenand_write_oob_nolock(struct mtd_info *mtd, loff_t to,
2062 to += ops->ooboffs;
2064 pr_debug("%s: to = 0x%08x, len = %i\n", __func__, (unsigned int)to,
2075 column = to & (mtd->oobsize - 1);
2078 printk(KERN_ERR "%s: Attempted to start write outside oob\n",
2085 printk(KERN_ERR "%s: Attempt to write past end of page\n",
2091 if (unlikely(to >= mtd->size ||
2093 (to >> this->page_shift)) * oobsize)) {
2094 printk(KERN_ERR "%s: Attempted to write past end of device\n",
2109 this->command(mtd, ONENAND_CMD_BUFFERRAM, to, mtd->oobsize);
2111 /* We send data to spare ram with oobsize
2112 * to prevent byte access */
2121 /* Set main area of DataRAM to 0xff*/
2127 this->command(mtd, oobcmd, to, mtd->oobsize);
2129 onenand_update_bufferram(mtd, to, 0);
2132 onenand_update_bufferram(mtd, to + this->writesize, 0);
2141 ret = onenand_verify_oob(mtd, oobbuf, to);
2152 to += mtd->writesize;
2163 * onenand_write - [MTD Interface] write buffer to FLASH
2165 * @param to offset to write to
2166 * @param len number of bytes to write
2167 * @param retlen pointer to variable to store the number of written bytes
2168 * @param buf the data to write
2172 static int onenand_write(struct mtd_info *mtd, loff_t to, size_t len,
2184 ret = onenand_write_ops_nolock(mtd, to, &ops);
2194 * @param to: offset to write
2197 static int onenand_write_oob(struct mtd_info *mtd, loff_t to,
2214 ret = onenand_write_ops_nolock(mtd, to, ops);
2216 ret = onenand_write_oob_nolock(mtd, to, ops);
2226 * @param allowbbt 1, if its allowed to access the bbt area
2272 * Erase one or more blocks up to 64 block at a time
2297 printk(KERN_WARNING "%s: attempt to erase a bad block "
2415 printk(KERN_WARNING "%s: attempt to erase a bad block "
2549 * @param ofs offset relative to mtd start
2593 /* We write two bytes, so we don't have to mess with 16-bit access */
2595 /* FIXME : What to do when marking SLC block in partition
2596 * with MLC erasesize? For now, it is not advisable to
2605 * @param ofs offset relative to mtd start
2630 * @param ofs offset relative to mtd start
2631 * @param len number of bytes to lock or unlock
2710 * @param ofs offset relative to mtd start
2711 * @param len number of bytes to unlock
2728 * @param ofs offset relative to mtd start
2729 * @param len number of bytes to unlock
2825 * onenand_otp_command - Send OTP specific command to OneNAND device
2827 * @param cmd the command to be sent
2828 * @param addr offset to read from or write to
2829 * @param len number of bytes to read or write
2900 * onenand_otp_write_oob_nolock - [INTERN] OneNAND write out-of-band, specific to OTP
2902 * @param to offset to write to
2903 * @param len number of bytes to write
2904 * @param retlen pointer to variable to store the number of written bytes
2905 * @param buf the data to write
2909 static int onenand_otp_write_oob_nolock(struct mtd_info *mtd, loff_t to,
2920 to += ops->ooboffs;
2927 column = to & (mtd->oobsize - 1);
2937 block = (int) (to >> this->erase_shift);
2963 /* We send data to spare ram with oobsize
2964 * to prevent byte access */
2976 onenand_otp_command(mtd, ONENAND_CMD_PROGOOB, to, mtd->oobsize);
2977 onenand_update_bufferram(mtd, to, 0);
2980 onenand_update_bufferram(mtd, to + this->writesize, 0);
3009 printk(KERN_DEBUG "Reboot to check\n");
3016 to += mtd->writesize;
3033 * @param from The offset to read
3034 * @param len number of bytes to read
3035 * @param retlen pointer to variable to store the number of readbytes
3036 * @param buf the databuffer to put/get data
3070 * @param to The offset to write
3071 * @param len number of bytes to write
3072 * @param retlen pointer to variable to store the number of write bytes
3073 * @param buf the databuffer to put/get data
3077 static int do_otp_write(struct mtd_info *mtd, loff_t to, size_t len,
3101 ret = onenand_write_ops_nolock(mtd, to, &ops);
3114 * @param from The offset to lock
3115 * @param len number of bytes to lock
3116 * @param retlen pointer to variable to store the number of lock bytes
3117 * @param buf the databuffer to put/get data
3134 * For Flex-OneNAND, we write lock mark to 1st word of sector 4 of
3162 * @param from The offset to read/write
3163 * @param len number of bytes to read/write
3164 * @param retlen pointer to variable to store the number of read bytes
3165 * @param buf the databuffer to put/get data
3243 * @param buf the databuffer to put/get data
3244 * @param len number of bytes to read
3262 * @param from The offset to read
3263 * @param len number of bytes to read
3264 * @param retlen pointer to variable to store the number of read bytes
3265 * @param buf the databuffer to put/get data
3278 * @param buf the databuffer to put/get data
3279 * @param len number of bytes to read
3297 * @param from The offset to read
3298 * @param len number of bytes to read
3299 * @param retlen pointer to variable to store the number of read bytes
3300 * @param buf the databuffer to put/get data
3313 * @param from The offset to write
3314 * @param len number of bytes to write
3315 * @param retlen pointer to variable to store the number of write bytes
3316 * @param buf the databuffer to put/get data
3329 * @param from The offset to lock
3330 * @param len number of bytes to unlock
3346 * Write lock mark to 8th word of sector0 of page0 of the spare0.
3348 * For Flex-OneNAND, we write lock mark to 1st word of sector 4 of
3409 * and no way to detect it by H/W config values.
3637 * @param start - first erase block to check
3638 * @param end - last erase block to check
3640 * Converting an unerased block from MLC to SLC
3641 * causes byte values to change. Since both data and its ECC
3643 * This might lead to the block being detected as bad.
3645 * Avoid this by ensuring that the block to be converted is
3662 printk(KERN_DEBUG "Check blocks from %d to %d\n", start, end);
3670 * Since main area write results in ECC write to spare,
3671 * it is sufficient to check only ECC bytes for change.
3796 /* Clear Sync. Burst Read mode to read BootRAM */
3806 /* Reset OneNAND to read default register values */
3876 /* The data buffer size is equal to page size */
3888 * Expose MLC erase size to find erase_shift and page_mask.
3950 * @param maxchips Number of chips to scan for
4034 * Allow subpage writes up to oobsize.
4070 * The number of bytes available for a client to place data into