diff options
author | Brian Norris <computersforpeace@gmail.com> | 2011-06-23 17:12:08 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-11 08:02:13 -0400 |
commit | 7854d3f7495b11be1570cd3e2318674d8f9ed797 (patch) | |
tree | 78eef0451fbec53ce062a37888ac026f079b56b0 /drivers/mtd/nand | |
parent | 15c60a508ab3393e68b7ccb3528981ccacf9c0f9 (diff) |
mtd: spelling, capitalization, uniformity
Therefor -> Therefore
[Intern], [Internal] -> [INTERN]
[REPLACABLE] -> [REPLACEABLE]
syndrom, syndom -> syndrome
ecc -> ECC
buswith -> buswidth
endianess -> endianness
dont -> don't
occures -> occurs
independend -> independent
wihin -> within
erease -> erase
blockes -> blocks
...
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r-- | drivers/mtd/nand/au1550nd.c | 29 | ||||
-rw-r--r-- | drivers/mtd/nand/cafe_nand.c | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/diskonchip.c | 4 | ||||
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 105 | ||||
-rw-r--r-- | drivers/mtd/nand/nand_bbt.c | 8 | ||||
-rw-r--r-- | drivers/mtd/nand/nand_ecc.c | 10 | ||||
-rw-r--r-- | drivers/mtd/nand/rtc_from4.c | 2 |
7 files changed, 78 insertions, 82 deletions
diff --git a/drivers/mtd/nand/au1550nd.c b/drivers/mtd/nand/au1550nd.c index e7767eef4505..60d58d3f1fcc 100644 --- a/drivers/mtd/nand/au1550nd.c +++ b/drivers/mtd/nand/au1550nd.c | |||
@@ -48,7 +48,7 @@ static const struct mtd_partition partition_info[] = { | |||
48 | * au_read_byte - read one byte from the chip | 48 | * au_read_byte - read one byte from the chip |
49 | * @mtd: MTD device structure | 49 | * @mtd: MTD device structure |
50 | * | 50 | * |
51 | * read function for 8bit buswith | 51 | * read function for 8bit buswidth |
52 | */ | 52 | */ |
53 | static u_char au_read_byte(struct mtd_info *mtd) | 53 | static u_char au_read_byte(struct mtd_info *mtd) |
54 | { | 54 | { |
@@ -63,7 +63,7 @@ static u_char au_read_byte(struct mtd_info *mtd) | |||
63 | * @mtd: MTD device structure | 63 | * @mtd: MTD device structure |
64 | * @byte: pointer to data byte to write | 64 | * @byte: pointer to data byte to write |
65 | * | 65 | * |
66 | * write function for 8it buswith | 66 | * write function for 8it buswidth |
67 | */ | 67 | */ |
68 | static void au_write_byte(struct mtd_info *mtd, u_char byte) | 68 | static void au_write_byte(struct mtd_info *mtd, u_char byte) |
69 | { | 69 | { |
@@ -73,11 +73,10 @@ static void au_write_byte(struct mtd_info *mtd, u_char byte) | |||
73 | } | 73 | } |
74 | 74 | ||
75 | /** | 75 | /** |
76 | * au_read_byte16 - read one byte endianess aware from the chip | 76 | * au_read_byte16 - read one byte endianness aware from the chip |
77 | * @mtd: MTD device structure | 77 | * @mtd: MTD device structure |
78 | * | 78 | * |
79 | * read function for 16bit buswith with | 79 | * read function for 16bit buswidth with endianness conversion |
80 | * endianess conversion | ||
81 | */ | 80 | */ |
82 | static u_char au_read_byte16(struct mtd_info *mtd) | 81 | static u_char au_read_byte16(struct mtd_info *mtd) |
83 | { | 82 | { |
@@ -88,12 +87,11 @@ static u_char au_read_byte16(struct mtd_info *mtd) | |||
88 | } | 87 | } |
89 | 88 | ||
90 | /** | 89 | /** |
91 | * au_write_byte16 - write one byte endianess aware to the chip | 90 | * au_write_byte16 - write one byte endianness aware to the chip |
92 | * @mtd: MTD device structure | 91 | * @mtd: MTD device structure |
93 | * @byte: pointer to data byte to write | 92 | * @byte: pointer to data byte to write |
94 | * | 93 | * |
95 | * write function for 16bit buswith with | 94 | * write function for 16bit buswidth with endianness conversion |
96 | * endianess conversion | ||
97 | */ | 95 | */ |
98 | static void au_write_byte16(struct mtd_info *mtd, u_char byte) | 96 | static void au_write_byte16(struct mtd_info *mtd, u_char byte) |
99 | { | 97 | { |
@@ -106,8 +104,7 @@ static void au_write_byte16(struct mtd_info *mtd, u_char byte) | |||
106 | * au_read_word - read one word from the chip | 104 | * au_read_word - read one word from the chip |
107 | * @mtd: MTD device structure | 105 | * @mtd: MTD device structure |
108 | * | 106 | * |
109 | * read function for 16bit buswith without | 107 | * read function for 16bit buswidth without endianness conversion |
110 | * endianess conversion | ||
111 | */ | 108 | */ |
112 | static u16 au_read_word(struct mtd_info *mtd) | 109 | static u16 au_read_word(struct mtd_info *mtd) |
113 | { | 110 | { |
@@ -123,7 +120,7 @@ static u16 au_read_word(struct mtd_info *mtd) | |||
123 | * @buf: data buffer | 120 | * @buf: data buffer |
124 | * @len: number of bytes to write | 121 | * @len: number of bytes to write |
125 | * | 122 | * |
126 | * write function for 8bit buswith | 123 | * write function for 8bit buswidth |
127 | */ | 124 | */ |
128 | static void au_write_buf(struct mtd_info *mtd, const u_char *buf, int len) | 125 | static void au_write_buf(struct mtd_info *mtd, const u_char *buf, int len) |
129 | { | 126 | { |
@@ -142,7 +139,7 @@ static void au_write_buf(struct mtd_info *mtd, const u_char *buf, int len) | |||
142 | * @buf: buffer to store date | 139 | * @buf: buffer to store date |
143 | * @len: number of bytes to read | 140 | * @len: number of bytes to read |
144 | * | 141 | * |
145 | * read function for 8bit buswith | 142 | * read function for 8bit buswidth |
146 | */ | 143 | */ |
147 | static void au_read_buf(struct mtd_info *mtd, u_char *buf, int len) | 144 | static void au_read_buf(struct mtd_info *mtd, u_char *buf, int len) |
148 | { | 145 | { |
@@ -161,7 +158,7 @@ static void au_read_buf(struct mtd_info *mtd, u_char *buf, int len) | |||
161 | * @buf: buffer containing the data to compare | 158 | * @buf: buffer containing the data to compare |
162 | * @len: number of bytes to compare | 159 | * @len: number of bytes to compare |
163 | * | 160 | * |
164 | * verify function for 8bit buswith | 161 | * verify function for 8bit buswidth |
165 | */ | 162 | */ |
166 | static int au_verify_buf(struct mtd_info *mtd, const u_char *buf, int len) | 163 | static int au_verify_buf(struct mtd_info *mtd, const u_char *buf, int len) |
167 | { | 164 | { |
@@ -183,7 +180,7 @@ static int au_verify_buf(struct mtd_info *mtd, const u_char *buf, int len) | |||
183 | * @buf: data buffer | 180 | * @buf: data buffer |
184 | * @len: number of bytes to write | 181 | * @len: number of bytes to write |
185 | * | 182 | * |
186 | * write function for 16bit buswith | 183 | * write function for 16bit buswidth |
187 | */ | 184 | */ |
188 | static void au_write_buf16(struct mtd_info *mtd, const u_char *buf, int len) | 185 | static void au_write_buf16(struct mtd_info *mtd, const u_char *buf, int len) |
189 | { | 186 | { |
@@ -205,7 +202,7 @@ static void au_write_buf16(struct mtd_info *mtd, const u_char *buf, int len) | |||
205 | * @buf: buffer to store date | 202 | * @buf: buffer to store date |
206 | * @len: number of bytes to read | 203 | * @len: number of bytes to read |
207 | * | 204 | * |
208 | * read function for 16bit buswith | 205 | * read function for 16bit buswidth |
209 | */ | 206 | */ |
210 | static void au_read_buf16(struct mtd_info *mtd, u_char *buf, int len) | 207 | static void au_read_buf16(struct mtd_info *mtd, u_char *buf, int len) |
211 | { | 208 | { |
@@ -226,7 +223,7 @@ static void au_read_buf16(struct mtd_info *mtd, u_char *buf, int len) | |||
226 | * @buf: buffer containing the data to compare | 223 | * @buf: buffer containing the data to compare |
227 | * @len: number of bytes to compare | 224 | * @len: number of bytes to compare |
228 | * | 225 | * |
229 | * verify function for 16bit buswith | 226 | * verify function for 16bit buswidth |
230 | */ | 227 | */ |
231 | static int au_verify_buf16(struct mtd_info *mtd, const u_char *buf, int len) | 228 | static int au_verify_buf16(struct mtd_info *mtd, const u_char *buf, int len) |
232 | { | 229 | { |
diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c index f6eb66432c81..11a56df89eab 100644 --- a/drivers/mtd/nand/cafe_nand.c +++ b/drivers/mtd/nand/cafe_nand.c | |||
@@ -370,7 +370,7 @@ static int cafe_nand_read_oob(struct mtd_info *mtd, struct nand_chip *chip, | |||
370 | return 1; | 370 | return 1; |
371 | } | 371 | } |
372 | /** | 372 | /** |
373 | * cafe_nand_read_page_syndrome - {REPLACABLE] hardware ecc syndrom based page read | 373 | * cafe_nand_read_page_syndrome - [REPLACEABLE] hardware ecc syndrome based page read |
374 | * @mtd: mtd info structure | 374 | * @mtd: mtd info structure |
375 | * @chip: nand chip info structure | 375 | * @chip: nand chip info structure |
376 | * @buf: buffer to store read data | 376 | * @buf: buffer to store read data |
diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c index b657d7f9b05c..de93a989aa54 100644 --- a/drivers/mtd/nand/diskonchip.c +++ b/drivers/mtd/nand/diskonchip.c | |||
@@ -132,7 +132,7 @@ static struct rs_control *rs_decoder; | |||
132 | 132 | ||
133 | /* | 133 | /* |
134 | * The HW decoder in the DoC ASIC's provides us a error syndrome, | 134 | * The HW decoder in the DoC ASIC's provides us a error syndrome, |
135 | * which we must convert to a standard syndrom usable by the generic | 135 | * which we must convert to a standard syndrome usable by the generic |
136 | * Reed-Solomon library code. | 136 | * Reed-Solomon library code. |
137 | * | 137 | * |
138 | * Fabrice Bellard figured this out in the old docecc code. I added | 138 | * Fabrice Bellard figured this out in the old docecc code. I added |
@@ -153,7 +153,7 @@ static int doc_ecc_decode(struct rs_control *rs, uint8_t *data, uint8_t *ecc) | |||
153 | ds[3] = ((ecc[3] & 0xc0) >> 6) | ((ecc[0] & 0xff) << 2); | 153 | ds[3] = ((ecc[3] & 0xc0) >> 6) | ((ecc[0] & 0xff) << 2); |
154 | parity = ecc[1]; | 154 | parity = ecc[1]; |
155 | 155 | ||
156 | /* Initialize the syndrom buffer */ | 156 | /* Initialize the syndrome buffer */ |
157 | for (i = 0; i < NROOTS; i++) | 157 | for (i = 0; i < NROOTS; i++) |
158 | s[i] = ds[0]; | 158 | s[i] = ds[0]; |
159 | /* | 159 | /* |
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 | */ |
164 | static uint8_t nand_read_byte(struct mtd_info *mtd) | 164 | static 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 | */ |
176 | static uint8_t nand_read_byte16(struct mtd_info *mtd) | 178 | static 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 | */ |
188 | static u16 nand_read_word(struct mtd_info *mtd) | 190 | static 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 | */ |
225 | static void nand_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len) | 227 | static 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 | */ |
242 | static void nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) | 244 | static 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 | */ |
259 | static int nand_verify_buf(struct mtd_info *mtd, const uint8_t *buf, int len) | 261 | static 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 | */ |
278 | static void nand_write_buf16(struct mtd_info *mtd, const uint8_t *buf, int len) | 280 | static 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 | */ |
298 | static void nand_read_buf16(struct mtd_info *mtd, uint8_t *buf, int len) | 300 | static 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 | */ |
317 | static int nand_verify_buf16(struct mtd_info *mtd, const uint8_t *buf, int len) | 319 | static 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. */ |
503 | void nand_wait_ready(struct mtd_info *mtd) | 505 | void 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 | */ |
635 | static void nand_command_lp(struct mtd_info *mtd, unsigned int command, | 637 | static 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, | |||
754 | static void panic_nand_get_device(struct nand_chip *chip, | 756 | static 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: | |||
1032 | EXPORT_SYMBOL(nand_lock); | 1034 | EXPORT_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 | */ |
1044 | static int nand_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip, | 1045 | static 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 | */ |
1236 | static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip, | 1236 | static 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 | */ |
1889 | static void nand_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip, | 1888 | static 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; |
diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c index 8875d6db2455..f30807c3a48d 100644 --- a/drivers/mtd/nand/nand_bbt.c +++ b/drivers/mtd/nand/nand_bbt.c | |||
@@ -149,7 +149,7 @@ static int check_short_pattern(uint8_t *buf, struct nand_bbt_descr *td) | |||
149 | * add_marker_len - compute the length of the marker in data area | 149 | * add_marker_len - compute the length of the marker in data area |
150 | * @td: BBT descriptor used for computation | 150 | * @td: BBT descriptor used for computation |
151 | * | 151 | * |
152 | * The length will be 0 if the markeris located in OOB area. | 152 | * The length will be 0 if the marker is located in OOB area. |
153 | */ | 153 | */ |
154 | static u32 add_marker_len(struct nand_bbt_descr *td) | 154 | static u32 add_marker_len(struct nand_bbt_descr *td) |
155 | { | 155 | { |
@@ -170,7 +170,7 @@ static u32 add_marker_len(struct nand_bbt_descr *td) | |||
170 | * @buf: temporary buffer | 170 | * @buf: temporary buffer |
171 | * @page: the starting page | 171 | * @page: the starting page |
172 | * @num: the number of bbt descriptors to read | 172 | * @num: the number of bbt descriptors to read |
173 | * @td: the bbt describtion table | 173 | * @td: the bbt describtion table |
174 | * @offs: offset in the memory table | 174 | * @offs: offset in the memory table |
175 | * | 175 | * |
176 | * Read the bad block table starting from page. | 176 | * Read the bad block table starting from page. |
@@ -1241,7 +1241,7 @@ static struct nand_bbt_descr agand_flashbased = { | |||
1241 | .pattern = scan_agand_pattern | 1241 | .pattern = scan_agand_pattern |
1242 | }; | 1242 | }; |
1243 | 1243 | ||
1244 | /* Generic flash bbt decriptors */ | 1244 | /* Generic flash bbt descriptors */ |
1245 | static uint8_t bbt_pattern[] = {'B', 'b', 't', '0' }; | 1245 | static uint8_t bbt_pattern[] = {'B', 'b', 't', '0' }; |
1246 | static uint8_t mirror_pattern[] = {'1', 't', 'b', 'B' }; | 1246 | static uint8_t mirror_pattern[] = {'1', 't', 'b', 'B' }; |
1247 | 1247 | ||
@@ -1286,7 +1286,7 @@ static struct nand_bbt_descr bbt_mirror_no_bbt_descr = { | |||
1286 | }; | 1286 | }; |
1287 | 1287 | ||
1288 | /** | 1288 | /** |
1289 | * nand_create_default_bbt_descr - [Internal] Creates a BBT descriptor structure | 1289 | * nand_create_default_bbt_descr - [INTERN] Creates a BBT descriptor structure |
1290 | * @this: NAND chip to create descriptor for | 1290 | * @this: NAND chip to create descriptor for |
1291 | * | 1291 | * |
1292 | * This function allocates and initializes a nand_bbt_descr for BBM detection | 1292 | * This function allocates and initializes a nand_bbt_descr for BBM detection |
diff --git a/drivers/mtd/nand/nand_ecc.c b/drivers/mtd/nand/nand_ecc.c index 271b8e735e8f..b7cfe0d37121 100644 --- a/drivers/mtd/nand/nand_ecc.c +++ b/drivers/mtd/nand/nand_ecc.c | |||
@@ -110,7 +110,7 @@ static const char bitsperbyte[256] = { | |||
110 | 110 | ||
111 | /* | 111 | /* |
112 | * addressbits is a lookup table to filter out the bits from the xor-ed | 112 | * addressbits is a lookup table to filter out the bits from the xor-ed |
113 | * ecc data that identify the faulty location. | 113 | * ECC data that identify the faulty location. |
114 | * this is only used for repairing parity | 114 | * this is only used for repairing parity |
115 | * see the comments in nand_correct_data for more details | 115 | * see the comments in nand_correct_data for more details |
116 | */ | 116 | */ |
@@ -153,7 +153,7 @@ static const char addressbits[256] = { | |||
153 | * __nand_calculate_ecc - [NAND Interface] Calculate 3-byte ECC for 256/512-byte | 153 | * __nand_calculate_ecc - [NAND Interface] Calculate 3-byte ECC for 256/512-byte |
154 | * block | 154 | * block |
155 | * @buf: input buffer with raw data | 155 | * @buf: input buffer with raw data |
156 | * @eccsize: data bytes per ecc step (256 or 512) | 156 | * @eccsize: data bytes per ECC step (256 or 512) |
157 | * @code: output buffer with ECC | 157 | * @code: output buffer with ECC |
158 | */ | 158 | */ |
159 | void __nand_calculate_ecc(const unsigned char *buf, unsigned int eccsize, | 159 | void __nand_calculate_ecc(const unsigned char *buf, unsigned int eccsize, |
@@ -348,7 +348,7 @@ void __nand_calculate_ecc(const unsigned char *buf, unsigned int eccsize, | |||
348 | rp17 = (par ^ rp16) & 0xff; | 348 | rp17 = (par ^ rp16) & 0xff; |
349 | 349 | ||
350 | /* | 350 | /* |
351 | * Finally calculate the ecc bits. | 351 | * Finally calculate the ECC bits. |
352 | * Again here it might seem that there are performance optimisations | 352 | * Again here it might seem that there are performance optimisations |
353 | * possible, but benchmarks showed that on the system this is developed | 353 | * possible, but benchmarks showed that on the system this is developed |
354 | * the code below is the fastest | 354 | * the code below is the fastest |
@@ -436,7 +436,7 @@ EXPORT_SYMBOL(nand_calculate_ecc); | |||
436 | * @buf: raw data read from the chip | 436 | * @buf: raw data read from the chip |
437 | * @read_ecc: ECC from the chip | 437 | * @read_ecc: ECC from the chip |
438 | * @calc_ecc: the ECC calculated from raw data | 438 | * @calc_ecc: the ECC calculated from raw data |
439 | * @eccsize: data bytes per ecc step (256 or 512) | 439 | * @eccsize: data bytes per ECC step (256 or 512) |
440 | * | 440 | * |
441 | * Detect and correct a 1 bit error for eccsize byte block | 441 | * Detect and correct a 1 bit error for eccsize byte block |
442 | */ | 442 | */ |
@@ -505,7 +505,7 @@ int __nand_correct_data(unsigned char *buf, | |||
505 | } | 505 | } |
506 | /* count nr of bits; use table lookup, faster than calculating it */ | 506 | /* count nr of bits; use table lookup, faster than calculating it */ |
507 | if ((bitsperbyte[b0] + bitsperbyte[b1] + bitsperbyte[b2]) == 1) | 507 | if ((bitsperbyte[b0] + bitsperbyte[b1] + bitsperbyte[b2]) == 1) |
508 | return 1; /* error in ecc data; no action needed */ | 508 | return 1; /* error in ECC data; no action needed */ |
509 | 509 | ||
510 | printk(KERN_ERR "uncorrectable error : "); | 510 | printk(KERN_ERR "uncorrectable error : "); |
511 | return -1; | 511 | return -1; |
diff --git a/drivers/mtd/nand/rtc_from4.c b/drivers/mtd/nand/rtc_from4.c index a07da2a3beee..33fe922b972c 100644 --- a/drivers/mtd/nand/rtc_from4.c +++ b/drivers/mtd/nand/rtc_from4.c | |||
@@ -351,7 +351,7 @@ static int rtc_from4_correct_data(struct mtd_info *mtd, const u_char *buf, u_cha | |||
351 | return 0; | 351 | return 0; |
352 | } | 352 | } |
353 | 353 | ||
354 | /* Read the syndrom pattern from the FPGA and correct the bitorder */ | 354 | /* Read the syndrome pattern from the FPGA and correct the bitorder */ |
355 | rs_ecc = (volatile unsigned short *)(rtc_from4_fio_base + RTC_FROM4_RS_ECC); | 355 | rs_ecc = (volatile unsigned short *)(rtc_from4_fio_base + RTC_FROM4_RS_ECC); |
356 | for (i = 0; i < 8; i++) { | 356 | for (i = 0; i < 8; i++) { |
357 | ecc[i] = bitrev8(*rs_ecc); | 357 | ecc[i] = bitrev8(*rs_ecc); |