inftl-user.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Parts of INFTL headers shared with userspace
  3. *
  4. */
  5. #ifndef __MTD_INFTL_USER_H__
  6. #define __MTD_INFTL_USER_H__
  7. #include <linux/types.h>
  8. #define OSAK_VERSION 0x5120
  9. #define PERCENTUSED 98
  10. #define SECTORSIZE 512
  11. /* Block Control Information */
  12. struct inftl_bci {
  13. __u8 ECCsig[6];
  14. __u8 Status;
  15. __u8 Status1;
  16. } __attribute__((packed));
  17. struct inftl_unithead1 {
  18. __u16 virtualUnitNo;
  19. __u16 prevUnitNo;
  20. __u8 ANAC;
  21. __u8 NACs;
  22. __u8 parityPerField;
  23. __u8 discarded;
  24. } __attribute__((packed));
  25. struct inftl_unithead2 {
  26. __u8 parityPerField;
  27. __u8 ANAC;
  28. __u16 prevUnitNo;
  29. __u16 virtualUnitNo;
  30. __u8 NACs;
  31. __u8 discarded;
  32. } __attribute__((packed));
  33. struct inftl_unittail {
  34. __u8 Reserved[4];
  35. __u16 EraseMark;
  36. __u16 EraseMark1;
  37. } __attribute__((packed));
  38. union inftl_uci {
  39. struct inftl_unithead1 a;
  40. struct inftl_unithead2 b;
  41. struct inftl_unittail c;
  42. };
  43. struct inftl_oob {
  44. struct inftl_bci b;
  45. union inftl_uci u;
  46. };
  47. /* INFTL Media Header */
  48. struct INFTLPartition {
  49. __u32 virtualUnits;
  50. __u32 firstUnit;
  51. __u32 lastUnit;
  52. __u32 flags;
  53. __u32 spareUnits;
  54. __u32 Reserved0;
  55. __u32 Reserved1;
  56. } __attribute__((packed));
  57. struct INFTLMediaHeader {
  58. char bootRecordID[8];
  59. __u32 NoOfBootImageBlocks;
  60. __u32 NoOfBinaryPartitions;
  61. __u32 NoOfBDTLPartitions;
  62. __u32 BlockMultiplierBits;
  63. __u32 FormatFlags;
  64. __u32 OsakVersion;
  65. __u32 PercentUsed;
  66. struct INFTLPartition Partitions[4];
  67. } __attribute__((packed));
  68. /* Partition flag types */
  69. #define INFTL_BINARY 0x20000000
  70. #define INFTL_BDTL 0x40000000
  71. #define INFTL_LAST 0x80000000
  72. #endif /* __MTD_INFTL_USER_H__ */