blob: da5a4475b051323a44f3ea9bb3eaddbf28f7a1f0 [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 Schochercfc58042010-04-26 13:07:28 +020029#define CONFIG_LAST_STAGE_INIT
30
31#define CONFIG_BOOTCOUNT_LIMIT
Heiko Schocher7937e4f2008-11-20 09:59:09 +010032
Heiko Schocher7937e4f2008-11-20 09:59:09 +010033/*
Prafulla Wadaskar84cba2e2010-10-27 17:46:06 +053034 * By default kwbimage.cfg from board specific folder is used
35 * If for some board, different configuration file need to be used,
36 * CONFIG_SYS_KWD_CONFIG should be defined in board specific header file
37 */
38#ifndef CONFIG_SYS_KWD_CONFIG
Wolfgang Denk302141d2010-11-27 23:30:56 +010039#define CONFIG_SYS_KWD_CONFIG $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg
Prafulla Wadaskar84cba2e2010-10-27 17:46:06 +053040#endif /* CONFIG_SYS_KWD_CONFIG */
41
Wolfgang Denk302141d2010-11-27 23:30:56 +010042/*
Prafulla Wadaskar84cba2e2010-10-27 17:46:06 +053043 * CONFIG_SYS_TEXT_BASE can be defined in board specific header file, if needed
44 */
45#ifndef CONFIG_SYS_TEXT_BASE
46#define CONFIG_SYS_TEXT_BASE 0x00400000
47#endif /* CONFIG_SYS_TEXT_BASE */
48
49/*
Heiko Schocher7937e4f2008-11-20 09:59:09 +010050 * Command line configuration.
51 */
52#include <config_cmd_default.h>
53
54#define CONFIG_CMD_ASKENV
55#define CONFIG_CMD_DHCP
56#define CONFIG_CMD_ECHO
57#define CONFIG_CMD_IMMAP
58#define CONFIG_CMD_MII
59#define CONFIG_CMD_PING
Heiko Schocher7937e4f2008-11-20 09:59:09 +010060#define CONFIG_CMD_EEPROM
61#define CONFIG_CMD_I2C
Heiko Schochera8d51892009-03-12 07:37:18 +010062#define CONFIG_CMD_JFFS2
Heiko Schocher875f47282009-07-09 12:04:18 +020063#define CONFIG_CMD_MTDPARTS
Holger Brunck0bd82022011-03-14 15:49:05 +010064#define CONFIG_CMD_SETEXPR
Heiko Schocher7937e4f2008-11-20 09:59:09 +010065
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010066#undef CONFIG_WATCHDOG /* disable platform specific watchdog */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010067
Holger Brunck0bd82022011-03-14 15:49:05 +010068#define CONFIG_BOOTDELAY 2 /* autoboot after 2 seconds */
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010069#undef CONFIG_BOOTARGS /* the boot command will set bootargs */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010070
71/*
72 * Miscellaneous configurable options
73 */
74#define CONFIG_SYS_HUSH_PARSER
75#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010076#define CONFIG_SYS_LONGHELP /* undef to save memory */
77#define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010078#if defined(CONFIG_CMD_KGDB)
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010079#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010080#else
Holger Brunck0bd82022011-03-14 15:49:05 +010081#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010082#endif
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010083#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
Holger Brunck0bd82022011-03-14 15:49:05 +010084#define CONFIG_SYS_MAXARGS 32 /* max number of command args */
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010085#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
86#define CONFIG_CMDLINE_EDITING
87#define CONFIG_AUTO_COMPLETE
Heiko Schocher7937e4f2008-11-20 09:59:09 +010088
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010089#define CONFIG_HUSH_INIT_VAR
Heiko Schocher7937e4f2008-11-20 09:59:09 +010090
91#define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010092
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010093#define CONFIG_SYS_HZ 1000 /* decr. freq: 1 ms ticks */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010094
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010095#define CONFIG_BAUDRATE 115200
Heiko Schocher7937e4f2008-11-20 09:59:09 +010096#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
97
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010098#define CONFIG_LOADS_ECHO
99#define CONFIG_SYS_LOADS_BAUD_CHANGE
Prafulla Wadaskarf8e42622010-09-30 19:33:19 +0530100#define CONFIG_SYS_BOARD_DRAM_INIT /* Used board specific dram_init */
Heiko Schocher7937e4f2008-11-20 09:59:09 +0100101
102/*
103 * How to get access to the slot ID. Put this here to make it easy
104 * to modify in a centralized location. This is used in the HDLC
105 * driver to set the MAC.
106*/
Heiko Schocher8ce3dd52011-03-15 16:52:29 +0100107#define CONFIG_CHECK_ETHERNET_PRESENT
Heiko Schocher3a8dd212011-03-08 10:47:39 +0100108#define CONFIG_SYS_SLOT_ID_BASE CONFIG_SYS_KMBEC_FPGA_BASE
Heiko Schocher7937e4f2008-11-20 09:59:09 +0100109#define CONFIG_SYS_SLOT_ID_OFF (0x07) /* register offset */
110#define CONFIG_SYS_SLOT_ID_MASK (0x3f) /* mask for slot ID bits */
111
Heiko Schocher8ce3dd52011-03-15 16:52:29 +0100112#define CONFIG_I2C_MULTI_BUS
Heiko Schocher875f47282009-07-09 12:04:18 +0200113#define CONFIG_SYS_MAX_I2C_BUS 1
Heiko Schocher8ce3dd52011-03-15 16:52:29 +0100114#define CONFIG_SYS_I2C_INIT_BOARD
115#define CONFIG_I2C_MUX
Heiko Schochera8d51892009-03-12 07:37:18 +0100116
117/* EEprom support */
Heiko Schocher8ce3dd52011-03-15 16:52:29 +0100118#define CONFIG_SYS_I2C_MULTI_EEPROMS
Heiko Schochera8d51892009-03-12 07:37:18 +0100119#define CONFIG_SYS_EEPROM_PAGE_WRITE_ENABLE
Heiko Schocher8ce3dd52011-03-15 16:52:29 +0100120#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
121#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10
Heiko Schochera8d51892009-03-12 07:37:18 +0100122
123/* Support the IVM EEprom */
124#define CONFIG_SYS_IVM_EEPROM_ADR 0x50
125#define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
126#define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
127
Heiko Schocher8ce3dd52011-03-15 16:52:29 +0100128#define CONFIG_SYS_FLASH_PROTECTION
Heiko Schochera8d51892009-03-12 07:37:18 +0100129
Heiko Schocher7937e4f2008-11-20 09:59:09 +0100130/*
131 * BOOTP options
132 */
133#define CONFIG_BOOTP_BOOTFILESIZE
134#define CONFIG_BOOTP_BOOTPATH
135#define CONFIG_BOOTP_GATEWAY
136#define CONFIG_BOOTP_HOSTNAME
137
Heiko Schocher8ce3dd52011-03-15 16:52:29 +0100138#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
Heiko Schocher875f47282009-07-09 12:04:18 +0200139
Heiko Schocher875f47282009-07-09 12:04:18 +0200140/* UBI Support for all Keymile boards */
141#define CONFIG_CMD_UBI
142#define CONFIG_RBTREE
143#define CONFIG_MTD_PARTITIONS
Heiko Schocher875f47282009-07-09 12:04:18 +0200144#define CONFIG_MTD_DEVICE
145#define CONFIG_MTD_CONCAT
146
Heiko Schochera8d51892009-03-12 07:37:18 +0100147/* define this to use the keymile's io muxing feature */
148/*#define CONFIG_IO_MUXING */
149
150#ifdef CONFIG_IO_MUXING
151#define CONFIG_KM_DEF_ENV_IOMUX \
Heiko Schocherc5e84052010-07-20 17:45:02 +0200152 "nc=setenv ethact HDLC \0" \
153 "nce=setenv ethact SCC \0" \
Heiko Schochera8d51892009-03-12 07:37:18 +0100154 "stderr=serial,nc \0" \
155 "stdin=serial,nc \0" \
156 "stdout=serial,nc \0" \
157 "tftpsrcp=69 \0" \
158 "tftpdstp=69 \0"
159#else
160#define CONFIG_KM_DEF_ENV_IOMUX \
161 "stderr=serial \0" \
162 "stdin=serial \0" \
163 "stdout=serial \0"
164#endif
165
166#ifndef CONFIG_KM_DEF_ENV_PRIVATE
167#define CONFIG_KM_DEF_ENV_PRIVATE \
168 "kmprivate=empty\0"
169#endif
170
Holger Brunck752ba312011-03-14 16:01:04 +0100171#ifndef CONFIG_KM_DEF_NETDEV
172#define CONFIG_KM_DEF_NETDEV \
173 "netdev=eth0\0"
174#endif
175
176#ifndef CONFIG_KM_UBI_PARTITION_NAME
177#define CONFIG_KM_UBI_PARTITION_NAME "ubi0"
178#endif
179#ifndef CONFIG_KM_UBI_LINUX_MTD_NAME
180#define CONFIG_KM_UBI_LINUX_MTD_NAME "ubi0"
181#endif
182
Heiko Schochera8d51892009-03-12 07:37:18 +0100183#define xstr(s) str(s)
184#define str(s) #s
185
Holger Brunck752ba312011-03-14 16:01:04 +0100186/*
187 * bootargs
188 * - modify 'bootargs'
189 *
190 * - 'addip': add ip configuration
191 * - 'addpanic': add kernel panic options
192 * - 'addramfs': add phram device for the rootfilesysten in ram
193 * - 'addtty': add console=...
194 * - 'nfsargs': default arguments for nfs boot
195 * - 'flashargs': defaults arguments for flash base boot
196 *
197 * processor specific settings
198 * - 'addmtdparts': add mtd partition information
199 */
200#define CONFIG_KM_DEF_ENV_BOOTARGS \
201 "addinit=" \
202 "setenv bootargs ${bootargs} init=${init}\0" \
203 "addip=" \
204 "setenv bootargs ${bootargs} " \
205 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
206 ":${hostname}:${netdev}:off\0" \
207 "addpanic=" \
208 "setenv bootargs ${bootargs} " \
209 "panic=1 panic_on_oops=1\0" \
210 "addramfs=" \
211 "setenv bootargs \"" \
212 "${bootargs} phram.phram=" \
213 "rootfs${actual_bank},${rootfsaddr},${rootfssize}\"\0" \
214 "addtty=" \
215 "setenv bootargs ${bootargs}" \
216 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}\0" \
217 "nfsargs=" \
218 "setenv bootargs " \
219 "ubi.mtd=" CONFIG_KM_UBI_LINUX_MTD_NAME " " \
220 "root=/dev/nfs rw " \
221 "nfsroot=${serverip}:${rootpath}\0" \
222 "flashargs=" \
223 "setenv bootargs " \
224 "ubi.mtd=" CONFIG_KM_UBI_LINUX_MTD_NAME " " \
225 "root=mtdblock:rootfs${actual_bank} " \
226 "rootfstype=squashfs ro\0" \
227 ""
228
229#define CONFIG_KM_DEF_ENV_COMPUTE_ADDR \
230 "setboardid=" \
231 "if test \"x${boardId}\" = \"x\"; then; " \
232 "setenv boardId ${IVM_BoardId} && " \
233 "setenv hwKey ${IVM_HWKey}; " \
234 "else; " \
235 "echo \\\\c; " \
236 "fi\0"
237
238/*
239 * flash_boot
240 * - commands for booting from flash
241 *
242 * - 'cramfsaddr': address to the cramfs (in ram)
243 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
244 * - 'ubiattach': attach ubi partition
245 * - 'ubicopy': copy ubi volume to ram
246 * - volume names: bootfs0, bootfs1, bootfs2, ...
247 * - 'ubiparition': mtd parition name for ubi
248 *
249 * processor specific settings
250 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
251 */
252#define CONFIG_KM_DEF_ENV_FLASH_BOOT \
253 "cramfsaddr="xstr(CONFIG_KM_CRAMFS_ADDR) "\0" \
254 "cramfsloadkernel=" \
255 "cramfsload ${kernel_addr_r} uImage && " \
256 "setenv actual_kernel_addr ${kernel_addr_r}\0" \
257 "ubiattach=ubi part ${ubipartition}\0" \
258 "ubicopy=ubi read ${cramfsaddr} bootfs${actual_bank}\0" \
259 "ubipartition=" CONFIG_KM_UBI_PARTITION_NAME "\0" \
260 ""
261
262/*
263 * net_boot
264 * - commands for booting over the network
265 *
266 * - 'tftpkernel': load a kernel with tftp into ram
267 *
268 * processor specific settings
269 * - 'tftpfdt': load fdt with tftp into ram
270 */
271#define CONFIG_KM_DEF_ENV_NET_BOOT \
272 "tftpkernel=" \
273 "tftpboot ${kernel_addr_r} ${kernel_file} && " \
274 "setenv actual_kernel_addr ${kernel_addr_r} \0"
275
276/*
277 * constants
278 * - KM specific constants and commands
279 *
280 * - 'default': setup default environment
281 */
282#define CONFIG_KM_DEF_ENV_CONSTANTS \
283 "actual=setenv actual_bank ${initial_boot_bank}\0" \
284 "actual0=setenv actual_bank 0\0" \
285 "actual_bank=${initial_boot_bank}\0" \
286 "default=" \
287 "setenv default 'run newenv; reset' && " \
288 "run release && saveenv; reset\0" \
289 "checkboardid=" \
290 "test \"x${boardId}\" = \"x${IVM_BoardId}\"\0" \
291 "printbootargs=print bootargs\0" \
292 "rootfsfile="xstr(CONFIG_HOSTNAME) "/rootfsImage\0" \
293 ""
294
Heiko Schochera8d51892009-03-12 07:37:18 +0100295#ifndef CONFIG_KM_DEF_ENV
296#define CONFIG_KM_DEF_ENV \
Heiko Schochera8d51892009-03-12 07:37:18 +0100297 CONFIG_KM_DEF_ENV_IOMUX \
298 CONFIG_KM_DEF_ENV_PRIVATE \
Holger Brunck752ba312011-03-14 16:01:04 +0100299 CONFIG_KM_DEF_NETDEV \
300 CONFIG_KM_DEF_ENV_CPU \
301 CONFIG_KM_DEF_ENV_BOOTARGS \
302 CONFIG_KM_DEF_ENV_COMPUTE_ADDR \
303 CONFIG_KM_DEF_ENV_FLASH_BOOT \
304 CONFIG_KM_DEF_ENV_NET_BOOT \
305 "altbootcmd=run bootcmd\0" \
306 "bootcmd=run default\0" \
307 "bootlimit=2\0" \
308 "init=/sbin/init-overlay.sh\0" \
309 "kernel_addr_r="xstr(CONFIG_KM_KERNEL_ADDR) "\0" \
310 "kernel_file="xstr(CONFIG_HOSTNAME) "/uImage\0" \
311 "kernel_name=uImage\0" \
312 "load=tftpboot ${u-boot_addr_r} ${u-boot}\0" \
313 "mtdids=" MTDIDS_DEFAULT "\0" \
314 "mtdparts=" MTDPARTS_DEFAULT "\0" \
315 "u-boot="xstr(CONFIG_HOSTNAME) "/u-boot.bin\0" \
316 "u-boot_addr_r="xstr(CONFIG_KM_KERNEL_ADDR) "\0" \
Heiko Schochera8d51892009-03-12 07:37:18 +0100317 ""
318#endif /* CONFIG_KM_DEF_ENV */
319
320#define CONFIG_VERSION_VARIABLE /* include version env variable */
321
Heiko Schocher7937e4f2008-11-20 09:59:09 +0100322#endif /* __CONFIG_KEYMILE_H */