]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/linux/mtd/onenand.h
mtd: OneNAND: Introduce chip_probe function
[net-next-2.6.git] / include / linux / mtd / onenand.h
index 5509eb06b326975c6080c16f983a01d541d6eea1..0c8815bfae1c4583d3d34c24fcb58c3d4593b7db 100644 (file)
@@ -68,6 +68,7 @@ struct onenand_bufferram {
  * @write_word:                [REPLACEABLE] hardware specific function for write
  *                     register of OneNAND
  * @mmcontrol:         sync burst read function
+ * @chip_probe:                [REPLACEABLE] hardware specific function for chip probe
  * @block_markbad:     function to mark a block as bad
  * @scan_bbt:          [REPLACEALBE] hardware specific function for scanning
  *                     Bad block Table
@@ -114,6 +115,7 @@ struct onenand_chip {
        unsigned short (*read_word)(void __iomem *addr);
        void (*write_word)(unsigned short value, void __iomem *addr);
        void (*mmcontrol)(struct mtd_info *mtd, int sync_read);
+       int (*chip_probe)(struct mtd_info *mtd);
        int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
        int (*scan_bbt)(struct mtd_info *mtd);
 
@@ -125,6 +127,9 @@ struct onenand_chip {
        flstate_t               state;
        unsigned char           *page_buf;
        unsigned char           *oob_buf;
+#ifdef CONFIG_MTD_ONENAND_VERIFY_WRITE
+       unsigned char           *verify_buf;
+#endif
 
        int                     subpagesize;
        struct nand_ecclayout   *ecclayout;
@@ -175,10 +180,14 @@ struct onenand_chip {
 #define ONENAND_HAS_CONT_LOCK          (0x0001)
 #define ONENAND_HAS_UNLOCK_ALL         (0x0002)
 #define ONENAND_HAS_2PLANE             (0x0004)
+#define ONENAND_HAS_4KB_PAGE           (0x0008)
 #define ONENAND_SKIP_UNLOCK_CHECK      (0x0100)
 #define ONENAND_PAGEBUF_ALLOC          (0x1000)
 #define ONENAND_OOBBUF_ALLOC           (0x2000)
 
+#define ONENAND_IS_4KB_PAGE(this)                                      \
+       (this->options & ONENAND_HAS_4KB_PAGE)
+
 /*
  * OneNAND Flash Manufacturer ID Codes
  */
@@ -205,6 +214,8 @@ struct mtd_partition;
 
 struct onenand_platform_data {
        void            (*mmcontrol)(struct mtd_info *mtd, int sync_read);
+       int             (*read_bufferram)(struct mtd_info *mtd, int area,
+                       unsigned char *buffer, int offset, size_t count);
        struct mtd_partition *parts;
        unsigned int    nr_parts;
 };