diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mtd/bbm.h | 35 | ||||
-rw-r--r-- | include/linux/mtd/mtd.h | 4 | ||||
-rw-r--r-- | include/linux/mtd/nand.h | 16 | ||||
-rw-r--r-- | include/linux/mtd/onenand.h | 77 | ||||
-rw-r--r-- | include/mtd/mtd-abi.h | 2 |
5 files changed, 76 insertions, 58 deletions
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h index 7a7fbe87fef0..1221b7c44158 100644 --- a/include/linux/mtd/bbm.h +++ b/include/linux/mtd/bbm.h | |||
@@ -19,21 +19,21 @@ | |||
19 | 19 | ||
20 | /** | 20 | /** |
21 | * struct nand_bbt_descr - bad block table descriptor | 21 | * struct nand_bbt_descr - bad block table descriptor |
22 | * @param options options for this descriptor | 22 | * @options: options for this descriptor |
23 | * @param pages the page(s) where we find the bbt, used with | 23 | * @pages: the page(s) where we find the bbt, used with |
24 | * option BBT_ABSPAGE when bbt is searched, | 24 | * option BBT_ABSPAGE when bbt is searched, |
25 | * then we store the found bbts pages here. | 25 | * then we store the found bbts pages here. |
26 | * Its an array and supports up to 8 chips now | 26 | * Its an array and supports up to 8 chips now |
27 | * @param offs offset of the pattern in the oob area of the page | 27 | * @offs: offset of the pattern in the oob area of the page |
28 | * @param veroffs offset of the bbt version counter in the oob are of the page | 28 | * @veroffs: offset of the bbt version counter in the oob area of the page |
29 | * @param version version read from the bbt page during scan | 29 | * @version: version read from the bbt page during scan |
30 | * @param len length of the pattern, if 0 no pattern check is performed | 30 | * @len: length of the pattern, if 0 no pattern check is performed |
31 | * @param maxblocks maximum number of blocks to search for a bbt. This number of | 31 | * @maxblocks: maximum number of blocks to search for a bbt. This |
32 | * blocks is reserved at the end of the device | 32 | * number of blocks is reserved at the end of the device |
33 | * where the tables are written. | 33 | * where the tables are written. |
34 | * @param reserved_block_code if non-0, this pattern denotes a reserved | 34 | * @reserved_block_code: if non-0, this pattern denotes a reserved |
35 | * (rather than bad) block in the stored bbt | 35 | * (rather than bad) block in the stored bbt |
36 | * @param pattern pattern to identify bad block table or factory marked | 36 | * @pattern: pattern to identify bad block table or factory marked |
37 | * good / bad blocks, can be NULL, if len = 0 | 37 | * good / bad blocks, can be NULL, if len = 0 |
38 | * | 38 | * |
39 | * Descriptor for the bad block table marker and the descriptor for the | 39 | * Descriptor for the bad block table marker and the descriptor for the |
@@ -93,12 +93,15 @@ struct nand_bbt_descr { | |||
93 | #define ONENAND_BADBLOCK_POS 0 | 93 | #define ONENAND_BADBLOCK_POS 0 |
94 | 94 | ||
95 | /** | 95 | /** |
96 | * struct bbt_info - [GENERIC] Bad Block Table data structure | 96 | * struct bbm_info - [GENERIC] Bad Block Table data structure |
97 | * @param bbt_erase_shift [INTERN] number of address bits in a bbt entry | 97 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry |
98 | * @param badblockpos [INTERN] position of the bad block marker in the oob area | 98 | * @badblockpos: [INTERN] position of the bad block marker in the oob area |
99 | * @param bbt [INTERN] bad block table pointer | 99 | * @options: options for this descriptor |
100 | * @param badblock_pattern [REPLACEABLE] bad block scan pattern used for initial bad block scan | 100 | * @bbt: [INTERN] bad block table pointer |
101 | * @param priv [OPTIONAL] pointer to private bbm date | 101 | * @isbad_bbt: function to determine if a block is bad |
102 | * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for | ||
103 | * initial bad block scan | ||
104 | * @priv: [OPTIONAL] pointer to private bbm date | ||
102 | */ | 105 | */ |
103 | struct bbm_info { | 106 | struct bbm_info { |
104 | int bbt_erase_shift; | 107 | int bbt_erase_shift; |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 9b7a2b525d63..94a443d45258 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -77,11 +77,11 @@ typedef enum { | |||
77 | * | 77 | * |
78 | * @len: number of bytes to write/read. When a data buffer is given | 78 | * @len: number of bytes to write/read. When a data buffer is given |
79 | * (datbuf != NULL) this is the number of data bytes. When | 79 | * (datbuf != NULL) this is the number of data bytes. When |
80 | + no data buffer is available this is the number of oob bytes. | 80 | * no data buffer is available this is the number of oob bytes. |
81 | * | 81 | * |
82 | * @retlen: number of bytes written/read. When a data buffer is given | 82 | * @retlen: number of bytes written/read. When a data buffer is given |
83 | * (datbuf != NULL) this is the number of data bytes. When | 83 | * (datbuf != NULL) this is the number of data bytes. When |
84 | + no data buffer is available this is the number of oob bytes. | 84 | * no data buffer is available this is the number of oob bytes. |
85 | * | 85 | * |
86 | * @ooblen: number of oob bytes per page | 86 | * @ooblen: number of oob bytes per page |
87 | * @ooboffs: offset of oob data in the oob area (only relevant when | 87 | * @ooboffs: offset of oob data in the oob area (only relevant when |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 66559272ebcb..0b4cd2fa64aa 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -202,7 +202,7 @@ typedef enum { | |||
202 | struct nand_chip; | 202 | struct nand_chip; |
203 | 203 | ||
204 | /** | 204 | /** |
205 | * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independend devices | 205 | * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices |
206 | * @lock: protection lock | 206 | * @lock: protection lock |
207 | * @active: the mtd device which holds the controller currently | 207 | * @active: the mtd device which holds the controller currently |
208 | * @wq: wait queue to sleep on if a NAND operation is in progress | 208 | * @wq: wait queue to sleep on if a NAND operation is in progress |
@@ -223,12 +223,15 @@ struct nand_hw_control { | |||
223 | * @total: total number of ecc bytes per page | 223 | * @total: total number of ecc bytes per page |
224 | * @prepad: padding information for syndrome based ecc generators | 224 | * @prepad: padding information for syndrome based ecc generators |
225 | * @postpad: padding information for syndrome based ecc generators | 225 | * @postpad: padding information for syndrome based ecc generators |
226 | * @layout: ECC layout control struct pointer | ||
226 | * @hwctl: function to control hardware ecc generator. Must only | 227 | * @hwctl: function to control hardware ecc generator. Must only |
227 | * be provided if an hardware ECC is available | 228 | * be provided if an hardware ECC is available |
228 | * @calculate: function for ecc calculation or readback from ecc hardware | 229 | * @calculate: function for ecc calculation or readback from ecc hardware |
229 | * @correct: function for ecc correction, matching to ecc generator (sw/hw) | 230 | * @correct: function for ecc correction, matching to ecc generator (sw/hw) |
230 | * @read_page: function to read a page according to the ecc generator requirements | 231 | * @read_page: function to read a page according to the ecc generator requirements |
231 | * @write_page: function to write a page according to the ecc generator requirements | 232 | * @write_page: function to write a page according to the ecc generator requirements |
233 | * @read_oob: function to read chip OOB data | ||
234 | * @write_oob: function to write chip OOB data | ||
232 | */ | 235 | */ |
233 | struct nand_ecc_ctrl { | 236 | struct nand_ecc_ctrl { |
234 | nand_ecc_modes_t mode; | 237 | nand_ecc_modes_t mode; |
@@ -300,11 +303,15 @@ struct nand_buffers { | |||
300 | * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip | 303 | * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip |
301 | * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on ready | 304 | * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on ready |
302 | * @ecc: [BOARDSPECIFIC] ecc control ctructure | 305 | * @ecc: [BOARDSPECIFIC] ecc control ctructure |
306 | * @buffers: buffer structure for read/write | ||
307 | * @hwcontrol: platform-specific hardware control structure | ||
308 | * @ops: oob operation operands | ||
303 | * @erase_cmd: [INTERN] erase command write function, selectable due to AND support | 309 | * @erase_cmd: [INTERN] erase command write function, selectable due to AND support |
304 | * @scan_bbt: [REPLACEABLE] function to scan bad block table | 310 | * @scan_bbt: [REPLACEABLE] function to scan bad block table |
305 | * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR) | 311 | * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR) |
306 | * @wq: [INTERN] wait queue to sleep on if a NAND operation is in progress | 312 | * @wq: [INTERN] wait queue to sleep on if a NAND operation is in progress |
307 | * @state: [INTERN] the current state of the NAND device | 313 | * @state: [INTERN] the current state of the NAND device |
314 | * @oob_poi: poison value buffer | ||
308 | * @page_shift: [INTERN] number of address bits in a page (column address bits) | 315 | * @page_shift: [INTERN] number of address bits in a page (column address bits) |
309 | * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock | 316 | * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock |
310 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry | 317 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry |
@@ -400,7 +407,6 @@ struct nand_chip { | |||
400 | 407 | ||
401 | /** | 408 | /** |
402 | * struct nand_flash_dev - NAND Flash Device ID Structure | 409 | * struct nand_flash_dev - NAND Flash Device ID Structure |
403 | * | ||
404 | * @name: Identify the device type | 410 | * @name: Identify the device type |
405 | * @id: device ID code | 411 | * @id: device ID code |
406 | * @pagesize: Pagesize in bytes. Either 256 or 512 or 0 | 412 | * @pagesize: Pagesize in bytes. Either 256 or 512 or 0 |
@@ -519,9 +525,8 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
519 | 525 | ||
520 | /** | 526 | /** |
521 | * struct platform_nand_chip - chip level device structure | 527 | * struct platform_nand_chip - chip level device structure |
522 | * | ||
523 | * @nr_chips: max. number of chips to scan for | 528 | * @nr_chips: max. number of chips to scan for |
524 | * @chip_offs: chip number offset | 529 | * @chip_offset: chip number offset |
525 | * @nr_partitions: number of partitions pointed to by partitions (or zero) | 530 | * @nr_partitions: number of partitions pointed to by partitions (or zero) |
526 | * @partitions: mtd partition list | 531 | * @partitions: mtd partition list |
527 | * @chip_delay: R/B delay value in us | 532 | * @chip_delay: R/B delay value in us |
@@ -542,11 +547,10 @@ struct platform_nand_chip { | |||
542 | 547 | ||
543 | /** | 548 | /** |
544 | * struct platform_nand_ctrl - controller level device structure | 549 | * struct platform_nand_ctrl - controller level device structure |
545 | * | ||
546 | * @hwcontrol: platform specific hardware control structure | 550 | * @hwcontrol: platform specific hardware control structure |
547 | * @dev_ready: platform specific function to read ready/busy pin | 551 | * @dev_ready: platform specific function to read ready/busy pin |
548 | * @select_chip: platform specific chip select function | 552 | * @select_chip: platform specific chip select function |
549 | * @priv_data: private data to transport driver specific settings | 553 | * @priv: private data to transport driver specific settings |
550 | * | 554 | * |
551 | * All fields are optional and depend on the hardware driver requirements | 555 | * All fields are optional and depend on the hardware driver requirements |
552 | */ | 556 | */ |
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index 9ce9a48db444..1f4972155249 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
@@ -23,7 +23,7 @@ extern int onenand_scan(struct mtd_info *mtd, int max_chips); | |||
23 | /* Free resources held by the OneNAND device */ | 23 | /* Free resources held by the OneNAND device */ |
24 | extern void onenand_release(struct mtd_info *mtd); | 24 | extern void onenand_release(struct mtd_info *mtd); |
25 | 25 | ||
26 | /** | 26 | /* |
27 | * onenand_state_t - chip states | 27 | * onenand_state_t - chip states |
28 | * Enumeration for OneNAND flash chip state | 28 | * Enumeration for OneNAND flash chip state |
29 | */ | 29 | */ |
@@ -42,9 +42,9 @@ typedef enum { | |||
42 | 42 | ||
43 | /** | 43 | /** |
44 | * struct onenand_bufferram - OneNAND BufferRAM Data | 44 | * struct onenand_bufferram - OneNAND BufferRAM Data |
45 | * @param block block address in BufferRAM | 45 | * @block: block address in BufferRAM |
46 | * @param page page address in BufferRAM | 46 | * @page: page address in BufferRAM |
47 | * @param valid valid flag | 47 | * @valid: valid flag |
48 | */ | 48 | */ |
49 | struct onenand_bufferram { | 49 | struct onenand_bufferram { |
50 | int block; | 50 | int block; |
@@ -54,32 +54,43 @@ struct onenand_bufferram { | |||
54 | 54 | ||
55 | /** | 55 | /** |
56 | * struct onenand_chip - OneNAND Private Flash Chip Data | 56 | * struct onenand_chip - OneNAND Private Flash Chip Data |
57 | * @param base [BOARDSPECIFIC] address to access OneNAND | 57 | * @base: [BOARDSPECIFIC] address to access OneNAND |
58 | * @param chipsize [INTERN] the size of one chip for multichip arrays | 58 | * @chipsize: [INTERN] the size of one chip for multichip arrays |
59 | * @param device_id [INTERN] device ID | 59 | * @device_id: [INTERN] device ID |
60 | * @param verstion_id [INTERN] version ID | 60 | * @density_mask: chip density, used for DDP devices |
61 | * @param options [BOARDSPECIFIC] various chip options. They can partly be set to inform onenand_scan about | 61 | * @verstion_id: [INTERN] version ID |
62 | * @param erase_shift [INTERN] number of address bits in a block | 62 | * @options: [BOARDSPECIFIC] various chip options. They can |
63 | * @param page_shift [INTERN] number of address bits in a page | 63 | * partly be set to inform onenand_scan about |
64 | * @param ppb_shift [INTERN] number of address bits in a pages per block | 64 | * @erase_shift: [INTERN] number of address bits in a block |
65 | * @param page_mask [INTERN] a page per block mask | 65 | * @page_shift: [INTERN] number of address bits in a page |
66 | * @param bufferam_index [INTERN] BufferRAM index | 66 | * @ppb_shift: [INTERN] number of address bits in a pages per block |
67 | * @param bufferam [INTERN] BufferRAM info | 67 | * @page_mask: [INTERN] a page per block mask |
68 | * @param readw [REPLACEABLE] hardware specific function for read short | 68 | * @bufferram_index: [INTERN] BufferRAM index |
69 | * @param writew [REPLACEABLE] hardware specific function for write short | 69 | * @bufferram: [INTERN] BufferRAM info |
70 | * @param command [REPLACEABLE] hardware specific function for writing commands to the chip | 70 | * @readw: [REPLACEABLE] hardware specific function for read short |
71 | * @param wait [REPLACEABLE] hardware specific function for wait on ready | 71 | * @writew: [REPLACEABLE] hardware specific function for write short |
72 | * @param read_bufferram [REPLACEABLE] hardware specific function for BufferRAM Area | 72 | * @command: [REPLACEABLE] hardware specific function for writing |
73 | * @param write_bufferram [REPLACEABLE] hardware specific function for BufferRAM Area | 73 | * commands to the chip |
74 | * @param read_word [REPLACEABLE] hardware specific function for read register of OneNAND | 74 | * @wait: [REPLACEABLE] hardware specific function for wait on ready |
75 | * @param write_word [REPLACEABLE] hardware specific function for write register of OneNAND | 75 | * @read_bufferram: [REPLACEABLE] hardware specific function for BufferRAM Area |
76 | * @param scan_bbt [REPLACEALBE] hardware specific function for scaning Bad block Table | 76 | * @write_bufferram: [REPLACEABLE] hardware specific function for BufferRAM Area |
77 | * @param chip_lock [INTERN] spinlock used to protect access to this structure and the chip | 77 | * @read_word: [REPLACEABLE] hardware specific function for read |
78 | * @param wq [INTERN] wait queue to sleep on if a OneNAND operation is in progress | 78 | * register of OneNAND |
79 | * @param state [INTERN] the current state of the OneNAND device | 79 | * @write_word: [REPLACEABLE] hardware specific function for write |
80 | * @param ecclayout [REPLACEABLE] the default ecc placement scheme | 80 | * register of OneNAND |
81 | * @param bbm [REPLACEABLE] pointer to Bad Block Management | 81 | * @mmcontrol: sync burst read function |
82 | * @param priv [OPTIONAL] pointer to private chip date | 82 | * @block_markbad: function to mark a block as bad |
83 | * @scan_bbt: [REPLACEALBE] hardware specific function for scanning | ||
84 | * Bad block Table | ||
85 | * @chip_lock: [INTERN] spinlock used to protect access to this | ||
86 | * structure and the chip | ||
87 | * @wq: [INTERN] wait queue to sleep on if a OneNAND | ||
88 | * operation is in progress | ||
89 | * @state: [INTERN] the current state of the OneNAND device | ||
90 | * @page_buf: data buffer | ||
91 | * @ecclayout: [REPLACEABLE] the default ecc placement scheme | ||
92 | * @bbm: [REPLACEABLE] pointer to Bad Block Management | ||
93 | * @priv: [OPTIONAL] pointer to private chip date | ||
83 | */ | 94 | */ |
84 | struct onenand_chip { | 95 | struct onenand_chip { |
85 | void __iomem *base; | 96 | void __iomem *base; |
@@ -147,9 +158,9 @@ struct onenand_chip { | |||
147 | #define ONENAND_MFR_SAMSUNG 0xec | 158 | #define ONENAND_MFR_SAMSUNG 0xec |
148 | 159 | ||
149 | /** | 160 | /** |
150 | * struct nand_manufacturers - NAND Flash Manufacturer ID Structure | 161 | * struct onenand_manufacturers - NAND Flash Manufacturer ID Structure |
151 | * @param name: Manufacturer name | 162 | * @name: Manufacturer name |
152 | * @param id: manufacturer ID code of device. | 163 | * @id: manufacturer ID code of device. |
153 | */ | 164 | */ |
154 | struct onenand_manufacturers { | 165 | struct onenand_manufacturers { |
155 | int id; | 166 | int id; |
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h index 31329fce1ff5..1da3f7fa7993 100644 --- a/include/mtd/mtd-abi.h +++ b/include/mtd/mtd-abi.h | |||
@@ -133,7 +133,7 @@ struct nand_ecclayout { | |||
133 | }; | 133 | }; |
134 | 134 | ||
135 | /** | 135 | /** |
136 | * struct mtd_ecc_stats - error correction status | 136 | * struct mtd_ecc_stats - error correction stats |
137 | * | 137 | * |
138 | * @corrected: number of corrected bits | 138 | * @corrected: number of corrected bits |
139 | * @failed: number of uncorrectable errors | 139 | * @failed: number of uncorrectable errors |