[uboot-lantiq] add preliminary AR9 support
[openwrt.git] / package / uboot-lantiq / files / include / configs / ifx-common.h
1 /*
2  * (C) Copyright 2008
3  * Stefan Roese, DENX Software Engineering, sr@denx.de.
4  *
5  * Common configuration options for all AMCC boards
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20  * MA 02111-1307 USA
21  */
22
23 #ifndef __IFX_COMMON_H
24 #define __IFX_COMMON_H
25
26 #define CONFIG_BOOTDELAY        5       /* autoboot after 5 seconds     */
27
28 #define CONFIG_BAUDRATE         115200
29
30 /* valid baudrates */
31 #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200 }
32
33 #define CONFIG_TIMESTAMP                /* Print image info with timestamp */
34
35 #define CONFIG_PREBOOT  "echo;" \
36         "echo Type \\\"run flash_nfs\\\" to mount root filesystem over NFS;" \
37         "echo"
38
39 #undef  CONFIG_BOOTARGS
40 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
41         "ram_addr=0x80500000\0"                                         \
42         "kernel_addr=0xb0050000\0"                                      \
43         "mtdparts=mtdparts=ifx-nor:256k(uboot)ro,64k(uboot_env)ro,64k(kernel),-(rootfs)\0" \
44         "flashargs=setenv bootargs rootfstype=squashfs,jffs2\0"         \
45         "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
46                 "nfsroot=${serverip}:${rootpath} \0"                    \
47         "addip=setenv bootargs ${bootargs} "                            \
48                 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
49                 ":${hostname}:${netdev}:off\0"                          \
50         "addmisc=setenv bootargs ${bootargs} init=/etc/preinit "        \
51                 "console=ttyS1,115200 ethaddr=${ethaddr} ${mtdparts}"           \
52                 "${mtdparts}\0"                                         \
53         "flash_flash=run flashargs addip addmisc;"                      \
54                 "bootm ${kernel_addr}\0"                                \
55         "flash_nfs=run nfsargs addip addmisc;bootm ${kernel_addr}\0"    \
56         "net_flash=run load_kernel flashargs addip addmisc;"            \
57                 "bootm ${ram_addr}\0"                                   \
58         "net_nfs=run load_kernel nfsargs addip addmisc;"                \
59                 "bootm ${ram_addr}\0"                                   \
60         "load_kernel=tftp ${ram_addr} "                                 \
61                 "${tftppath}openwrt-ifxmips-uImage\0"                   \
62         "update_uboot=tftp 0x80500000 ${tftppath}u-boot.bin;era 0xb0000000 +${filesize};" \
63                 "cp.b 0x80500000 0xb0000000 ${filesize}\0" \
64         "update_openwrt=tftp ${ram_addr} "                              \
65                 "${tftppath}openwrt-ifxmips-squashfs.image;"            \
66                 "era ${kernel_addr} +${filesize};"                      \
67                 "cp.b ${ram_addr} ${kernel_addr} ${filesize}\0"
68
69 #define CONFIG_BOOTCOMMAND      "run flash_flash"
70
71 /*
72  * TFTP is using fragmented packets
73 */
74 #define CONFIG_IP_DEFRAG
75
76 /*
77  * BOOTP options
78  */
79 #define CONFIG_BOOTP_BOOTFILESIZE
80 #define CONFIG_BOOTP_BOOTPATH
81 #define CONFIG_BOOTP_GATEWAY
82 #define CONFIG_BOOTP_HOSTNAME
83
84
85 /*
86  * Command line configuration.
87  */
88 #include <config_cmd_default.h>
89
90 #undef CONFIG_CMD_CONSOLE
91 #undef CONFIG_CMD_FPGA
92 #undef CONFIG_CMD_IMLS
93 #undef CONFIG_CMD_LOADB
94 #undef CONFIG_CMD_LOADS
95 #undef CONFIG_CMD_NFS
96 #undef CONFIG_CMD_XIMG
97
98 //#define CONFIG_CMD_ASKENV
99 //#define CONFIG_CMD_DHCP
100 //#define CONFIG_CMD_ELF
101 #define CONFIG_CMD_PING
102 //#define CONFIG_CMD_JFFS2
103 //#define CONFIG_CMD_SNTP
104
105
106 /*
107  * Miscellaneous configurable options
108  */
109
110 #define CONFIG_LZMA
111
112 #define CONFIG_SYS_LONGHELP                             /* undef to save memory */
113 #ifndef CONFIG_SYS_PROMPT
114 #define CONFIG_SYS_PROMPT               "=> "           /* Monitor Command Prompt */
115 #endif
116 #define CONFIG_SYS_CBSIZE               256             /* Console I/O Buffer Size */
117 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)  /* Print Buffer Size */
118 #define CONFIG_SYS_MAXARGS              16              /* max number of command args */
119
120 #define CONFIG_SYS_MALLOC_LEN           1024*1024
121 #define CONFIG_SYS_BOOTPARAMS_LEN       128*1024
122
123 #define CONFIG_SYS_MIPS_TIMER_FREQ      (CPU_CLOCK_RATE/2)
124 #define CONFIG_SYS_HZ                   1000
125
126 #define CONFIG_SYS_SDRAM_BASE           0x80000000
127 #define CONFIG_SYS_LOAD_ADDR            0x80100000      /* default load address */
128 #define CONFIG_SYS_MEMTEST_START        0x80100000
129 #define CONFIG_SYS_MEMTEST_END          0x80800000
130
131 #define CONFIG_CMDLINE_EDITING          /* add command line history     */
132 #define CONFIG_AUTO_COMPLETE            /* add autocompletion support   */
133
134 #define CONFIG_ZERO_BOOTDELAY_CHECK     /* check for keypress on bootdelay==0 */
135 #define CONFIG_VERSION_VARIABLE         /* include version env variable */
136 #define CONFIG_SYS_CONSOLE_INFO_QUIET   /* don't print console @ startup*/
137
138 #ifdef CONFIG_SYS_HUSH_PARSER
139 #define CONFIG_SYS_PROMPT_HUSH_PS2      "> "
140 #endif
141
142 #define CONFIG_LOADS_ECHO               /* echo on for serial download  */
143 #define CONFIG_SYS_LOADS_BAUD_CHANGE    /* allow baudrate change        */
144
145 /*-----------------------------------------------------------------------
146  * FLASH and environment organization
147  */
148  
149 #define CONFIG_SYS_MAX_FLASH_BANKS_DETECT       1
150
151 #define CONFIG_SYS_MAX_FLASH_BANKS      1       /* max number of memory banks */
152 #define CONFIG_SYS_MAX_FLASH_SECT       (140)   /* max number of sectors on one chip */
153
154 #define PHYS_FLASH_1                    0xB0000000 /* Flash Bank #1 */
155 #define PHYS_FLASH_2                    0xB0800000 /* Flash Bank #2 */
156
157 /* The following #defines are needed to get flash environment right */
158 #define CONFIG_SYS_MONITOR_BASE         TEXT_BASE
159 #define CONFIG_SYS_MONITOR_LEN          (192 << 10)
160
161 #define CONFIG_SYS_INIT_SP_OFFSET       0x400000
162
163 #define CONFIG_SYS_FLASH_BASE           PHYS_FLASH_1
164
165 #define CONFIG_ENV_OVERWRITE            1
166 #define CONFIG_ENV_IS_IN_FLASH          1
167
168 /* Address and size of Primary Environment Sector       */
169 #define CONFIG_ENV_ADDR                 0xB0040000
170 #define CONFIG_ENV_SIZE                 0x10000
171
172 #ifdef CONFIG_FLASH_CFI_DRIVER
173 #define CONFIG_SYS_FLASH_CFI
174 #define CONFIG_SYS_FLASH_SWAP_ADDR
175 #define CONFIG_FLASH_SHOW_PROGRESS      45
176
177 #define CONFIG_SYS_FLASH_CFI_WIDTH      FLASH_CFI_16BIT
178
179 #define FLASH_FIXUP_ADDR_8(addr)        ((void*)((ulong)(addr)^2))
180 #define FLASH_FIXUP_ADDR_16(addr)       ((void*)((ulong)(addr)^2))
181
182 #endif
183
184 #define CONFIG_NR_DRAM_BANKS            1
185
186 #ifdef CONFIG_SYS_EBU_BOOT
187 #ifndef INFINEON_EBU_BOOTCFG
188 #error Please define INFINEON_EBU_BOOTCFG
189 #endif
190 #endif
191
192 #endif /* __IFX_COMMON_H */