vserver 1.9.5.x5
[linux-2.6.git] / include / linux / mtd / nand.h
index 7de9f8d..9a19c65 100644 (file)
@@ -5,7 +5,7 @@
  *                     Steven J. Hill <sjhill@realitydiluted.com>
  *                    Thomas Gleixner <tglx@linutronix.de>
  *
- * $Id: nand.h,v 1.63 2004/07/07 16:29:43 gleixner Exp $
+ * $Id: nand.h,v 1.68 2004/11/12 10:40:37 gleixner Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -138,6 +138,8 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
 #define NAND_ECC_HW6_512       4
 /* Hardware ECC 8 byte ECC per 512 Byte data */
 #define NAND_ECC_HW8_512       6
+/* Hardware ECC 12 byte ECC per 2048 Byte data */
+#define NAND_ECC_HW12_2048     7
 
 /*
  * Constants for Hardware ECC
@@ -212,6 +214,18 @@ typedef enum {
        FL_CACHEDPRG,
 } nand_state_t;
 
+/* Keep gcc happy */
+struct nand_chip;
+
+/**
+ * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independend devices
+ * @lock:               protection lock  
+ * @active:            the mtd device which holds the controller currently
+ */
+struct nand_hw_control {
+       spinlock_t       lock;
+       struct nand_chip *active;
+};
 
 /**
  * struct nand_chip - NAND Private Flash Chip Data
@@ -241,6 +255,7 @@ typedef enum {
  * @scan_bbt:          [REPLACEABLE] function to scan bad block table
  * @eccmode:           [BOARDSPECIFIC] mode of ecc, see defines 
  * @eccsize:           [INTERN] databytes used per ecc-calculation
+ * @eccbytes:          [INTERN] number of ecc bytes per ecc-calculation step
  * @eccsteps:          [INTERN] number of ecc calculation steps per page
  * @chip_delay:                [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR)
  * @chip_lock:         [INTERN] spinlock used to protect access to this structure and the chip
@@ -265,12 +280,14 @@ typedef enum {
  * @bbt:               [INTERN] bad block table pointer
  * @bbt_td:            [REPLACEABLE] bad block table descriptor for flash lookup
  * @bbt_md:            [REPLACEABLE] bad block table mirror descriptor
+ * @badblock_pattern:  [REPLACEABLE] bad block scan pattern used for initial bad block scan 
+ * @controller:                [OPTIONAL] a pointer to a hardware controller structure which is shared among multiple independend devices
  * @priv:              [OPTIONAL] pointer to private chip date
  */
  
 struct nand_chip {
-       unsigned long   IO_ADDR_R;
-       unsigned long   IO_ADDR_W;
+       void  __iomem   *IO_ADDR_R;
+       void  __iomem   *IO_ADDR_W;
        
        u_char          (*read_byte)(struct mtd_info *mtd);
        void            (*write_byte)(struct mtd_info *mtd, u_char byte);
@@ -294,6 +311,7 @@ struct nand_chip {
        int             (*scan_bbt)(struct mtd_info *mtd);
        int             eccmode;
        int             eccsize;
+       int             eccbytes;
        int             eccsteps;
        int             chip_delay;
        spinlock_t      chip_lock;
@@ -317,6 +335,8 @@ struct nand_chip {
        uint8_t         *bbt;
        struct nand_bbt_descr   *bbt_td;
        struct nand_bbt_descr   *bbt_md;
+       struct nand_bbt_descr   *badblock_pattern;
+       struct nand_hw_control  *controller;
        void            *priv;
 };