blob: 3641554e8e7e503f5b987ddf68a57ef68a5d237b [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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>
22struct erase_info_user {
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24 __u32 start;
25 __u32 length;
26};
27struct erase_info_user64 {
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29 __u64 start;
30 __u64 length;
31};
32struct 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 */
39struct 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};
46enum {
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};
52struct 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 Ferrisba8d4f42014-09-03 19:56:49 -070084#define MTD_CAP_NVRAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)
Ben Cheng655a7c02013-10-16 16:09:24 -070085#define MTD_NANDECC_OFF 0
86#define MTD_NANDECC_PLACE 1
87#define MTD_NANDECC_AUTOPLACE 2
Ben Cheng655a7c02013-10-16 16:09:24 -070088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070089#define MTD_NANDECC_PLACEONLY 3
Ben Cheng655a7c02013-10-16 16:09:24 -070090#define MTD_NANDECC_AUTOPL_USR 4
91#define MTD_OTP_OFF 0
92#define MTD_OTP_FACTORY 1
Ben Cheng655a7c02013-10-16 16:09:24 -070093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070094#define MTD_OTP_USER 2
Ben Cheng655a7c02013-10-16 16:09:24 -070095struct mtd_info_user {
96 __u8 type;
97 __u32 flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070099 __u32 size;
Ben Cheng655a7c02013-10-16 16:09:24 -0700100 __u32 erasesize;
101 __u32 writesize;
102 __u32 oobsize;
Ben Cheng655a7c02013-10-16 16:09:24 -0700103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700104 __u64 padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700105};
106struct region_info_user {
107 __u32 offset;
Ben Cheng655a7c02013-10-16 16:09:24 -0700108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700109 __u32 erasesize;
Ben Cheng655a7c02013-10-16 16:09:24 -0700110 __u32 numblocks;
111 __u32 regionindex;
112};
Ben Cheng655a7c02013-10-16 16:09:24 -0700113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700114struct otp_info {
Ben Cheng655a7c02013-10-16 16:09:24 -0700115 __u32 start;
116 __u32 length;
117 __u32 locked;
Ben Cheng655a7c02013-10-16 16:09:24 -0700118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700119};
Ben Cheng655a7c02013-10-16 16:09:24 -0700120#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 Cheng655a7c02013-10-16 16:09:24 -0700123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700124#define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf)
Ben Cheng655a7c02013-10-16 16:09:24 -0700125#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 Cheng655a7c02013-10-16 16:09:24 -0700128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700129#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user)
Ben Cheng655a7c02013-10-16 16:09:24 -0700130#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 Cheng655a7c02013-10-16 16:09:24 -0700133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700134#define OTPSELECT _IOR('M', 13, int)
Ben Cheng655a7c02013-10-16 16:09:24 -0700135#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 Cheng655a7c02013-10-16 16:09:24 -0700138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700139#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout_user)
Ben Cheng655a7c02013-10-16 16:09:24 -0700140#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 Cheng655a7c02013-10-16 16:09:24 -0700143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700144#define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64)
Ben Cheng655a7c02013-10-16 16:09:24 -0700145#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 Cheng655a7c02013-10-16 16:09:24 -0700148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700149struct nand_oobinfo {
Ben Cheng655a7c02013-10-16 16:09:24 -0700150 __u32 useecc;
151 __u32 eccbytes;
152 __u32 oobfree[8][2];
Ben Cheng655a7c02013-10-16 16:09:24 -0700153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700154 __u32 eccpos[32];
Ben Cheng655a7c02013-10-16 16:09:24 -0700155};
156struct nand_oobfree {
157 __u32 offset;
Ben Cheng655a7c02013-10-16 16:09:24 -0700158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700159 __u32 length;
Ben Cheng655a7c02013-10-16 16:09:24 -0700160};
161#define MTD_MAX_OOBFREE_ENTRIES 8
162#define MTD_MAX_ECCPOS_ENTRIES 64
Ben Cheng655a7c02013-10-16 16:09:24 -0700163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700164struct nand_ecclayout_user {
Ben Cheng655a7c02013-10-16 16:09:24 -0700165 __u32 eccbytes;
166 __u32 eccpos[MTD_MAX_ECCPOS_ENTRIES];
167 __u32 oobavail;
Ben Cheng655a7c02013-10-16 16:09:24 -0700168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700169 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES];
Ben Cheng655a7c02013-10-16 16:09:24 -0700170};
171struct mtd_ecc_stats {
172 __u32 corrected;
Ben Cheng655a7c02013-10-16 16:09:24 -0700173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700174 __u32 failed;
Ben Cheng655a7c02013-10-16 16:09:24 -0700175 __u32 badblocks;
176 __u32 bbtblocks;
177};
Ben Cheng655a7c02013-10-16 16:09:24 -0700178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700179enum mtd_file_modes {
Ben Cheng655a7c02013-10-16 16:09:24 -0700180 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 Cheng655a7c02013-10-16 16:09:24 -0700183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700184 MTD_FILE_MODE_RAW,
Ben Cheng655a7c02013-10-16 16:09:24 -0700185};
186#endif