#define ADDR_COLUMN_PAGE 3
    #define NAND_ChipID_UNKNOWN 0x00
    #define NAND_MAX_FLOORS 1
-   #define NAND_MAX_CHIPS 1
+   #define CONFIG_SYS_NAND_MAX_CHIPS 1
 
    #define CONFIG_SYS_DAVINCI_BROKEN_ECC
       Versions of U-Boot <= 1.3.3 and Montavista Linux kernels
 
 {
        int page, len, status, pages_per_block, ret, chipnr;
        struct nand_chip *chip = mtd->priv;
-       int rewrite_bbt[NAND_MAX_CHIPS]={0};
+       int rewrite_bbt[CONFIG_SYS_NAND_MAX_CHIPS]={0};
        unsigned int bbt_masked_page = 0xffffffff;
 
        MTDDEBUG (MTD_DEBUG_LEVEL3, "nand_erase: start = 0x%08x, len = %i\n",
 
 {
        int floor, chip;
        int numchips[NAND_MAX_FLOORS];
-       int maxchips = NAND_MAX_CHIPS;
+       int maxchips = CONFIG_SYS_NAND_MAX_CHIPS;
        int ret = 1;
 
        nand->numchips = 0;
 
  *-----------------------------------------------------------------------
  */
 #define CONFIG_SYS_NAND_BASE_LIST      { CONFIG_SYS_NAND_BASE }
-#define NAND_MAX_CHIPS          1
 #define CONFIG_SYS_MAX_NAND_DEVICE     1         /* Max number of NAND devices */
 #define NAND_BIG_DELAY_US      25
 
 
 
 #define NAND_ChipID_UNKNOWN    0x00
 #define NAND_MAX_FLOORS 1
-#define NAND_MAX_CHIPS 1
 
 #define CONFIG_SYS_NAND0_CE  (0x80000000 >> 1)  /* our CE is GPIO1 */
 #define CONFIG_SYS_NAND0_CLE (0x80000000 >> 2)  /* our CLE is GPIO2 */
 
  *-----------------------------------------------------------------------
  */
 #define CONFIG_SYS_NAND_BASE_LIST      { CONFIG_SYS_NAND_BASE }
-#define NAND_MAX_CHIPS          1
 #define CONFIG_SYS_MAX_NAND_DEVICE     1         /* Max number of NAND devices */
 #define NAND_BIG_DELAY_US      25
 
 
  * NAND FLASH
  */
 #define CONFIG_SYS_MAX_NAND_DEVICE     2
-#define NAND_MAX_CHIPS         CONFIG_SYS_MAX_NAND_DEVICE
 #define CONFIG_SYS_NAND_SELECT_DEVICE  1       /* nand driver supports mutipl. chips */
 #define CONFIG_SYS_NAND_BASE_LIST      {CONFIG_SYS_NAND0_ADDR + CONFIG_SYS_NAND0_CS, \
                                 CONFIG_SYS_NAND1_ADDR + CONFIG_SYS_NAND1_CS}
 
 
 #define NAND_ChipID_UNKNOWN    0x00
 #define NAND_MAX_FLOORS 1
-#define NAND_MAX_CHIPS 1
 
 #define CONFIG_SYS_NAND_CE  (0x80000000 >> 1)  /* our CE is GPIO1 */
 #define CONFIG_SYS_NAND_CLE (0x80000000 >> 2)  /* our CLE is GPIO2 */
 
  *-----------------------------------------------------------------------
  */
 #define CONFIG_SYS_NAND_BASE_LIST      { CONFIG_SYS_NAND_BASE }
-#define NAND_MAX_CHIPS          1
 #define CONFIG_SYS_MAX_NAND_DEVICE     1         /* Max number of NAND devices */
 #define NAND_BIG_DELAY_US      25
 
 
  *-----------------------------------------------------------------------
  */
 #define CONFIG_SYS_NAND_BASE_LIST      { CONFIG_SYS_NAND_BASE }
-#define NAND_MAX_CHIPS          1
 #define CONFIG_SYS_MAX_NAND_DEVICE     1         /* Max number of NAND devices */
 #define NAND_BIG_DELAY_US      25
 
 
 
 #define NAND_ChipID_UNKNOWN     0x00
 #define NAND_MAX_FLOORS 1
-#define NAND_MAX_CHIPS 1
 
 #define NAND_DISABLE_CE(nand) do \
 { \
 
 #      define CONFIG_SYS_NAND_BASE             CONFIG_SYS_CS2_BASE
 #      define CONFIG_SYS_NAND_SIZE             1
 #      define CONFIG_SYS_NAND_BASE_LIST        { CONFIG_SYS_NAND_BASE }
-#      define NAND_MAX_CHIPS           1
 #      define NAND_ALLOW_ERASE_ALL     1
 #      define CONFIG_JFFS2_NAND        1
 #      define CONFIG_JFFS2_DEV         "nand0"
 
 #      define CONFIG_SYS_NAND_BASE             CONFIG_SYS_CS2_BASE
 #      define CONFIG_SYS_NAND_SIZE             1
 #      define CONFIG_SYS_NAND_BASE_LIST        { CONFIG_SYS_NAND_BASE }
-#      define NAND_MAX_CHIPS           1
 #      define NAND_ALLOW_ERASE_ALL     1
 #      define CONFIG_JFFS2_NAND        1
 #      define CONFIG_JFFS2_DEV         "nand0"
 
 #endif
 
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define NAND_MAX_CHIPS         1
 #define CONFIG_MTD_NAND_VERIFY_WRITE
 #define CONFIG_CMD_NAND 1
 #define CONFIG_NAND_FSL_ELBC 1
 
  */
 #define CONFIG_SYS_NAND_BASE           0xE0600000      /* 0xE0600000 */
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define NAND_MAX_CHIPS                 1
 #define CONFIG_MTD_NAND_VERIFY_WRITE   1
 #define CONFIG_CMD_NAND                        1
 #define CONFIG_NAND_FSL_ELBC           1
 
 #define CONFIG_CMD_NAND                1
 #define CONFIG_NAND_FSL_UPM    1
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define NAND_MAX_CHIPS         1
 #define CONFIG_MTD_NAND_VERIFY_WRITE
 
 #define CONFIG_SYS_LBLAWBAR1_PRELIM    CONFIG_SYS_NAND_BASE
 
 #define CONFIG_CMD_NAND                1
 #define CONFIG_MTD_NAND_VERIFY_WRITE   1
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define NAND_MAX_CHIPS         1
 #define CONFIG_NAND_FSL_ELBC   1
 
 #define CONFIG_SYS_NAND_BASE           0xE0600000      /* 0xE0600000 */
 
                                CONFIG_SYS_NAND_BASE + 0x80000, \
                                CONFIG_SYS_NAND_BASE + 0xC0000}
 #define CONFIG_SYS_MAX_NAND_DEVICE     4
-#define NAND_MAX_CHIPS         1
 #define CONFIG_MTD_NAND_VERIFY_WRITE
 #define CONFIG_CMD_NAND                1
 #define CONFIG_NAND_FSL_ELBC   1
 
                                CONFIG_SYS_NAND_BASE + 0x80000,\
                                CONFIG_SYS_NAND_BASE + 0xC0000}
 #define CONFIG_SYS_MAX_NAND_DEVICE    4
-#define NAND_MAX_CHIPS         1
 #define CONFIG_MTD_NAND_VERIFY_WRITE
 #define CONFIG_CMD_NAND                1
 #define CONFIG_NAND_FSL_ELBC   1
 
  * NAND flash support
  */
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define NAND_MAX_CHIPS         1
 
 /*-----------------------------------------------------------------------
  * SYPCR - System Protection Control                                   11-9
 
 #define ADDR_COLUMN_PAGE       3
 #define NAND_ChipID_UNKNOWN    0x00
 #define NAND_MAX_FLOORS                1
-#define NAND_MAX_CHIPS         1
 
 /* ALE = PD17, CLE = PE18, CE = PE20, F_RY_BY = PE31 */
 #define NAND_DISABLE_CE(nand) \
 
 #define ADDR_COLUMN_PAGE       3
 #define NAND_ChipID_UNKNOWN    0x00
 #define NAND_MAX_FLOORS                1
-#define NAND_MAX_CHIPS         1
 
 /* ALE = PD3, CLE = PD4, CE = PD5, F_RY_BY = PC13 */
 #define NAND_DISABLE_CE(nand) \
 
 #define ADDR_COLUMN_PAGE       3
 #define NAND_ChipID_UNKNOWN    0x00
 #define NAND_MAX_FLOORS                1
-#define NAND_MAX_CHIPS         1
 
 /* ALE = PD17, CLE = PE18, CE = PE20, F_RY_BY = PE31 */
 #define NAND_DISABLE_CE(nand) \
 
 #define ADDR_COLUMN_PAGE       3
 #define NAND_ChipID_UNKNOWN    0x00
 #define NAND_MAX_FLOORS                1
-#define NAND_MAX_CHIPS         1
 
 #define NAND_DISABLE_CE(nand) \
        do { \
 
  * NAND-FLASH stuff
  */
 #define CONFIG_SYS_NAND_BASE_LIST      {CONFIG_SYS_NAND_BASE}
-#define NAND_MAX_CHIPS          1
 #define CONFIG_SYS_MAX_NAND_DEVICE     1         /* Max number of NAND devices */
 #define NAND_BIG_DELAY_US      25
 
 
  * NAND FLASH
  *----------------------------------------------------------------------*/
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define NAND_MAX_CHIPS         1
 #define CONFIG_SYS_NAND_BASE           (CONFIG_SYS_NAND_ADDR + CONFIG_SYS_NAND_CS)
 #define CONFIG_SYS_NAND_SELECT_DEVICE  1 /* nand driver supports mutipl. chips */
 #define CONFIG_SYS_NAND_QUIET_TEST     1
 
 #define NAND_BIG_DELAY_US      25
 #define CONFIG_SYS_MAX_NAND_DEVICE     2       /* Max number of NAND devices */
 
-#define NAND_MAX_CHIPS 1
-
 #define CONFIG_SYS_NAND0_CE  (0x80000000 >> 1)  /* our CE is GPIO1 */
 #define CONFIG_SYS_NAND0_RDY (0x80000000 >> 4)  /* our RDY is GPIO4 */
 #define CONFIG_SYS_NAND0_CLE (0x80000000 >> 2)  /* our CLE is GPIO2 */
 
 
 #define NAND_ChipID_UNKNOWN    0x00
 #define NAND_MAX_FLOORS 1
-#define NAND_MAX_CHIPS 1
 
 /* DFBUSY is available on Port C, bit 12; 0 if busy */
 #define NAND_WAIT_READY(nand)  \
 
 #define CONFIG_SYS_NAND3_BASE (CONFIG_SYS_NAND2_BASE + CONFIG_SYS_NAND_CS_DIST)
 
 #define CONFIG_SYS_MAX_NAND_DEVICE     4       /* Max number of NAND devices           */
-#define NAND_MAX_CHIPS 1
 
 #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND0_BASE, \
                             CONFIG_SYS_NAND1_BASE, \
 
 #define CONFIG_SYS_NAND3_BASE          (CONFIG_SYS_NAND2_BASE + CONFIG_SYS_NAND_CS_DIST)
 
 #define CONFIG_SYS_MAX_NAND_DEVICE     2       /* Max number of NAND devices   */
-#define NAND_MAX_CHIPS         1
 
 #if (CONFIG_SYS_MAX_NAND_DEVICE == 1)
 #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND0_BASE }
 
 
 #define NAND_ChipID_UNKNOWN    0x00
 #define NAND_MAX_FLOORS 1
-#define NAND_MAX_CHIPS 1
 
 #define NAND_WAIT_READY(nand)  NF_WaitRB()
 
 
  *-----------------------------------------------------------------------
  */
 #define CONFIG_SYS_NAND_BASE_LIST      { CONFIG_SYS_NAND_BASE }
-#define NAND_MAX_CHIPS          1
 #define CONFIG_SYS_MAX_NAND_DEVICE     1         /* Max number of NAND devices */
 #define NAND_BIG_DELAY_US      25
 
 
  *-----------------------------------------------------------------------
  */
 #define CONFIG_SYS_NAND_BASE_LIST      { CONFIG_SYS_NAND_BASE }
-#define NAND_MAX_CHIPS          1
 #define CONFIG_SYS_MAX_NAND_DEVICE     1         /* Max number of NAND devices */
 #define NAND_BIG_DELAY_US      25
 
 
  * NAND FLASH
  *----------------------------------------------------------------------*/
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define NAND_MAX_CHIPS         1
 #define CONFIG_SYS_NAND_BASE           (CONFIG_SYS_NAND_ADDR + CONFIG_SYS_NAND_CS)
 #define CONFIG_SYS_NAND_SELECT_DEVICE  1       /* nand driver supports mutipl. chips   */
 
 
 #define DATAFLASH_TCHS                 (0x1 << 24)
 
 /* NAND flash */
-#define NAND_MAX_CHIPS                 1
 #define CONFIG_SYS_MAX_NAND_DEVICE             1
 #define CONFIG_SYS_NAND_BASE                   0x40000000
 #define CONFIG_SYS_NAND_DBW_8                  1
 
  * NAND-FLASH stuff
  *-----------------------------------------------------------------------*/
 #define CONFIG_SYS_MAX_NAND_DEVICE     4
-#define NAND_MAX_CHIPS         CONFIG_SYS_MAX_NAND_DEVICE
 #define CONFIG_SYS_NAND_BASE           0xF0000000      /* NAND FLASH Base Address      */
 #define CONFIG_SYS_NAND_BASE_LIST      { CONFIG_SYS_NAND_BASE + 0, CONFIG_SYS_NAND_BASE + 2,   \
                                  CONFIG_SYS_NAND_BASE + 4, CONFIG_SYS_NAND_BASE + 6 }
 
 #define CONFIG_SYS_MAX_FLASH_BANKS             1
 
 /* NAND flash */
-#define NAND_MAX_CHIPS                 1
 #define CONFIG_SYS_MAX_NAND_DEVICE             1
 #define CONFIG_SYS_NAND_BASE                   0x40000000
 #define CONFIG_SYS_NAND_DBW_8                  1
 
 
 #define NAND_ChipID_UNKNOWN    0x00
 #define NAND_MAX_FLOORS 1
-#define NAND_MAX_CHIPS 1
 
 #define AT91_SMART_MEDIA_ALE (1 << 22) /* our ALE is AD22 */
 #define AT91_SMART_MEDIA_CLE (1 << 21) /* our CLE is AD21 */
 
 #define DATAFLASH_TCHS                 (0x1 << 24)
 
 /* NAND flash */
-#define NAND_MAX_CHIPS                 1
 #define CONFIG_SYS_MAX_NAND_DEVICE             1
 #define CONFIG_SYS_NAND_BASE                   0x40000000
 #define CONFIG_SYS_NAND_DBW_8                  1
 
 #define DATAFLASH_TCHS                 (0x1 << 24)
 
 /* NAND flash */
-#define NAND_MAX_CHIPS                 1
 #define CONFIG_SYS_MAX_NAND_DEVICE             1
 #define CONFIG_SYS_NAND_BASE                   0x40000000
 #define CONFIG_SYS_NAND_DBW_8                  1
 
 #endif
 
 /* NAND flash */
-#define NAND_MAX_CHIPS                 1
 #define CONFIG_SYS_MAX_NAND_DEVICE             1
 #define CONFIG_SYS_NAND_BASE                   0x40000000
 #define CONFIG_SYS_NAND_DBW_8                  1
 
 #define CONFIG_SYS_NO_FLASH                    1
 
 /* NAND flash */
-#define NAND_MAX_CHIPS                 1
 #define CONFIG_SYS_MAX_NAND_DEVICE             1
 #define CONFIG_SYS_NAND_BASE                   0x40000000
 #define CONFIG_SYS_NAND_DBW_8                  1
 
  * NAND FLASH
  *----------------------------------------------------------------------*/
 #define CONFIG_SYS_MAX_NAND_DEVICE     2
-#define NAND_MAX_CHIPS         CONFIG_SYS_MAX_NAND_DEVICE
 #define CONFIG_SYS_NAND_BASE           (CONFIG_SYS_NAND_ADDR + CONFIG_SYS_NAND_CS)
 #define CONFIG_SYS_NAND_BASE_LIST      { CONFIG_SYS_NAND_BASE, CONFIG_SYS_NAND_ADDR + 2 }
 #define CONFIG_SYS_NAND_SELECT_DEVICE  1       /* nand driver supports mutipl. chips   */
 
 #define ADDR_COLUMN_PAGE       3
 #define NAND_ChipID_UNKNOWN    0x00
 #define NAND_MAX_FLOORS                1
-#define NAND_MAX_CHIPS         1
 #define BFIN_NAND_READY                PF3
 
 #define NAND_WAIT_READY(nand)                  \
 
  * NAND-FLASH related
  *----------------------------------------------------------------------*/
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define NAND_MAX_CHIPS         1
 #define CONFIG_SYS_NAND_BASE           (CONFIG_SYS_NAND_ADDR + CONFIG_SYS_NAND_CS)
 #define CONFIG_SYS_NAND_SELECT_DEVICE  1       /* nand driver supports mutipl. chips   */
 
 
 
 #define NAND_ChipID_UNKNOWN    0x00
 #define NAND_MAX_FLOORS 1
-#define NAND_MAX_CHIPS 1
 
 #define AT91_SMART_MEDIA_ALE (1 << 22) /* our ALE is AD22 */
 #define AT91_SMART_MEDIA_CLE (1 << 21) /* our CLE is AD21 */
 
 #define CONFIG_SYS_NAND_BASE           0x02000000
 #define CONFIG_SYS_NAND_HW_ECC
 #define CONFIG_SYS_MAX_NAND_DEVICE     1       /* Max number of NAND devices */
-#define NAND_MAX_CHIPS         1
 #define CONFIG_ENV_OFFSET              0x0     /* Block 0--not used by bootcode */
 #define DEF_BOOTM              ""
 #elif defined(CONFIG_SYS_USE_NOR)
 
 #define CONFIG_SYS_NAND_BASE           0x02000000
 #define CONFIG_SYS_NAND_HW_ECC
 #define CONFIG_SYS_MAX_NAND_DEVICE     1       /* Max number of NAND devices */
-#define NAND_MAX_CHIPS         1
 #define CONFIG_ENV_OFFSET              0x0     /* Block 0--not used by bootcode */
 /*=====================*/
 /* Board related stuff */
 
 #define CONFIG_SYS_NAND_BASE           0x02000000
 #define CONFIG_SYS_NAND_HW_ECC
 #define CONFIG_SYS_MAX_NAND_DEVICE     1       /* Max number of NAND devices */
-#define NAND_MAX_CHIPS         1
 #define CONFIG_ENV_OFFSET              0x0     /* Block 0--not used by bootcode */
 /* I2C switch definitions for PCA9543 chip */
 #define CONFIG_SYS_I2C_PCA9543_ADDR            0x70
 
 #define CONFIG_SYS_NAND_BASE           0x02000000
 #define CONFIG_SYS_NAND_HW_ECC
 #define CONFIG_SYS_MAX_NAND_DEVICE     1       /* Max number of NAND devices */
-#define NAND_MAX_CHIPS         1
 #define CONFIG_ENV_OFFSET              0x0     /* Block 0--not used by bootcode */
 #define DEF_BOOTM              ""
 #elif defined(CONFIG_SYS_USE_NOR)
 
 
 #define NAND_ChipID_UNKNOWN    0x00
 #define NAND_MAX_FLOORS                1
-#define NAND_MAX_CHIPS         1
 
 #define CONFIG_SYS_NO_FLASH            1
 
 
  * NAND FLASH
  *----------------------------------------------------------------------*/
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define NAND_MAX_CHIPS         1
 #define CONFIG_SYS_NAND_BASE           (CONFIG_SYS_NAND_ADDR + CONFIG_SYS_NAND_CS)
 #define CONFIG_SYS_NAND_SELECT_DEVICE  1       /* nand driver supports mutipl. chips   */
 
 
  * NAND flash
  */
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define NAND_MAX_CHIPS         1
 #define CONFIG_SYS_NAND_BASE   0x04000000 + (2 << 23)
 #define NAND_ALLOW_ERASE_ALL   1
 
 
 
 #define NAND_ChipID_UNKNOWN 0x00
 #define NAND_MAX_FLOORS     1
-#define NAND_MAX_CHIPS      1
 
 #define WRITE_NAND_COMMAND(d, adr) do {*(volatile u16 *)0x6800A07C = d;} while(0)
 #define WRITE_NAND_ADDRESS(d, adr) do {*(volatile u16 *)0x6800A080 = d;} while(0)
 
  * NAND-FLASH stuff
  */
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define NAND_MAX_CHIPS         1
 #define CONFIG_SYS_NAND_BASE           0x51000000      /* NAND FLASH Base Address      */
 #endif
 
 
 #define CONFIG_SYS_NAND_CE     24   /* our CE is GPIO24  */
 #define CONFIG_SYS_NAND_CLE    31   /* our CLE is GPIO31 */
 #define CONFIG_SYS_NAND_ALE    30   /* our ALE is GPIO30 */
-#define NAND_MAX_CHIPS 1
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
 #endif
 
 
 
 #define NAND_ChipID_UNKNOWN    0x00
 #define NAND_MAX_FLOORS 1
-#define NAND_MAX_CHIPS 1
 
 #define NAND_WAIT_READY(nand)  NF_WaitRB()
 #define NAND_DISABLE_CE(nand)  NF_SetCE(NFCE_HIGH)
 
  * NAND-FLASH stuff
  */
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define NAND_MAX_CHIPS         1
 #define CONFIG_SYS_NAND_BASE           0x77D00000
 
 
 
  * NAND FLASH
  */
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define NAND_MAX_CHIPS         1
 #define CONFIG_SYS_NAND_BASE           (CONFIG_SYS_NAND_ADDR + CONFIG_SYS_NAND_CS)
 #define CONFIG_SYS_NAND_SELECT_DEVICE  1       /* nand driver supports mutipl. chips */
 
 
 /* NAND configuration */
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
 #define CONFIG_SYS_NAND_BASE           0x70200010
-#define NAND_MAX_CHIPS         1
 #define CONFIG_SYS_S3C_NAND_HWECC
 
 #define CONFIG_SYS_NAND_SKIP_BAD_DOT_I 1  /* ".i" read skips bad blocks              */
 
 
 #define CONFIG_SYS_NAND_BASE           (CONFIG_SYS_FPGA_BASE + 0x70)
 #define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define NAND_MAX_CHIPS         1
 #define CONFIG_CMD_NAND
 
 /* LIME GDC */
 
 #define ADDR_COLUMN_PAGE       3
 #define NAND_ChipID_UNKNOWN    0x00
 #define NAND_MAX_FLOORS                1
-#define NAND_MAX_CHIPS         1
 
 /* ALE = PC15, CLE = PB23, CE = PA7, F_RY_BY = PA6 */
 #define NAND_DISABLE_CE(nand) \
 
 
 #define NAND_ChipID_UNKNOWN    0x00
 #define NAND_MAX_FLOORS                1
-#define NAND_MAX_CHIPS         1
 
 #define CONFIG_SYS_NO_FLASH            1
 
 
 #define __LINUX_MTD_BBM_H
 
 /* The maximum number of NAND chips in an array */
-#ifndef NAND_MAX_CHIPS
-#define NAND_MAX_CHIPS         8
+#ifndef CONFIG_SYS_NAND_MAX_CHIPS
+#define CONFIG_SYS_NAND_MAX_CHIPS      1
 #endif
 
 /**
  */
 struct nand_bbt_descr {
        int options;
-       int pages[NAND_MAX_CHIPS];
+       int pages[CONFIG_SYS_NAND_MAX_CHIPS];
        int offs;
        int veroffs;
-       uint8_t version[NAND_MAX_CHIPS];
+       uint8_t version[CONFIG_SYS_NAND_MAX_CHIPS];
        int len;
        int maxblocks;
        int reserved_block_code;
 
 /* Internal helper for board drivers which need to override command function */
 extern void nand_wait_ready(struct mtd_info *mtd);
 
-/* The maximum number of NAND chips in an array */
-#ifndef NAND_MAX_CHIPS
-#define NAND_MAX_CHIPS         8
-#endif
-
 /* This constant declares the max. oobsize / page, which
  * is supported now. If you add a chip with bigger oobsize/page
  * adjust this accordingly.
 extern struct nand_flash_dev nand_flash_ids[];
 extern struct nand_manufacturers nand_manuf_ids[];
 
-#ifndef NAND_MAX_CHIPS
-#define NAND_MAX_CHIPS 8
-#endif
-
 extern int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd);
 extern int nand_update_bbt(struct mtd_info *mtd, loff_t offs);
 extern int nand_default_bbt(struct mtd_info *mtd);
 
 #error This module is for the legacy NAND support
 #endif
 
+/* The maximum number of NAND chips in an array */
+#ifndef CONFIG_SYS_NAND_MAX_CHIPS
+#define CONFIG_SYS_NAND_MAX_CHIPS      1
+#endif
+
 /*
  * Standard NAND flash commands
  */