rename CFG_ENV macros to CONFIG_ENV
[platform/kernel/u-boot.git] / include / configs / SXNI855T.h
index 8725f27..0cc4fe4 100644 (file)
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
 #endif
 
+#define CONFIG_HAS_ETH1
+
+/*-----------------------------------------------------------------------
+ * Definitions for status LED
+ */
+#define        CONFIG_STATUS_LED       1       /* Status LED enabled           */
+
+# define STATUS_LED_PAR                im_ioport.iop_papar
+# define STATUS_LED_DIR                im_ioport.iop_padir
+# define STATUS_LED_ODR                im_ioport.iop_paodr
+# define STATUS_LED_DAT                im_ioport.iop_padat
+
+# define STATUS_LED_BIT                0x8000          /* LED 0 is on PA.0 */
+# define STATUS_LED_PERIOD     ((CFG_HZ / 2) / 5)      /* blink at 5 Hz */
+# define STATUS_LED_STATE      STATUS_LED_BLINKING
+
+# define STATUS_LED_ACTIVE     0               /* LED on for bit == 0  */
+
+# define STATUS_LED_BOOT       0               /* LED 0 used for boot status */
+
+#ifdef DEV     /* development (debug) settings */
+#define CONFIG_BOOT_LED_STATE  STATUS_LED_OFF
+#else          /* production settings */
+#define CONFIG_BOOT_LED_STATE  STATUS_LED_ON
+#endif
+
+#define CONFIG_SHOW_BOOT_PROGRESS 1
+
 #define CONFIG_BOOTCOMMAND     "bootm f8040000 f8100000" /* autoboot command */
 #define CONFIG_BOOTARGS                "root=/dev/ram ip=off"
 
 # define CFG_I2C_EEPROM_ADDR_LEN 2     /* two byte address             */
 
 #define        CONFIG_FEC_ENET         1       /* use FEC ethernet  */
+#define        CONFIG_MII              1
 
 #define CFG_DISCOVER_PHY
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | CFG_CMD_EEPROM | CFG_CMD_DATE)
 
-/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
-#include <cmd_confdefs.h>
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE
+#define CONFIG_BOOTP_BOOTPATH
+#define CONFIG_BOOTP_GATEWAY
+#define CONFIG_BOOTP_HOSTNAME
+
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_JFFS2
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_DATE
+
+
+#define CFG_JFFS2_SORT_FRAGMENTS
+
+/*
+ * JFFS2 partitions
+ *
+ */
+/* No command line, one static partition */
+#undef CONFIG_JFFS2_CMDLINE
+
+/*
+#define CONFIG_JFFS2_DEV               "nor0"
+#define CONFIG_JFFS2_PART_SIZE         0x00780000
+#define CONFIG_JFFS2_PART_OFFSET       0x00080000
+*/
+
+#define CONFIG_JFFS2_DEV               "nand0"
+#define CONFIG_JFFS2_PART_SIZE         0x00200000
+#define CONFIG_JFFS2_PART_OFFSET       0x00000000
+
+/* mtdparts command line support */
+/* Note: fake mtd_id used, no linux mtd map file */
+/*
+#define CONFIG_JFFS2_CMDLINE
+#define MTDIDS_DEFAULT         "nor0=sixnet-0,nand0=sixnet-nand"
+#define MTDPARTS_DEFAULT       "mtdparts=sixnet-0:7680k@512k();sixnet-nand:2m(jffs2-nand)"
+*/
+
+/* NAND flash support */
+#define CONFIG_NAND_LEGACY
+#define CONFIG_MTD_NAND_ECC_JFFS2
+#define CFG_MAX_NAND_DEVICE    1       /* Max number of NAND devices   */
+#define SECTORSIZE 512
+
+#define ADDR_COLUMN 1
+#define ADDR_PAGE 2
+#define ADDR_COLUMN_PAGE 3
+
+#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)  \
+       while (!(((volatile immap_t *)CFG_IMMR)->im_ioport.iop_pcdat & 0x0008));
+#define WRITE_NAND_COMMAND(d, adr) WRITE_NAND((d), (adr))
+#define WRITE_NAND_ADDRESS(d, adr) WRITE_NAND((d), (adr))
+#define WRITE_NAND(d, adr)     \
+        do { (*(volatile uint8_t *)(adr) = (uint8_t)(d)); } while (0)
+#define READ_NAND(adr) (*(volatile uint8_t *)(adr))
+#define        CLE_LO  0x01    /* 0 selects CLE mode (CLE high) */
+#define        ALE_LO  0x02    /* 0 selects ALE mode (ALE high) */
+#define        CE_LO   0x04    /* 1 selects chip (CE low) */
+#define        nand_setcr(cr, val) do {*(volatile uint8_t*)(cr) = (val);} while (0)
+#define NAND_DISABLE_CE(nand) \
+       nand_setcr((nand)->IO_ADDR + 1, ALE_LO | CLE_LO)
+#define NAND_ENABLE_CE(nand) \
+       nand_setcr((nand)->IO_ADDR + 1, CE_LO | ALE_LO | CLE_LO)
+#define NAND_CTL_CLRALE(nandptr) \
+       nand_setcr((nandptr) + 1, CE_LO | ALE_LO | CLE_LO)
+#define NAND_CTL_SETALE(nandptr) \
+       nand_setcr((nandptr) + 1, CE_LO | CLE_LO)
+#define NAND_CTL_CLRCLE(nandptr) \
+       nand_setcr((nandptr) + 1, CE_LO | ALE_LO | CLE_LO)
+#define NAND_CTL_SETCLE(nandptr) \
+       nand_setcr((nandptr) + 1, CE_LO | ALE_LO)
 
 /*
  * Miscellaneous configurable options
  */
 #define        CFG_LONGHELP                    /* undef to save a little memory */
 #define        CFG_PROMPT              "=>"    /* Monitor Command Prompt       */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
 #else
 #define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
 #define CFG_MEMTEST_START      0x0100000       /* memtest works on     */
 #define CFG_MEMTEST_END                0x0400000       /* 1 ... 4 MB in DRAM   */
 
-#define CFG_LOAD_ADDR          0x00100000
+#define CFG_LOAD_ADDR          0x00100000
 
 #define        CFG_HZ          1000            /* decrementer freq: 1 ms ticks */
 
  * Cache Configuration
  */
 #define CFG_CACHELINE_SIZE     16      /* For all MPC8xx CPUs                  */
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#if defined(CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT    4       /* log base 2 of the above value        */
 #endif
 
  * These preliminary values are also the final values.
  */
 #define CFG_OR_TIMING_FPGA \
-       (OR_CSNT_SAM | OR_ACS_DIV2 | OR_BI | OR_SCY_5_CLK | OR_EHTR)
+       (OR_CSNT_SAM | OR_ACS_DIV2 | OR_BI | OR_SCY_4_CLK | OR_EHTR | OR_TRLX)
 #define CFG_BR1_PRELIM ((CFG_FPGA_BASE & BR_BA_MSK) | BR_PS_8 | BR_V )
 #define CFG_OR1_PRELIM (((-CFG_FPGA_SIZE) & OR_AM_MSK) | CFG_OR_TIMING_FPGA)
 
  * These preliminary values are also the final values.
  */
 #define CFG_OR_TIMING_DFLASH \
-       (OR_CSNT_SAM | OR_ACS_DIV4 | OR_BI | OR_SCY_5_CLK | OR_EHTR)
+       (OR_CSNT_SAM | OR_ACS_DIV4 | OR_BI | OR_SCY_2_CLK | OR_EHTR | OR_TRLX)
 #define CFG_BR4_PRELIM ((CFG_DFLASH_BASE & BR_BA_MSK) | BR_PS_8 | BR_V )
 #define CFG_OR4_PRELIM (((-CFG_DFLASH_SIZE) & OR_AM_MSK) | CFG_OR_TIMING_DFLASH)
 
 
 #define CONFIG_RESET_ON_PANIC          /* reset if system panic() */
 
-/* to put environment in EEROM */
-#define        CFG_ENV_IS_IN_EEPROM    1
-#define CFG_ENV_OFFSET         0       /* Start right at beginning of NVRAM */
-#define CFG_ENV_SIZE           1024    /* Use only a part of it*/
-
-#if 1
-#define CONFIG_BOOT_RETRY_TIME 60      /* boot if no command in 60 seconds */
+#define CONFIG_ENV_IS_IN_FLASH
+#ifdef CONFIG_ENV_IS_IN_FLASH
+  /* environment is in FLASH */
+  #define CONFIG_ENV_ADDR              0xF8040000      /* AM29LV641 or AM29LV800BT */
+  #define CONFIG_ENV_ADDR_REDUND       0xF8050000      /* AM29LV641 or AM29LV800BT */
+  #define CONFIG_ENV_SECT_SIZE 0x00010000
+  #define CONFIG_ENV_SIZE              0x00002000
+#else
+  /* environment is in EEPROM */
+  #define CONFIG_ENV_IS_IN_EEPROM              1
+  #define CONFIG_ENV_OFFSET            0       /* at beginning of EEPROM */
+  #define CONFIG_ENV_SIZE                   1024       /* Use only a part of it*/
 #endif
 
 #if 1
 #define CONFIG_AUTOBOOT_KEYED          /* use key strings to stop autoboot */
-#define CONFIG_AUTOBOOT_PROMPT         "autoboot in %d seconds\n"
+#define CONFIG_AUTOBOOT_PROMPT         "autoboot in %d seconds\n", bootdelay
 #define CONFIG_AUTOBOOT_DELAY_STR      "delayabit"
 #define CONFIG_AUTOBOOT_STOP_STR       " " /* easy to stop for now */
 #endif