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__ 21struct erase_info_user { 22 uint32_t start; 23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 24 uint32_t length; 25}; 26struct mtd_oob_buf { 27 uint32_t start; 28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 29 uint32_t length; 30 unsigned char __user *ptr; 31}; 32#define MTD_ABSENT 0 33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 34#define MTD_RAM 1 35#define MTD_ROM 2 36#define MTD_NORFLASH 3 37#define MTD_NANDFLASH 4 38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 39#define MTD_DATAFLASH 6 40#define MTD_WRITEABLE 0x400 41#define MTD_BIT_WRITEABLE 0x800 42#define MTD_NO_ERASE 0x1000 43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 44#define MTD_STUPID_LOCK 0x2000 45#define MTD_CAP_ROM 0 46#define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE) 47#define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE) 48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 49#define MTD_CAP_NANDFLASH (MTD_WRITEABLE) 50#define MTD_NANDECC_OFF 0 51#define MTD_NANDECC_PLACE 1 52#define MTD_NANDECC_AUTOPLACE 2 53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 54#define MTD_NANDECC_PLACEONLY 3 55#define MTD_NANDECC_AUTOPL_USR 4 56#define MTD_OTP_OFF 0 57#define MTD_OTP_FACTORY 1 58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 59#define MTD_OTP_USER 2 60struct mtd_info_user { 61 uint8_t type; 62 uint32_t flags; 63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 64 uint32_t size; 65 uint32_t erasesize; 66 uint32_t writesize; 67 uint32_t oobsize; 68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 69 uint32_t ecctype; 70 uint32_t eccsize; 71}; 72struct region_info_user { 73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 74 uint32_t offset; 75 uint32_t erasesize; 76 uint32_t numblocks; 77 uint32_t regionindex; 78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 79}; 80struct otp_info { 81 uint32_t start; 82 uint32_t length; 83/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 84 uint32_t locked; 85}; 86#define MEMGETINFO _IOR('M', 1, struct mtd_info_user) 87#define MEMERASE _IOW('M', 2, struct erase_info_user) 88/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 89#define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf) 90#define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf) 91#define MEMLOCK _IOW('M', 5, struct erase_info_user) 92#define MEMUNLOCK _IOW('M', 6, struct erase_info_user) 93/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 94#define MEMGETREGIONCOUNT _IOR('M', 7, int) 95#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user) 96#define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo) 97#define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo) 98/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 99#define MEMGETBADBLOCK _IOW('M', 11, loff_t) 100#define MEMSETBADBLOCK _IOW('M', 12, loff_t) 101#define OTPSELECT _IOR('M', 13, int) 102#define OTPGETREGIONCOUNT _IOW('M', 14, int) 103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 104#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info) 105#define OTPLOCK _IOR('M', 16, struct otp_info) 106#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout) 107#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats) 108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 109#define MTDFILEMODE _IO('M', 19) 110struct nand_oobinfo { 111 uint32_t useecc; 112 uint32_t eccbytes; 113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 114 uint32_t oobfree[8][2]; 115 uint32_t eccpos[32]; 116}; 117struct nand_oobfree { 118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 119 uint32_t offset; 120 uint32_t length; 121}; 122#define MTD_MAX_OOBFREE_ENTRIES 8 123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 124struct nand_ecclayout { 125 uint32_t eccbytes; 126 uint32_t eccpos[64]; 127 uint32_t oobavail; 128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 129 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES]; 130}; 131struct mtd_ecc_stats { 132 uint32_t corrected; 133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 134 uint32_t failed; 135 uint32_t badblocks; 136 uint32_t bbtblocks; 137}; 138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 139enum mtd_file_modes { 140 MTD_MODE_NORMAL = MTD_OTP_OFF, 141 MTD_MODE_OTP_FACTORY = MTD_OTP_FACTORY, 142 MTD_MODE_OTP_USER = MTD_OTP_USER, 143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 144 MTD_MODE_RAW, 145}; 146#endif 147