Go to the documentation of this file.
23 #include <linux/types.h>
96 #define MTD_NORFLASH 3
97 #define MTD_NANDFLASH 4
98 #define MTD_DATAFLASH 6
99 #define MTD_UBIVOLUME 7
100 #define MTD_MLCNANDFLASH 8
102 #define MTD_WRITEABLE 0x400
103 #define MTD_BIT_WRITEABLE 0x800
104 #define MTD_NO_ERASE 0x1000
105 #define MTD_POWERUP_LOCK 0x2000
108 #define MTD_CAP_ROM 0
109 #define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)
110 #define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE)
111 #define MTD_CAP_NANDFLASH (MTD_WRITEABLE)
114 #define MTD_NANDECC_OFF 0 // Switch off ECC (Not recommended)
115 #define MTD_NANDECC_PLACE 1 // Use the given placement in the structure (YAFFS1 legacy mode)
116 #define MTD_NANDECC_AUTOPLACE 2 // Use the default placement scheme
117 #define MTD_NANDECC_PLACEONLY 3 // Use the given placement in the structure (Do not store ecc result on read)
118 #define MTD_NANDECC_AUTOPL_USR 4 // Use the given autoplacement scheme rather than using the default
121 #define MTD_OTP_OFF 0
122 #define MTD_OTP_FACTORY 1
123 #define MTD_OTP_USER 2
156 #define MEMGETINFO _IOR('M', 1, struct mtd_info_user)
158 #define MEMERASE _IOW('M', 2, struct erase_info_user)
160 #define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf)
162 #define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf)
164 #define MEMLOCK _IOW('M', 5, struct erase_info_user)
166 #define MEMUNLOCK _IOW('M', 6, struct erase_info_user)
168 #define MEMGETREGIONCOUNT _IOR('M', 7, int)
170 #define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user)
172 #define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo)
174 #define MEMGETBADBLOCK _IOW('M', 11, __kernel_loff_t)
176 #define MEMSETBADBLOCK _IOW('M', 12, __kernel_loff_t)
178 #define OTPSELECT _IOR('M', 13, int)
180 #define OTPGETREGIONCOUNT _IOW('M', 14, int)
182 #define OTPGETREGIONINFO _IOW('M', 15, struct otp_info)
184 #define OTPLOCK _IOR('M', 16, struct otp_info)
186 #define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout_user)
188 #define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats)
190 #define MTDFILEMODE _IO('M', 19)
192 #define MEMERASE64 _IOW('M', 20, struct erase_info_user64)
194 #define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64)
196 #define MEMREADOOB64 _IOWR('M', 22, struct mtd_oob_buf64)
198 #define MEMISLOCKED _IOR('M', 23, struct erase_info_user)
204 #define MEMWRITE _IOWR('M', 24, struct mtd_write_req)
222 #define MTD_MAX_OOBFREE_ENTRIES 8
223 #define MTD_MAX_ECCPOS_ENTRIES 64