aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nand_base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r--drivers/mtd/nand/nand_base.c105
1 files changed, 52 insertions, 53 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 408e1d0abfd1..237d7daa189c 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -21,7 +21,7 @@
21 * TODO: 21 * TODO:
22 * Enable cached programming for 2k page size chips 22 * Enable cached programming for 2k page size chips
23 * Check, if mtd->ecctype should be set to MTD_ECC_HW 23 * Check, if mtd->ecctype should be set to MTD_ECC_HW
24 * if we have HW ecc support. 24 * if we have HW ECC support.
25 * The AG-AND chips have nice features for speed improvement, 25 * The AG-AND chips have nice features for speed improvement,
26 * which are not supported yet. Read / program 4 pages in one go. 26 * which are not supported yet. Read / program 4 pages in one go.
27 * BBT table is not serialized, has to be fixed 27 * BBT table is not serialized, has to be fixed
@@ -159,7 +159,7 @@ static void nand_release_device(struct mtd_info *mtd)
159 * nand_read_byte - [DEFAULT] read one byte from the chip 159 * nand_read_byte - [DEFAULT] read one byte from the chip
160 * @mtd: MTD device structure 160 * @mtd: MTD device structure
161 * 161 *
162 * Default read function for 8bit buswith. 162 * Default read function for 8bit buswidth
163 */ 163 */
164static uint8_t nand_read_byte(struct mtd_info *mtd) 164static uint8_t nand_read_byte(struct mtd_info *mtd)
165{ 165{
@@ -169,9 +169,11 @@ static uint8_t nand_read_byte(struct mtd_info *mtd)
169 169
170/** 170/**
171 * nand_read_byte16 - [DEFAULT] read one byte endianess aware from the chip 171 * nand_read_byte16 - [DEFAULT] read one byte endianess aware from the chip
172 * nand_read_byte16 - [DEFAULT] read one byte endianness aware from the chip
172 * @mtd: MTD device structure 173 * @mtd: MTD device structure
173 * 174 *
174 * Default read function for 16bit buswith with endianess conversion. 175 * Default read function for 16bit buswidth with endianness conversion.
176 *
175 */ 177 */
176static uint8_t nand_read_byte16(struct mtd_info *mtd) 178static uint8_t nand_read_byte16(struct mtd_info *mtd)
177{ 179{
@@ -183,7 +185,7 @@ static uint8_t nand_read_byte16(struct mtd_info *mtd)
183 * nand_read_word - [DEFAULT] read one word from the chip 185 * nand_read_word - [DEFAULT] read one word from the chip
184 * @mtd: MTD device structure 186 * @mtd: MTD device structure
185 * 187 *
186 * Default read function for 16bit buswith without endianess conversion. 188 * Default read function for 16bit buswidth without endianness conversion.
187 */ 189 */
188static u16 nand_read_word(struct mtd_info *mtd) 190static u16 nand_read_word(struct mtd_info *mtd)
189{ 191{
@@ -220,7 +222,7 @@ static void nand_select_chip(struct mtd_info *mtd, int chipnr)
220 * @buf: data buffer 222 * @buf: data buffer
221 * @len: number of bytes to write 223 * @len: number of bytes to write
222 * 224 *
223 * Default write function for 8bit buswith. 225 * Default write function for 8bit buswidth.
224 */ 226 */
225static void nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len) 227static void nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
226{ 228{
@@ -237,7 +239,7 @@ static void nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
237 * @buf: buffer to store date 239 * @buf: buffer to store date
238 * @len: number of bytes to read 240 * @len: number of bytes to read
239 * 241 *
240 * Default read function for 8bit buswith. 242 * Default read function for 8bit buswidth.
241 */ 243 */
242static void nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) 244static void nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
243{ 245{
@@ -254,7 +256,7 @@ static void nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
254 * @buf: buffer containing the data to compare 256 * @buf: buffer containing the data to compare
255 * @len: number of bytes to compare 257 * @len: number of bytes to compare
256 * 258 *
257 * Default verify function for 8bit buswith. 259 * Default verify function for 8bit buswidth.
258 */ 260 */
259static int nand_verify_buf(struct mtd_info *mtd, const uint8_t *buf, int len) 261static int nand_verify_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
260{ 262{
@@ -273,7 +275,7 @@ static int nand_verify_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
273 * @buf: data buffer 275 * @buf: data buffer
274 * @len: number of bytes to write 276 * @len: number of bytes to write
275 * 277 *
276 * Default write function for 16bit buswith. 278 * Default write function for 16bit buswidth.
277 */ 279 */
278static void nand_write_buf16(struct mtd_info *mtd, const uint8_t *buf, int len) 280static void nand_write_buf16(struct mtd_info *mtd, const uint8_t *buf, int len)
279{ 281{
@@ -293,7 +295,7 @@ static void nand_write_buf16(struct mtd_info *mtd, const uint8_t *buf, int len)
293 * @buf: buffer to store date 295 * @buf: buffer to store date
294 * @len: number of bytes to read 296 * @len: number of bytes to read
295 * 297 *
296 * Default read function for 16bit buswith. 298 * Default read function for 16bit buswidth.
297 */ 299 */
298static void nand_read_buf16(struct mtd_info *mtd, uint8_t *buf, int len) 300static void nand_read_buf16(struct mtd_info *mtd, uint8_t *buf, int len)
299{ 301{
@@ -312,7 +314,7 @@ static void nand_read_buf16(struct mtd_info *mtd, uint8_t *buf, int len)
312 * @buf: buffer containing the data to compare 314 * @buf: buffer containing the data to compare
313 * @len: number of bytes to compare 315 * @len: number of bytes to compare
314 * 316 *
315 * Default verify function for 16bit buswith. 317 * Default verify function for 16bit buswidth.
316 */ 318 */
317static int nand_verify_buf16(struct mtd_info *mtd, const uint8_t *buf, int len) 319static int nand_verify_buf16(struct mtd_info *mtd, const uint8_t *buf, int len)
318{ 320{
@@ -499,7 +501,7 @@ static void panic_nand_wait_ready(struct mtd_info *mtd, unsigned long timeo)
499 } 501 }
500} 502}
501 503
502/* Wait for the ready pin, after a command. The timeout is catched later */ 504/* Wait for the ready pin, after a command. The timeout is caught later. */
503void nand_wait_ready(struct mtd_info *mtd) 505void nand_wait_ready(struct mtd_info *mtd)
504{ 506{
505 struct nand_chip *chip = mtd->priv; 507 struct nand_chip *chip = mtd->priv;
@@ -510,7 +512,7 @@ void nand_wait_ready(struct mtd_info *mtd)
510 return panic_nand_wait_ready(mtd, 400); 512 return panic_nand_wait_ready(mtd, 400);
511 513
512 led_trigger_event(nand_led_trigger, LED_FULL); 514 led_trigger_event(nand_led_trigger, LED_FULL);
513 /* Wait until command is processed or timeout occures */ 515 /* Wait until command is processed or timeout occurs */
514 do { 516 do {
515 if (chip->dev_ready(mtd)) 517 if (chip->dev_ready(mtd))
516 break; 518 break;
@@ -629,8 +631,8 @@ static void nand_command(struct mtd_info *mtd, unsigned int command,
629 * @page_addr: the page address for this command, -1 if none 631 * @page_addr: the page address for this command, -1 if none
630 * 632 *
631 * Send command to NAND device. This is the version for the new large page 633 * Send command to NAND device. This is the version for the new large page
632 * devices We dont have the separate regions as we have in the small page 634 * devices. We don't have the separate regions as we have in the small page
633 * devices. We must emulate NAND_CMD_READOOB to keep the code compatible. 635 * devices. We must emulate NAND_CMD_READOOB to keep the code compatible.
634 */ 636 */
635static void nand_command_lp(struct mtd_info *mtd, unsigned int command, 637static void nand_command_lp(struct mtd_info *mtd, unsigned int command,
636 int column, int page_addr) 638 int column, int page_addr)
@@ -754,7 +756,7 @@ static void nand_command_lp(struct mtd_info *mtd, unsigned int command,
754static void panic_nand_get_device(struct nand_chip *chip, 756static void panic_nand_get_device(struct nand_chip *chip,
755 struct mtd_info *mtd, int new_state) 757 struct mtd_info *mtd, int new_state)
756{ 758{
757 /* Hardware controller shared among independend devices */ 759 /* Hardware controller shared among independent devices */
758 chip->controller->active = chip; 760 chip->controller->active = chip;
759 chip->state = new_state; 761 chip->state = new_state;
760} 762}
@@ -1032,14 +1034,13 @@ out:
1032EXPORT_SYMBOL(nand_lock); 1034EXPORT_SYMBOL(nand_lock);
1033 1035
1034/** 1036/**
1035 * nand_read_page_raw - [Intern] read raw page data without ecc 1037 * nand_read_page_raw - [INTERN] read raw page data without ecc
1036 * @mtd: mtd info structure 1038 * @mtd: mtd info structure
1037 * @chip: nand chip info structure 1039 * @chip: nand chip info structure
1038 * @buf: buffer to store read data 1040 * @buf: buffer to store read data
1039 * @page: page number to read 1041 * @page: page number to read
1040 * 1042 *
1041 * Not for syndrome calculating ecc controllers, which use a special oob 1043 * Not for syndrome calculating ECC controllers, which use a special oob layout.
1042 * layout.
1043 */ 1044 */
1044static int nand_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip, 1045static int nand_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
1045 uint8_t *buf, int page) 1046 uint8_t *buf, int page)
@@ -1050,7 +1051,7 @@ static int nand_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
1050} 1051}
1051 1052
1052/** 1053/**
1053 * nand_read_page_raw_syndrome - [Intern] read raw page data without ecc 1054 * nand_read_page_raw_syndrome - [INTERN] read raw page data without ecc
1054 * @mtd: mtd info structure 1055 * @mtd: mtd info structure
1055 * @chip: nand chip info structure 1056 * @chip: nand chip info structure
1056 * @buf: buffer to store read data 1057 * @buf: buffer to store read data
@@ -1093,7 +1094,7 @@ static int nand_read_page_raw_syndrome(struct mtd_info *mtd,
1093} 1094}
1094 1095
1095/** 1096/**
1096 * nand_read_page_swecc - [REPLACABLE] software ecc based page read function 1097 * nand_read_page_swecc - [REPLACEABLE] software ECC based page read function
1097 * @mtd: mtd info structure 1098 * @mtd: mtd info structure
1098 * @chip: nand chip info structure 1099 * @chip: nand chip info structure
1099 * @buf: buffer to store read data 1100 * @buf: buffer to store read data
@@ -1134,7 +1135,7 @@ static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
1134} 1135}
1135 1136
1136/** 1137/**
1137 * nand_read_subpage - [REPLACABLE] software ecc based sub-page read function 1138 * nand_read_subpage - [REPLACEABLE] software ECC based sub-page read function
1138 * @mtd: mtd info structure 1139 * @mtd: mtd info structure
1139 * @chip: nand chip info structure 1140 * @chip: nand chip info structure
1140 * @data_offs: offset of requested data within the page 1141 * @data_offs: offset of requested data within the page
@@ -1152,7 +1153,7 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
1152 int busw = (chip->options & NAND_BUSWIDTH_16) ? 2 : 1; 1153 int busw = (chip->options & NAND_BUSWIDTH_16) ? 2 : 1;
1153 int index = 0; 1154 int index = 0;
1154 1155
1155 /* Column address wihin the page aligned to ECC size (256bytes) */ 1156 /* Column address within the page aligned to ECC size (256bytes) */
1156 start_step = data_offs / chip->ecc.size; 1157 start_step = data_offs / chip->ecc.size;
1157 end_step = (data_offs + readlen - 1) / chip->ecc.size; 1158 end_step = (data_offs + readlen - 1) / chip->ecc.size;
1158 num_steps = end_step - start_step + 1; 1159 num_steps = end_step - start_step + 1;
@@ -1175,7 +1176,7 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
1175 1176
1176 /* 1177 /*
1177 * The performance is faster if we position offsets according to 1178 * The performance is faster if we position offsets according to
1178 * ecc.pos. Let's make sure that there are no gaps in ecc positions. 1179 * ecc.pos. Let's make sure that there are no gaps in ECC positions.
1179 */ 1180 */
1180 for (i = 0; i < eccfrag_len - 1; i++) { 1181 for (i = 0; i < eccfrag_len - 1; i++) {
1181 if (eccpos[i + start_step * chip->ecc.bytes] + 1 != 1182 if (eccpos[i + start_step * chip->ecc.bytes] + 1 !=
@@ -1189,7 +1190,7 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
1189 chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); 1190 chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
1190 } else { 1191 } else {
1191 /* 1192 /*
1192 * Send the command to read the particular ecc bytes take care 1193 * Send the command to read the particular ECC bytes take care
1193 * about buswidth alignment in read_buf. 1194 * about buswidth alignment in read_buf.
1194 */ 1195 */
1195 index = start_step * chip->ecc.bytes; 1196 index = start_step * chip->ecc.bytes;
@@ -1224,14 +1225,13 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
1224} 1225}
1225 1226
1226/** 1227/**
1227 * nand_read_page_hwecc - [REPLACABLE] hardware ecc based page read function 1228 * nand_read_page_hwecc - [REPLACEABLE] hardware ECC based page read function
1228 * @mtd: mtd info structure 1229 * @mtd: mtd info structure
1229 * @chip: nand chip info structure 1230 * @chip: nand chip info structure
1230 * @buf: buffer to store read data 1231 * @buf: buffer to store read data
1231 * @page: page number to read 1232 * @page: page number to read
1232 * 1233 *
1233 * Not for syndrome calculating ecc controllers which need a special oob 1234 * Not for syndrome calculating ECC controllers which need a special oob layout.
1234 * layout.
1235 */ 1235 */
1236static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip, 1236static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
1237 uint8_t *buf, int page) 1237 uint8_t *buf, int page)
@@ -1270,7 +1270,7 @@ static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
1270} 1270}
1271 1271
1272/** 1272/**
1273 * nand_read_page_hwecc_oob_first - [REPLACABLE] hw ecc, read oob first 1273 * nand_read_page_hwecc_oob_first - [REPLACEABLE] hw ecc, read oob first
1274 * @mtd: mtd info structure 1274 * @mtd: mtd info structure
1275 * @chip: nand chip info structure 1275 * @chip: nand chip info structure
1276 * @buf: buffer to store read data 1276 * @buf: buffer to store read data
@@ -1318,7 +1318,7 @@ static int nand_read_page_hwecc_oob_first(struct mtd_info *mtd,
1318} 1318}
1319 1319
1320/** 1320/**
1321 * nand_read_page_syndrome - [REPLACABLE] hardware ecc syndrom based page read 1321 * nand_read_page_syndrome - [REPLACEABLE] hardware ECC syndrome based page read
1322 * @mtd: mtd info structure 1322 * @mtd: mtd info structure
1323 * @chip: nand chip info structure 1323 * @chip: nand chip info structure
1324 * @buf: buffer to store read data 1324 * @buf: buffer to store read data
@@ -1373,7 +1373,7 @@ static int nand_read_page_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
1373} 1373}
1374 1374
1375/** 1375/**
1376 * nand_transfer_oob - [Internal] Transfer oob to client buffer 1376 * nand_transfer_oob - [INTERN] Transfer oob to client buffer
1377 * @chip: nand chip structure 1377 * @chip: nand chip structure
1378 * @oob: oob destination address 1378 * @oob: oob destination address
1379 * @ops: oob ops structure 1379 * @ops: oob ops structure
@@ -1421,7 +1421,7 @@ static uint8_t *nand_transfer_oob(struct nand_chip *chip, uint8_t *oob,
1421} 1421}
1422 1422
1423/** 1423/**
1424 * nand_do_read_ops - [Internal] Read data with ECC 1424 * nand_do_read_ops - [INTERN] Read data with ECC
1425 * @mtd: MTD device structure 1425 * @mtd: MTD device structure
1426 * @from: offset to read from 1426 * @from: offset to read from
1427 * @ops: oob ops structure 1427 * @ops: oob ops structure
@@ -1599,7 +1599,7 @@ static int nand_read(struct mtd_info *mtd, loff_t from, size_t len,
1599} 1599}
1600 1600
1601/** 1601/**
1602 * nand_read_oob_std - [REPLACABLE] the most common OOB data read function 1602 * nand_read_oob_std - [REPLACEABLE] the most common OOB data read function
1603 * @mtd: mtd info structure 1603 * @mtd: mtd info structure
1604 * @chip: nand chip info structure 1604 * @chip: nand chip info structure
1605 * @page: page number to read 1605 * @page: page number to read
@@ -1617,7 +1617,7 @@ static int nand_read_oob_std(struct mtd_info *mtd, struct nand_chip *chip,
1617} 1617}
1618 1618
1619/** 1619/**
1620 * nand_read_oob_syndrome - [REPLACABLE] OOB data read function for HW ECC 1620 * nand_read_oob_syndrome - [REPLACEABLE] OOB data read function for HW ECC
1621 * with syndromes 1621 * with syndromes
1622 * @mtd: mtd info structure 1622 * @mtd: mtd info structure
1623 * @chip: nand chip info structure 1623 * @chip: nand chip info structure
@@ -1656,7 +1656,7 @@ static int nand_read_oob_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
1656} 1656}
1657 1657
1658/** 1658/**
1659 * nand_write_oob_std - [REPLACABLE] the most common OOB data write function 1659 * nand_write_oob_std - [REPLACEABLE] the most common OOB data write function
1660 * @mtd: mtd info structure 1660 * @mtd: mtd info structure
1661 * @chip: nand chip info structure 1661 * @chip: nand chip info structure
1662 * @page: page number to write 1662 * @page: page number to write
@@ -1679,7 +1679,7 @@ static int nand_write_oob_std(struct mtd_info *mtd, struct nand_chip *chip,
1679} 1679}
1680 1680
1681/** 1681/**
1682 * nand_write_oob_syndrome - [REPLACABLE] OOB data write function for HW ECC 1682 * nand_write_oob_syndrome - [REPLACEABLE] OOB data write function for HW ECC
1683 * with syndrome - only for large page flash 1683 * with syndrome - only for large page flash
1684 * @mtd: mtd info structure 1684 * @mtd: mtd info structure
1685 * @chip: nand chip info structure 1685 * @chip: nand chip info structure
@@ -1738,7 +1738,7 @@ static int nand_write_oob_syndrome(struct mtd_info *mtd,
1738} 1738}
1739 1739
1740/** 1740/**
1741 * nand_do_read_oob - [Intern] NAND read out-of-band 1741 * nand_do_read_oob - [INTERN] NAND read out-of-band
1742 * @mtd: MTD device structure 1742 * @mtd: MTD device structure
1743 * @from: offset to read from 1743 * @from: offset to read from
1744 * @ops: oob operations description structure 1744 * @ops: oob operations description structure
@@ -1878,13 +1878,12 @@ out:
1878 1878
1879 1879
1880/** 1880/**
1881 * nand_write_page_raw - [Intern] raw page write function 1881 * nand_write_page_raw - [INTERN] raw page write function
1882 * @mtd: mtd info structure 1882 * @mtd: mtd info structure
1883 * @chip: nand chip info structure 1883 * @chip: nand chip info structure
1884 * @buf: data buffer 1884 * @buf: data buffer
1885 * 1885 *
1886 * Not for syndrome calculating ecc controllers, which use a special oob 1886 * Not for syndrome calculating ECC controllers, which use a special oob layout.
1887 * layout.
1888 */ 1887 */
1889static void nand_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip, 1888static void nand_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
1890 const uint8_t *buf) 1889 const uint8_t *buf)
@@ -1894,7 +1893,7 @@ static void nand_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
1894} 1893}
1895 1894
1896/** 1895/**
1897 * nand_write_page_raw_syndrome - [Intern] raw page write function 1896 * nand_write_page_raw_syndrome - [INTERN] raw page write function
1898 * @mtd: mtd info structure 1897 * @mtd: mtd info structure
1899 * @chip: nand chip info structure 1898 * @chip: nand chip info structure
1900 * @buf: data buffer 1899 * @buf: data buffer
@@ -1933,7 +1932,7 @@ static void nand_write_page_raw_syndrome(struct mtd_info *mtd,
1933 chip->write_buf(mtd, oob, size); 1932 chip->write_buf(mtd, oob, size);
1934} 1933}
1935/** 1934/**
1936 * nand_write_page_swecc - [REPLACABLE] software ecc based page write function 1935 * nand_write_page_swecc - [REPLACEABLE] software ECC based page write function
1937 * @mtd: mtd info structure 1936 * @mtd: mtd info structure
1938 * @chip: nand chip info structure 1937 * @chip: nand chip info structure
1939 * @buf: data buffer 1938 * @buf: data buffer
@@ -1948,7 +1947,7 @@ static void nand_write_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
1948 const uint8_t *p = buf; 1947 const uint8_t *p = buf;
1949 uint32_t *eccpos = chip->ecc.layout->eccpos; 1948 uint32_t *eccpos = chip->ecc.layout->eccpos;
1950 1949
1951 /* Software ecc calculation */ 1950 /* Software ECC calculation */
1952 for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) 1951 for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize)
1953 chip->ecc.calculate(mtd, p, &ecc_calc[i]); 1952 chip->ecc.calculate(mtd, p, &ecc_calc[i]);
1954 1953
@@ -1959,7 +1958,7 @@ static void nand_write_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
1959} 1958}
1960 1959
1961/** 1960/**
1962 * nand_write_page_hwecc - [REPLACABLE] hardware ecc based page write function 1961 * nand_write_page_hwecc - [REPLACEABLE] hardware ECC based page write function
1963 * @mtd: mtd info structure 1962 * @mtd: mtd info structure
1964 * @chip: nand chip info structure 1963 * @chip: nand chip info structure
1965 * @buf: data buffer 1964 * @buf: data buffer
@@ -1987,7 +1986,7 @@ static void nand_write_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
1987} 1986}
1988 1987
1989/** 1988/**
1990 * nand_write_page_syndrome - [REPLACABLE] hardware ecc syndrom based page write 1989 * nand_write_page_syndrome - [REPLACEABLE] hardware ECC syndrome based page write
1991 * @mtd: mtd info structure 1990 * @mtd: mtd info structure
1992 * @chip: nand chip info structure 1991 * @chip: nand chip info structure
1993 * @buf: data buffer 1992 * @buf: data buffer
@@ -2052,7 +2051,7 @@ static int nand_write_page(struct mtd_info *mtd, struct nand_chip *chip,
2052 chip->ecc.write_page(mtd, chip, buf); 2051 chip->ecc.write_page(mtd, chip, buf);
2053 2052
2054 /* 2053 /*
2055 * Cached progamming disabled for now, Not sure if its worth the 2054 * Cached progamming disabled for now. Not sure if it's worth the
2056 * trouble. The speed gain is not very impressive. (2.3->2.6Mib/s). 2055 * trouble. The speed gain is not very impressive. (2.3->2.6Mib/s).
2057 */ 2056 */
2058 cached = 0; 2057 cached = 0;
@@ -2087,7 +2086,7 @@ static int nand_write_page(struct mtd_info *mtd, struct nand_chip *chip,
2087} 2086}
2088 2087
2089/** 2088/**
2090 * nand_fill_oob - [Internal] Transfer client buffer to oob 2089 * nand_fill_oob - [INTERN] Transfer client buffer to oob
2091 * @mtd: MTD device structure 2090 * @mtd: MTD device structure
2092 * @oob: oob data buffer 2091 * @oob: oob data buffer
2093 * @len: oob data write length 2092 * @len: oob data write length
@@ -2145,7 +2144,7 @@ static uint8_t *nand_fill_oob(struct mtd_info *mtd, uint8_t *oob, size_t len,
2145#define NOTALIGNED(x) ((x & (chip->subpagesize - 1)) != 0) 2144#define NOTALIGNED(x) ((x & (chip->subpagesize - 1)) != 0)
2146 2145
2147/** 2146/**
2148 * nand_do_write_ops - [Internal] NAND write with ECC 2147 * nand_do_write_ops - [INTERN] NAND write with ECC
2149 * @mtd: MTD device structure 2148 * @mtd: MTD device structure
2150 * @to: offset to write to 2149 * @to: offset to write to
2151 * @ops: oob operations description structure 2150 * @ops: oob operations description structure
@@ -2454,7 +2453,7 @@ out:
2454} 2453}
2455 2454
2456/** 2455/**
2457 * single_erease_cmd - [GENERIC] NAND standard block erase command function 2456 * single_erase_cmd - [GENERIC] NAND standard block erase command function
2458 * @mtd: MTD device structure 2457 * @mtd: MTD device structure
2459 * @page: the page address of the block which will be erased 2458 * @page: the page address of the block which will be erased
2460 * 2459 *
@@ -2469,7 +2468,7 @@ static void single_erase_cmd(struct mtd_info *mtd, int page)
2469} 2468}
2470 2469
2471/** 2470/**
2472 * multi_erease_cmd - [GENERIC] AND specific block erase command function 2471 * multi_erase_cmd - [GENERIC] AND specific block erase command function
2473 * @mtd: MTD device structure 2472 * @mtd: MTD device structure
2474 * @page: the page address of the block which will be erased 2473 * @page: the page address of the block which will be erased
2475 * 2474 *
@@ -2500,7 +2499,7 @@ static int nand_erase(struct mtd_info *mtd, struct erase_info *instr)
2500 2499
2501#define BBT_PAGE_MASK 0xffffff3f 2500#define BBT_PAGE_MASK 0xffffff3f
2502/** 2501/**
2503 * nand_erase_nand - [Internal] erase block(s) 2502 * nand_erase_nand - [INTERN] erase block(s)
2504 * @mtd: MTD device structure 2503 * @mtd: MTD device structure
2505 * @instr: erase instruction 2504 * @instr: erase instruction
2506 * @allowbbt: allow erasing the bbt area 2505 * @allowbbt: allow erasing the bbt area
@@ -2550,7 +2549,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
2550 * If BBT requires refresh, set the BBT page mask to see if the BBT 2549 * If BBT requires refresh, set the BBT page mask to see if the BBT
2551 * should be rewritten. Otherwise the mask is set to 0xffffffff which 2550 * should be rewritten. Otherwise the mask is set to 0xffffffff which
2552 * can not be matched. This is also done when the bbt is actually 2551 * can not be matched. This is also done when the bbt is actually
2553 * erased to avoid recusrsive updates. 2552 * erased to avoid recursive updates.
2554 */ 2553 */
2555 if (chip->options & BBT_AUTO_REFRESH && !allowbbt) 2554 if (chip->options & BBT_AUTO_REFRESH && !allowbbt)
2556 bbt_masked_page = chip->bbt_td->pages[chipnr] & BBT_PAGE_MASK; 2555 bbt_masked_page = chip->bbt_td->pages[chipnr] & BBT_PAGE_MASK;
@@ -2824,7 +2823,7 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
2824 int i; 2823 int i;
2825 int val; 2824 int val;
2826 2825
2827 /* Try ONFI for unknow chip or LP */ 2826 /* Try ONFI for unknown chip or LP */
2828 chip->cmdfunc(mtd, NAND_CMD_READID, 0x20, -1); 2827 chip->cmdfunc(mtd, NAND_CMD_READID, 0x20, -1);
2829 if (chip->read_byte(mtd) != 'O' || chip->read_byte(mtd) != 'N' || 2828 if (chip->read_byte(mtd) != 'O' || chip->read_byte(mtd) != 'N' ||
2830 chip->read_byte(mtd) != 'F' || chip->read_byte(mtd) != 'I') 2829 chip->read_byte(mtd) != 'F' || chip->read_byte(mtd) != 'I')
@@ -3395,7 +3394,7 @@ int nand_scan_tail(struct mtd_info *mtd)
3395 */ 3394 */
3396 chip->ecc.steps = mtd->writesize / chip->ecc.size; 3395 chip->ecc.steps = mtd->writesize / chip->ecc.size;
3397 if (chip->ecc.steps * chip->ecc.size != mtd->writesize) { 3396 if (chip->ecc.steps * chip->ecc.size != mtd->writesize) {
3398 printk(KERN_WARNING "Invalid ecc parameters\n"); 3397 printk(KERN_WARNING "Invalid ECC parameters\n");
3399 BUG(); 3398 BUG();
3400 } 3399 }
3401 chip->ecc.total = chip->ecc.steps * chip->ecc.bytes; 3400 chip->ecc.total = chip->ecc.steps * chip->ecc.bytes;