mtd/include/linux/mtd nand.h,1.51,1.52

gleixner at infradead.org gleixner at infradead.org
Fri May 28 19:02:37 EDT 2004


Update of /home/cvs/mtd/include/linux/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv30660

Modified Files:
	nand.h 
Log Message:
Make bad block table per chip default. Fake bad blocks in the bbt region. Signed-off-by: Thomas Gleixner <tglx at linutronix.de>

Index: nand.h
===================================================================
RCS file: /home/cvs/mtd/include/linux/mtd/nand.h,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- nand.h	28 May 2004 11:15:31 -0000	1.51
+++ nand.h	28 May 2004 23:02:34 -0000	1.52
@@ -104,6 +104,7 @@
 #define NAND_CMD_READOOB	0x50
 #define NAND_CMD_ERASE1		0x60
 #define NAND_CMD_STATUS		0x70
+#define NAND_CMD_STATUS_MULTI	0x71
 #define NAND_CMD_SEQIN		0x80
 #define NAND_CMD_READID		0x90
 #define NAND_CMD_ERASE2		0xd0
@@ -239,6 +240,7 @@
  * @state: 		[INTERN] the current state of the NAND device
  * @page_shift:		[INTERN] number of address bits in a page (column address bits)
  * @erase_shift:	[INTERN] number of address bits in an eraseblock
+ * @chip_shift:		[INTERN] number of address bits in one chip
  * @data_buf:		[INTERN] internal buffer for one page + oob 
  * @oob_buf:		[INTERN] oob buffer for one eraseblock
  * @oobdirty:		[INTERN] indicates that oob_buf must be reinitialized
@@ -254,7 +256,6 @@
  * @bbt:		[INTERN] bad block table pointer
  * @bbt_td:		[REPLACEABLE] bad block table descriptor for flash lookup
  * @bbt_md:		[REPLACEABLE] bad block table mirror descriptor
- * @bbt_size:		[INTERN] chip size reserved for the bbt tables 
  * @priv:		[OPTIONAL] pointer to private chip date
  */
  
@@ -291,6 +292,7 @@
 	nand_state_t 	state;
 	int 		page_shift;
 	int		erase_shift;
+	int		chip_shift;
 	u_char 		*data_buf;
 	u_char		*oob_buf;
 	int		oobdirty;
@@ -305,7 +307,6 @@
 	uint8_t		*bbt;
 	struct nand_bbt_descr	*bbt_td;
 	struct nand_bbt_descr	*bbt_md;
-	unsigned long	bbt_size;
 	void		*priv;
 };
 
@@ -380,7 +381,7 @@
 	int	pages[NAND_MAX_CHIPS];
 	int	offs;
 	int	veroffs;
-	int	version;
+	int	version[NAND_MAX_CHIPS];
 	int	len;
 	int 	maxblocks;
 	uint8_t	*pattern;
@@ -414,15 +415,16 @@
 #define NAND_BBT_WRITE		0x00001000
 /* Read and write back block contents when writing bbt */
 #define NAND_BBT_SAVECONTENT	0x00002000
-/* Automatically reduce device size if last block based bbts are used */
-#define NAND_BBT_REDUCESIZE	0x00004000
 
 /* The maximum number of blocks to scan for a bbt */
 #define NAND_BBT_SCAN_MAXBLOCKS	4
 
 extern int nand_scan_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd);
-extern int nand_update_bbt (struct mtd_info *mtd);
+extern int nand_update_bbt (struct mtd_info *mtd, loff_t offs);
 extern int nand_default_bbt (struct mtd_info *mtd);
+extern int nand_isbad_bbt (struct mtd_info *mtd, loff_t offs, int allowbbt);
+extern int nand_erase_nand (struct mtd_info *mtd, struct erase_info *instr, int allowbbt);
+
 /*
 * Constants for oob configuration
 */





More information about the linux-mtd-cvs mailing list