]> git.ipfire.org Git - people/ms/u-boot.git/blame - include/configs/km/keymile-common.h
i2c, soft-i2c: switch to new multibus/multiadapter support
[people/ms/u-boot.git] / include / configs / km / 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
f1fef1d8 27#define CONFIG_BOOTCOUNT_LIMIT
1e8f4e78 28
1e8f4e78
HS
29/*
30 * Command line configuration.
31 */
32#include <config_cmd_default.h>
33
34#define CONFIG_CMD_ASKENV
35#define CONFIG_CMD_DHCP
b0e55d5b 36#define CONFIG_CMD_DEFAULTENV_VARS
1e8f4e78
HS
37#define CONFIG_CMD_ECHO
38#define CONFIG_CMD_IMMAP
39#define CONFIG_CMD_MII
40#define CONFIG_CMD_PING
1e8f4e78
HS
41#define CONFIG_CMD_EEPROM
42#define CONFIG_CMD_I2C
364123db 43#define CONFIG_CMD_JFFS2
dc71b248 44#define CONFIG_CMD_MTDPARTS
f41ee960 45#define CONFIG_CMD_SETEXPR
1e8f4e78 46
b11f53f3 47#undef CONFIG_WATCHDOG /* disable platform specific watchdog */
1e8f4e78 48
f41ee960 49#define CONFIG_BOOTDELAY 2 /* autoboot after 2 seconds */
b11f53f3 50#undef CONFIG_BOOTARGS /* the boot command will set bootargs */
1e8f4e78
HS
51
52/*
53 * Miscellaneous configurable options
54 */
55#define CONFIG_SYS_HUSH_PARSER
b11f53f3
HS
56#define CONFIG_SYS_LONGHELP /* undef to save memory */
57#define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */
1e8f4e78 58#if defined(CONFIG_CMD_KGDB)
b11f53f3 59#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
1e8f4e78 60#else
f41ee960 61#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
1e8f4e78 62#endif
b11f53f3 63#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
f41ee960 64#define CONFIG_SYS_MAXARGS 32 /* max number of command args */
b11f53f3
HS
65#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
66#define CONFIG_CMDLINE_EDITING
67#define CONFIG_AUTO_COMPLETE
1e8f4e78 68
b11f53f3 69#define CONFIG_HUSH_INIT_VAR
1e8f4e78
HS
70
71#define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
1e8f4e78 72
b11f53f3 73#define CONFIG_SYS_HZ 1000 /* decr. freq: 1 ms ticks */
1e8f4e78 74
b11f53f3 75#define CONFIG_BAUDRATE 115200
499b1a4d 76#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
1e8f4e78 77
b11f53f3
HS
78#define CONFIG_LOADS_ECHO
79#define CONFIG_SYS_LOADS_BAUD_CHANGE
1e8f4e78 80
b11f53f3 81#define CONFIG_SYS_I2C_INIT_BOARD
364123db 82
364123db
HS
83/* Support the IVM EEprom */
84#define CONFIG_SYS_IVM_EEPROM_ADR 0x50
85#define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
86#define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
87
b11f53f3 88#define CONFIG_SYS_FLASH_PROTECTION
364123db 89
1e8f4e78
HS
90/*
91 * BOOTP options
92 */
93#define CONFIG_BOOTP_BOOTFILESIZE
94#define CONFIG_BOOTP_BOOTPATH
95#define CONFIG_BOOTP_GATEWAY
96#define CONFIG_BOOTP_HOSTNAME
97
b11f53f3 98#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
dc71b248 99
dc71b248
HS
100/* UBI Support for all Keymile boards */
101#define CONFIG_CMD_UBI
102#define CONFIG_RBTREE
103#define CONFIG_MTD_PARTITIONS
dc71b248
HS
104#define CONFIG_MTD_DEVICE
105#define CONFIG_MTD_CONCAT
106
f7fb46a8
HB
107#define CONFIG_CMD_CRAMFS
108#define CONFIG_CRAMFS_CMDLINE
109
a21b5d4b
HB
110#ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
111#define CONFIG_KM_DEF_ENV_BOOTPARAMS \
db0bb572 112 "actual_bank=0\0"
364123db
HS
113#endif
114
de3ad13d
HB
115#ifndef CONFIG_KM_DEF_NETDEV
116#define CONFIG_KM_DEF_NETDEV \
117 "netdev=eth0\0"
118#endif
119
cf73639d
AH
120#ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
121#define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
122#endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
123
124#ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
125/* one flash chip only called boot */
126/* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
127# define CONFIG_KM_UBI_LINUX_MTD \
128 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT
129# define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
130 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
131#else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
132/* two flash chips called boot and app */
133/* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
134/* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
135# define CONFIG_KM_UBI_LINUX_MTD \
136 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT " " \
137 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
138# define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
139 "ubiattach=if test ${boot_bank} -eq 0; then; " \
140 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
141 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
142#endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
de3ad13d 143
dacc109c
AH
144#ifdef CONFIG_NAND_ECC_BCH
145#define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
a7bc9144 146#define CONFIG_KM_ECC_MODE " eccmode=bch"
dacc109c
AH
147#else
148#define CONFIG_KM_UIMAGE_NAME "uImage\0"
a7bc9144 149#define CONFIG_KM_ECC_MODE
dacc109c
AH
150#endif
151
a21b5d4b
HB
152/*
153 * boottargets
db0bb572 154 * - set 'subbootcmds'
a21b5d4b
HB
155 * - set 'bootcmd' and 'altbootcmd'
156 * available targets:
157 * - 'release': for a standalone system kernel/rootfs from flash
a21b5d4b
HB
158 */
159#define CONFIG_KM_DEF_ENV_BOOTTARGETS \
db0bb572
HB
160 "subbootcmds=ubiattach ubicopy cramfsloadfdt cramfsloadkernel " \
161 "flashargs add_default addpanic boot\0" \
b648bfc2
HB
162 "develop=" \
163 "tftp 200000 scripts/develop-${arch}.txt && " \
2d9528e3 164 "env import -t 200000 ${filesize} && " \
b648bfc2
HB
165 "run setup_debug_env\0" \
166 "ramfs=" \
167 "tftp 200000 scripts/ramfs-${arch}.txt && " \
168 "env import -t 200000 ${filesize} && " \
169 "run setup_debug_env\0" \
a21b5d4b
HB
170 ""
171
de3ad13d
HB
172/*
173 * bootargs
174 * - modify 'bootargs'
175 *
db0bb572 176 * - 'add_default': default bootargs common for all arm/ppc boards
de3ad13d 177 * - 'addpanic': add kernel panic options
de3ad13d
HB
178 * - 'flashargs': defaults arguments for flash base boot
179 *
de3ad13d
HB
180 */
181#define CONFIG_KM_DEF_ENV_BOOTARGS \
db0bb572 182 "add_default=" \
de3ad13d
HB
183 "setenv bootargs ${bootargs} " \
184 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
db0bb572
HB
185 ":${hostname}:${netdev}:off3" \
186 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
2a7714ce 187 " mem=${kernelmem} init=${init}" \
a7bc9144 188 CONFIG_KM_ECC_MODE \
93ea89f0 189 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
cf73639d 190 " " CONFIG_KM_UBI_LINUX_MTD " " \
db0bb572
HB
191 CONFIG_KM_DEF_BOOT_ARGS_CPU \
192 "\0" \
de3ad13d 193 "addpanic=" \
2d9528e3 194 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
de3ad13d
HB
195 "flashargs=" \
196 "setenv bootargs " \
e80ab3e6 197 "root=mtdblock:rootfs${boot_bank} " \
de3ad13d
HB
198 "rootfstype=squashfs ro\0" \
199 ""
200
de3ad13d
HB
201/*
202 * flash_boot
203 * - commands for booting from flash
204 *
de3ad13d
HB
205 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
206 * - 'ubiattach': attach ubi partition
207 * - 'ubicopy': copy ubi volume to ram
208 * - volume names: bootfs0, bootfs1, bootfs2, ...
de3ad13d
HB
209 *
210 * processor specific settings
211 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
212 */
213#define CONFIG_KM_DEF_ENV_FLASH_BOOT \
93ea89f0 214 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
dacc109c 215 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
93ea89f0 216 "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
2d9528e3 217 " bootfs${boot_bank}\0" \
dacc109c 218 "uimage=" CONFIG_KM_UIMAGE_NAME \
cf73639d 219 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
de3ad13d
HB
220
221/*
222 * constants
223 * - KM specific constants and commands
224 *
225 * - 'default': setup default environment
226 */
227#define CONFIG_KM_DEF_ENV_CONSTANTS \
e80ab3e6 228 "backup_bank=0\0" \
db0bb572 229 "release=run newenv; reset\0" \
93ea89f0 230 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
0333cfe6
TH
231 "testbootcmd=setenv boot_bank ${test_bank}; " \
232 "run ${subbootcmds}; reset\0" \
de3ad13d
HB
233 ""
234
364123db
HS
235#ifndef CONFIG_KM_DEF_ENV
236#define CONFIG_KM_DEF_ENV \
a21b5d4b 237 CONFIG_KM_DEF_ENV_BOOTPARAMS \
de3ad13d
HB
238 CONFIG_KM_DEF_NETDEV \
239 CONFIG_KM_DEF_ENV_CPU \
a21b5d4b 240 CONFIG_KM_DEF_ENV_BOOTTARGETS \
de3ad13d 241 CONFIG_KM_DEF_ENV_BOOTARGS \
de3ad13d 242 CONFIG_KM_DEF_ENV_FLASH_BOOT \
a21b5d4b 243 CONFIG_KM_DEF_ENV_CONSTANTS \
de3ad13d 244 "altbootcmd=run bootcmd\0" \
db0bb572 245 "bootcmd=km_checkbidhwk && " \
c1b3d841
TH
246 "setenv bootcmd \'if km_checktestboot; then; " \
247 "setenv boot_bank ${test_bank}; else; " \
248 "setenv boot_bank ${actual_bank}; fi;" \
db0bb572
HB
249 "run ${subbootcmds}; reset\' && " \
250 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
251 "run ${subbootcmds}; reset\' && " \
252 "saveenv && saveenv && boot\0" \
31dd8988 253 "bootlimit=3\0" \
de3ad13d 254 "init=/sbin/init-overlay.sh\0" \
93ea89f0 255 "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
db0bb572 256 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
de3ad13d
HB
257 "mtdids=" MTDIDS_DEFAULT "\0" \
258 "mtdparts=" MTDPARTS_DEFAULT "\0" \
364123db
HS
259 ""
260#endif /* CONFIG_KM_DEF_ENV */
261
499b1a4d 262#define CONFIG_VERSION_VARIABLE /* include version env variable */
364123db 263
1e8f4e78 264#endif /* __CONFIG_KEYMILE_H */