Merge with /home/mk/11-cmb1920/u-boot#4upstream
[oweals/u-boot.git] / include / configs / TQM834x.h
index 96a1ad28fc96bae560fd62cbd74cc321ac58af5a..728083b304c4e4b58f48a985e3044b1472fe1838 100644 (file)
 #define CONFIG_E300            1       /* E300 Family */
 #define CONFIG_MPC83XX         1       /* MPC83XX family */
 #define CONFIG_MPC834X         1       /* MPC834X specific */
+#define CONFIG_MPC8349         1       /* MPC8349 specific */
 #define CONFIG_TQM834X         1       /* TQM834X board specific */
 
 /* IMMR Base Addres Register, use Freescale default: 0xff400000 */
-#define CFG_IMMRBAR            0xff400000
+#define CFG_IMMR               0xff400000
 
 /* System clock. Primary input clock when in PCI host mode */
 #define CONFIG_83XX_CLKIN      66666000        /* 66,666 MHz */
  */
 #define CFG_LCRR               (LCRR_DBYP | LCRR_CLKDIV_8)
 
+#define CFG_SCCR_INIT          (SCCR_DEFAULT & (~SCCR_CLK_MASK))
+#define CFG_SCCR_TSEC1CM       SCCR_TSEC1CM_1  /* TSEC1 clock setting */
+#define CFG_SCCR_TSEC2CM       SCCR_TSEC2CM_1  /* TSEC2 clock setting */
+#define CFG_SCCR_ENCCM         SCCR_ENCCM_3    /* ENC clock setting */
+#define CFG_SCCR_USBCM         SCCR_USBCM_3    /* USB clock setting */
+#define CFG_SCCR_VAL           ( CFG_SCCR_INIT         \
+                               | CFG_SCCR_TSEC1CM      \
+                               | CFG_SCCR_TSEC2CM      \
+                               | CFG_SCCR_ENCCM        \
+                               | CFG_SCCR_USBCM        )
+
 /* board pre init: do not call, nothing to do */
 #undef CONFIG_BOARD_EARLY_INIT_F
 
@@ -83,6 +95,7 @@
 #define CFG_FLASH_CFI_DRIVER                   /* use the CFI driver */
 #undef CFG_FLASH_CHECKSUM
 #define CFG_FLASH_BASE         0x80000000      /* start of FLASH   */
+#define CFG_FLASH_SIZE         8               /* FLASH size in MB */
 
 /* buffered writes in the AMD chip set is not supported yet */
 #undef CFG_FLASH_USE_BUFFER_WRITE
  * When CFG_MAX_FLASH_BANKS_DETECT is defined, the actual number of Flash
  * banks has to be determined at runtime and stored in a gloabl variable
  * tqm834x_num_flash_banks. The value of CFG_MAX_FLASH_BANKS_DETECT is only
- * used insted of CFG_MAX_FLASH_BANKS to allocate the array flash_info, and
+ * used instead of CFG_MAX_FLASH_BANKS to allocate the array flash_info, and
  * should be made sufficiently large to accomodate the number of banks that
- * might acutally be detected.  Since most (all?) Flash related functions use
+ * might actually be detected.  Since most (all?) Flash related functions use
  * CFG_MAX_FLASH_BANKS as the number of actual banks on the board, it is
  * defined as tqm834x_num_flash_banks.
  */
 #define CFG_MAX_FLASH_BANKS_DETECT     2
-#ifndef __ASSEMBLY__ 
+#ifndef __ASSEMBLY__
 extern int tqm834x_num_flash_banks;
 #endif
 #define CFG_MAX_FLASH_BANKS (tqm834x_num_flash_banks)
@@ -122,6 +135,7 @@ extern int tqm834x_num_flash_banks;
 #define CFG_OR0_PRELIM         (CFG_PRELIM_OR_AM  | CFG_OR_TIMING_FLASH)
 
 #define CFG_LBLAWAR0_PRELIM    0x8000001D      /* 1 GiB window size (2^(size + 1)) */
+
 #define CFG_LBLAWBAR0_PRELIM   CFG_FLASH_BASE  /* Window base at flash base */
 
 /* disable remaining mappings */
@@ -196,14 +210,15 @@ extern int tqm834x_num_flash_banks;
 #define CFG_BAUDRATE_TABLE  \
        {300, 600, 1200, 2400, 4800, 9600, 19200, 38400,115200}
 
-#define CFG_NS16550_COM1       (CFG_IMMRBAR + 0x4500)
-#define CFG_NS16550_COM2       (CFG_IMMRBAR + 0x4600)
+#define CFG_NS16550_COM1       (CFG_IMMR + 0x4500)
+#define CFG_NS16550_COM2       (CFG_IMMR + 0x4600)
 
 /*
  * I2C
  */
 #define CONFIG_HARD_I2C                                /* I2C with hardware support    */
 #undef CONFIG_SOFT_I2C                         /* I2C bit-banged               */
+#define CONFIG_FSL_I2C
 #define CFG_I2C_SPEED                  400000  /* I2C speed: 400KHz            */
 #define CFG_I2C_SLAVE                  0x7F    /* slave address                */
 #define CFG_I2C_OFFSET                 0x3000
@@ -234,21 +249,21 @@ extern int tqm834x_num_flash_banks;
 #define CONFIG_MII
 
 #define CFG_TSEC1_OFFSET       0x24000
-#define CFG_TSEC1              (CFG_IMMRBAR + CFG_TSEC1_OFFSET)
+#define CFG_TSEC1              (CFG_IMMR + CFG_TSEC1_OFFSET)
 #define CFG_TSEC2_OFFSET       0x25000
-#define CFG_TSEC2              (CFG_IMMRBAR + CFG_TSEC2_OFFSET)
+#define CFG_TSEC2              (CFG_IMMR + CFG_TSEC2_OFFSET)
 
 #if defined(CONFIG_TSEC_ENET)
 
 #ifndef CONFIG_NET_MULTI
-#define CONFIG_NET_MULTI               1
+#define CONFIG_NET_MULTI
 #endif
 
 #define CONFIG_MPC83XX_TSEC1           1
 #define CONFIG_MPC83XX_TSEC1_NAME      "TSEC0"
 #define CONFIG_MPC83XX_TSEC2           1
 #define CONFIG_MPC83XX_TSEC2_NAME      "TSEC1"
-#define TSEC1_PHY_ADDR                 0
+#define TSEC1_PHY_ADDR                 2
 #define TSEC2_PHY_ADDR                 1
 #define TSEC1_PHYIDX                   0
 #define TSEC2_PHYIDX                   0
@@ -262,45 +277,33 @@ extern int tqm834x_num_flash_banks;
  * General PCI
  * Addresses are mapped 1-1.
  */
-/* FIXME: Real PCI support will come in a follow-up update. */
-#undef CONFIG_PCI
-
-#define CFG_PCI1_MEM_BASE      0x80000000
-#define CFG_PCI1_MEM_PHYS      CFG_PCI1_MEM_BASE
-#define CFG_PCI1_MEM_SIZE      0x20000000      /* 512M */
-#define CFG_PCI1_IO_BASE       0x00000000
-#define CFG_PCI1_IO_PHYS       0xe2000000
-#define CFG_PCI1_IO_SIZE       0x1000000       /* 16M */
-
-#define CFG_PCI2_MEM_BASE      0xA0000000
-#define CFG_PCI2_MEM_PHYS      CFG_PCI2_MEM_BASE
-#define CFG_PCI2_MEM_SIZE      0x20000000      /* 512M */
-#define CFG_PCI2_IO_BASE       0x00000000
-#define CFG_PCI2_IO_PHYS       0xe3000000
-#define CFG_PCI2_IO_SIZE       0x1000000       /* 16M */
+#define CONFIG_PCI
+
 #if defined(CONFIG_PCI)
 
-#define PCI_ALL_PCI1
-#if defined(PCI_64BIT)
-#undef PCI_ALL_PCI1
-#undef PCI_TWO_PCI1
-#undef PCI_ONE_PCI1
-#endif
+#define CONFIG_PCI_PNP                  /* do pci plug-and-play */
+#define CONFIG_PCI_SCAN_SHOW            /* show pci devices on startup */
+
+/* PCI1 host bridge */
+#define CFG_PCI1_MEM_BASE       0xc0000000
+#define CFG_PCI1_MEM_PHYS       CFG_PCI1_MEM_BASE
+#define CFG_PCI1_MEM_SIZE       0x20000000      /* 512M */
+#define CFG_PCI1_IO_BASE        0xe2000000
+#define CFG_PCI1_IO_PHYS        CFG_PCI1_IO_BASE
+#define CFG_PCI1_IO_SIZE        0x1000000       /* 16M */
 
-#define CONFIG_NET_MULTI
-#define CONFIG_PCI_PNP         /* do pci plug-and-play */
 
 #undef CONFIG_EEPRO100
+#define CONFIG_EEPRO100
 #undef CONFIG_TULIP
 
 #if !defined(CONFIG_PCI_PNP)
-       #define PCI_ENET0_IOADDR        0xFIXME
-       #define PCI_ENET0_MEMADDR       0xFIXME
-       #define PCI_IDSEL_NUMBER        0x0c    /* slot0->3(IDSEL)=12->15 */
+       #define PCI_ENET0_IOADDR        CFG_PCI1_IO_BASE
+       #define PCI_ENET0_MEMADDR       CFG_PCI1_MEM_BASE
+       #define PCI_IDSEL_NUMBER        0x1c    /* slot0 (IDSEL) = 28 */
 #endif
 
-#undef CONFIG_PCI_SCAN_SHOW                    /* show pci devices on startup */
-#define CFG_PCI_SUBSYS_VENDORID                0x1057  /* Motorola */
+#define CFG_PCI_SUBSYS_VENDORID                0x1957  /* Freescale */
 
 #endif /* CONFIG_PCI */
 
@@ -364,6 +367,12 @@ extern int tqm834x_num_flash_banks;
 #define CFG_LOAD_ADDR          0x2000000       /* default load address */
 #define CFG_PROMPT             "=> "           /* Monitor Command Prompt */
 
+#define CONFIG_CMDLINE_EDITING 1       /* add command line history     */
+#define CFG_HUSH_PARSER                1       /* Use the HUSH parser          */
+#ifdef CFG_HUSH_PARSER
+#define        CFG_PROMPT_HUSH_PS2     "> "
+#endif
+
 #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
        #define CFG_CBSIZE      1024            /* Console I/O Buffer Size */
 #else
@@ -418,7 +427,7 @@ extern int tqm834x_num_flash_banks;
        HRCWH_PCI_HOST |\
        HRCWH_32_BIT_PCI |\
        HRCWH_PCI1_ARBITER_ENABLE |\
-       HRCWH_PCI2_ARBITER_ENABLE |\
+       HRCWH_PCI2_ARBITER_DISABLE |\
        HRCWH_CORE_ENABLE |\
        HRCWH_FROM_0X00000100 |\
        HRCWH_BOOTSEQ_DISABLE |\
@@ -428,10 +437,66 @@ extern int tqm834x_num_flash_banks;
        HRCWH_TSEC2M_IN_GMII )
 #endif
 
+/* System IO Config */
+#define CFG_SICRH      SICRH_TSOBI1
+#define CFG_SICRL      SICRL_LDP_A
+
 /* i-cache and d-cache disabled */
-#define CFG_HID0_INIT          0x000000000
-#define CFG_HID0_FINAL         CFG_HID0_INIT
-#define CFG_HID2               0x000000000
+#define CFG_HID0_INIT  0x000000000
+#define CFG_HID0_FINAL CFG_HID0_INIT
+#define CFG_HID2       HID2_HBE
+
+/* DDR 0 - 512M */
+#define CFG_IBAT0L     (CFG_SDRAM_BASE | BATL_PP_10 | BATL_MEMCOHERENCE)
+#define CFG_IBAT0U     (CFG_SDRAM_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
+#define CFG_IBAT1L     (CFG_SDRAM_BASE + 0x10000000 | BATL_PP_10 | BATL_MEMCOHERENCE)
+#define CFG_IBAT1U     (CFG_SDRAM_BASE + 0x10000000 | BATU_BL_256M | BATU_VS | BATU_VP)
+
+/* stack in DCACHE @ 512M (no backing mem) */
+#define CFG_IBAT2L     (CFG_INIT_RAM_ADDR | BATL_PP_10 | BATL_MEMCOHERENCE)
+#define CFG_IBAT2U     (CFG_INIT_RAM_ADDR | BATU_BL_128K | BATU_VS | BATU_VP)
+
+/* PCI */
+#ifdef CONFIG_PCI
+#define CFG_IBAT3L     (CFG_PCI1_MEM_BASE | BATL_PP_10 | BATL_MEMCOHERENCE)
+#define CFG_IBAT3U     (CFG_PCI1_MEM_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
+#define CFG_IBAT4L     (CFG_PCI1_MEM_BASE + 0x10000000 | BATL_PP_10 | BATL_MEMCOHERENCE)
+#define CFG_IBAT4U     (CFG_PCI1_MEM_BASE + 0x10000000 | BATU_BL_256M | BATU_VS | BATU_VP)
+#define CFG_IBAT5L     (CFG_PCI1_IO_BASE | BATL_PP_10 | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CFG_IBAT5U     (CFG_PCI1_IO_BASE + 0x10000000 | BATU_BL_16M | BATU_VS | BATU_VP)
+#else
+#define CFG_IBAT3L     (0)
+#define CFG_IBAT3U     (0)
+#define CFG_IBAT4L     (0)
+#define CFG_IBAT4U     (0)
+#define CFG_IBAT5L     (0)
+#define CFG_IBAT5U     (0)
+#endif
+
+/* IMMRBAR */
+#define CFG_IBAT6L     (CFG_IMMR | BATL_PP_10 | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CFG_IBAT6U     (CFG_IMMR | BATU_BL_1M | BATU_VS | BATU_VP)
+
+/* FLASH */
+#define CFG_IBAT7L     (CFG_FLASH_BASE | BATL_PP_10 | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE)
+#define CFG_IBAT7U     (CFG_FLASH_BASE | BATU_BL_256M | BATU_VS | BATU_VP)
+
+#define CFG_DBAT0L     CFG_IBAT0L
+#define CFG_DBAT0U     CFG_IBAT0U
+#define CFG_DBAT1L     CFG_IBAT1L
+#define CFG_DBAT1U     CFG_IBAT1U
+#define CFG_DBAT2L     CFG_IBAT2L
+#define CFG_DBAT2U     CFG_IBAT2U
+#define CFG_DBAT3L     CFG_IBAT3L
+#define CFG_DBAT3U     CFG_IBAT3U
+#define CFG_DBAT4L     CFG_IBAT4L
+#define CFG_DBAT4U     CFG_IBAT4U
+#define CFG_DBAT5L     CFG_IBAT5L
+#define CFG_DBAT5U     CFG_IBAT5U
+#define CFG_DBAT6L     CFG_IBAT6L
+#define CFG_DBAT6U     CFG_IBAT6U
+#define CFG_DBAT7L     CFG_IBAT7L
+#define CFG_DBAT7U     CFG_IBAT7U
 
 /*
  * Internal Definitions
@@ -483,17 +548,17 @@ extern int tqm834x_num_flash_banks;
        "netdev=eth0\0"                                                 \
        "hostname=tqm83xx\0"                                            \
        "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
-               "nfsroot=$(serverip):$(rootpath)\0"                     \
+               "nfsroot=${serverip}:${rootpath}\0"                     \
        "ramargs=setenv bootargs root=/dev/ram rw\0"                    \
-       "addip=setenv bootargs $(bootargs) "                            \
-               "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask)"      \
-               ":$(hostname):$(netdev):off panic=1\0"                  \
-       "addtty=setenv bootargs $(bootargs) console=ttyS0,$(baudrate)\0"\
+       "addip=setenv bootargs ${bootargs} "                            \
+               "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
+               ":${hostname}:${netdev}:off panic=1\0"                  \
+       "addtty=setenv bootargs ${bootargs} console=ttyS0,${baudrate}\0"\
        "flash_nfs=run nfsargs addip addtty;"                           \
-               "bootm $(kernel_addr)\0"                                \
+               "bootm ${kernel_addr}\0"                                \
        "flash_self=run ramargs addip addtty;"                          \
-               "bootm $(kernel_addr) $(ramdisk_addr)\0"                \
-       "net_nfs=tftp 200000 $(bootfile);run nfsargs addip addtty;"     \
+               "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
+       "net_nfs=tftp 200000 ${bootfile};run nfsargs addip addtty;"     \
                "bootm\0"                                               \
        "rootpath=/opt/eldk/ppc_6xx\0"                                  \
        "bootfile=/tftpboot/tqm83xx/uImage\0"                           \