Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Thomas Gleixner | e4f0648 | 2005-11-07 11:15:37 +0000 | [diff] [blame] | 2 | * Parts of INFTL headers shared with userspace |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * |
| 4 | */ |
| 5 | |
| 6 | #ifndef __MTD_INFTL_USER_H__ |
| 7 | #define __MTD_INFTL_USER_H__ |
| 8 | |
Jaswinder Singh Rajput | 70c2ed6 | 2009-01-30 22:32:35 +0530 | [diff] [blame] | 9 | #include <linux/types.h> |
| 10 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | #define OSAK_VERSION 0x5120 |
| 12 | #define PERCENTUSED 98 |
| 13 | |
| 14 | #define SECTORSIZE 512 |
| 15 | |
| 16 | /* Block Control Information */ |
| 17 | |
| 18 | struct inftl_bci { |
Arnd Bergmann | ccef7ab | 2009-02-26 00:51:41 +0100 | [diff] [blame] | 19 | __u8 ECCsig[6]; |
| 20 | __u8 Status; |
| 21 | __u8 Status1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | } __attribute__((packed)); |
| 23 | |
| 24 | struct inftl_unithead1 { |
Arnd Bergmann | ccef7ab | 2009-02-26 00:51:41 +0100 | [diff] [blame] | 25 | __u16 virtualUnitNo; |
| 26 | __u16 prevUnitNo; |
| 27 | __u8 ANAC; |
| 28 | __u8 NACs; |
| 29 | __u8 parityPerField; |
| 30 | __u8 discarded; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | } __attribute__((packed)); |
| 32 | |
| 33 | struct inftl_unithead2 { |
Arnd Bergmann | ccef7ab | 2009-02-26 00:51:41 +0100 | [diff] [blame] | 34 | __u8 parityPerField; |
| 35 | __u8 ANAC; |
| 36 | __u16 prevUnitNo; |
| 37 | __u16 virtualUnitNo; |
| 38 | __u8 NACs; |
| 39 | __u8 discarded; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | } __attribute__((packed)); |
| 41 | |
| 42 | struct inftl_unittail { |
Arnd Bergmann | ccef7ab | 2009-02-26 00:51:41 +0100 | [diff] [blame] | 43 | __u8 Reserved[4]; |
| 44 | __u16 EraseMark; |
| 45 | __u16 EraseMark1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | } __attribute__((packed)); |
| 47 | |
| 48 | union inftl_uci { |
| 49 | struct inftl_unithead1 a; |
| 50 | struct inftl_unithead2 b; |
| 51 | struct inftl_unittail c; |
| 52 | }; |
| 53 | |
| 54 | struct inftl_oob { |
| 55 | struct inftl_bci b; |
| 56 | union inftl_uci u; |
| 57 | }; |
| 58 | |
| 59 | |
| 60 | /* INFTL Media Header */ |
| 61 | |
| 62 | struct INFTLPartition { |
| 63 | __u32 virtualUnits; |
| 64 | __u32 firstUnit; |
| 65 | __u32 lastUnit; |
| 66 | __u32 flags; |
| 67 | __u32 spareUnits; |
| 68 | __u32 Reserved0; |
| 69 | __u32 Reserved1; |
| 70 | } __attribute__((packed)); |
| 71 | |
| 72 | struct INFTLMediaHeader { |
| 73 | char bootRecordID[8]; |
| 74 | __u32 NoOfBootImageBlocks; |
| 75 | __u32 NoOfBinaryPartitions; |
| 76 | __u32 NoOfBDTLPartitions; |
| 77 | __u32 BlockMultiplierBits; |
| 78 | __u32 FormatFlags; |
| 79 | __u32 OsakVersion; |
| 80 | __u32 PercentUsed; |
| 81 | struct INFTLPartition Partitions[4]; |
| 82 | } __attribute__((packed)); |
| 83 | |
| 84 | /* Partition flag types */ |
| 85 | #define INFTL_BINARY 0x20000000 |
| 86 | #define INFTL_BDTL 0x40000000 |
| 87 | #define INFTL_LAST 0x80000000 |
| 88 | |
| 89 | #endif /* __MTD_INFTL_USER_H__ */ |
| 90 | |
| 91 | |