blob: 6d5059e79cfaf13724c863ca1696b2925e2dfd88 [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_INFTL_USER_H__
20#define __MTD_INFTL_USER_H__
21#include <linux/types.h>
22#define OSAK_VERSION 0x5120
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define PERCENTUSED 98
24#define SECTORSIZE 512
25struct inftl_bci {
Tao Baod7db5942015-01-28 10:07:51 -080026 __u8 ECCsig[6];
Tao Baod7db5942015-01-28 10:07:51 -080027 __u8 Status;
28 __u8 Status1;
Ben Cheng655a7c02013-10-16 16:09:24 -070029} __attribute__((packed));
30struct inftl_unithead1 {
Tao Baod7db5942015-01-28 10:07:51 -080031 __u16 virtualUnitNo;
32 __u16 prevUnitNo;
33 __u8 ANAC;
34 __u8 NACs;
Tao Baod7db5942015-01-28 10:07:51 -080035 __u8 parityPerField;
36 __u8 discarded;
Ben Cheng655a7c02013-10-16 16:09:24 -070037} __attribute__((packed));
38struct inftl_unithead2 {
Tao Baod7db5942015-01-28 10:07:51 -080039 __u8 parityPerField;
40 __u8 ANAC;
41 __u16 prevUnitNo;
42 __u16 virtualUnitNo;
Tao Baod7db5942015-01-28 10:07:51 -080043 __u8 NACs;
44 __u8 discarded;
Ben Cheng655a7c02013-10-16 16:09:24 -070045} __attribute__((packed));
46struct inftl_unittail {
Tao Baod7db5942015-01-28 10:07:51 -080047 __u8 Reserved[4];
48 __u16 EraseMark;
49 __u16 EraseMark1;
Ben Cheng655a7c02013-10-16 16:09:24 -070050} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -070051union inftl_uci {
Tao Baod7db5942015-01-28 10:07:51 -080052 struct inftl_unithead1 a;
53 struct inftl_unithead2 b;
54 struct inftl_unittail c;
Ben Cheng655a7c02013-10-16 16:09:24 -070055};
56struct inftl_oob {
Tao Baod7db5942015-01-28 10:07:51 -080057 struct inftl_bci b;
58 union inftl_uci u;
Ben Cheng655a7c02013-10-16 16:09:24 -070059};
60struct INFTLPartition {
Tao Baod7db5942015-01-28 10:07:51 -080061 __u32 virtualUnits;
62 __u32 firstUnit;
Tao Baod7db5942015-01-28 10:07:51 -080063 __u32 lastUnit;
64 __u32 flags;
65 __u32 spareUnits;
66 __u32 Reserved0;
Tao Baod7db5942015-01-28 10:07:51 -080067 __u32 Reserved1;
Ben Cheng655a7c02013-10-16 16:09:24 -070068} __attribute__((packed));
69struct INFTLMediaHeader {
Tao Baod7db5942015-01-28 10:07:51 -080070 char bootRecordID[8];
Tao Baod7db5942015-01-28 10:07:51 -080071 __u32 NoOfBootImageBlocks;
72 __u32 NoOfBinaryPartitions;
73 __u32 NoOfBDTLPartitions;
74 __u32 BlockMultiplierBits;
Tao Baod7db5942015-01-28 10:07:51 -080075 __u32 FormatFlags;
76 __u32 OsakVersion;
77 __u32 PercentUsed;
78 struct INFTLPartition Partitions[4];
Ben Cheng655a7c02013-10-16 16:09:24 -070079} __attribute__((packed));
80#define INFTL_BINARY 0x20000000
81#define INFTL_BDTL 0x40000000
82#define INFTL_LAST 0x80000000
Ben Cheng655a7c02013-10-16 16:09:24 -070083#endif