Coding style cleanup
[platform/kernel/u-boot.git] / include / configs / TQM5200.h
index 897d1b2..aa3627b 100644 (file)
@@ -44,7 +44,7 @@
 
 #define CFG_MPC5XXX_CLKIN      33000000 /* ... running at 33.000000MHz         */
 
-#define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH     */
+#define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM          0x02    /* Software reboot                      */
 
 #define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs                     */
 
 #undef CONFIG_BOOTARGS
 
-#ifdef CONFIG_STK52XX
-# if defined(CONFIG_TQM5200_B)
-#  if defined(CFG_LOWBOOT)
-#   define ENV_UPDT                                                    \
-       "update=protect off FC000000 FC07FFFF;"                         \
-               "erase FC000000 FC07FFFF;"                              \
-               "cp.b 200000 FC000000 ${filesize};"                     \
-               "protect on FC000000 FC07FFFF\0"
-#  else        /* highboot */
-#   define ENV_UPDT                                                    \
-       "update=protect off FFF00000 FFF7FFFF;"                         \
-               "erase FFF00000 FFF7FFFF;"                              \
+#if defined(CONFIG_TQM5200_B) && !defined(CFG_LOWBOOT)
+# define ENV_UPDT                                                      \
+       "update=protect off FFF00000 +${filesize};"                     \
+               "erase FFF00000 +${filesize};"                          \
                "cp.b 200000 FFF00000 ${filesize};"                     \
-               "protect on FFF00000 FFF7FFFF\0"
-#  endif /* CFG_LOWBOOT */
-# else /* !CONFIG_TQM5200_B */
-#  define ENV_UPDT                                                     \
-       "update=protect off FC000000 FC05FFFF;"                         \
-               "erase FC000000 FC05FFFF;"                              \
-               "cp.b 200000 FC000000 ${filesize};"                     \
-               "protect on FC000000 FC05FFFF\0"
-# endif /* CONFIG_TQM5200_B */
-#elif defined (CONFIG_CAM5200)
-#   define ENV_UPDT                                                    \
-       "update=protect off FC000000 FC03FFFF;"                         \
-               "erase FC000000 FC03FFFF;"                              \
-               "cp.b 200000 FC000000 ${filesize};"                     \
-               "protect on FC000000 FC03FFFF\0"
-#elif defined (CONFIG_FO300)
+               "protect on FFF00000 +${filesize}\0"
+#else  /* default lowboot configuration */
 #   define ENV_UPDT                                                    \
-       "update=protect off FC000000 FC05FFFF;"                         \
-               "erase FC000000 FC05FFFF;"                              \
+       "update=protect off FC000000 +${filesize};"                     \
+               "erase FC000000 +${filesize};"                          \
                "cp.b 200000 FC000000 ${filesize};"                     \
-               "protect on FC000000 FC05FFFF\0"
+               "protect on FC000000 +${filesize}\0"
+#endif
+
+#ifndef CONFIG_CAM5200
+#define CUSTOM_ENV_SETTINGS                                            \
+       "bootfile=/tftpboot/tqm5200/uImage\0"                           \
+       "bootfile_fdt=/tftpboot/tqm5200/uImage_fdt\0"                   \
+       "fdt_file=/tftpboot/tqm5200/tqm5200.dtb\0"                      \
+       "u-boot=/tftpboot/tqm5200/u-boot.bin\0"
 #else
-# error "Unknown Carrier Board"
-#endif /* CONFIG_STK52XX */
+#define CUSTOM_ENV_SETTINGS                                            \
+       "bootfile=cam5200/uImage\0"                                     \
+       "u-boot=cam5200/u-boot.bin\0"                                   \
+       "setup=tftp 200000 cam5200/setup.img; autoscr 200000\0"
+#endif
 
 #define CONFIG_EXTRA_ENV_SETTINGS                                      \
+       "console=ttyS0\0"                                               \
+       "kernel_addr=200000\0"                                          \
+       "fdt_addr=400000\0"                                             \
+       "hostname=tqm5200\0"                                            \
        "netdev=eth0\0"                                                 \
        "rootpath=/opt/eldk/ppc_6xx\0"                                  \
        "ramargs=setenv bootargs root=/dev/ram rw\0"                    \
                "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
                ":${hostname}:${netdev}:off panic=1\0"                  \
        "addcons=setenv bootargs ${bootargs} "                          \
-               "console=ttyS0,${baudrate}\0"                           \
+               "console=${console},${baudrate}\0"                      \
        "flash_self=run ramargs addip addcons;"                         \
                "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
        "flash_nfs=run nfsargs addip addcons;"                          \
                "bootm ${kernel_addr}\0"                                \
-       "net_nfs=tftp 200000 ${bootfile};run nfsargs addip addcons;"    \
-               "bootm\0"                                               \
-       "bootfile=/tftpboot/tqm5200/uImage\0"                           \
-       "u-boot=/tftpboot/tqm5200/u-boot.bin\0"                         \
+       "net_nfs=tftp ${kernel_addr} ${bootfile};"                      \
+               "run nfsargs addip addcons;bootm\0"                     \
+       "net_nfs_fdt=tftp ${kernel_addr} ${bootfile_fdt};"              \
+               "tftp ${fdt_addr} ${fdt_file};setenv console ttyPSC0;"  \
+               "run nfsargs addip addcons;"                            \
+               "bootm ${kernel_addr} - ${fdt_addr}\0"                  \
+       CUSTOM_ENV_SETTINGS                                             \
        "load=tftp 200000 ${u-boot}\0"                                  \
        ENV_UPDT                                                        \
        ""
 /*
  * IPB Bus clocking configuration.
  */
-#define CFG_IPBSPEED_133               /* define for 133MHz speed */
+#define CFG_IPBCLK_EQUALS_XLBCLK               /* define for 133MHz speed */
 
-#if defined(CFG_IPBSPEED_133) && !defined(CONFIG_CAM5200)
+#if defined(CFG_IPBCLK_EQUALS_XLBCLK) && !defined(CONFIG_CAM5200)
 /*
  * PCI Bus clocking configuration
  *
  * Actually a PCI Clock of 66 MHz is only set (in cpu_init.c) if
- * CFG_IPBSPEED_133 is defined. This is because a PCI Clock of 66 MHz yet hasn't
- * been tested with a IPB Bus Clock of 66 MHz.
+ * CFG_IPBCLK_EQUALS_XLBCLK is defined. This is because a PCI Clock of
+ * 66 MHz yet hasn't been tested with a IPB Bus Clock of 66 MHz.
  */
-#define CFG_PCISPEED_66                        /* define for 66MHz speed */
+#define CFG_PCICLK_EQUALS_IPBCLK_DIV2  /* define for 66MHz speed */
 #endif
 
 /*
  */
 #define CFG_FLASH_BASE         0xFC000000
 
-#ifndef CONFIG_CAM5200
-/* use CFI flash driver */
-#define CFG_FLASH_CFI          1       /* Flash is CFI conformant */
-#define CFG_FLASH_CFI_DRIVER   1       /* Use the common driver */
-#define CFG_FLASH_BANKS_LIST   { CFG_BOOTCS_START }
-#define CFG_MAX_FLASH_BANKS    1       /* max num of flash banks
-                                          (= chip selects) */
-#define CFG_MAX_FLASH_SECT     512     /* max num of sects on one chip */
-#else /* CONFIG_CAM5200 */
+#if defined(CONFIG_CAM5200) && defined(CONFIG_CAM5200_NIOSFLASH)
 #define CFG_MAX_FLASH_BANKS    2       /* max num of flash banks
                                           (= chip selects) */
 #define CFG_FLASH_WORD_SIZE    unsigned int /* main flash device with */
 #define CFG_FLASH_ADDR1                0x2AA
 #define CFG_FLASH_2ND_16BIT_DEV        1       /* NIOS flash is a 16bit device */
 #define CFG_MAX_FLASH_SECT     128
-#endif /* ifndef CONFIG_CAM5200 */
+#else
+/* use CFI flash driver */
+#define CFG_FLASH_CFI          1       /* Flash is CFI conformant */
+#define CFG_FLASH_CFI_DRIVER   1       /* Use the common driver */
+#define CFG_FLASH_BANKS_LIST   { CFG_BOOTCS_START }
+#define CFG_MAX_FLASH_BANKS    1       /* max num of flash banks
+                                          (= chip selects) */
+#define CFG_MAX_FLASH_SECT     512     /* max num of sects on one chip */
+#endif
 
 #define CFG_FLASH_EMPTY_INFO
 #define CFG_FLASH_SIZE         0x04000000 /* 64 MByte */
  */
 #define CFG_ENV_IS_IN_FLASH    1
 #define CFG_ENV_SIZE           0x4000  /* 16 k - keep small for fast booting */
-#if defined(CONFIG_TQM5200_B)
+#if defined(CONFIG_TQM5200_B) || defined (CONFIG_CAM5200)
 #define CFG_ENV_SECT_SIZE      0x40000
 #else
 #define CFG_ENV_SECT_SIZE      0x20000
 #define CFG_LONGHELP                   /* undef to save memory     */
 #define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
 
+#define CONFIG_CMDLINE_EDITING 1       /* add command line history     */
 #define        CFG_HUSH_PARSER         1       /* use "hush" command parser    */
 #define        CFG_PROMPT_HUSH_PS2     "> "
 
 
 #define CFG_BOOTCS_START       CFG_FLASH_BASE
 #define CFG_BOOTCS_SIZE                CFG_FLASH_SIZE
-#ifdef CFG_PCISPEED_66
+#ifdef CFG_PCICLK_EQUALS_IPBCLK_DIV2
 #define CFG_BOOTCS_CFG         0x0008DF30 /* for pci_clk  = 66 MHz */
 #else
 #define CFG_BOOTCS_CFG         0x0004DF30 /* for pci_clk = 33 MHz */
 /* Interval between registers                                               */
 #define CFG_ATA_STRIDE         4
 
+/*-----------------------------------------------------------------------
+ * Open firmware flat tree support
+ *-----------------------------------------------------------------------
+ */
+#define CONFIG_OF_FLAT_TREE    1
+#define CONFIG_OF_BOARD_SETUP  1
+
+/* maximum size of the flat tree (8K) */
+#define OF_FLAT_TREE_MAX_SIZE  8192
+#define OF_CPU                 "PowerPC,5200@0"
+#define OF_SOC                 "soc5200@f0000000"
+#define OF_TBCLK               (bd->bi_busfreq / 4)
+#define OF_STDOUT_PATH         "/soc5200@f0000000/serial@2000"
+
 #endif /* __CONFIG_H */