Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [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 | *** |
| 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 | *** |
| 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef __MTD_ABI_H__ |
| 20 | #define __MTD_ABI_H__ |
| 21 | #include <linux/types.h> |
| 22 | struct erase_info_user { |
| 23 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 24 | __u32 start; |
| 25 | __u32 length; |
| 26 | }; |
| 27 | struct erase_info_user64 { |
| 28 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 29 | __u64 start; |
| 30 | __u64 length; |
| 31 | }; |
| 32 | struct mtd_oob_buf { |
| 33 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 34 | __u32 start; |
| 35 | __u32 length; |
| 36 | unsigned char __user *ptr; |
| 37 | }; |
| 38 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 39 | struct mtd_oob_buf64 { |
| 40 | __u64 start; |
| 41 | __u32 pad; |
| 42 | __u32 length; |
| 43 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 44 | __u64 usr_ptr; |
| 45 | }; |
| 46 | enum { |
| 47 | MTD_OPS_PLACE_OOB = 0, |
| 48 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 49 | MTD_OPS_AUTO_OOB = 1, |
| 50 | MTD_OPS_RAW = 2, |
| 51 | }; |
| 52 | struct mtd_write_req { |
| 53 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 54 | __u64 start; |
| 55 | __u64 len; |
| 56 | __u64 ooblen; |
| 57 | __u64 usr_data; |
| 58 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 59 | __u64 usr_oob; |
| 60 | __u8 mode; |
| 61 | __u8 padding[7]; |
| 62 | }; |
| 63 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 64 | #define MTD_ABSENT 0 |
| 65 | #define MTD_RAM 1 |
| 66 | #define MTD_ROM 2 |
| 67 | #define MTD_NORFLASH 3 |
| 68 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 69 | #define MTD_NANDFLASH 4 |
| 70 | #define MTD_DATAFLASH 6 |
| 71 | #define MTD_UBIVOLUME 7 |
| 72 | #define MTD_MLCNANDFLASH 8 |
| 73 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 74 | #define MTD_WRITEABLE 0x400 |
| 75 | #define MTD_BIT_WRITEABLE 0x800 |
| 76 | #define MTD_NO_ERASE 0x1000 |
| 77 | #define MTD_POWERUP_LOCK 0x2000 |
| 78 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
| 79 | #define MTD_CAP_ROM 0 |
| 80 | #define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE) |
| 81 | #define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE) |
| 82 | #define MTD_CAP_NANDFLASH (MTD_WRITEABLE) |
| 83 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 84 | #define MTD_CAP_NVRAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 85 | #define MTD_NANDECC_OFF 0 |
| 86 | #define MTD_NANDECC_PLACE 1 |
| 87 | #define MTD_NANDECC_AUTOPLACE 2 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 88 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 89 | #define MTD_NANDECC_PLACEONLY 3 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 90 | #define MTD_NANDECC_AUTOPL_USR 4 |
| 91 | #define MTD_OTP_OFF 0 |
| 92 | #define MTD_OTP_FACTORY 1 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 93 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 94 | #define MTD_OTP_USER 2 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 95 | struct mtd_info_user { |
| 96 | __u8 type; |
| 97 | __u32 flags; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 98 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 99 | __u32 size; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 100 | __u32 erasesize; |
| 101 | __u32 writesize; |
| 102 | __u32 oobsize; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 103 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 104 | __u64 padding; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 105 | }; |
| 106 | struct region_info_user { |
| 107 | __u32 offset; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 108 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 109 | __u32 erasesize; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 110 | __u32 numblocks; |
| 111 | __u32 regionindex; |
| 112 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 113 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 114 | struct otp_info { |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 115 | __u32 start; |
| 116 | __u32 length; |
| 117 | __u32 locked; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 118 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 119 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 120 | #define MEMGETINFO _IOR('M', 1, struct mtd_info_user) |
| 121 | #define MEMERASE _IOW('M', 2, struct erase_info_user) |
| 122 | #define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 123 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 124 | #define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 125 | #define MEMLOCK _IOW('M', 5, struct erase_info_user) |
| 126 | #define MEMUNLOCK _IOW('M', 6, struct erase_info_user) |
| 127 | #define MEMGETREGIONCOUNT _IOR('M', 7, int) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 128 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 129 | #define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 130 | #define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo) |
| 131 | #define MEMGETBADBLOCK _IOW('M', 11, __kernel_loff_t) |
| 132 | #define MEMSETBADBLOCK _IOW('M', 12, __kernel_loff_t) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 133 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 134 | #define OTPSELECT _IOR('M', 13, int) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 135 | #define OTPGETREGIONCOUNT _IOW('M', 14, int) |
| 136 | #define OTPGETREGIONINFO _IOW('M', 15, struct otp_info) |
| 137 | #define OTPLOCK _IOR('M', 16, struct otp_info) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 138 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 139 | #define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout_user) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 140 | #define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats) |
| 141 | #define MTDFILEMODE _IO('M', 19) |
| 142 | #define MEMERASE64 _IOW('M', 20, struct erase_info_user64) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 143 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 144 | #define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 145 | #define MEMREADOOB64 _IOWR('M', 22, struct mtd_oob_buf64) |
| 146 | #define MEMISLOCKED _IOR('M', 23, struct erase_info_user) |
| 147 | #define MEMWRITE _IOWR('M', 24, struct mtd_write_req) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 148 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 149 | struct nand_oobinfo { |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 150 | __u32 useecc; |
| 151 | __u32 eccbytes; |
| 152 | __u32 oobfree[8][2]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 153 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 154 | __u32 eccpos[32]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 155 | }; |
| 156 | struct nand_oobfree { |
| 157 | __u32 offset; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 158 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 159 | __u32 length; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 160 | }; |
| 161 | #define MTD_MAX_OOBFREE_ENTRIES 8 |
| 162 | #define MTD_MAX_ECCPOS_ENTRIES 64 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 163 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 164 | struct nand_ecclayout_user { |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 165 | __u32 eccbytes; |
| 166 | __u32 eccpos[MTD_MAX_ECCPOS_ENTRIES]; |
| 167 | __u32 oobavail; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 168 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 169 | struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 170 | }; |
| 171 | struct mtd_ecc_stats { |
| 172 | __u32 corrected; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 173 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 174 | __u32 failed; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 175 | __u32 badblocks; |
| 176 | __u32 bbtblocks; |
| 177 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 178 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 179 | enum mtd_file_modes { |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 180 | MTD_FILE_MODE_NORMAL = MTD_OTP_OFF, |
| 181 | MTD_FILE_MODE_OTP_FACTORY = MTD_OTP_FACTORY, |
| 182 | MTD_FILE_MODE_OTP_USER = MTD_OTP_USER, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 183 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame^] | 184 | MTD_FILE_MODE_RAW, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 185 | }; |
| 186 | #endif |