Merge with /home/wd/git/u-boot/testing-NAND/ to add new NAND handling.
[oweals/u-boot.git] / include / configs / PPChameleonEVB.h
index 98af125cbf0f6d6dd410a6618d8e358174c326ec..c406c8f4bc17d5f1593caa82267c639e41005ccd 100644 (file)
@@ -47,7 +47,7 @@
  * CONFIG_PPCHAMELEON_CLK_33
  */
 #if (!defined(CONFIG_PPCHAMELEON_CLK_25) && !defined(CONFIG_PPCHAMELEON_CLK_33))
-#define CONFIG_PPCHAMELEON_CLK_33
+#define CONFIG_PPCHAMELEON_CLK_25
 #endif
 
 #if (defined(CONFIG_PPCHAMELEON_CLK_25) && defined(CONFIG_PPCHAMELEON_CLK_33))
 
 #define CONFIG_MII             1       /* MII PHY management           */
 #ifndef         CONFIG_EXT_PHY
-#define CONFIG_PHY_ADDR                0       /* EMAC0 PHY address            */
-#define CONFIG_PHY1_ADDR       1       /* EMAC1 PHY address            */
+#define CONFIG_PHY_ADDR                1       /* EMAC0 PHY address            */
+#define CONFIG_PHY1_ADDR       2       /* EMAC1 PHY address            */
 #else
 #define CONFIG_PHY_ADDR                2       /* PHY address                  */
 #endif
  * NAND-FLASH stuff
  *-----------------------------------------------------------------------
  */
+
+/* Use the new NAND code. (BOARDLIBS = drivers/nand/libnand.a required) */
+#define CONFIG_NEW_NAND_CODE
 #define CFG_NAND0_BASE 0xFF400000
 #define CFG_NAND1_BASE 0xFF000000
-
-#define CFG_MAX_NAND_DEVICE    2       /* Max number of NAND devices           */
+#define CFG_NAND_BASE_LIST     { CFG_NAND0_BASE, CFG_NAND1_BASE }
+#define NAND_BIG_DELAY_US      25
+#define CFG_MAX_NAND_DEVICE    2       /* Max number of NAND devices */
 #define SECTORSIZE 512
 #define NAND_NO_RB
 
 #define CFG_NAND1_ALE (0x80000000 >> 16)  /* our ALE is GPIO16 */
 #define CFG_NAND1_RDY (0x80000000 >> 31)  /* our RDY is GPIO31 */
 
+#ifdef CONFIG_NEW_NAND_CODE
+#define MACRO_NAND_DISABLE_CE(nandptr) do \
+{ \
+       switch((unsigned long)nandptr) \
+       { \
+           case CFG_NAND0_BASE: \
+               out32(GPIO0_OR, in32(GPIO0_OR) | CFG_NAND0_CE); \
+               break; \
+           case CFG_NAND1_BASE: \
+               out32(GPIO0_OR, in32(GPIO0_OR) | CFG_NAND1_CE); \
+               break; \
+       } \
+} while(0)
+
+#define MACRO_NAND_ENABLE_CE(nandptr) do \
+{ \
+       switch((unsigned long)nandptr) \
+       { \
+           case CFG_NAND0_BASE: \
+               out32(GPIO0_OR, in32(GPIO0_OR) & ~CFG_NAND0_CE); \
+               break; \
+           case CFG_NAND1_BASE: \
+               out32(GPIO0_OR, in32(GPIO0_OR) & ~CFG_NAND1_CE); \
+               break; \
+       } \
+} while(0)
+
+#define MACRO_NAND_CTL_CLRALE(nandptr) do \
+{ \
+       switch((unsigned long)nandptr) \
+       { \
+           case CFG_NAND0_BASE: \
+               out32(GPIO0_OR, in32(GPIO0_OR) & ~CFG_NAND0_ALE); \
+               break; \
+           case CFG_NAND1_BASE: \
+               out32(GPIO0_OR, in32(GPIO0_OR) & ~CFG_NAND1_ALE); \
+               break; \
+       } \
+} while(0)
+
+#define MACRO_NAND_CTL_SETALE(nandptr) do \
+{ \
+       switch((unsigned long)nandptr) \
+       { \
+           case CFG_NAND0_BASE: \
+               out32(GPIO0_OR, in32(GPIO0_OR) | CFG_NAND0_ALE); \
+               break; \
+           case CFG_NAND1_BASE: \
+               out32(GPIO0_OR, in32(GPIO0_OR) | CFG_NAND1_ALE); \
+               break; \
+       } \
+} while(0)
+
+#define MACRO_NAND_CTL_CLRCLE(nandptr) do \
+{ \
+       switch((unsigned long)nandptr) \
+       { \
+           case CFG_NAND0_BASE: \
+               out32(GPIO0_OR, in32(GPIO0_OR) & ~CFG_NAND0_CLE); \
+               break; \
+           case CFG_NAND1_BASE: \
+               out32(GPIO0_OR, in32(GPIO0_OR) & ~CFG_NAND1_CLE); \
+               break; \
+       } \
+} while(0)
+
+#define MACRO_NAND_CTL_SETCLE(nandptr) do { \
+       switch((unsigned long)nandptr) { \
+       case CFG_NAND0_BASE: \
+               out32(GPIO0_OR, in32(GPIO0_OR) | CFG_NAND0_CLE); \
+               break; \
+       case CFG_NAND1_BASE: \
+               out32(GPIO0_OR, in32(GPIO0_OR) | CFG_NAND1_CLE); \
+               break; \
+       } \
+} while(0)
+#else
 #define NAND_DISABLE_CE(nand) do \
 { \
        switch((unsigned long)(((struct nand_chip *)nand)->IO_ADDR)) \
                break; \
        } \
 } while(0)
+#endif /* !CONFIG_NEW_NAND_CODE */
 
 #ifdef NAND_NO_RB
 /* constant delay (see also tR in the datasheet) */
  * Please note that CFG_SDRAM_BASE _must_ start at 0
  */
 #define CFG_SDRAM_BASE         0x00000000
+
+/* Reserve 256 kB for Monitor  */
+/*
 #define CFG_FLASH_BASE         0xFFFC0000
 #define CFG_MONITOR_BASE       CFG_FLASH_BASE
-#define CFG_MONITOR_LEN                (256 * 1024)    /* Reserve 256 kB for Monitor   */
+#define CFG_MONITOR_LEN                (256 * 1024)
+*/
+
+/* Reserve 320 kB for Monitor  */
+#define CFG_FLASH_BASE         0xFFFB0000
+#define CFG_MONITOR_BASE       CFG_FLASH_BASE
+#define CFG_MONITOR_LEN                (320 * 1024)
+
 #define CFG_MALLOC_LEN         (256 * 1024)    /* Reserve 256 kB for malloc()  */
 
 /*
 
 #define CFG_FLASH_EMPTY_INFO           /* print 'E' for empty sector on flinfo */
 
-#if 0 /* test-only */
-#define CFG_JFFS2_FIRST_BANK   0        /* use for JFFS2 */
-#define CFG_JFFS2_NUM_BANKS    1        /* ! second bank contains U-Boot */
-#endif
-
 /*-----------------------------------------------------------------------
  * Environment Variable setup
  */
 /*-----------------------------------------------------------------------
  * Cache Configuration
  */
-#define CFG_DCACHE_SIZE                16384   /* For IBM 405 CPUs, older 405 ppc's    */
+#define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
                                        /* have only 8kB, 16kB is save here     */
 #define CFG_CACHELINE_SIZE     32      /* ...                  */
 #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
 #endif /* CONFIG_NO_SERIAL_EEPROM */
 
 #define CONFIG_JFFS2_NAND 1                    /* jffs2 on nand support */
-#define CONFIG_JFFS2_NAND_DEV 0                        /* nand device jffs2 lives on */
-#define CONFIG_JFFS2_NAND_OFF 0                        /* start of jffs2 partition */
-#define CONFIG_JFFS2_NAND_SIZE 2*1024*1024     /* size of jffs2 partition */
 #define NAND_CACHE_PAGES 16                    /* size of nand cache in 512 bytes pages */
 
+/*
+ * JFFS2 partitions
+ */
+
+/* No command line, one static partition */
+#undef CONFIG_JFFS2_CMDLINE
+#define CONFIG_JFFS2_DEV               "nand0"
+#define CONFIG_JFFS2_PART_SIZE         0x00400000
+#define CONFIG_JFFS2_PART_OFFSET       0x00000000
+
+/* mtdparts command line support */
+/*
+#define CONFIG_JFFS2_CMDLINE
+#define MTDIDS_DEFAULT         "nor0=PPChameleon-0,nand0=ppchameleonevb-nand"
+*/
+
+/* 256 kB U-boot image */
+/*
+#define MTDPARTS_DEFAULT       "mtdparts=PPChameleon-0:1m(kernel1),1m(kernel2)," \
+                                       "1792k(user),256k(u-boot);" \
+                               "ppchameleonevb-nand:-(nand)"
+*/
+
+/* 320 kB U-boot image */
+/*
+#define MTDPARTS_DEFAULT       "mtdparts=PPChameleon-0:1m(kernel1),1m(kernel2)," \
+                                       "1728k(user),320k(u-boot);" \
+                               "ppchameleonevb-nand:-(nand)"
+*/
+
 #endif /* __CONFIG_H */