diff options
Diffstat (limited to 'include/linux/mtd')
| -rw-r--r-- | include/linux/mtd/bbm.h | 35 | ||||
| -rw-r--r-- | include/linux/mtd/cfi.h | 9 | ||||
| -rw-r--r-- | include/linux/mtd/flashchip.h | 9 | ||||
| -rw-r--r-- | include/linux/mtd/nand.h | 97 | ||||
| -rw-r--r-- | include/linux/mtd/nand_ecc.h | 10 | ||||
| -rw-r--r-- | include/linux/mtd/onenand.h | 23 | ||||
| -rw-r--r-- | include/linux/mtd/onenand_regs.h | 2 |
7 files changed, 53 insertions, 132 deletions
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h index fff8c53e5434..9c3757c5759d 100644 --- a/include/linux/mtd/bbm.h +++ b/include/linux/mtd/bbm.h | |||
| @@ -19,22 +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 | * @options: options for this descriptor | 22 | * @options: options for this descriptor |
| 23 | * @pages: the page(s) where we find the bbt, used with | 23 | * @pages: the page(s) where we find the bbt, used with option BBT_ABSPAGE |
| 24 | * option BBT_ABSPAGE when bbt is searched, | 24 | * when bbt is searched, then we store the found bbts pages here. |
| 25 | * then we store the found bbts pages here. | 25 | * Its an array and supports up to 8 chips now |
| 26 | * Its an array and supports up to 8 chips now | 26 | * @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 | 27 | * @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 | 28 | * @version: version read from the bbt page during scan |
| 29 | * @version: version read from the bbt page during scan | 29 | * @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 | 30 | * @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 | 31 | * blocks is reserved at the end of the device where the tables are |
| 32 | * number of blocks is reserved at the end of the device | 32 | * written. |
| 33 | * where the tables are written. | 33 | * @reserved_block_code: if non-0, this pattern denotes a reserved (rather than |
| 34 | * @reserved_block_code: if non-0, this pattern denotes a reserved | 34 | * bad) block in the stored bbt |
| 35 | * (rather than bad) block in the stored bbt | 35 | * @pattern: pattern to identify bad block table or factory marked good / |
| 36 | * @pattern: pattern to identify bad block table or factory marked | 36 | * bad blocks, can be NULL, if len = 0 |
| 37 | * good / bad blocks, can be NULL, if len = 0 | ||
| 38 | * | 37 | * |
| 39 | * Descriptor for the bad block table marker and the descriptor for the | 38 | * Descriptor for the bad block table marker and the descriptor for the |
| 40 | * pattern which identifies good and bad blocks. The assumption is made | 39 | * pattern which identifies good and bad blocks. The assumption is made |
| @@ -90,7 +89,9 @@ struct nand_bbt_descr { | |||
| 90 | /* | 89 | /* |
| 91 | * Constants for oob configuration | 90 | * Constants for oob configuration |
| 92 | */ | 91 | */ |
| 93 | #define ONENAND_BADBLOCK_POS 0 | 92 | #define NAND_SMALL_BADBLOCK_POS 5 |
| 93 | #define NAND_LARGE_BADBLOCK_POS 0 | ||
| 94 | #define ONENAND_BADBLOCK_POS 0 | ||
| 94 | 95 | ||
| 95 | /* | 96 | /* |
| 96 | * Bad block scanning errors | 97 | * Bad block scanning errors |
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index 88d3d8fbf9f2..df89f4275232 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h | |||
| @@ -518,10 +518,11 @@ struct cfi_fixup { | |||
| 518 | #define CFI_MFR_ANY 0xffff | 518 | #define CFI_MFR_ANY 0xffff |
| 519 | #define CFI_ID_ANY 0xffff | 519 | #define CFI_ID_ANY 0xffff |
| 520 | 520 | ||
| 521 | #define CFI_MFR_AMD 0x0001 | 521 | #define CFI_MFR_AMD 0x0001 |
| 522 | #define CFI_MFR_ATMEL 0x001F | 522 | #define CFI_MFR_INTEL 0x0089 |
| 523 | #define CFI_MFR_SAMSUNG 0x00EC | 523 | #define CFI_MFR_ATMEL 0x001F |
| 524 | #define CFI_MFR_ST 0x0020 /* STMicroelectronics */ | 524 | #define CFI_MFR_SAMSUNG 0x00EC |
| 525 | #define CFI_MFR_ST 0x0020 /* STMicroelectronics */ | ||
| 525 | 526 | ||
| 526 | void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup* fixups); | 527 | void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup* fixups); |
| 527 | 528 | ||
diff --git a/include/linux/mtd/flashchip.h b/include/linux/mtd/flashchip.h index d4f38c5fd44e..d0bf422ae374 100644 --- a/include/linux/mtd/flashchip.h +++ b/include/linux/mtd/flashchip.h | |||
| @@ -38,6 +38,15 @@ typedef enum { | |||
| 38 | FL_XIP_WHILE_ERASING, | 38 | FL_XIP_WHILE_ERASING, |
| 39 | FL_XIP_WHILE_WRITING, | 39 | FL_XIP_WHILE_WRITING, |
| 40 | FL_SHUTDOWN, | 40 | FL_SHUTDOWN, |
| 41 | /* These 2 come from nand_state_t, which has been unified here */ | ||
| 42 | FL_READING, | ||
| 43 | FL_CACHEDPRG, | ||
| 44 | /* These 4 come from onenand_state_t, which has been unified here */ | ||
| 45 | FL_RESETING, | ||
| 46 | FL_OTPING, | ||
| 47 | FL_PREPARING_ERASE, | ||
| 48 | FL_VERIFYING_ERASE, | ||
| 49 | |||
| 41 | FL_UNKNOWN | 50 | FL_UNKNOWN |
| 42 | } flstate_t; | 51 | } flstate_t; |
| 43 | 52 | ||
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 7a232a9bdd62..ccab9dfc5217 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
| @@ -21,6 +21,8 @@ | |||
| 21 | #include <linux/wait.h> | 21 | #include <linux/wait.h> |
| 22 | #include <linux/spinlock.h> | 22 | #include <linux/spinlock.h> |
| 23 | #include <linux/mtd/mtd.h> | 23 | #include <linux/mtd/mtd.h> |
| 24 | #include <linux/mtd/flashchip.h> | ||
| 25 | #include <linux/mtd/bbm.h> | ||
| 24 | 26 | ||
| 25 | struct mtd_info; | 27 | struct mtd_info; |
| 26 | /* Scan and identify a NAND device */ | 28 | /* Scan and identify a NAND device */ |
| @@ -168,7 +170,6 @@ typedef enum { | |||
| 168 | /* Chip does not allow subpage writes */ | 170 | /* Chip does not allow subpage writes */ |
| 169 | #define NAND_NO_SUBPAGE_WRITE 0x00000200 | 171 | #define NAND_NO_SUBPAGE_WRITE 0x00000200 |
| 170 | 172 | ||
| 171 | |||
| 172 | /* Options valid for Samsung large page devices */ | 173 | /* Options valid for Samsung large page devices */ |
| 173 | #define NAND_SAMSUNG_LP_OPTIONS \ | 174 | #define NAND_SAMSUNG_LP_OPTIONS \ |
| 174 | (NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK) | 175 | (NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK) |
| @@ -194,6 +195,9 @@ typedef enum { | |||
| 194 | /* This option is defined if the board driver allocates its own buffers | 195 | /* This option is defined if the board driver allocates its own buffers |
| 195 | (e.g. because it needs them DMA-coherent */ | 196 | (e.g. because it needs them DMA-coherent */ |
| 196 | #define NAND_OWN_BUFFERS 0x00040000 | 197 | #define NAND_OWN_BUFFERS 0x00040000 |
| 198 | /* Chip may not exist, so silence any errors in scan */ | ||
| 199 | #define NAND_SCAN_SILENT_NODEV 0x00080000 | ||
| 200 | |||
| 197 | /* Options set by nand scan */ | 201 | /* Options set by nand scan */ |
| 198 | /* Nand scan has allocated controller struct */ | 202 | /* Nand scan has allocated controller struct */ |
| 199 | #define NAND_CONTROLLER_ALLOC 0x80000000 | 203 | #define NAND_CONTROLLER_ALLOC 0x80000000 |
| @@ -202,20 +206,6 @@ typedef enum { | |||
| 202 | #define NAND_CI_CHIPNR_MSK 0x03 | 206 | #define NAND_CI_CHIPNR_MSK 0x03 |
| 203 | #define NAND_CI_CELLTYPE_MSK 0x0C | 207 | #define NAND_CI_CELLTYPE_MSK 0x0C |
| 204 | 208 | ||
| 205 | /* | ||
| 206 | * nand_state_t - chip states | ||
| 207 | * Enumeration for NAND flash chip state | ||
| 208 | */ | ||
| 209 | typedef enum { | ||
| 210 | FL_READY, | ||
| 211 | FL_READING, | ||
| 212 | FL_WRITING, | ||
| 213 | FL_ERASING, | ||
| 214 | FL_SYNCING, | ||
| 215 | FL_CACHEDPRG, | ||
| 216 | FL_PM_SUSPENDED, | ||
| 217 | } nand_state_t; | ||
| 218 | |||
| 219 | /* Keep gcc happy */ | 209 | /* Keep gcc happy */ |
| 220 | struct nand_chip; | 210 | struct nand_chip; |
| 221 | 211 | ||
| @@ -402,7 +392,7 @@ struct nand_chip { | |||
| 402 | uint8_t cellinfo; | 392 | uint8_t cellinfo; |
| 403 | int badblockpos; | 393 | int badblockpos; |
| 404 | 394 | ||
| 405 | nand_state_t state; | 395 | flstate_t state; |
| 406 | 396 | ||
| 407 | uint8_t *oob_poi; | 397 | uint8_t *oob_poi; |
| 408 | struct nand_hw_control *controller; | 398 | struct nand_hw_control *controller; |
| @@ -470,75 +460,6 @@ struct nand_manufacturers { | |||
| 470 | extern struct nand_flash_dev nand_flash_ids[]; | 460 | extern struct nand_flash_dev nand_flash_ids[]; |
| 471 | extern struct nand_manufacturers nand_manuf_ids[]; | 461 | extern struct nand_manufacturers nand_manuf_ids[]; |
| 472 | 462 | ||
| 473 | /** | ||
| 474 | * struct nand_bbt_descr - bad block table descriptor | ||
| 475 | * @options: options for this descriptor | ||
| 476 | * @pages: the page(s) where we find the bbt, used with option BBT_ABSPAGE | ||
| 477 | * when bbt is searched, then we store the found bbts pages here. | ||
| 478 | * Its an array and supports up to 8 chips now | ||
| 479 | * @offs: offset of the pattern in the oob area of the page | ||
| 480 | * @veroffs: offset of the bbt version counter in the oob are of the page | ||
| 481 | * @version: version read from the bbt page during scan | ||
| 482 | * @len: length of the pattern, if 0 no pattern check is performed | ||
| 483 | * @maxblocks: maximum number of blocks to search for a bbt. This number of | ||
| 484 | * blocks is reserved at the end of the device where the tables are | ||
| 485 | * written. | ||
| 486 | * @reserved_block_code: if non-0, this pattern denotes a reserved (rather than | ||
| 487 | * bad) block in the stored bbt | ||
| 488 | * @pattern: pattern to identify bad block table or factory marked good / | ||
| 489 | * bad blocks, can be NULL, if len = 0 | ||
| 490 | * | ||
| 491 | * Descriptor for the bad block table marker and the descriptor for the | ||
| 492 | * pattern which identifies good and bad blocks. The assumption is made | ||
| 493 | * that the pattern and the version count are always located in the oob area | ||
| 494 | * of the first block. | ||
