blob: 6f37f53fff8f639634726b6aa6cf517b717bb6c1 [file] [log] [blame]
Heiko Schocher7937e4f2008-11-20 09:59:09 +01001/*
Heiko Schocher8ce3dd52011-03-15 16:52:29 +01002 * (C) Copyright 2008-2011
Heiko Schocher7937e4f2008-11-20 09:59:09 +01003 * 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 */
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010028#define CONFIG_BOARD_EARLY_INIT_R
Heiko Schocher7937e4f2008-11-20 09:59:09 +010029
Heiko Schocher7937e4f2008-11-20 09:59:09 +010030/*
Prafulla Wadaskar84cba2e2010-10-27 17:46:06 +053031 * By default kwbimage.cfg from board specific folder is used
32 * If for some board, different configuration file need to be used,
33 * CONFIG_SYS_KWD_CONFIG should be defined in board specific header file
34 */
35#ifndef CONFIG_SYS_KWD_CONFIG
Wolfgang Denk302141d2010-11-27 23:30:56 +010036#define CONFIG_SYS_KWD_CONFIG $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg
Prafulla Wadaskar84cba2e2010-10-27 17:46:06 +053037#endif /* CONFIG_SYS_KWD_CONFIG */
38
Wolfgang Denk302141d2010-11-27 23:30:56 +010039/*
Prafulla Wadaskar84cba2e2010-10-27 17:46:06 +053040 * CONFIG_SYS_TEXT_BASE can be defined in board specific header file, if needed
41 */
42#ifndef CONFIG_SYS_TEXT_BASE
43#define CONFIG_SYS_TEXT_BASE 0x00400000
44#endif /* CONFIG_SYS_TEXT_BASE */
45
46/*
Heiko Schocher7937e4f2008-11-20 09:59:09 +010047 * Command line configuration.
48 */
49#include <config_cmd_default.h>
50
51#define CONFIG_CMD_ASKENV
52#define CONFIG_CMD_DHCP
53#define CONFIG_CMD_ECHO
54#define CONFIG_CMD_IMMAP
55#define CONFIG_CMD_MII
56#define CONFIG_CMD_PING
Heiko Schocher7937e4f2008-11-20 09:59:09 +010057#define CONFIG_CMD_EEPROM
58#define CONFIG_CMD_I2C
Heiko Schochera8d51892009-03-12 07:37:18 +010059#define CONFIG_CMD_JFFS2
Heiko Schocher875f47282009-07-09 12:04:18 +020060#define CONFIG_CMD_MTDPARTS
Holger Brunck0bd82022011-03-14 15:49:05 +010061#define CONFIG_CMD_SETEXPR
Heiko Schocher7937e4f2008-11-20 09:59:09 +010062
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010063#undef CONFIG_WATCHDOG /* disable platform specific watchdog */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010064
Holger Brunck0bd82022011-03-14 15:49:05 +010065#define CONFIG_BOOTDELAY 2 /* autoboot after 2 seconds */
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010066#undef CONFIG_BOOTARGS /* the boot command will set bootargs */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010067
68/*
69 * Miscellaneous configurable options
70 */
71#define CONFIG_SYS_HUSH_PARSER
72#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010073#define CONFIG_SYS_LONGHELP /* undef to save memory */
74#define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010075#if defined(CONFIG_CMD_KGDB)
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010076#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010077#else
Holger Brunck0bd82022011-03-14 15:49:05 +010078#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010079#endif
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010080#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
Holger Brunck0bd82022011-03-14 15:49:05 +010081#define CONFIG_SYS_MAXARGS 32 /* max number of command args */
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010082#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
83#define CONFIG_CMDLINE_EDITING
84#define CONFIG_AUTO_COMPLETE
Heiko Schocher7937e4f2008-11-20 09:59:09 +010085
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010086#define CONFIG_HUSH_INIT_VAR
Heiko Schocher7937e4f2008-11-20 09:59:09 +010087
88#define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010089#define CONFIG_SYS_MEMTEST_START 0x00100000
90#define CONFIG_SYS_MEMTEST_END 0x00f00000 /* 1 ... 15 MB in DRAM */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010091
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010092#define CONFIG_SYS_LOAD_ADDR 0x100000
Heiko Schocher7937e4f2008-11-20 09:59:09 +010093
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010094#define CONFIG_SYS_HZ 1000 /* decr. freq: 1 ms ticks */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010095
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010096#define CONFIG_BAUDRATE 115200
Heiko Schocher7937e4f2008-11-20 09:59:09 +010097#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
98
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010099#define CONFIG_LOADS_ECHO
100#define CONFIG_SYS_LOADS_BAUD_CHANGE
Prafulla Wadaskarf8e42622010-09-30 19:33:19 +0530101#define CONFIG_SYS_BOARD_DRAM_INIT /* Used board specific dram_init */
Heiko Schocher7937e4f2008-11-20 09:59:09 +0100102
103/*
104 * How to get access to the slot ID. Put this here to make it easy
105 * to modify in a centralized location. This is used in the HDLC
106 * driver to set the MAC.
107*/
Heiko Schocher8ce3dd52011-03-15 16:52:29 +0100108#define CONFIG_CHECK_ETHERNET_PRESENT
Heiko Schocher7937e4f2008-11-20 09:59:09 +0100109#define CONFIG_SYS_SLOT_ID_BASE CONFIG_SYS_PIGGY_BASE
110#define CONFIG_SYS_SLOT_ID_OFF (0x07) /* register offset */
111#define CONFIG_SYS_SLOT_ID_MASK (0x3f) /* mask for slot ID bits */
112
Heiko Schocher8ce3dd52011-03-15 16:52:29 +0100113#define CONFIG_I2C_MULTI_BUS
Heiko Schocher875f47282009-07-09 12:04:18 +0200114#define CONFIG_SYS_MAX_I2C_BUS 1
Heiko Schocher8ce3dd52011-03-15 16:52:29 +0100115#define CONFIG_SYS_I2C_INIT_BOARD
116#define CONFIG_I2C_MUX
Heiko Schochera8d51892009-03-12 07:37:18 +0100117
118/* EEprom support */
Heiko Schocher8ce3dd52011-03-15 16:52:29 +0100119#define CONFIG_SYS_I2C_MULTI_EEPROMS
Heiko Schochera8d51892009-03-12 07:37:18 +0100120#define CONFIG_SYS_EEPROM_PAGE_WRITE_ENABLE
Heiko Schocher8ce3dd52011-03-15 16:52:29 +0100121#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
122#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10
Heiko Schochera8d51892009-03-12 07:37:18 +0100123
124/* Support the IVM EEprom */
125#define CONFIG_SYS_IVM_EEPROM_ADR 0x50
126#define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
127#define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
128
Heiko Schocher8ce3dd52011-03-15 16:52:29 +0100129#define CONFIG_SYS_FLASH_PROTECTION
Heiko Schochera8d51892009-03-12 07:37:18 +0100130
Heiko Schocher7937e4f2008-11-20 09:59:09 +0100131/*
132 * BOOTP options
133 */
134#define CONFIG_BOOTP_BOOTFILESIZE
135#define CONFIG_BOOTP_BOOTPATH
136#define CONFIG_BOOTP_GATEWAY
137#define CONFIG_BOOTP_HOSTNAME
138
Heiko Schocher8ce3dd52011-03-15 16:52:29 +0100139#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
Heiko Schocher875f47282009-07-09 12:04:18 +0200140
Heiko Schocher875f47282009-07-09 12:04:18 +0200141/* UBI Support for all Keymile boards */
142#define CONFIG_CMD_UBI
143#define CONFIG_RBTREE
144#define CONFIG_MTD_PARTITIONS
145#define CONFIG_FLASH_CFI_MTD
146#define CONFIG_MTD_DEVICE
147#define CONFIG_MTD_CONCAT
148
Heiko Schochera8d51892009-03-12 07:37:18 +0100149/* define this to use the keymile's io muxing feature */
150/*#define CONFIG_IO_MUXING */
151
152#ifdef CONFIG_IO_MUXING
153#define CONFIG_KM_DEF_ENV_IOMUX \
Heiko Schocherc5e84052010-07-20 17:45:02 +0200154 "nc=setenv ethact HDLC \0" \
155 "nce=setenv ethact SCC \0" \
Heiko Schochera8d51892009-03-12 07:37:18 +0100156 "stderr=serial,nc \0" \
157 "stdin=serial,nc \0" \
158 "stdout=serial,nc \0" \
159 "tftpsrcp=69 \0" \
160 "tftpdstp=69 \0"
161#else
162#define CONFIG_KM_DEF_ENV_IOMUX \
163 "stderr=serial \0" \
164 "stdin=serial \0" \
165 "stdout=serial \0"
166#endif
167
168#ifndef CONFIG_KM_DEF_ENV_PRIVATE
169#define CONFIG_KM_DEF_ENV_PRIVATE \
170 "kmprivate=empty\0"
171#endif
172
173#define xstr(s) str(s)
174#define str(s) #s
175
176#ifndef CONFIG_KM_DEF_ENV
177#define CONFIG_KM_DEF_ENV \
178 "netdev=eth0\0" \
179 "u-boot_addr_r=100000\0" \
180 "kernel_addr_r=200000\0" \
181 "fdt_addr_r=600000\0" \
182 "ram_ws=800000 \0" \
Peter Tyserd78876c2009-09-16 21:38:10 -0500183 "script_ws=780000 \0" \
Heiko Schochera8d51892009-03-12 07:37:18 +0100184 "fdt_file=" xstr(CONFIG_HOSTNAME) "/" \
185 xstr(CONFIG_HOSTNAME) ".dtb\0" \
186 "u-boot=" xstr(CONFIG_HOSTNAME) "/u-boot.bin \0" \
187 "kernel_file=" xstr(CONFIG_HOSTNAME) "/uImage \0" \
188 "load=tftp ${u-boot_addr_r} ${u-boot}\0" \
189 "update=protect off " xstr(BOOTFLASH_START) " +${filesize};" \
190 "erase " xstr(BOOTFLASH_START) " +${filesize};" \
191 "cp.b ${u-boot_addr_r} " xstr(BOOTFLASH_START) \
192 " ${filesize};" \
193 "protect on " xstr(BOOTFLASH_START) " +${filesize}\0" \
194 "load_fdt=tftp ${fdt_addr_r} ${fdt_file}; " \
195 "setenv actual_fdt_addr ${fdt_addr_r} \0" \
196 "load_kernel=tftp ${kernel_addr_r} ${kernel_file}; " \
197 "setenv actual_kernel_addr ${kernel_addr_r} \0" \
198 "ramargs=setenv bootargs root=/dev/ram rw\0" \
199 "nfsargs=setenv bootargs root=/dev/nfs rw " \
200 "nfsroot=${serverip}:${rootpath}\0" \
201 "mtdargs=setenv bootargs root=${actual_rootfs} rw " \
202 "rootfstype=jffs2 \0" \
203 "altmtdargs=setenv bootargs root=${backup_rootfs} rw " \
204 "rootfstype=jffs2 \0" \
205 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
206 "addip=setenv bootargs ${bootargs} " \
207 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
208 ":${hostname}:${netdev}:off panic=1\0" \
209 "addboardid=setenv bootargs ${bootargs} " \
210 "hwKey=${IVM_HWKey} boardId=0x${IVM_BoardId} \0" \
211 "addpram=setenv bootargs ${bootargs} " \
212 "mem=${mem} pram=${pram}\0" \
213 "pram=" xstr(CONFIG_PRAM) "k\0" \
214 "net_nfs=tftp ${kernel_addr_r} ${kernel_file}; " \
215 "tftp ${fdt_addr_r} ${fdt_file}; " \
216 "run nfsargs addip addcon addboardid addpram;" \
217 "bootm ${kernel_addr_r} - ${fdt_addr_r}\0" \
218 "net_self=tftp ${kernel_addr_r} ${kernel_file}; " \
219 "tftp ${fdt_addr_r} ${fdt_file}; " \
220 "tftp ${ramdisk_addr} ${ramdisk_file}; " \
221 "run ramargs addip addboardid addpram; " \
222 "bootm ${kernel_addr_r} ${ramdisk_addr} ${fdt_addr_r}\0"\
223 "flash_nfs=run nfsargs addip addcon;" \
224 "bootm ${kernel_addr} - ${fdt_addr}\0" \
225 "flash_self=run ramargs addip addcon addboardid addpram;" \
226 "bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0" \
227 "bootcmd=run mtdargs addip addcon addboardid addpram; " \
228 "bootm ${actual_kernel_addr} - ${actual_fdt_addr} \0" \
229 "altbootcmd=run altmtdargs addip addcon addboardid addpram; " \
230 "bootm ${backup_kernel_addr} - ${backup_fdt_addr} \0" \
231 "actual0=setenv actual_bank 0; setenv actual_kernel_addr " \
232 "${bank0_kernel_addr}; " \
233 "setenv actual_fdt_addr ${bank0_fdt_addr}; " \
234 "setenv actual_rootfs ${bank0_rootfs} \0" \
235 "actual1=setenv actual_bank 1; setenv actual_kernel_addr " \
236 "${bank1_kernel_addr}; " \
237 "setenv actual_fdt_addr ${bank1_fdt_addr}; " \
238 "setenv actual_rootfs ${bank1_rootfs} \0" \
239 "backup0=setenv backup_bank 0; setenv backup_kernel_addr " \
240 "${bank0_kernel_addr}; " \
241 "setenv backup_fdt_addr ${bank0_fdt_addr}; " \
242 "setenv backup_rootfs ${bank0_rootfs} \0" \
243 "backup1=setenv backup_bank 1; setenv backup_kernel_addr " \
244 "${bank1_kernel_addr}; " \
245 "setenv backup_fdt_addr ${bank1_fdt_addr}; " \
246 "setenv backup_rootfs ${bank1_rootfs} \0" \
247 "setbank0=run actual0 backup1 \0" \
248 "setbank1=run actual1 backup0 \0" \
249 "release=setenv bootcmd " \
250 "\'run mtdargs addip addcon addboardid addpram;" \
251 "bootm ${actual_kernel_addr} - ${actual_fdt_addr} \'; " \
252 "saveenv \0" \
253 "develop=setenv bootcmd " \
254 "\'run nfsargs addip addcon addboardid addpram;" \
255 "bootm ${actual_kernel_addr} - ${actual_fdt_addr} \'; " \
256 "saveenv \0" \
257 "developall=setenv bootcmd " \
258 "\'run load_fdt load_kernel nfsargs " \
259 "addip addcon addboardid addpram; " \
260 "bootm ${actual_kernel_addr} - ${actual_fdt_addr} \'; " \
261 "saveenv \0" \
262 "set_new_esw_script=setenv new_esw_script " \
263 "new_esw_0x${IVM_BoardId}_0x${IVM_HWKey}.scr \0" \
264 "new_esw=run set_new_esw_script; " \
Peter Tyserd78876c2009-09-16 21:38:10 -0500265 "tftp ${script_ws} ${new_esw_script}; " \
266 "iminfo ${script_ws}; source ${script_ws} \0" \
Heiko Schochera8d51892009-03-12 07:37:18 +0100267 "bootlimit=0 \0" \
268 CONFIG_KM_DEF_ENV_IOMUX \
269 CONFIG_KM_DEF_ENV_PRIVATE \
270 ""
271#endif /* CONFIG_KM_DEF_ENV */
272
273#define CONFIG_VERSION_VARIABLE /* include version env variable */
274
Heiko Schocher7937e4f2008-11-20 09:59:09 +0100275#endif /* __CONFIG_KEYMILE_H */