]> git.ipfire.org Git - people/ms/u-boot.git/blame - include/linux/mtd/nftl.h
Update MTD to that of Linux 2.6.22.1
[people/ms/u-boot.git] / include / linux / mtd / nftl.h
CommitLineData
cfa460ad
WJ
1/*
2 * $Id: nftl.h,v 1.16 2004/06/30 14:49:00 dbrown Exp $
3 *
4 * (C) 1999-2003 David Woodhouse <dwmw2@infradead.org>
5 */
a1e329b4
WD
6
7#ifndef __MTD_NFTL_H__
8#define __MTD_NFTL_H__
9
cfa460ad
WJ
10#include <linux/mtd/mtd.h>
11#include <linux/mtd/blktrans.h>
a1e329b4 12
cfa460ad 13#include <linux/mtd/nftl-user.h>
a1e329b4
WD
14
15/* these info are used in ReplUnitTable */
16#define BLOCK_NIL 0xffff /* last block of a chain */
17#define BLOCK_FREE 0xfffe /* free block */
18#define BLOCK_NOTEXPLORED 0xfffd /* non explored block, only used during mounting */
19#define BLOCK_RESERVED 0xfffc /* bios block or bad block */
20
21struct NFTLrecord {
cfa460ad 22 struct mtd_blktrans_dev mbd;
a1e329b4
WD
23 __u16 MediaUnit, SpareMediaUnit;
24 __u32 EraseSize;
25 struct NFTLMediaHeader MediaHdr;
26 int usecount;
27 unsigned char heads;
28 unsigned char sectors;
29 unsigned short cylinders;
30 __u16 numvunits;
31 __u16 lastEUN; /* should be suppressed */
32 __u16 numfreeEUNs;
53677ef1 33 __u16 LastFreeEUN; /* To speed up finding a free EUN */
a1e329b4 34 int head,sect,cyl;
53677ef1
WD
35 __u16 *EUNtable; /* [numvunits]: First EUN for each virtual unit */
36 __u16 *ReplUnitTable; /* [numEUNs]: ReplUnitNumber for each */
cfa460ad
WJ
37 unsigned int nb_blocks; /* number of physical blocks */
38 unsigned int nb_boot_blocks; /* number of blocks used by the bios */
39 struct erase_info instr;
40 struct nand_ecclayout oobinfo;
a1e329b4
WD
41};
42
cfa460ad
WJ
43int NFTL_mount(struct NFTLrecord *s);
44int NFTL_formatblock(struct NFTLrecord *s, int block);
45
46#ifndef NFTL_MAJOR
47#define NFTL_MAJOR 93
48#endif
49
a1e329b4 50#define MAX_NFTLS 16
cfa460ad 51#define MAX_SECTORS_PER_UNIT 64
a1e329b4
WD
52#define NFTL_PARTN_BITS 4
53
54#endif /* __MTD_NFTL_H__ */