blob: e3bd264a80bab29e20264d2a64f93cf267890bab [file] [log] [blame]
Heiko Schocher7937e4f2008-11-20 09:59:09 +01001/*
2 * (C) Copyright 2008
3 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
4 *
5 * See file CREDITS for list of people who contributed to this
6 * project.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
22 */
23
24#ifndef __CONFIG_KEYMILE_H
25#define __CONFIG_KEYMILE_H
26
27/* Do boardspecific init for all boards */
28#define CONFIG_BOARD_EARLY_INIT_R 1
29
Heiko Schocher7937e4f2008-11-20 09:59:09 +010030#define CONFIG_BOOTCOUNT_LIMIT
Heiko Schocher7937e4f2008-11-20 09:59:09 +010031
32/*
Prafulla Wadaskar84cba2e2010-10-27 17:46:06 +053033 * By default kwbimage.cfg from board specific folder is used
34 * If for some board, different configuration file need to be used,
35 * CONFIG_SYS_KWD_CONFIG should be defined in board specific header file
36 */
37#ifndef CONFIG_SYS_KWD_CONFIG
Wolfgang Denk302141d2010-11-27 23:30:56 +010038#define CONFIG_SYS_KWD_CONFIG $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg
Prafulla Wadaskar84cba2e2010-10-27 17:46:06 +053039#endif /* CONFIG_SYS_KWD_CONFIG */
40
Wolfgang Denk302141d2010-11-27 23:30:56 +010041/*
Prafulla Wadaskar84cba2e2010-10-27 17:46:06 +053042 * CONFIG_SYS_TEXT_BASE can be defined in board specific header file, if needed
43 */
44#ifndef CONFIG_SYS_TEXT_BASE
45#define CONFIG_SYS_TEXT_BASE 0x00400000
46#endif /* CONFIG_SYS_TEXT_BASE */
47
48/*
Heiko Schocher7937e4f2008-11-20 09:59:09 +010049 * Command line configuration.
50 */
51#include <config_cmd_default.h>
52
53#define CONFIG_CMD_ASKENV
54#define CONFIG_CMD_DHCP
55#define CONFIG_CMD_ECHO
56#define CONFIG_CMD_IMMAP
57#define CONFIG_CMD_MII
58#define CONFIG_CMD_PING
Heiko Schocher7937e4f2008-11-20 09:59:09 +010059#define CONFIG_CMD_DTT
60#define CONFIG_CMD_EEPROM
61#define CONFIG_CMD_I2C
Heiko Schochera8d51892009-03-12 07:37:18 +010062#define CONFIG_CMD_JFFS2
63#define CONFIG_JFFS2_CMDLINE
Heiko Schocher875f47282009-07-09 12:04:18 +020064#define CONFIG_CMD_MTDPARTS
Heiko Schocher7937e4f2008-11-20 09:59:09 +010065
66#undef CONFIG_WATCHDOG /* disable platform specific watchdog */
67
Heiko Schocher7937e4f2008-11-20 09:59:09 +010068#define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
69#undef CONFIG_BOOTARGS /* the boot command will set bootargs */
70
71/*
72 * Miscellaneous configurable options
73 */
74#define CONFIG_SYS_HUSH_PARSER
75#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
76#define CONFIG_SYS_LONGHELP /* undef to save memory */
77#define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */
78#if defined(CONFIG_CMD_KGDB)
79#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
80#else
81#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
82#endif
83#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
84#define CONFIG_SYS_MAXARGS 16 /* max number of command args */
85#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
86#define CONFIG_CMDLINE_EDITING 1 /* add command line history */
Heiko Schochera8d51892009-03-12 07:37:18 +010087#define CONFIG_AUTO_COMPLETE /* add autocompletion support */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010088
Heiko Schocher7937e4f2008-11-20 09:59:09 +010089#define CONFIG_HUSH_INIT_VAR 1
Heiko Schocher7937e4f2008-11-20 09:59:09 +010090
91#define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
92#define CONFIG_SYS_MEMTEST_START 0x00100000 /* memtest works on */
93#define CONFIG_SYS_MEMTEST_END 0x00f00000 /* 1 ... 15 MB in DRAM */
94
95#define CONFIG_SYS_LOAD_ADDR 0x100000 /* default load address */
96
97#define CONFIG_SYS_HZ 1000 /* decrementer freq: 1 ms ticks */
98
99#define CONFIG_BAUDRATE 115200
100#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
101
102#define CONFIG_LOADS_ECHO 1 /* echo on for serial download */
103#define CONFIG_SYS_LOADS_BAUD_CHANGE 1 /* allow baudrate change */
Prafulla Wadaskarf8e42622010-09-30 19:33:19 +0530104#define CONFIG_SYS_BOARD_DRAM_INIT /* Used board specific dram_init */
Heiko Schocher7937e4f2008-11-20 09:59:09 +0100105
106/*
107 * How to get access to the slot ID. Put this here to make it easy
108 * to modify in a centralized location. This is used in the HDLC
109 * driver to set the MAC.
110*/
111#define CONFIG_CHECK_ETHERNET_PRESENT 1
112#define CONFIG_SYS_SLOT_ID_BASE CONFIG_SYS_PIGGY_BASE
113#define CONFIG_SYS_SLOT_ID_OFF (0x07) /* register offset */
114#define CONFIG_SYS_SLOT_ID_MASK (0x3f) /* mask for slot ID bits */
115
Heiko Schochera8d51892009-03-12 07:37:18 +0100116#define CONFIG_I2C_MULTI_BUS 1
Heiko Schocher875f47282009-07-09 12:04:18 +0200117#define CONFIG_SYS_MAX_I2C_BUS 1
Heiko Schochera8d51892009-03-12 07:37:18 +0100118#define CONFIG_SYS_I2C_INIT_BOARD 1
119#define CONFIG_I2C_MUX 1
120
121/* EEprom support */
122#define CONFIG_SYS_I2C_MULTI_EEPROMS 1
123#define CONFIG_SYS_EEPROM_PAGE_WRITE_ENABLE
124#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
125#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10
126
127/* Support the IVM EEprom */
128#define CONFIG_SYS_IVM_EEPROM_ADR 0x50
129#define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
130#define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
131
132#define CONFIG_SYS_FLASH_PROTECTION 1
133
Heiko Schocher7937e4f2008-11-20 09:59:09 +0100134/*
135 * BOOTP options
136 */
137#define CONFIG_BOOTP_BOOTFILESIZE
138#define CONFIG_BOOTP_BOOTPATH
139#define CONFIG_BOOTP_GATEWAY
140#define CONFIG_BOOTP_HOSTNAME
141
Heiko Schocher875f47282009-07-09 12:04:18 +0200142#define CONFIG_ENV_SIZE 0x04000 /* Size of Environment */
143
Heiko Schocher2f6ea292010-01-07 08:55:50 +0100144#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
Heiko Schocher875f47282009-07-09 12:04:18 +0200145
Heiko Schocher875f47282009-07-09 12:04:18 +0200146/* UBI Support for all Keymile boards */
147#define CONFIG_CMD_UBI
148#define CONFIG_RBTREE
149#define CONFIG_MTD_PARTITIONS
150#define CONFIG_FLASH_CFI_MTD
151#define CONFIG_MTD_DEVICE
152#define CONFIG_MTD_CONCAT
153
Heiko Schochera8d51892009-03-12 07:37:18 +0100154/* define this to use the keymile's io muxing feature */
155/*#define CONFIG_IO_MUXING */
156
157#ifdef CONFIG_IO_MUXING
158#define CONFIG_KM_DEF_ENV_IOMUX \
Heiko Schocherc5e84052010-07-20 17:45:02 +0200159 "nc=setenv ethact HDLC \0" \
160 "nce=setenv ethact SCC \0" \
Heiko Schochera8d51892009-03-12 07:37:18 +0100161 "stderr=serial,nc \0" \
162 "stdin=serial,nc \0" \
163 "stdout=serial,nc \0" \
164 "tftpsrcp=69 \0" \
165 "tftpdstp=69 \0"
166#else
167#define CONFIG_KM_DEF_ENV_IOMUX \
168 "stderr=serial \0" \
169 "stdin=serial \0" \
170 "stdout=serial \0"
171#endif
172
173#ifndef CONFIG_KM_DEF_ENV_PRIVATE
174#define CONFIG_KM_DEF_ENV_PRIVATE \
175 "kmprivate=empty\0"
176#endif
177
178#define xstr(s) str(s)
179#define str(s) #s
180
181#ifndef CONFIG_KM_DEF_ENV
182#define CONFIG_KM_DEF_ENV \
183 "netdev=eth0\0" \
184 "u-boot_addr_r=100000\0" \
185 "kernel_addr_r=200000\0" \
186 "fdt_addr_r=600000\0" \
187 "ram_ws=800000 \0" \
Peter Tyserd78876c2009-09-16 21:38:10 -0500188 "script_ws=780000 \0" \
Heiko Schochera8d51892009-03-12 07:37:18 +0100189 "fdt_file=" xstr(CONFIG_HOSTNAME) "/" \
190 xstr(CONFIG_HOSTNAME) ".dtb\0" \
191 "u-boot=" xstr(CONFIG_HOSTNAME) "/u-boot.bin \0" \
192 "kernel_file=" xstr(CONFIG_HOSTNAME) "/uImage \0" \
193 "load=tftp ${u-boot_addr_r} ${u-boot}\0" \
194 "update=protect off " xstr(BOOTFLASH_START) " +${filesize};" \
195 "erase " xstr(BOOTFLASH_START) " +${filesize};" \
196 "cp.b ${u-boot_addr_r} " xstr(BOOTFLASH_START) \
197 " ${filesize};" \
198 "protect on " xstr(BOOTFLASH_START) " +${filesize}\0" \
199 "load_fdt=tftp ${fdt_addr_r} ${fdt_file}; " \
200 "setenv actual_fdt_addr ${fdt_addr_r} \0" \
201 "load_kernel=tftp ${kernel_addr_r} ${kernel_file}; " \
202 "setenv actual_kernel_addr ${kernel_addr_r} \0" \
203 "ramargs=setenv bootargs root=/dev/ram rw\0" \
204 "nfsargs=setenv bootargs root=/dev/nfs rw " \
205 "nfsroot=${serverip}:${rootpath}\0" \
206 "mtdargs=setenv bootargs root=${actual_rootfs} rw " \
207 "rootfstype=jffs2 \0" \
208 "altmtdargs=setenv bootargs root=${backup_rootfs} rw " \
209 "rootfstype=jffs2 \0" \
210 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
211 "addip=setenv bootargs ${bootargs} " \
212 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
213 ":${hostname}:${netdev}:off panic=1\0" \
214 "addboardid=setenv bootargs ${bootargs} " \
215 "hwKey=${IVM_HWKey} boardId=0x${IVM_BoardId} \0" \
216 "addpram=setenv bootargs ${bootargs} " \
217 "mem=${mem} pram=${pram}\0" \
218 "pram=" xstr(CONFIG_PRAM) "k\0" \
219 "net_nfs=tftp ${kernel_addr_r} ${kernel_file}; " \
220 "tftp ${fdt_addr_r} ${fdt_file}; " \
221 "run nfsargs addip addcon addboardid addpram;" \
222 "bootm ${kernel_addr_r} - ${fdt_addr_r}\0" \
223 "net_self=tftp ${kernel_addr_r} ${kernel_file}; " \
224 "tftp ${fdt_addr_r} ${fdt_file}; " \
225 "tftp ${ramdisk_addr} ${ramdisk_file}; " \
226 "run ramargs addip addboardid addpram; " \
227 "bootm ${kernel_addr_r} ${ramdisk_addr} ${fdt_addr_r}\0"\
228 "flash_nfs=run nfsargs addip addcon;" \
229 "bootm ${kernel_addr} - ${fdt_addr}\0" \
230 "flash_self=run ramargs addip addcon addboardid addpram;" \
231 "bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0" \
232 "bootcmd=run mtdargs addip addcon addboardid addpram; " \
233 "bootm ${actual_kernel_addr} - ${actual_fdt_addr} \0" \
234 "altbootcmd=run altmtdargs addip addcon addboardid addpram; " \
235 "bootm ${backup_kernel_addr} - ${backup_fdt_addr} \0" \
236 "actual0=setenv actual_bank 0; setenv actual_kernel_addr " \
237 "${bank0_kernel_addr}; " \
238 "setenv actual_fdt_addr ${bank0_fdt_addr}; " \
239 "setenv actual_rootfs ${bank0_rootfs} \0" \
240 "actual1=setenv actual_bank 1; setenv actual_kernel_addr " \
241 "${bank1_kernel_addr}; " \
242 "setenv actual_fdt_addr ${bank1_fdt_addr}; " \
243 "setenv actual_rootfs ${bank1_rootfs} \0" \
244 "backup0=setenv backup_bank 0; setenv backup_kernel_addr " \
245 "${bank0_kernel_addr}; " \
246 "setenv backup_fdt_addr ${bank0_fdt_addr}; " \
247 "setenv backup_rootfs ${bank0_rootfs} \0" \
248 "backup1=setenv backup_bank 1; setenv backup_kernel_addr " \
249 "${bank1_kernel_addr}; " \
250 "setenv backup_fdt_addr ${bank1_fdt_addr}; " \
251 "setenv backup_rootfs ${bank1_rootfs} \0" \
252 "setbank0=run actual0 backup1 \0" \
253 "setbank1=run actual1 backup0 \0" \
254 "release=setenv bootcmd " \
255 "\'run mtdargs addip addcon addboardid addpram;" \
256 "bootm ${actual_kernel_addr} - ${actual_fdt_addr} \'; " \
257 "saveenv \0" \
258 "develop=setenv bootcmd " \
259 "\'run nfsargs addip addcon addboardid addpram;" \
260 "bootm ${actual_kernel_addr} - ${actual_fdt_addr} \'; " \
261 "saveenv \0" \
262 "developall=setenv bootcmd " \
263 "\'run load_fdt load_kernel nfsargs " \
264 "addip addcon addboardid addpram; " \
265 "bootm ${actual_kernel_addr} - ${actual_fdt_addr} \'; " \
266 "saveenv \0" \
267 "set_new_esw_script=setenv new_esw_script " \
268 "new_esw_0x${IVM_BoardId}_0x${IVM_HWKey}.scr \0" \
269 "new_esw=run set_new_esw_script; " \
Peter Tyserd78876c2009-09-16 21:38:10 -0500270 "tftp ${script_ws} ${new_esw_script}; " \
271 "iminfo ${script_ws}; source ${script_ws} \0" \
Heiko Schochera8d51892009-03-12 07:37:18 +0100272 "bootlimit=0 \0" \
273 CONFIG_KM_DEF_ENV_IOMUX \
274 CONFIG_KM_DEF_ENV_PRIVATE \
275 ""
276#endif /* CONFIG_KM_DEF_ENV */
277
278#define CONFIG_VERSION_VARIABLE /* include version env variable */
279
Heiko Schocher7937e4f2008-11-20 09:59:09 +0100280#endif /* __CONFIG_KEYMILE_H */