OneNAND: ONENAND_DISABLE_READ_WHILE_LOAD support
authorKyungmin Park <kyungmin.park@samsung.com>
Tue, 28 Jul 2009 08:34:46 +0000 (17:34 +0900)
committerKyungmin Park <kyungmin.park@samsung.com>
Tue, 28 Jul 2009 08:34:46 +0000 (17:34 +0900)
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
board/samsung/universal/onenand.c
drivers/mtd/onenand/onenand_base.c
include/linux/mtd/onenand.h

index 1a36a68..4a0b501 100644 (file)
@@ -44,6 +44,8 @@ void onenand_board_init(struct mtd_info *mtd)
 
        if (cpu_is_s5pc110()) {
                this->base = (void *) 0xB0000000;
+               this->options |= ONENAND_DISABLE_READ_WHILE_LOAD;
+               this->options |= ONENAND_RUNTIME_BADBLOCK_CHECK;
        } else {
                this->base = (void *) S5PC100_ONENAND_BASE;
 
index c721c06..ae33012 100644 (file)
@@ -475,10 +475,6 @@ static int onenand_check_bufferram(struct mtd_info *mtd, loff_t addr)
        int blockpage, found = 0;
        unsigned int i;
 
-#if defined(CONFIG_S3C64XX) || defined(CONFIG_S5PC100)
-       return 0;
-#endif
-
        if (ONENAND_IS_2PLANE(this))
                blockpage = onenand_get_2x_blockpage(mtd, addr);
        else
@@ -693,6 +689,10 @@ static int onenand_read_ops_nolock(struct mtd_info *mtd, loff_t from,
        while (!ret) {
                /* If there is more to load then start next load */
                from += thislen;
+
+               if (this->options & ONENAND_DISABLE_READ_WHILE_LOAD)
+                       goto skip_read_while_load;
+
                if (read + thislen < len) {
                        this->command(mtd, ONENAND_CMD_READ, from, writesize);
                        /*
@@ -708,7 +708,7 @@ static int onenand_read_ops_nolock(struct mtd_info *mtd, loff_t from,
                                boundary = 0;
                        ONENAND_SET_PREV_BUFFERRAM(this);
                }
-
+skip_read_while_load:
                /* While load is going, read from last bufferRAM */
                this->read_bufferram(mtd, from - thislen, ONENAND_DATARAM, buf, column, thislen);
 
@@ -733,7 +733,10 @@ static int onenand_read_ops_nolock(struct mtd_info *mtd, loff_t from,
                /* Set up for next read from bufferRAM */
                if (unlikely(boundary))
                        this->write_word(ONENAND_DDP_CHIP1, this->base + ONENAND_REG_START_ADDRESS2);
-               ONENAND_SET_NEXT_BUFFERRAM(this);
+               if (this->options & ONENAND_DISABLE_READ_WHILE_LOAD)
+                       this->command(mtd, ONENAND_CMD_READ, from, writesize);
+               else
+                       ONENAND_SET_NEXT_BUFFERRAM(this);
                buf += thislen;
                thislen = min_t(int, writesize, len - read);
                column = 0;
index 76dfce4..23d6f03 100644 (file)
@@ -136,6 +136,7 @@ struct onenand_chip {
 #define ONENAND_HAS_UNLOCK_ALL         (0x0002)
 #define ONENAND_HAS_2PLANE             (0x0004)
 #define ONENAND_RUNTIME_BADBLOCK_CHECK (0x0200)
+#define ONENAND_DISABLE_READ_WHILE_LOAD        (0x0400)
 #define ONENAND_PAGEBUF_ALLOC          (0x1000)
 #define ONENAND_OOBBUF_ALLOC           (0x2000)