2 /* Defines for NAND Flash Translation Layer */
3 /* (c) 1999 Machine Vision Holdings, Inc. */
5 /* $Id: nftl.h,v 1.10 2000/12/29 00:25:38 dwmw2 Exp $ */
10 /* Block Control Information */
13 unsigned char ECCSig[6];
16 }__attribute__((packed));
18 /* Unit Control Information */
23 __u16 SpareVirtUnitNum;
24 __u16 SpareReplUnitNum;
25 } __attribute__((packed));
31 } __attribute__((packed));
37 } __attribute__((packed));
50 /* NFTL Media Header */
52 struct NFTLMediaHeader {
55 __u16 FirstPhysicalEUN;
57 unsigned char UnitSizeFactor;
58 } __attribute__((packed));
60 #define MAX_ERASE_ZONES (8192 - 512)
62 #define ERASE_MARK 0x3c69
63 #define SECTOR_FREE 0xff
64 #define SECTOR_USED 0x55
65 #define SECTOR_IGNORE 0x11
66 #define SECTOR_DELETED 0x00
68 #define FOLD_MARK_IN_PROGRESS 0x5555
70 #define ZONE_GOOD 0xff
71 #define ZONE_BAD_ORIGINAL 0
72 #define ZONE_BAD_MARKED 7
74 /* these info are used in ReplUnitTable */
75 #define BLOCK_NIL 0xffff /* last block of a chain */
76 #define BLOCK_FREE 0xfffe /* free block */
77 #define BLOCK_NOTEXPLORED 0xfffd /* non explored block, only used during mounting */
78 #define BLOCK_RESERVED 0xfffc /* bios block or bad block */
81 struct DiskOnChip *mtd;
82 __u16 MediaUnit, SpareMediaUnit;
84 struct NFTLMediaHeader MediaHdr;
87 unsigned char sectors;
88 unsigned short cylinders;
90 __u16 lastEUN; /* should be suppressed */
92 __u16 LastFreeEUN; /* To speed up finding a free EUN */
95 __u16 *EUNtable; /* [numvunits]: First EUN for each virtual unit */
96 __u16 *ReplUnitTable; /* [numEUNs]: ReplUnitNumber for each */
97 unsigned int nb_blocks; /* number of physical blocks */
98 unsigned int nb_boot_blocks; /* number of blocks used by the bios */
102 #define MAX_SECTORS_PER_UNIT 32
103 #define NFTL_PARTN_BITS 4
105 #endif /* __MTD_NFTL_H__ */