1 /****************************************************************************
2 ****************************************************************************
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.
10 ****************************************************************************
11 ****************************************************************************/
15 struct erase_info_user {
23 unsigned char __user *ptr;
29 #define MTD_NORFLASH 3
30 #define MTD_NANDFLASH 4
31 #define MTD_DATAFLASH 6
33 #define MTD_WRITEABLE 0x400
34 #define MTD_BIT_WRITEABLE 0x800
35 #define MTD_NO_ERASE 0x1000
36 #define MTD_STUPID_LOCK 0x2000
39 #define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)
40 #define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE)
41 #define MTD_CAP_NANDFLASH (MTD_WRITEABLE)
43 #define MTD_NANDECC_OFF 0
44 #define MTD_NANDECC_PLACE 1
45 #define MTD_NANDECC_AUTOPLACE 2
46 #define MTD_NANDECC_PLACEONLY 3
47 #define MTD_NANDECC_AUTOPL_USR 4
50 #define MTD_OTP_FACTORY 1
51 #define MTD_OTP_USER 2
53 struct mtd_info_user {
65 struct region_info_user {
78 #define MEMGETINFO _IOR('M', 1, struct mtd_info_user)
79 #define MEMERASE _IOW('M', 2, struct erase_info_user)
80 #define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf)
81 #define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf)
82 #define MEMLOCK _IOW('M', 5, struct erase_info_user)
83 #define MEMUNLOCK _IOW('M', 6, struct erase_info_user)
84 #define MEMGETREGIONCOUNT _IOR('M', 7, int)
85 #define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user)
86 #define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo)
87 #define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo)
88 #define MEMGETBADBLOCK _IOW('M', 11, loff_t)
89 #define MEMSETBADBLOCK _IOW('M', 12, loff_t)
90 #define OTPSELECT _IOR('M', 13, int)
91 #define OTPGETREGIONCOUNT _IOW('M', 14, int)
92 #define OTPGETREGIONINFO _IOW('M', 15, struct otp_info)
93 #define OTPLOCK _IOR('M', 16, struct otp_info)
94 #define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout)
95 #define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats)
96 #define MTDFILEMODE _IO('M', 19)
101 uint32_t oobfree[8][2];
105 struct nand_oobfree {
110 #define MTD_MAX_OOBFREE_ENTRIES 8
112 struct nand_ecclayout {
116 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES];
119 struct mtd_ecc_stats {
126 enum mtd_file_modes {
127 MTD_MODE_NORMAL = MTD_OTP_OFF,
128 MTD_MODE_OTP_FACTORY = MTD_OTP_FACTORY,
129 MTD_MODE_OTP_USER = MTD_OTP_USER,