blob: e17eda302b2d6c505902d8992f89712f362c9197 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Thomas Gleixnere4f06482005-11-07 11:15:37 +00002 * Parts of INFTL headers shared with userspace
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
4 */
5
6#ifndef __MTD_INFTL_USER_H__
7#define __MTD_INFTL_USER_H__
8
9#define OSAK_VERSION 0x5120
10#define PERCENTUSED 98
11
12#define SECTORSIZE 512
13
14/* Block Control Information */
15
16struct inftl_bci {
17 uint8_t ECCsig[6];
18 uint8_t Status;
19 uint8_t Status1;
20} __attribute__((packed));
21
22struct inftl_unithead1 {
23 uint16_t virtualUnitNo;
24 uint16_t prevUnitNo;
25 uint8_t ANAC;
26 uint8_t NACs;
27 uint8_t parityPerField;
28 uint8_t discarded;
29} __attribute__((packed));
30
31struct inftl_unithead2 {
32 uint8_t parityPerField;
33 uint8_t ANAC;
34 uint16_t prevUnitNo;
35 uint16_t virtualUnitNo;
36 uint8_t NACs;
37 uint8_t discarded;
38} __attribute__((packed));
39
40struct inftl_unittail {
41 uint8_t Reserved[4];
42 uint16_t EraseMark;
43 uint16_t EraseMark1;
44} __attribute__((packed));
45
46union inftl_uci {
47 struct inftl_unithead1 a;
48 struct inftl_unithead2 b;
49 struct inftl_unittail c;
50};
51
52struct inftl_oob {
53 struct inftl_bci b;
54 union inftl_uci u;
55};
56
57
58/* INFTL Media Header */
59
60struct INFTLPartition {
61 __u32 virtualUnits;
62 __u32 firstUnit;
63 __u32 lastUnit;
64 __u32 flags;
65 __u32 spareUnits;
66 __u32 Reserved0;
67 __u32 Reserved1;
68} __attribute__((packed));
69
70struct INFTLMediaHeader {
71 char bootRecordID[8];
72 __u32 NoOfBootImageBlocks;
73 __u32 NoOfBinaryPartitions;
74 __u32 NoOfBDTLPartitions;
75 __u32 BlockMultiplierBits;
76 __u32 FormatFlags;
77 __u32 OsakVersion;
78 __u32 PercentUsed;
79 struct INFTLPartition Partitions[4];
80} __attribute__((packed));
81
82/* Partition flag types */
83#define INFTL_BINARY 0x20000000
84#define INFTL_BDTL 0x40000000
85#define INFTL_LAST 0x80000000
86
87#endif /* __MTD_INFTL_USER_H__ */
88
89