diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/kmsg_dump.h | 60 | ||||
| -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 |
8 files changed, 113 insertions, 132 deletions
diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h new file mode 100644 index 000000000000..e32aa268efac --- /dev/null +++ b/include/linux/kmsg_dump.h | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | /* | ||
| 2 | * linux/include/kmsg_dump.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009 Net Insight AB | ||
| 5 | * | ||
| 6 | * Author: Simon Kagstrom <simon.kagstrom@netinsight.net> | ||
| 7 | * | ||
| 8 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 9 | * License. See the file COPYING in the main directory of this archive | ||
| 10 | * for more details. | ||
| 11 | */ | ||
| 12 | #ifndef _LINUX_KMSG_DUMP_H | ||
| 13 | #define _LINUX_KMSG_DUMP_H | ||
| 14 | |||
| 15 | #include <linux/list.h> | ||
| 16 | |||
| 17 | enum kmsg_dump_reason { | ||
| 18 | KMSG_DUMP_OOPS, | ||
| 19 | KMSG_DUMP_PANIC, | ||
| 20 | }; | ||
| 21 | |||
| 22 | /** | ||
| 23 | * struct kmsg_dumper - kernel crash message dumper structure | ||
| 24 | * @dump: The callback which gets called on crashes. The buffer is passed | ||
| 25 | * as two sections, where s1 (length l1) contains the older | ||
| 26 | * messages and s2 (length l2) contains the newer. | ||
| 27 | * @list: Entry in the dumper list (private) | ||
| 28 | * @registered: Flag that specifies if this is already registered | ||
| 29 | */ | ||
| 30 | struct kmsg_dumper { | ||
| 31 | void (*dump)(struct kmsg_dumper *dumper, enum kmsg_dump_reason reason, | ||
| 32 | const char *s1, unsigned long l1, | ||
| 33 | const char *s2, unsigned long l2); | ||
| 34 | struct list_head list; | ||
| 35 | int registered; | ||
| 36 | }; | ||
| 37 | |||
| 38 | #ifdef CONFIG_PRINTK | ||
| 39 | void kmsg_dump(enum kmsg_dump_reason reason); | ||
| 40 | |||
| 41 | int kmsg_dump_register(struct kmsg_dumper *dumper); | ||
| 42 | |||
| 43 | int kmsg_dump_unregister(struct kmsg_dumper *dumper); | ||
| 44 | #else | ||
| 45 | static inline void kmsg_dump(enum kmsg_dump_reason reason) | ||
| 46 | { | ||
| 47 | } | ||
| 48 | |||
| 49 | static inline int kmsg_dump_register(struct kmsg_dumper *dumper) | ||
| 50 | { | ||
| 51 | return -EINVAL; | ||
| 52 | } | ||
| 53 | |||
| 54 | static inline int kmsg_dump_unregister(struct kmsg_dumper *dumper) | ||
| 55 | { | ||
| 56 | return -EINVAL; | ||
| 57 | } | ||
| 58 | #endif | ||
| 59 | |||
| 60 | #endif /* _LINUX_KMSG_DUMP_H */ | ||
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 | ||
