The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef __LINUX_MTD_NAND_H |
| 20 | #define __LINUX_MTD_NAND_H |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 21 | #include <linux/wait.h> |
| 22 | #include <linux/spinlock.h> |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 23 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 24 | #include <linux/mtd/mtd.h> |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 25 | struct mtd_info; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 26 | #define NAND_MAX_CHIPS 8 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 27 | #define NAND_MAX_OOBSIZE 64 |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 28 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 29 | #define NAND_MAX_PAGESIZE 2048 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 30 | #define NAND_NCE 0x01 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 31 | #define NAND_CLE 0x02 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 32 | #define NAND_ALE 0x04 |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 33 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 34 | #define NAND_CTRL_CLE (NAND_NCE | NAND_CLE) |
| 35 | #define NAND_CTRL_ALE (NAND_NCE | NAND_ALE) |
| 36 | #define NAND_CTRL_CHANGE 0x80 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 37 | #define NAND_CMD_READ0 0 |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 38 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 39 | #define NAND_CMD_READ1 1 |
| 40 | #define NAND_CMD_RNDOUT 5 |
| 41 | #define NAND_CMD_PAGEPROG 0x10 |
| 42 | #define NAND_CMD_READOOB 0x50 |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 43 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 44 | #define NAND_CMD_ERASE1 0x60 |
| 45 | #define NAND_CMD_STATUS 0x70 |
| 46 | #define NAND_CMD_STATUS_MULTI 0x71 |
| 47 | #define NAND_CMD_SEQIN 0x80 |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 48 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 49 | #define NAND_CMD_RNDIN 0x85 |
| 50 | #define NAND_CMD_READID 0x90 |
| 51 | #define NAND_CMD_ERASE2 0xd0 |
| 52 | #define NAND_CMD_RESET 0xff |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 53 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 54 | #define NAND_CMD_READSTART 0x30 |
| 55 | #define NAND_CMD_RNDOUTSTART 0xE0 |
| 56 | #define NAND_CMD_CACHEDPROG 0x15 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 57 | #define NAND_CMD_DEPLETE1 0x100 |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 58 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 59 | #define NAND_CMD_DEPLETE2 0x38 |
| 60 | #define NAND_CMD_STATUS_MULTI 0x71 |
| 61 | #define NAND_CMD_STATUS_ERROR 0x72 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 62 | #define NAND_CMD_STATUS_ERROR0 0x73 |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 63 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 64 | #define NAND_CMD_STATUS_ERROR1 0x74 |
| 65 | #define NAND_CMD_STATUS_ERROR2 0x75 |
| 66 | #define NAND_CMD_STATUS_ERROR3 0x76 |
| 67 | #define NAND_CMD_STATUS_RESET 0x7f |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 68 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 69 | #define NAND_CMD_STATUS_CLEAR 0xff |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 70 | #define NAND_CMD_NONE -1 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 71 | #define NAND_STATUS_FAIL 0x01 |
| 72 | #define NAND_STATUS_FAIL_N1 0x02 |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 73 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 74 | #define NAND_STATUS_TRUE_READY 0x20 |
| 75 | #define NAND_STATUS_READY 0x40 |
| 76 | #define NAND_STATUS_WP 0x80 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 77 | typedef enum { |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 78 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 79 | NAND_ECC_NONE, |
| 80 | NAND_ECC_SOFT, |
| 81 | NAND_ECC_HW, |
| 82 | NAND_ECC_HW_SYNDROME, |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 83 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 84 | } nand_ecc_modes_t; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 85 | #define NAND_ECC_READ 0 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 86 | #define NAND_ECC_WRITE 1 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 87 | #define NAND_ECC_READSYN 2 |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 88 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 89 | #define NAND_GET_DEVICE 0x80 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 90 | #define NAND_NO_AUTOINCR 0x00000001 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 91 | #define NAND_BUSWIDTH_16 0x00000002 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 92 | #define NAND_NO_PADDING 0x00000004 |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 93 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 94 | #define NAND_CACHEPRG 0x00000008 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 95 | #define NAND_COPYBACK 0x00000010 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 96 | #define NAND_IS_AND 0x00000020 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 97 | #define NAND_4PAGE_ARRAY 0x00000040 |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 98 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 99 | #define BBT_AUTO_REFRESH 0x00000080 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 100 | #define NAND_NO_READRDY 0x00000100 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 101 | #define NAND_SAMSUNG_LP_OPTIONS (NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 102 | #define NAND_CANAUTOINCR(chip) (!(chip->options & NAND_NO_AUTOINCR)) |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 103 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 104 | #define NAND_MUST_PAD(chip) (!(chip->options & NAND_NO_PADDING)) |
| 105 | #define NAND_HAS_CACHEPROG(chip) ((chip->options & NAND_CACHEPRG)) |
| 106 | #define NAND_HAS_COPYBACK(chip) ((chip->options & NAND_COPYBACK)) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 107 | #define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR) |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 108 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 109 | #define NAND_USE_FLASH_BBT 0x00010000 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 110 | #define NAND_SKIP_BBTSCAN 0x00020000 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 111 | #define NAND_CONTROLLER_ALLOC 0x80000000 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 112 | typedef enum { |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 113 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 114 | FL_READY, |
| 115 | FL_READING, |
| 116 | FL_WRITING, |
| 117 | FL_ERASING, |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 118 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 119 | FL_SYNCING, |
| 120 | FL_CACHEDPRG, |
| 121 | FL_PM_SUSPENDED, |
| 122 | } nand_state_t; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 123 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 124 | struct nand_chip; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 125 | struct nand_hw_control { |
| 126 | spinlock_t lock; |
| 127 | struct nand_chip *active; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 128 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 129 | wait_queue_head_t wq; |
| 130 | }; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 131 | struct nand_ecc_ctrl { |
| 132 | nand_ecc_modes_t mode; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 133 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 134 | int steps; |
| 135 | int size; |
| 136 | int bytes; |
| 137 | int total; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 138 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 139 | int prepad; |
| 140 | int postpad; |
| 141 | struct nand_ecclayout *layout; |
| 142 | void (*hwctl)(struct mtd_info *mtd, int mode); |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 143 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 144 | int (*calculate)(struct mtd_info *mtd, |
| 145 | const uint8_t *dat, |
| 146 | uint8_t *ecc_code); |
| 147 | int (*correct)(struct mtd_info *mtd, uint8_t *dat, |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 148 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 149 | uint8_t *read_ecc, |
| 150 | uint8_t *calc_ecc); |
| 151 | int (*read_page)(struct mtd_info *mtd, |
| 152 | struct nand_chip *chip, |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 153 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 154 | uint8_t *buf); |
| 155 | void (*write_page)(struct mtd_info *mtd, |
| 156 | struct nand_chip *chip, |
| 157 | const uint8_t *buf); |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 158 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 159 | int (*read_oob)(struct mtd_info *mtd, |
| 160 | struct nand_chip *chip, |
| 161 | int page, |
| 162 | int sndcmd); |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 163 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 164 | int (*write_oob)(struct mtd_info *mtd, |
| 165 | struct nand_chip *chip, |
| 166 | int page); |
| 167 | }; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 168 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 169 | struct nand_buffers { |
| 170 | uint8_t ecccalc[NAND_MAX_OOBSIZE]; |
| 171 | uint8_t ecccode[NAND_MAX_OOBSIZE]; |
| 172 | uint8_t oobwbuf[NAND_MAX_OOBSIZE]; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 173 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 174 | uint8_t databuf[NAND_MAX_PAGESIZE]; |
| 175 | uint8_t oobrbuf[NAND_MAX_OOBSIZE]; |
| 176 | }; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 177 | struct nand_chip { |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 178 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 179 | void __iomem *IO_ADDR_R; |
| 180 | void __iomem *IO_ADDR_W; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 181 | uint8_t (*read_byte)(struct mtd_info *mtd); |
| 182 | u16 (*read_word)(struct mtd_info *mtd); |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 183 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 184 | void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); |
| 185 | void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len); |
| 186 | int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); |
| 187 | void (*select_chip)(struct mtd_info *mtd, int chip); |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 188 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 189 | int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip); |
| 190 | int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); |
| 191 | void (*cmd_ctrl)(struct mtd_info *mtd, int dat, |
| 192 | unsigned int ctrl); |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 193 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 194 | int (*dev_ready)(struct mtd_info *mtd); |
| 195 | void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr); |
| 196 | int (*waitfunc)(struct mtd_info *mtd, struct nand_chip *this); |
| 197 | void (*erase_cmd)(struct mtd_info *mtd, int page); |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 198 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 199 | int (*scan_bbt)(struct mtd_info *mtd); |
| 200 | int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 201 | int chip_delay; |
| 202 | unsigned int options; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 203 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 204 | int page_shift; |
| 205 | int phys_erase_shift; |
| 206 | int bbt_erase_shift; |
| 207 | int chip_shift; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 208 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 209 | int numchips; |
| 210 | unsigned long chipsize; |
| 211 | int pagemask; |
| 212 | int pagebuf; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 213 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 214 | int badblockpos; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 215 | nand_state_t state; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 216 | uint8_t *oob_poi; |
| 217 | struct nand_hw_control *controller; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 218 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 219 | struct nand_ecclayout *ecclayout; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 220 | struct nand_ecc_ctrl ecc; |
| 221 | struct nand_buffers buffers; |
| 222 | struct nand_hw_control hwcontrol; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 223 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 224 | struct mtd_oob_ops ops; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 225 | uint8_t *bbt; |
| 226 | struct nand_bbt_descr *bbt_td; |
| 227 | struct nand_bbt_descr *bbt_md; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 228 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 229 | struct nand_bbt_descr *badblock_pattern; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 230 | void *priv; |
| 231 | }; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 232 | #define NAND_MFR_TOSHIBA 0x98 |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 233 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 234 | #define NAND_MFR_SAMSUNG 0xec |
| 235 | #define NAND_MFR_FUJITSU 0x04 |
| 236 | #define NAND_MFR_NATIONAL 0x8f |
| 237 | #define NAND_MFR_RENESAS 0x07 |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 238 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 239 | #define NAND_MFR_STMICRO 0x20 |
| 240 | #define NAND_MFR_HYNIX 0xad |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 241 | struct nand_flash_dev { |
| 242 | char *name; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 243 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 244 | int id; |
| 245 | unsigned long pagesize; |
| 246 | unsigned long chipsize; |
| 247 | unsigned long erasesize; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 248 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 249 | unsigned long options; |
| 250 | }; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 251 | struct nand_manufacturers { |
| 252 | int id; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 253 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 254 | char * name; |
| 255 | }; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 256 | struct nand_bbt_descr { |
| 257 | int options; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 258 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 259 | int pages[NAND_MAX_CHIPS]; |
| 260 | int offs; |
| 261 | int veroffs; |
| 262 | uint8_t version[NAND_MAX_CHIPS]; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 263 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 264 | int len; |
| 265 | int maxblocks; |
| 266 | int reserved_block_code; |
| 267 | uint8_t *pattern; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 268 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 269 | }; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 270 | #define NAND_BBT_NRBITS_MSK 0x0000000F |
| 271 | #define NAND_BBT_1BIT 0x00000001 |
| 272 | #define NAND_BBT_2BIT 0x00000002 |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 273 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 274 | #define NAND_BBT_4BIT 0x00000004 |
| 275 | #define NAND_BBT_8BIT 0x00000008 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 276 | #define NAND_BBT_LASTBLOCK 0x00000010 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 277 | #define NAND_BBT_ABSPAGE 0x00000020 |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 278 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 279 | #define NAND_BBT_SEARCH 0x00000040 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 280 | #define NAND_BBT_PERCHIP 0x00000080 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 281 | #define NAND_BBT_VERSION 0x00000100 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 282 | #define NAND_BBT_CREATE 0x00000200 |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 283 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 284 | #define NAND_BBT_SCANALLPAGES 0x00000400 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 285 | #define NAND_BBT_SCANEMPTY 0x00000800 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 286 | #define NAND_BBT_WRITE 0x00001000 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 287 | #define NAND_BBT_SAVECONTENT 0x00002000 |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 288 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 289 | #define NAND_BBT_SCAN2NDPAGE 0x00004000 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 290 | #define NAND_BBT_SCAN_MAXBLOCKS 4 |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 291 | #define NAND_SMALL_BADBLOCK_POS 5 |
| 292 | #define NAND_LARGE_BADBLOCK_POS 0 |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 293 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 294 | struct platform_nand_chip { |
| 295 | int nr_chips; |
| 296 | int chip_offset; |
| 297 | int nr_partitions; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 298 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 299 | struct mtd_partition *partitions; |
| 300 | struct nand_ecclayout *ecclayout; |
| 301 | int chip_delay; |
| 302 | unsigned int options; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 303 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 304 | void *priv; |
| 305 | }; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 306 | struct platform_nand_ctrl { |
| 307 | void (*hwcontrol)(struct mtd_info *mtd, int cmd); |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 308 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 309 | int (*dev_ready)(struct mtd_info *mtd); |
| 310 | void (*select_chip)(struct mtd_info *mtd, int chip); |
| 311 | void *priv; |
| 312 | }; |
Ben Cheng | 94a85f6 | 2012-03-06 15:45:52 -0800 | [diff] [blame^] | 313 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 314 | #endif |