aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2010-10-05 06:41:01 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-10-24 19:56:32 -0400
commita0491fc4d4b584ddc23f412e9a57b05d66a21263 (patch)
tree5917ac015d84417df9363a93c54fd12f34d178c9 /include/linux/mtd
parent766f271a63d1ee7caed8030736e6aed253d02073 (diff)
mtd: cleanup nand.h
- *var instead of * var - proper multiline comment - func(args) instead of func (args) - 80 lines So from |total: 2 errors, 37 warnings, 654 lines checked we got to one warning. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r--include/linux/mtd/nand.h155
1 files changed, 99 insertions, 56 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 023866572fb1..acd0b500f55a 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -27,15 +27,17 @@
27struct mtd_info; 27struct mtd_info;
28struct nand_flash_dev; 28struct nand_flash_dev;
29/* Scan and identify a NAND device */ 29/* Scan and identify a NAND device */
30extern int nand_scan (struct mtd_info *mtd, int max_chips); 30extern int nand_scan(struct mtd_info *mtd, int max_chips);
31/* Separate phases of nand_scan(), allowing board driver to intervene 31/*
32 * and override command or ECC setup according to flash type */ 32 * Separate phases of nand_scan(), allowing board driver to intervene
33 * and override command or ECC setup according to flash type.
34 */
33extern int nand_scan_ident(struct mtd_info *mtd, int max_chips, 35extern int nand_scan_ident(struct mtd_info *mtd, int max_chips,
34 struct nand_flash_dev *table); 36 struct nand_flash_dev *table);
35extern int nand_scan_tail(struct mtd_info *mtd); 37extern int nand_scan_tail(struct mtd_info *mtd);
36 38
37/* Free resources held by the NAND device */ 39/* Free resources held by the NAND device */
38extern void nand_release (struct mtd_info *mtd); 40extern void nand_release(struct mtd_info *mtd);
39 41
40/* Internal helper for board drivers which need to override command function */ 42/* Internal helper for board drivers which need to override command function */
41extern void nand_wait_ready(struct mtd_info *mtd); 43extern void nand_wait_ready(struct mtd_info *mtd);
@@ -49,7 +51,8 @@ extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
49/* The maximum number of NAND chips in an array */ 51/* The maximum number of NAND chips in an array */
50#define NAND_MAX_CHIPS 8 52#define NAND_MAX_CHIPS 8
51 53
52/* This constant declares the max. oobsize / page, which 54/*
55 * This constant declares the max. oobsize / page, which
53 * is supported now. If you add a chip with bigger oobsize/page 56 * is supported now. If you add a chip with bigger oobsize/page
54 * adjust this accordingly. 57 * adjust this accordingly.
55 */ 58 */
@@ -153,9 +156,10 @@ typedef enum {
153#define NAND_GET_DEVICE 0x80 156#define NAND_GET_DEVICE 0x80
154 157
155 158
156/* Option constants for bizarre disfunctionality and real 159/*
157* features 160 * Option constants for bizarre disfunctionality and real
158*/ 161 * features.
162 */
159/* Chip can not auto increment pages */ 163/* Chip can not auto increment pages */
160#define NAND_NO_AUTOINCR 0x00000001 164#define NAND_NO_AUTOINCR 0x00000001
161/* Buswitdh is 16 bit */ 165/* Buswitdh is 16 bit */
@@ -166,19 +170,27 @@ typedef enum {
166#define NAND_CACHEPRG 0x00000008 170#define NAND_CACHEPRG 0x00000008
167/* Chip has copy back function */ 171/* Chip has copy back function */
168#define NAND_COPYBACK 0x00000010 172#define NAND_COPYBACK 0x00000010
169/* AND Chip which has 4 banks and a confusing page / block 173/*
170 * assignment. See Renesas datasheet for further information */ 174 * AND Chip which has 4 banks and a confusing page / block
175 * assignment. See Renesas datasheet for further information.
176 */
171#define NAND_IS_AND 0x00000020 177#define NAND_IS_AND 0x00000020
172/* Chip has a array of 4 pages which can be read without 178/*
173 * additional ready /busy waits */ 179 * Chip has a array of 4 pages which can be read without
180 * additional ready /busy waits.
181 */
174#define NAND_4PAGE_ARRAY 0x00000040 182#define NAND_4PAGE_ARRAY 0x00000040
175/* Chip requires that BBT is periodically rewritten to prevent 183/*
184 * Chip requires that BBT is periodically rewritten to prevent
176 * bits from adjacent blocks from 'leaking' in altering data. 185 * bits from adjacent blocks from 'leaking' in altering data.
177 * This happens with the Renesas AG-AND chips, possibly others. */ 186 * This happens with the Renesas AG-AND chips, possibly others.
187 */
178#define BBT_AUTO_REFRESH 0x00000080 188#define BBT_AUTO_REFRESH 0x00000080
179/* Chip does not require ready check on read. True 189/*
190 * Chip does not require ready check on read. True
180 * for all large page devices, as they do not support 191 * for all large page devices, as they do not support
181 * autoincrement.*/ 192 * autoincrement.
193 */
182#define NAND_NO_READRDY 0x00000100 194#define NAND_NO_READRDY 0x00000100
183/* Chip does not allow subpage writes */ 195/* Chip does not allow subpage writes */
184#define NAND_NO_SUBPAGE_WRITE 0x00000200 196#define NAND_NO_SUBPAGE_WRITE 0x00000200
@@ -213,8 +225,10 @@ typedef enum {
213#define NAND_USE_FLASH_BBT 0x00010000 225#define NAND_USE_FLASH_BBT 0x00010000
214/* This option skips the bbt scan during initialization. */ 226/* This option skips the bbt scan during initialization. */
215#define NAND_SKIP_BBTSCAN 0x00020000 227#define NAND_SKIP_BBTSCAN 0x00020000
216/* This option is defined if the board driver allocates its own buffers 228/*
217 (e.g. because it needs them DMA-coherent */ 229 * This option is defined if the board driver allocates its own buffers
230 * (e.g. because it needs them DMA-coherent).
231 */
218#define NAND_OWN_BUFFERS 0x00040000 232#define NAND_OWN_BUFFERS 0x00040000
219/* Chip may not exist, so silence any errors in scan */ 233/* Chip may not exist, so silence any errors in scan */
220#define NAND_SCAN_SILENT_NODEV 0x00080000 234#define NAND_SCAN_SILENT_NODEV 0x00080000
@@ -304,8 +318,9 @@ struct nand_onfi_params {
304 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices 318 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices
305 * @lock: protection lock 319 * @lock: protection lock
306 * @active: the mtd device which holds the controller currently 320 * @active: the mtd device which holds the controller currently
307 * @wq: wait queue to sleep on if a NAND operation is in progress 321 * @wq: wait queue to sleep on if a NAND operation is in
308 * used instead of the per chip wait queue when a hw controller is available 322 * progress used instead of the per chip wait queue
323 * when a hw controller is available.
309 */ 324 */
310struct nand_hw_control { 325struct nand_hw_control {
311 spinlock_t lock; 326 spinlock_t lock;
@@ -329,9 +344,11 @@ struct nand_hw_control {
329 * @correct: function for ecc correction, matching to ecc generator (sw/hw) 344 * @correct: function for ecc correction, matching to ecc generator (sw/hw)
330 * @read_page_raw: function to read a raw page without ECC 345 * @read_page_raw: function to read a raw page without ECC
331 * @write_page_raw: function to write a raw page without ECC 346 * @write_page_raw: function to write a raw page without ECC
332 * @read_page: function to read a page according to the ecc generator requirements 347 * @read_page: function to read a page according to the ecc generator
348 * requirements.
333 * @read_subpage: function to read parts of the page covered by ECC. 349 * @read_subpage: function to read parts of the page covered by ECC.
334 * @write_page: function to write a page according to the ecc generator requirements 350 * @write_page: function to write a page according to the ecc generator
351 * requirements.
335 * @read_oob: function to read chip OOB data 352 * @read_oob: function to read chip OOB data
336 * @write_oob: function to write chip OOB data 353 * @write_oob: function to write chip OOB data
337 */ 354 */
@@ -393,13 +410,16 @@ struct nand_buffers {
393 410
394/** 411/**
395 * struct nand_chip - NAND Private Flash Chip Data 412 * struct nand_chip - NAND Private Flash Chip Data
396 * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device 413 * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the
397 * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device 414 * flash device
415 * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the
416 * flash device.
398 * @read_byte: [REPLACEABLE] read one byte from the chip 417 * @read_byte: [REPLACEABLE] read one byte from the chip
399 * @read_word: [REPLACEABLE] read one word from the chip 418 * @read_word: [REPLACEABLE] read one word from the chip
400 * @write_buf: [REPLACEABLE] write data from the buffer to the chip 419 * @write_buf: [REPLACEABLE] write data from the buffer to the chip
401 * @read_buf: [REPLACEABLE] read data from the chip into the buffer 420 * @read_buf: [REPLACEABLE] read data from the chip into the buffer
402 * @verify_buf: [REPLACEABLE] verify buffer contents against the chip data 421 * @verify_buf: [REPLACEABLE] verify buffer contents against the chip
422 * data.
403 * @select_chip: [REPLACEABLE] select chip nr 423 * @select_chip: [REPLACEABLE] select chip nr
404 * @block_bad: [REPLACEABLE] check, if the block is bad 424 * @block_bad: [REPLACEABLE] check, if the block is bad
405 * @block_markbad: [REPLACEABLE] mark the block bad 425 * @block_markbad: [REPLACEABLE] mark the block bad
@@ -409,45 +429,60 @@ struct nand_buffers {
409 * mtd->oobsize, mtd->writesize and so on. 429 * mtd->oobsize, mtd->writesize and so on.
410 * @id_data contains the 8 bytes values of NAND_CMD_READID. 430 * @id_data contains the 8 bytes values of NAND_CMD_READID.
411 * Return with the bus width. 431 * Return with the bus width.
412 * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing device ready/busy line 432 * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing
413 * If set to NULL no access to ready/busy is available and the ready/busy information 433 * device ready/busy line. If set to NULL no access to
414 * is read from the chip status register 434 * ready/busy is available and the ready/busy information
415 * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip 435 * is read from the chip status register.
416 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on ready 436 * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing
437 * commands to the chip.
438 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on
439 * ready.
417 * @ecc: [BOARDSPECIFIC] ecc control ctructure 440 * @ecc: [BOARDSPECIFIC] ecc control ctructure
418 * @buffers: buffer structure for read/write 441 * @buffers: buffer structure for read/write
419 * @hwcontrol: platform-specific hardware control structure