blob: 77e20909ce82e83b4384e6ec86f9f8d4903ba0fa [file] [log] [blame]
Heiko Schocher1e8f4e72008-11-20 09:59:09 +01001/*
Heiko Schocherb11f53f2011-03-15 16:52:29 +01002 * (C) Copyright 2008-2011
Heiko Schocher1e8f4e72008-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 Schocherb11f53f2011-03-15 16:52:29 +010028#define CONFIG_BOARD_EARLY_INIT_R
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010029
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010030/*
Prafulla Wadaskar31d80c72010-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 Denk844f07d2010-11-27 23:30:56 +010036#define CONFIG_SYS_KWD_CONFIG $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg
Prafulla Wadaskar31d80c72010-10-27 17:46:06 +053037#endif /* CONFIG_SYS_KWD_CONFIG */
38
Wolfgang Denk844f07d2010-11-27 23:30:56 +010039/*
Prafulla Wadaskar31d80c72010-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 Schocher1e8f4e72008-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 Schocher1e8f4e72008-11-20 09:59:09 +010057#define CONFIG_CMD_EEPROM
58#define CONFIG_CMD_I2C
Heiko Schocher364123d2009-03-12 07:37:18 +010059#define CONFIG_CMD_JFFS2
Heiko Schocherdc71b242009-07-09 12:04:18 +020060#define CONFIG_CMD_MTDPARTS
Holger Brunckf41ee962011-03-14 15:49:05 +010061#define CONFIG_CMD_SETEXPR
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010062
Heiko Schocherb11f53f2011-03-15 16:52:29 +010063#undef CONFIG_WATCHDOG /* disable platform specific watchdog */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010064
Holger Brunckf41ee962011-03-14 15:49:05 +010065#define CONFIG_BOOTDELAY 2 /* autoboot after 2 seconds */
Heiko Schocherb11f53f2011-03-15 16:52:29 +010066#undef CONFIG_BOOTARGS /* the boot command will set bootargs */
Heiko Schocher1e8f4e72008-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 Schocherb11f53f2011-03-15 16:52:29 +010073#define CONFIG_SYS_LONGHELP /* undef to save memory */
74#define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010075#if defined(CONFIG_CMD_KGDB)
Heiko Schocherb11f53f2011-03-15 16:52:29 +010076#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010077#else
Holger Brunckf41ee962011-03-14 15:49:05 +010078#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010079#endif
Heiko Schocherb11f53f2011-03-15 16:52:29 +010080#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
Holger Brunckf41ee962011-03-14 15:49:05 +010081#define CONFIG_SYS_MAXARGS 32 /* max number of command args */
Heiko Schocherb11f53f2011-03-15 16:52:29 +010082#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
83#define CONFIG_CMDLINE_EDITING
84#define CONFIG_AUTO_COMPLETE
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010085
Heiko Schocherb11f53f2011-03-15 16:52:29 +010086#define CONFIG_HUSH_INIT_VAR
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010087
88#define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010089
Heiko Schocherb11f53f2011-03-15 16:52:29 +010090#define CONFIG_SYS_HZ 1000 /* decr. freq: 1 ms ticks */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010091
Heiko Schocherb11f53f2011-03-15 16:52:29 +010092#define CONFIG_BAUDRATE 115200
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010093#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
94
Heiko Schocherb11f53f2011-03-15 16:52:29 +010095#define CONFIG_LOADS_ECHO
96#define CONFIG_SYS_LOADS_BAUD_CHANGE
Prafulla Wadaskarbeeb2582010-09-30 19:33:19 +053097#define CONFIG_SYS_BOARD_DRAM_INIT /* Used board specific dram_init */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010098
99/*
100 * How to get access to the slot ID. Put this here to make it easy
101 * to modify in a centralized location. This is used in the HDLC
102 * driver to set the MAC.
103*/
Heiko Schocherb11f53f2011-03-15 16:52:29 +0100104#define CONFIG_CHECK_ETHERNET_PRESENT
Heiko Schocher8ed74342011-03-08 10:47:39 +0100105#define CONFIG_SYS_SLOT_ID_BASE CONFIG_SYS_KMBEC_FPGA_BASE
Heiko Schocher1e8f4e72008-11-20 09:59:09 +0100106#define CONFIG_SYS_SLOT_ID_OFF (0x07) /* register offset */
107#define CONFIG_SYS_SLOT_ID_MASK (0x3f) /* mask for slot ID bits */
108
Heiko Schocherb11f53f2011-03-15 16:52:29 +0100109#define CONFIG_I2C_MULTI_BUS
Heiko Schocherdc71b242009-07-09 12:04:18 +0200110#define CONFIG_SYS_MAX_I2C_BUS 1
Heiko Schocherb11f53f2011-03-15 16:52:29 +0100111#define CONFIG_SYS_I2C_INIT_BOARD
112#define CONFIG_I2C_MUX
Heiko Schocher364123d2009-03-12 07:37:18 +0100113
114/* EEprom support */
Heiko Schocherb11f53f2011-03-15 16:52:29 +0100115#define CONFIG_SYS_I2C_MULTI_EEPROMS
Heiko Schocher364123d2009-03-12 07:37:18 +0100116#define CONFIG_SYS_EEPROM_PAGE_WRITE_ENABLE
Heiko Schocherb11f53f2011-03-15 16:52:29 +0100117#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
118#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10
Heiko Schocher364123d2009-03-12 07:37:18 +0100119
120/* Support the IVM EEprom */
121#define CONFIG_SYS_IVM_EEPROM_ADR 0x50
122#define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
123#define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
124
Heiko Schocherb11f53f2011-03-15 16:52:29 +0100125#define CONFIG_SYS_FLASH_PROTECTION
Heiko Schocher364123d2009-03-12 07:37:18 +0100126
Heiko Schocher1e8f4e72008-11-20 09:59:09 +0100127/*
128 * BOOTP options
129 */
130#define CONFIG_BOOTP_BOOTFILESIZE
131#define CONFIG_BOOTP_BOOTPATH
132#define CONFIG_BOOTP_GATEWAY
133#define CONFIG_BOOTP_HOSTNAME
134
Heiko Schocherb11f53f2011-03-15 16:52:29 +0100135#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
Heiko Schocherdc71b242009-07-09 12:04:18 +0200136
Heiko Schocherdc71b242009-07-09 12:04:18 +0200137/* UBI Support for all Keymile boards */
138#define CONFIG_CMD_UBI
139#define CONFIG_RBTREE
140#define CONFIG_MTD_PARTITIONS
Heiko Schocherdc71b242009-07-09 12:04:18 +0200141#define CONFIG_MTD_DEVICE
142#define CONFIG_MTD_CONCAT
143
Heiko Schocher364123d2009-03-12 07:37:18 +0100144/* define this to use the keymile's io muxing feature */
145/*#define CONFIG_IO_MUXING */
146
147#ifdef CONFIG_IO_MUXING
148#define CONFIG_KM_DEF_ENV_IOMUX \
Heiko Schocher48690d82010-07-20 17:45:02 +0200149 "nc=setenv ethact HDLC \0" \
150 "nce=setenv ethact SCC \0" \
Heiko Schocher364123d2009-03-12 07:37:18 +0100151 "stderr=serial,nc \0" \
152 "stdin=serial,nc \0" \
153 "stdout=serial,nc \0" \
154 "tftpsrcp=69 \0" \
155 "tftpdstp=69 \0"
156#else
157#define CONFIG_KM_DEF_ENV_IOMUX \
158 "stderr=serial \0" \
159 "stdin=serial \0" \
160 "stdout=serial \0"
161#endif
162
163#ifndef CONFIG_KM_DEF_ENV_PRIVATE
164#define CONFIG_KM_DEF_ENV_PRIVATE \
165 "kmprivate=empty\0"
166#endif
167
Holger Brunckde3ad132011-03-14 16:01:04 +0100168#ifndef CONFIG_KM_DEF_NETDEV
169#define CONFIG_KM_DEF_NETDEV \
170 "netdev=eth0\0"
171#endif
172
173#ifndef CONFIG_KM_UBI_PARTITION_NAME
174#define CONFIG_KM_UBI_PARTITION_NAME "ubi0"
175#endif
176#ifndef CONFIG_KM_UBI_LINUX_MTD_NAME
177#define CONFIG_KM_UBI_LINUX_MTD_NAME "ubi0"
178#endif
179
Heiko Schocher364123d2009-03-12 07:37:18 +0100180#define xstr(s) str(s)
181#define str(s) #s
182
Holger Brunckde3ad132011-03-14 16:01:04 +0100183/*
184 * bootargs
185 * - modify 'bootargs'
186 *
187 * - 'addip': add ip configuration
188 * - 'addpanic': add kernel panic options
189 * - 'addramfs': add phram device for the rootfilesysten in ram
190 * - 'addtty': add console=...
191 * - 'nfsargs': default arguments for nfs boot
192 * - 'flashargs': defaults arguments for flash base boot
193 *
194 * processor specific settings
195 * - 'addmtdparts': add mtd partition information
196 */
197#define CONFIG_KM_DEF_ENV_BOOTARGS \
198 "addinit=" \
199 "setenv bootargs ${bootargs} init=${init}\0" \
200 "addip=" \
201 "setenv bootargs ${bootargs} " \
202 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
203 ":${hostname}:${netdev}:off\0" \
204 "addpanic=" \
205 "setenv bootargs ${bootargs} " \
206 "panic=1 panic_on_oops=1\0" \
207 "addramfs=" \
208 "setenv bootargs \"" \
209 "${bootargs} phram.phram=" \
210 "rootfs${actual_bank},${rootfsaddr},${rootfssize}\"\0" \
211 "addtty=" \
212 "setenv bootargs ${bootargs}" \
213 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}\0" \
214 "nfsargs=" \
215 "setenv bootargs " \
216 "ubi.mtd=" CONFIG_KM_UBI_LINUX_MTD_NAME " " \
217 "root=/dev/nfs rw " \
218 "nfsroot=${serverip}:${rootpath}\0" \
219 "flashargs=" \
220 "setenv bootargs " \
221 "ubi.mtd=" CONFIG_KM_UBI_LINUX_MTD_NAME " " \
222 "root=mtdblock:rootfs${actual_bank} " \
223 "rootfstype=squashfs ro\0" \
224 ""
225
226#define CONFIG_KM_DEF_ENV_COMPUTE_ADDR \
227 "setboardid=" \
228 "if test \"x${boardId}\" = \"x\"; then; " \
229 "setenv boardId ${IVM_BoardId} && " \
230 "setenv hwKey ${IVM_HWKey}; " \
231 "else; " \
232 "echo \\\\c; " \
233 "fi\0"
234
235/*
236 * flash_boot
237 * - commands for booting from flash
238 *
239 * - 'cramfsaddr': address to the cramfs (in ram)
240 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
241 * - 'ubiattach': attach ubi partition
242 * - 'ubicopy': copy ubi volume to ram
243 * - volume names: bootfs0, bootfs1, bootfs2, ...
244 * - 'ubiparition': mtd parition name for ubi
245 *
246 * processor specific settings
247 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
248 */
249#define CONFIG_KM_DEF_ENV_FLASH_BOOT \
250 "cramfsaddr="xstr(CONFIG_KM_CRAMFS_ADDR) "\0" \
251 "cramfsloadkernel=" \
252 "cramfsload ${kernel_addr_r} uImage && " \
253 "setenv actual_kernel_addr ${kernel_addr_r}\0" \
254 "ubiattach=ubi part ${ubipartition}\0" \
255 "ubicopy=ubi read ${cramfsaddr} bootfs${actual_bank}\0" \
256 "ubipartition=" CONFIG_KM_UBI_PARTITION_NAME "\0" \
257 ""
258
259/*
260 * net_boot
261 * - commands for booting over the network
262 *
263 * - 'tftpkernel': load a kernel with tftp into ram
264 *
265 * processor specific settings
266 * - 'tftpfdt': load fdt with tftp into ram
267 */
268#define CONFIG_KM_DEF_ENV_NET_BOOT \
269 "tftpkernel=" \
270 "tftpboot ${kernel_addr_r} ${kernel_file} && " \
271 "setenv actual_kernel_addr ${kernel_addr_r} \0"
272
273/*
274 * constants
275 * - KM specific constants and commands
276 *
277 * - 'default': setup default environment
278 */
279#define CONFIG_KM_DEF_ENV_CONSTANTS \
280 "actual=setenv actual_bank ${initial_boot_bank}\0" \
281 "actual0=setenv actual_bank 0\0" \
282 "actual_bank=${initial_boot_bank}\0" \
283 "default=" \
284 "setenv default 'run newenv; reset' && " \
285 "run release && saveenv; reset\0" \
286 "checkboardid=" \
287 "test \"x${boardId}\" = \"x${IVM_BoardId}\"\0" \
288 "printbootargs=print bootargs\0" \
289 "rootfsfile="xstr(CONFIG_HOSTNAME) "/rootfsImage\0" \
290 ""
291
Heiko Schocher364123d2009-03-12 07:37:18 +0100292#ifndef CONFIG_KM_DEF_ENV
293#define CONFIG_KM_DEF_ENV \
Heiko Schocher364123d2009-03-12 07:37:18 +0100294 CONFIG_KM_DEF_ENV_IOMUX \
295 CONFIG_KM_DEF_ENV_PRIVATE \
Holger Brunckde3ad132011-03-14 16:01:04 +0100296 CONFIG_KM_DEF_NETDEV \
297 CONFIG_KM_DEF_ENV_CPU \
298 CONFIG_KM_DEF_ENV_BOOTARGS \
299 CONFIG_KM_DEF_ENV_COMPUTE_ADDR \
300 CONFIG_KM_DEF_ENV_FLASH_BOOT \
301 CONFIG_KM_DEF_ENV_NET_BOOT \
302 "altbootcmd=run bootcmd\0" \
303 "bootcmd=run default\0" \
304 "bootlimit=2\0" \
305 "init=/sbin/init-overlay.sh\0" \
306 "kernel_addr_r="xstr(CONFIG_KM_KERNEL_ADDR) "\0" \
307 "kernel_file="xstr(CONFIG_HOSTNAME) "/uImage\0" \
308 "kernel_name=uImage\0" \
309 "load=tftpboot ${u-boot_addr_r} ${u-boot}\0" \
310 "mtdids=" MTDIDS_DEFAULT "\0" \
311 "mtdparts=" MTDPARTS_DEFAULT "\0" \
312 "u-boot="xstr(CONFIG_HOSTNAME) "/u-boot.bin\0" \
313 "u-boot_addr_r="xstr(CONFIG_KM_KERNEL_ADDR) "\0" \
Heiko Schocher364123d2009-03-12 07:37:18 +0100314 ""
315#endif /* CONFIG_KM_DEF_ENV */
316
317#define CONFIG_VERSION_VARIABLE /* include version env variable */
318
Heiko Schocher1e8f4e72008-11-20 09:59:09 +0100319#endif /* __CONFIG_KEYMILE_H */