]> git.ipfire.org Git - people/ms/u-boot.git/blame - include/configs/keymile-common.h
keymile boards: add CONFIG_PIGGY_MAC_ADRESS_OFFSET
[people/ms/u-boot.git] / include / configs / keymile-common.h
CommitLineData
1e8f4e78 1/*
b11f53f3 2 * (C) Copyright 2008-2011
1e8f4e78
HS
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 */
b11f53f3 28#define CONFIG_BOARD_EARLY_INIT_R
1e8f4e78 29
31d80c77
PW
30/*
31 * 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
844f07d8 36#define CONFIG_SYS_KWD_CONFIG $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg
31d80c77
PW
37#endif /* CONFIG_SYS_KWD_CONFIG */
38
844f07d8 39/*
31d80c77
PW
40 * 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
1e8f4e78
HS
46/*
47 * 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
1e8f4e78
HS
57#define CONFIG_CMD_EEPROM
58#define CONFIG_CMD_I2C
364123db 59#define CONFIG_CMD_JFFS2
dc71b248 60#define CONFIG_CMD_MTDPARTS
f41ee960 61#define CONFIG_CMD_SETEXPR
1e8f4e78 62
b11f53f3 63#undef CONFIG_WATCHDOG /* disable platform specific watchdog */
1e8f4e78 64
f41ee960 65#define CONFIG_BOOTDELAY 2 /* autoboot after 2 seconds */
b11f53f3 66#undef CONFIG_BOOTARGS /* the boot command will set bootargs */
1e8f4e78
HS
67
68/*
69 * Miscellaneous configurable options
70 */
71#define CONFIG_SYS_HUSH_PARSER
72#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
b11f53f3
HS
73#define CONFIG_SYS_LONGHELP /* undef to save memory */
74#define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */
1e8f4e78 75#if defined(CONFIG_CMD_KGDB)
b11f53f3 76#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
1e8f4e78 77#else
f41ee960 78#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
1e8f4e78 79#endif
b11f53f3 80#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
f41ee960 81#define CONFIG_SYS_MAXARGS 32 /* max number of command args */
b11f53f3
HS
82#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
83#define CONFIG_CMDLINE_EDITING
84#define CONFIG_AUTO_COMPLETE
1e8f4e78 85
b11f53f3 86#define CONFIG_HUSH_INIT_VAR
1e8f4e78
HS
87
88#define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
1e8f4e78 89
b11f53f3 90#define CONFIG_SYS_HZ 1000 /* decr. freq: 1 ms ticks */
1e8f4e78 91
b11f53f3 92#define CONFIG_BAUDRATE 115200
1e8f4e78
HS
93#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
94
b11f53f3
HS
95#define CONFIG_LOADS_ECHO
96#define CONFIG_SYS_LOADS_BAUD_CHANGE
beeb2589 97#define CONFIG_SYS_BOARD_DRAM_INIT /* Used board specific dram_init */
1e8f4e78
HS
98
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*/
b11f53f3 104#define CONFIG_CHECK_ETHERNET_PRESENT
8ed74341 105#define CONFIG_SYS_SLOT_ID_BASE CONFIG_SYS_KMBEC_FPGA_BASE
1e8f4e78
HS
106#define CONFIG_SYS_SLOT_ID_OFF (0x07) /* register offset */
107#define CONFIG_SYS_SLOT_ID_MASK (0x3f) /* mask for slot ID bits */
108
b11f53f3 109#define CONFIG_I2C_MULTI_BUS
dc71b248 110#define CONFIG_SYS_MAX_I2C_BUS 1
b11f53f3
HS
111#define CONFIG_SYS_I2C_INIT_BOARD
112#define CONFIG_I2C_MUX
364123db
HS
113
114/* EEprom support */
b11f53f3 115#define CONFIG_SYS_I2C_MULTI_EEPROMS
364123db 116#define CONFIG_SYS_EEPROM_PAGE_WRITE_ENABLE
b11f53f3
HS
117#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
118#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10
364123db
HS
119
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
b11f53f3 125#define CONFIG_SYS_FLASH_PROTECTION
364123db 126
1e8f4e78
HS
127/*
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
b11f53f3 135#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
dc71b248 136
dc71b248
HS
137/* UBI Support for all Keymile boards */
138#define CONFIG_CMD_UBI
139#define CONFIG_RBTREE
140#define CONFIG_MTD_PARTITIONS
dc71b248
HS
141#define CONFIG_MTD_DEVICE
142#define CONFIG_MTD_CONCAT
143
364123db
HS
144/* 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 \
48690d80
HS
149 "nc=setenv ethact HDLC \0" \
150 "nce=setenv ethact SCC \0" \
364123db
HS
151 "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
de3ad13d
HB
168#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
364123db
HS
180#define xstr(s) str(s)
181#define str(s) #s
182
de3ad13d
HB
183/*
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
364123db
HS
292#ifndef CONFIG_KM_DEF_ENV
293#define CONFIG_KM_DEF_ENV \
364123db
HS
294 CONFIG_KM_DEF_ENV_IOMUX \
295 CONFIG_KM_DEF_ENV_PRIVATE \
de3ad13d
HB
296 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" \
364123db
HS
314 ""
315#endif /* CONFIG_KM_DEF_ENV */
316
317#define CONFIG_VERSION_VARIABLE /* include version env variable */
318
1e8f4e78 319#endif /* __CONFIG_KEYMILE_H */