From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyungmin Park Date: Tue, 22 Jul 2008 17:09:19 +0900 Subject: [U-Boot-Users] [PATCH] Fix duplicated flash state Message-ID: <20080722080919.GA14956@july> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Move to one place I just compiled test. Please check other NAND users. Signed-off-by: Kyungmin Park --- diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 05ba375..ce9d937 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -19,6 +19,20 @@ #define MTD_ERASE_DONE 0x08 #define MTD_ERASE_FAILED 0x10 +/* + * Enumeration for NAND/OneNAND flash chip state + */ +enum { + FL_READY, + FL_READING, + FL_WRITING, + FL_ERASING, + FL_SYNCING, + FL_CACHEDPRG, + FL_UNLOCKING, + FL_LOCKING, +}; + /* If the erase fails, fail_addr might indicate exactly which block failed. If fail_addr = 0xffffffff, the failure was not at the device level or was not specific to any particular block. */ diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index e2a25a6..0b64d3c 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -195,20 +195,6 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_ /* Nand scan has allocated data_buf */ #define NAND_DATABUF_ALLOC 0x80000000 - -/* - * nand_state_t - chip states - * Enumeration for NAND flash chip state - */ -typedef enum { - FL_READY, - FL_READING, - FL_WRITING, - FL_ERASING, - FL_SYNCING, - FL_CACHEDPRG, -} nand_state_t; - /* Keep gcc happy */ struct nand_chip; diff --git a/include/linux/mtd/nand_legacy.h b/include/linux/mtd/nand_legacy.h index b05e726..bb66e45 100644 --- a/include/linux/mtd/nand_legacy.h +++ b/include/linux/mtd/nand_legacy.h @@ -55,18 +55,6 @@ #define NAND_CMD_RESET 0xff /* - * Enumeration for NAND flash chip state - */ -typedef enum { - FL_READY, - FL_READING, - FL_WRITING, - FL_ERASING, - FL_SYNCING -} nand_state_t; - - -/* * NAND Private Flash Chip Data * * Structure overview: diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index 4b0c2df..903c3af 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h @@ -17,6 +17,7 @@ /* Note: The header order is impoertant */ #include +#include #include #define MAX_BUFFERRAM 2 @@ -28,20 +29,6 @@ extern int onenand_scan (struct mtd_info *mtd, int max_chips); extern void onenand_release (struct mtd_info *mtd); /** - * onenand_state_t - chip states - * Enumeration for OneNAND flash chip state - */ -typedef enum { - FL_READY, - FL_READING, - FL_WRITING, - FL_ERASING, - FL_SYNCING, - FL_UNLOCKING, - FL_LOCKING, -} onenand_state_t; - -/** * struct onenand_bufferram - OneNAND BufferRAM Data * @param block block address in BufferRAM * @param page page address in BufferRAM @@ -106,7 +93,7 @@ struct onenand_chip { spinlock_t chip_lock; wait_queue_head_t wq; - onenand_state_t state; + int state; struct nand_oobinfo *autooob;