blob: accbccb52843aa92ca513383e39b738a4989622c [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef __MTD_INFTL_USER_H__
8#define __MTD_INFTL_USER_H__
9#include <linux/types.h>
10#define OSAK_VERSION 0x5120
Ben Cheng655a7c02013-10-16 16:09:24 -070011#define PERCENTUSED 98
12#define SECTORSIZE 512
13struct inftl_bci {
Tao Baod7db5942015-01-28 10:07:51 -080014 __u8 ECCsig[6];
Tao Baod7db5942015-01-28 10:07:51 -080015 __u8 Status;
16 __u8 Status1;
Ben Cheng655a7c02013-10-16 16:09:24 -070017} __attribute__((packed));
18struct inftl_unithead1 {
Tao Baod7db5942015-01-28 10:07:51 -080019 __u16 virtualUnitNo;
20 __u16 prevUnitNo;
21 __u8 ANAC;
22 __u8 NACs;
Tao Baod7db5942015-01-28 10:07:51 -080023 __u8 parityPerField;
24 __u8 discarded;
Ben Cheng655a7c02013-10-16 16:09:24 -070025} __attribute__((packed));
26struct inftl_unithead2 {
Tao Baod7db5942015-01-28 10:07:51 -080027 __u8 parityPerField;
28 __u8 ANAC;
29 __u16 prevUnitNo;
30 __u16 virtualUnitNo;
Tao Baod7db5942015-01-28 10:07:51 -080031 __u8 NACs;
32 __u8 discarded;
Ben Cheng655a7c02013-10-16 16:09:24 -070033} __attribute__((packed));
34struct inftl_unittail {
Tao Baod7db5942015-01-28 10:07:51 -080035 __u8 Reserved[4];
36 __u16 EraseMark;
37 __u16 EraseMark1;
Ben Cheng655a7c02013-10-16 16:09:24 -070038} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -070039union inftl_uci {
Tao Baod7db5942015-01-28 10:07:51 -080040 struct inftl_unithead1 a;
41 struct inftl_unithead2 b;
42 struct inftl_unittail c;
Ben Cheng655a7c02013-10-16 16:09:24 -070043};
44struct inftl_oob {
Tao Baod7db5942015-01-28 10:07:51 -080045 struct inftl_bci b;
46 union inftl_uci u;
Ben Cheng655a7c02013-10-16 16:09:24 -070047};
48struct INFTLPartition {
Tao Baod7db5942015-01-28 10:07:51 -080049 __u32 virtualUnits;
50 __u32 firstUnit;
Tao Baod7db5942015-01-28 10:07:51 -080051 __u32 lastUnit;
52 __u32 flags;
53 __u32 spareUnits;
54 __u32 Reserved0;
Tao Baod7db5942015-01-28 10:07:51 -080055 __u32 Reserved1;
Ben Cheng655a7c02013-10-16 16:09:24 -070056} __attribute__((packed));
57struct INFTLMediaHeader {
Tao Baod7db5942015-01-28 10:07:51 -080058 char bootRecordID[8];
Tao Baod7db5942015-01-28 10:07:51 -080059 __u32 NoOfBootImageBlocks;
60 __u32 NoOfBinaryPartitions;
61 __u32 NoOfBDTLPartitions;
62 __u32 BlockMultiplierBits;
Tao Baod7db5942015-01-28 10:07:51 -080063 __u32 FormatFlags;
64 __u32 OsakVersion;
65 __u32 PercentUsed;
66 struct INFTLPartition Partitions[4];
Ben Cheng655a7c02013-10-16 16:09:24 -070067} __attribute__((packed));
68#define INFTL_BINARY 0x20000000
69#define INFTL_BDTL 0x40000000
70#define INFTL_LAST 0x80000000
Ben Cheng655a7c02013-10-16 16:09:24 -070071#endif