Fix JFFS2 support for legacy NAND driver.
authorMarian Balakowicz <m8@semihalf.com>
Sat, 8 Apr 2006 17:08:06 +0000 (19:08 +0200)
committerMarian Balakowicz <m8@semihalf.com>
Sat, 8 Apr 2006 17:08:06 +0000 (19:08 +0200)
Some more NAND cleanup and small fixes.

38 files changed:
Makefile
board/amcc/bamboo/config.mk
board/dave/PPChameleonEVB/config.mk
board/delta/config.mk
board/delta/nand.c
board/esd/ash405/config.mk
board/esd/cms700/config.mk
board/esd/common/auto_update.c
board/esd/cpci405/config.mk
board/esd/hh405/config.mk
board/esd/hub405/config.mk
board/esd/plu405/config.mk
board/esd/voh405/config.mk
board/esd/wuh405/config.mk
board/netphone/config.mk
board/netstar/config.mk
board/netta/netta.c
board/netta2/config.mk
board/netvia/config.mk
board/sixnet/config.mk
drivers/nand/diskonchip.c
drivers/nand/nand.c
drivers/nand/nand_base.c
drivers/nand/nand_bbt.c
drivers/nand/nand_ecc.c
drivers/nand/nand_ids.c
drivers/nand_legacy/nand_legacy.c
fs/jffs2/jffs2_1pass.c
include/configs/CATcenter.h
include/configs/CPU86.h
include/configs/IDS8247.h
include/configs/NC650.h
include/configs/NETTA.h
include/configs/RBC823.h
include/configs/VCMA9.h
include/configs/delta.h
include/configs/omap2420h4.h
include/configs/stxxtc.h

index af0c25a..9b93463 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -133,6 +133,8 @@ LIBS += disk/libdisk.a
 LIBS += rtc/librtc.a
 LIBS += dtt/libdtt.a
 LIBS += drivers/libdrivers.a
+LIBS += drivers/nand/libnand.a
+LIBS += drivers/nand_legacy/libnand_legacy.a
 LIBS += drivers/sk98lin/libsk98lin.a
 LIBS += post/libpost.a post/cpu/libcpu.a
 LIBS += common/libcommon.a
index 433429b..35cb655 100644 (file)
@@ -32,6 +32,3 @@ endif
 ifeq ($(dbcr),1)
 PLATFORM_CPPFLAGS += -DCFG_INIT_DBCR=0x8cff0000
 endif
-
-# legacy nand support
-BOARDLIBS = drivers/nand_legacy/libnand_legacy.a
index 1dc635f..9083aac 100644 (file)
@@ -26,9 +26,3 @@
 
 # Reserve 320 kB for Monitor
 TEXT_BASE = 0xFFFB0000
-
-# Compile the new NAND code (CFG_NAND_LEGACY mustn't be defined)
-BOARDLIBS = drivers/nand/libnand.a
-
-# Compile the legacy NAND code (CFG_NAND_LEGACY must be defined)
-#BOARDLIBS = drivers/nand_legacy/libnand_legacy.a
index 9564625..61828bb 100644 (file)
@@ -3,6 +3,3 @@
 #TEXT_BASE = 0xa3080000
 #TEXT_BASE = 0x9ffe0000
 TEXT_BASE = 0xa3008000
-
-# Compile the new NAND code (needed iff #ifdef CONFIG_NEW_NAND_CODE)
-BOARDLIBS = drivers/nand/libnand.a
index c4df6e5..7982548 100644 (file)
@@ -23,7 +23,7 @@
 #include <common.h>
 
 #if (CONFIG_COMMANDS & CFG_CMD_NAND)
-#ifdef CONFIG_NEW_NAND_CODE
+#if !defined(CFG_NAND_LEGACY)
 
 #include <nand.h>
 #include <asm/arch/pxa-regs.h>
index 3cf5dd8..1d743a9 100644 (file)
@@ -26,6 +26,3 @@
 #
 
 TEXT_BASE = 0xFFFC0000
-
-# Compile the legacy NAND code (CFG_NAND_LEGACY must be defined)
-BOARDLIBS = drivers/nand_legacy/libnand_legacy.a
index 0c56c40..5c3c01c 100644 (file)
@@ -26,6 +26,3 @@
 #
 
 TEXT_BASE = 0xFFFC0000
-
-# Compile the legacy NAND code (CFG_NAND_LEGACY must be defined)
-BOARDLIBS = drivers/nand_legacy/libnand_legacy.a
index cad8211..5cd3423 100644 (file)
@@ -24,8 +24,8 @@
 
 #include <common.h>
 
-#ifndef CFG_NAND_LEGACY
-#error CFG_NAND_LEGACY not defined in a file using the legacy NAND support!
+#if (CONFIG_COMMANDS & CFG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
+#warning CFG_NAND_LEGACY not defined in a file using the legacy NAND support!
 #endif
 
 #include <command.h>
@@ -74,7 +74,7 @@ extern int flash_write (char *, ulong, ulong);
 /* change char* to void* to shutup the compiler */
 extern block_dev_desc_t *get_dev (char*, int);
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
 /* references to names in cmd_nand.c */
 #define NANDRW_READ    0x01
 #define NANDRW_WRITE   0x00
@@ -84,7 +84,7 @@ extern struct nand_chip nand_dev_desc[];
 extern int nand_legacy_rw(struct nand_chip* nand, int cmd, size_t start, size_t len,
                   size_t * retlen, u_char * buf);
 extern int nand_legacy_erase(struct nand_chip* nand, size_t ofs, size_t len, int clean);
-#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) */
+#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY) */
 
 extern block_dev_desc_t ide_dev_desc[CFG_IDE_MAXDEVICE];
 
@@ -188,7 +188,7 @@ int au_do_update(int i, long sz)
        int off, rc;
        uint nbytes;
        int k;
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
        int total;
 #endif
 
@@ -262,7 +262,7 @@ int au_do_update(int i, long sz)
                        debug ("flash_sect_erase(%lx, %lx);\n", start, end);
                        flash_sect_erase(start, end);
                } else {
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
                        printf("Updating NAND FLASH with image %s\n", au_image[i].name);
                        debug ("nand_legacy_erase(%lx, %lx);\n", start, end);
                        rc = nand_legacy_erase (nand_dev_desc, start, end - start + 1, 0);
@@ -290,7 +290,7 @@ int au_do_update(int i, long sz)
                        debug ("flash_write(%p, %lx %x)\n", addr, start, nbytes);
                        rc = flash_write((char *)addr, start, nbytes);
                } else {
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
                        debug ("nand_legacy_rw(%p, %lx %x)\n", addr, start, nbytes);
                        rc = nand_legacy_rw(nand_dev_desc, NANDRW_WRITE | NANDRW_JFFS2,
                                     start, nbytes, (size_t *)&total, (uchar *)addr);
@@ -308,7 +308,7 @@ int au_do_update(int i, long sz)
                if (au_image[i].type != AU_NAND) {
                        rc = crc32 (0, (uchar *)(start + off), ntohl(hdr->ih_size));
                } else {
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
                        rc = nand_legacy_rw(nand_dev_desc, NANDRW_READ | NANDRW_JFFS2 | NANDRW_JFFS2_SKIP,
                                     start, nbytes, (size_t *)&total, (uchar *)addr);
                        rc = crc32 (0, (uchar *)(addr + off), ntohl(hdr->ih_size));
index ceff4c4..0be45c7 100644 (file)
@@ -38,6 +38,3 @@ TEXT_BASE = 0xFFFD0000
 endif
 endif
 endif
-
-# Compile the legacy NAND code (CFG_NAND_LEGACY must be defined)
-BOARDLIBS = drivers/nand_legacy/libnand_legacy.a
index 798a3fa..7129ad5 100644 (file)
@@ -29,6 +29,3 @@
 TEXT_BASE = 0xFFF80000
 #TEXT_BASE = 0xFFFC0000
 #TEXT_BASE = 0x00FC0000
-
-# Compile the legacy NAND code (CFG_NAND_LEGACY must be defined)
-BOARDLIBS = drivers/nand_legacy/libnand_legacy.a
index 4c60c35..a6d31aa 100644 (file)
@@ -26,6 +26,3 @@
 #
 
 TEXT_BASE = 0xFFFC0000
-
-# Compile the legacy NAND code (CFG_NAND_LEGACY must be defined)
-BOARDLIBS = drivers/nand_legacy/libnand_legacy.a
index 916b285..25b2105 100644 (file)
@@ -27,6 +27,3 @@
 
 TEXT_BASE = 0xFFFC0000
 #TEXT_BASE = 0x00FC0000
-
-# Compile the legacy NAND code (CFG_NAND_LEGACY must be defined)
-BOARDLIBS = drivers/nand_legacy/libnand_legacy.a
index 72e8103..219a4eb 100644 (file)
@@ -26,6 +26,3 @@
 #
 
 TEXT_BASE = 0xFFF80000
-
-# Compile the legacy NAND code (CFG_NAND_LEGACY must be defined)
-BOARDLIBS = drivers/nand_legacy/libnand_legacy.a
index 3cf5dd8..1d743a9 100644 (file)
@@ -26,6 +26,3 @@
 #
 
 TEXT_BASE = 0xFFFC0000
-
-# Compile the legacy NAND code (CFG_NAND_LEGACY must be defined)
-BOARDLIBS = drivers/nand_legacy/libnand_legacy.a
index de179c2..8497ebc 100644 (file)
@@ -26,6 +26,3 @@
 #
 
 TEXT_BASE = 0x40000000
-
-# Compile the legacy NAND code (CFG_NAND_LEGACY must be defined)
-BOARDLIBS = drivers/nand_legacy/libnand_legacy.a
index 50d647a..8b73e97 100644 (file)
@@ -9,6 +9,3 @@
 
 # XXX TEXT_BASE = 0x20012000
 TEXT_BASE = 0x13FC0000
-
-# Compile the new NAND code
-BOARDLIBS = drivers/nand/libnand.a
index 9194bfb..4923e3a 100644 (file)
@@ -555,9 +555,9 @@ int board_early_init_f(void)
        return 0;
 }
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
 
-#include <linux/mtd/nand.h>
+#include <linux/mtd/nand_legacy.h>
 
 extern ulong nand_probe(ulong physadr);
 extern struct nand_chip nand_dev_desc[CFG_MAX_NAND_DEVICE];
index de179c2..8497ebc 100644 (file)
@@ -26,6 +26,3 @@
 #
 
 TEXT_BASE = 0x40000000
-
-# Compile the legacy NAND code (CFG_NAND_LEGACY must be defined)
-BOARDLIBS = drivers/nand_legacy/libnand_legacy.a
index 583174a..9dddaad 100644 (file)
@@ -26,6 +26,3 @@
 #
 
 TEXT_BASE = 0x40000000
-
-# Compile the legacy NAND code (CFG_NAND_LEGACY must be defined)
-BOARDLIBS = drivers/nand_legacy/libnand_legacy.a
index 8e73d2f..0cd8f44 100644 (file)
@@ -26,6 +26,3 @@
 #
 
 TEXT_BASE = 0xF8000000
-
-# Compile the legacy NAND code (CFG_NAND_LEGACY must be defined)
-BOARDLIBS = drivers/nand_legacy/libnand_legacy.a
index afaae83..e17af70 100644 (file)
@@ -21,9 +21,7 @@
 
 #include <common.h>
 
-#ifdef CFG_NAND_LEGACY
-#error CFG_NAND_LEGACY defined in a file not using the legacy NAND support!
-#endif
+#if !defined(CFG_NAND_LEGACY)
 
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -1786,3 +1784,4 @@ module_exit(cleanup_nanddoc);
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
 MODULE_DESCRIPTION("M-Systems DiskOnChip 2000, Millennium and Millennium Plus device driver\n");
+#endif
index dd80026..e1781fc 100644 (file)
 
 #include <common.h>
 
-#ifdef CFG_NAND_LEGACY
-#error CFG_NAND_LEGACY defined in a file not using the legacy NAND support!
-#endif
-
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if (CONFIG_COMMANDS & CFG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
 
 #include <nand.h>
 
index e0b4060..b7a5d32 100644 (file)
 
 #include <common.h>
 
-#ifdef CFG_NAND_LEGACY
-#error CFG_NAND_LEGACY defined in a file not using the legacy NAND support!
-#endif
-
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if (CONFIG_COMMANDS & CFG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
 
 #include <malloc.h>
 #include <watchdog.h>
index ac16872..aaa9400 100644 (file)
 
 #include <common.h>
 
-#ifdef CFG_NAND_LEGACY
-#error CFG_NAND_LEGACY defined in a file not using the legacy NAND support!
-#endif
-
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if (CONFIG_COMMANDS & CFG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
 
 #include <malloc.h>
 #include <linux/mtd/compat.h>
index e0d0e8b..f33be96 100644 (file)
 
 #include <common.h>
 
-#ifdef CFG_NAND_LEGACY
-#error CFG_NAND_LEGACY defined in a file not using the legacy NAND support!
-#endif
-
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if (CONFIG_COMMANDS & CFG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
 
 #include<linux/mtd/mtd.h>
 /*
index 3d4d372..8b58736 100644 (file)
 
 #include <common.h>
 
-#ifdef CFG_NAND_LEGACY
-#error CFG_NAND_LEGACY defined in a file not using the legacy NAND support!
-#endif
-
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if (CONFIG_COMMANDS & CFG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
 
 #include <linux/mtd/nand.h>
 
index 3989ca2..458046d 100644 (file)
  */
 
 #include <common.h>
-
-#ifndef CFG_NAND_LEGACY
-#error CFG_NAND_LEGACY not defined in a file using the legacy NAND support!
-#endif
-
 #include <command.h>
 #include <malloc.h>
 #include <asm/io.h>
@@ -27,7 +22,7 @@
 # define SHOW_BOOT_PROGRESS(arg)
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
 
 #include <linux/mtd/nand_legacy.h>
 #include <linux/mtd/nand_ids.h>
@@ -1612,4 +1607,13 @@ static int nand_correct_data (u_char *dat, u_char *read_ecc, u_char *calc_ecc)
 
 #endif
 
-#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) */
+#ifdef CONFIG_JFFS2_NAND
+int read_jffs2_nand(size_t start, size_t len,
+               size_t * retlen, u_char * buf, int nanddev)
+{
+       return nand_legacy_rw(nand_dev_desc + nanddev, NANDRW_READ | NANDRW_JFFS2,
+                       start, len, retlen, buf);
+}
+#endif /* CONFIG_JFFS2_NAND */
+
+#endif /* (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY) */
index 49c8652..41ff4c1 100644 (file)
 static struct part_info *current_part;
 
 #if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if defined(CFG_NAND_LEGACY)
+#include <linux/mtd/nand_legacy.h>
+#else
 #include <nand.h>
+#endif
 /*
  * Support for jffs2 on top of NAND-flash
  *
@@ -155,8 +159,14 @@ static struct part_info *current_part;
  *
  */
 
+#if defined(CFG_NAND_LEGACY)
+/* this one defined in nand_legacy.c */
+int read_jffs2_nand(size_t start, size_t len,
+               size_t * retlen, u_char * buf, int nanddev);
+#else
 /* info for NAND chips, defined in drivers/nand/nand.c */
 extern nand_info_t nand_info[];
+#endif
 
 #define NAND_PAGE_SIZE 512
 #define NAND_PAGE_SHIFT 9
@@ -167,7 +177,6 @@ extern nand_info_t nand_info[];
 #endif
 #define NAND_CACHE_SIZE (NAND_CACHE_PAGES*NAND_PAGE_SIZE)
 
-#ifdef CFG_NAND_LEGACY
 static u8* nand_cache = NULL;
 static u32 nand_cache_off = (u32)-1;
 
@@ -175,7 +184,11 @@ static int read_nand_cached(u32 off, u32 size, u_char *buf)
 {
        struct mtdids *id = current_part->dev->id;
        u32 bytes_read = 0;
+#if defined(CFG_NAND_LEGACY)
+       size_t retlen;
+#else
        ulong retlen;
+#endif
        int cpy_bytes;
 
        while (bytes_read < size) {
@@ -193,14 +206,24 @@ static int read_nand_cached(u32 off, u32 size, u_char *buf)
                                }
                        }
 
+#if defined(CFG_NAND_LEGACY)
+                       if (read_jffs2_nand(nand_cache_off, NAND_CACHE_SIZE,
+                                               &retlen, nand_cache, id->num) < 0 ||
+                                       retlen != NAND_CACHE_SIZE) {
+                               printf("read_nand_cached: error reading nand off %#x size %d bytes\n",
+                                               nand_cache_off, NAND_CACHE_SIZE);
+                               return -1;
+                       }
+#else
                        retlen = NAND_CACHE_SIZE;
                        if (nand_read(&nand_info[id->num], nand_cache_off,
-                                       &retlen, nand_cache) != 0 ||
+                                               &retlen, nand_cache) != 0 ||
                                        retlen != NAND_CACHE_SIZE) {
                                printf("read_nand_cached: error reading nand off %#x size %d bytes\n",
                                                nand_cache_off, NAND_CACHE_SIZE);
                                return -1;
                        }
+#endif
                }
                cpy_bytes = nand_cache_off + NAND_CACHE_SIZE - (off + bytes_read);
                if (cpy_bytes > size - bytes_read)
@@ -251,7 +274,6 @@ static void put_fl_mem_nand(void *buf)
 {
        free(buf);
 }
-#endif /* CFG_NAND_LEGACY */
 #endif /* #if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND) */
 
 
@@ -294,7 +316,7 @@ static inline void *get_fl_mem(u32 off, u32 size, void *ext_buf)
                return get_fl_mem_nor(off);
 #endif
 
-#if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND)
        if (id->type == MTD_DEV_TYPE_NAND)
                return get_fl_mem_nand(off, size, ext_buf);
 #endif
@@ -312,7 +334,7 @@ static inline void *get_node_mem(u32 off)
                return get_node_mem_nor(off);
 #endif
 
-#if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND)
        if (id->type == MTD_DEV_TYPE_NAND)
                return get_node_mem_nand(off);
 #endif
@@ -323,7 +345,7 @@ static inline void *get_node_mem(u32 off)
 
 static inline void put_fl_mem(void *buf)
 {
-#if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND) && defined(CFG_NAND_LEGACY)
+#if defined(CONFIG_JFFS2_NAND) && (CONFIG_COMMANDS & CFG_CMD_NAND)
        struct mtdids *id = current_part->dev->id;
 
        if (id->type == MTD_DEV_TYPE_NAND)
index ffe89cb..7ec4599 100644 (file)
  */
 #define CFG_NAND0_BASE 0xFF400000
 #define CFG_NAND1_BASE 0xFF000000
+#define CFG_NAND_BASE_LIST     { CFG_NAND0_BASE }
+#define NAND_BIG_DELAY_US      25
 
 /* For CATcenter there is only NAND on the module */
 #define CFG_MAX_NAND_DEVICE    1       /* Max number of NAND devices           */
 #define CFG_NAND1_RDY (0x80000000 >> 31)  /* our RDY is GPIO31 */
 
 
-#define NAND_DISABLE_CE(nand) do \
+#define MACRO_NAND_DISABLE_CE(nandptr) do \
 { \
-       switch((unsigned long)(((struct nand_chip *)nand)->IO_ADDR)) \
+       switch((unsigned long)nandptr) \
        { \
            case CFG_NAND0_BASE: \
                out32(GPIO0_OR, in32(GPIO0_OR) | CFG_NAND0_CE); \
        } \
 } while(0)
 
-#define NAND_ENABLE_CE(nand) do \
+#define MACRO_NAND_ENABLE_CE(nandptr) do \
 { \
-       switch((unsigned long)(((struct nand_chip *)nand)->IO_ADDR)) \
+       switch((unsigned long)nandptr) \
        { \
            case CFG_NAND0_BASE: \
                out32(GPIO0_OR, in32(GPIO0_OR) & ~CFG_NAND0_CE); \
        } \
 } while(0)
 
-
-#define NAND_CTL_CLRALE(nandptr) do \
+#define MACRO_NAND_CTL_CLRALE(nandptr) do \
 { \
        switch((unsigned long)nandptr) \
        { \
        } \
 } while(0)
 
-#define NAND_CTL_SETALE(nandptr) do \
+#define MACRO_NAND_CTL_SETALE(nandptr) do \
 { \
        switch((unsigned long)nandptr) \
        { \
        } \
 } while(0)
 
-#define NAND_CTL_CLRCLE(nandptr) do \
+#define MACRO_NAND_CTL_CLRCLE(nandptr) do \
 { \
        switch((unsigned long)nandptr) \
        { \
        } \
 } while(0)
 
-#define NAND_CTL_SETCLE(nandptr) do { \
+#define MACRO_NAND_CTL_SETCLE(nandptr) do { \
        switch((unsigned long)nandptr) { \
        case CFG_NAND0_BASE: \
                out32(GPIO0_OR, in32(GPIO0_OR) | CFG_NAND0_CLE); \
index 1e9a99e..16a9ea5 100644 (file)
 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 #include <cmd_confdefs.h>
 
-#define CFG_NAND_LEGACY
-
 /*
  * Miscellaneous configurable options
  */
index aaa44c5..29eb874 100644 (file)
  */
 #if (CONFIG_COMMANDS & CFG_CMD_NAND)
 
+#define CFG_NAND_LEGACY
 #define CFG_NAND0_BASE 0xE1000000
 
 #define CFG_MAX_NAND_DEVICE     1       /* Max number of NAND devices           */
index 371ea17..3c59df4 100644 (file)
 /*
  * NAND flash support
  */
+#define CFG_NAND_LEGACY
+
 #define CFG_MAX_NAND_DEVICE    1
 #define NAND_ChipID_UNKNOWN    0x00
 #define SECTORSIZE             512
index 1bcd88d..25b6345 100644 (file)
 /****************************************************************/
 
 /* NAND */
+#define CFG_NAND_LEGACY
 #define CFG_NAND_BASE                  NAND_BASE
 #define CONFIG_MTD_NAND_VERIFY_WRITE
 #define CONFIG_MTD_NAND_UNSAFE
index 21945a3..242c837 100644 (file)
 /************************************************************
  * Disk-On-Chip configuration
  ************************************************************/
-#define CFG_NAND_LEGACY
-
 #define CFG_MAX_DOC_DEVICE     1       /* Max number of DOC devices            */
 #define CFG_DOC_SHORT_TIMEOUT
 #define CFG_DOC_SUPPORT_2000
index 3f29190..5f48a70 100644 (file)
  */
 #if (CONFIG_COMMANDS & CFG_CMD_NAND)
 
+#define CFG_NAND_LEGACY
 #define CFG_MAX_NAND_DEVICE    1       /* Max number of NAND devices           */
 #define SECTORSIZE 512
 
index b42a7e2..31feaa3 100644 (file)
  * NAND Flash
  */
 /* Use the new NAND code. (BOARDLIBS = drivers/nand/libnand.a required) */
-#define CONFIG_NEW_NAND_CODE
+#undef CFG_NAND_LEGACY
+
 #define CFG_NAND0_BASE         0x0 /* 0x43100040 */ /* 0x10000000 */
 #undef CFG_NAND1_BASE
 
index 12252ac..5837461 100644 (file)
 /*
  *  Board NAND Info.
  */
+#define CFG_NAND_LEGACY
 #define CFG_NAND_ADDR 0x04000000  /* physical address to access nand at CS0*/
 
 #define CFG_MAX_NAND_DEVICE 1  /* Max number of NAND devices */
index be6c36c..614a046 100644 (file)
 /****************************************************************/
 
 /* NAND */
+#define CFG_NAND_LEGACY
 #define CFG_NAND_BASE          NAND_BASE
 #define CONFIG_MTD_NAND_ECC_JFFS2
 #define CONFIG_MTD_NAND_VERIFY_WRITE