blob: 3b15c4e6910010197a6fa9c7952e47a8caa4b690 [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
Heiko Schocherf1fef1d2010-04-26 13:07:28 +020027#define CONFIG_BOOTCOUNT_LIMIT
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010028
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010029/*
30 * Command line configuration.
31 */
32#include <config_cmd_default.h>
33
34#define CONFIG_CMD_ASKENV
35#define CONFIG_CMD_DHCP
Gerlando Falautob0e55d52011-09-22 05:06:12 +000036#define CONFIG_CMD_DEFAULTENV_VARS
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010037#define CONFIG_CMD_ECHO
38#define CONFIG_CMD_IMMAP
39#define CONFIG_CMD_MII
40#define CONFIG_CMD_PING
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010041#define CONFIG_CMD_EEPROM
42#define CONFIG_CMD_I2C
Heiko Schocher364123d2009-03-12 07:37:18 +010043#define CONFIG_CMD_JFFS2
Heiko Schocherdc71b242009-07-09 12:04:18 +020044#define CONFIG_CMD_MTDPARTS
Holger Brunckf41ee962011-03-14 15:49:05 +010045#define CONFIG_CMD_SETEXPR
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010046
Heiko Schocherb11f53f2011-03-15 16:52:29 +010047#undef CONFIG_WATCHDOG /* disable platform specific watchdog */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010048
Holger Brunckf41ee962011-03-14 15:49:05 +010049#define CONFIG_BOOTDELAY 2 /* autoboot after 2 seconds */
Heiko Schocherb11f53f2011-03-15 16:52:29 +010050#undef CONFIG_BOOTARGS /* the boot command will set bootargs */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010051
52/*
53 * Miscellaneous configurable options
54 */
55#define CONFIG_SYS_HUSH_PARSER
Heiko Schocherb11f53f2011-03-15 16:52:29 +010056#define CONFIG_SYS_LONGHELP /* undef to save memory */
57#define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010058#if defined(CONFIG_CMD_KGDB)
Heiko Schocherb11f53f2011-03-15 16:52:29 +010059#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010060#else
Holger Brunckf41ee962011-03-14 15:49:05 +010061#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010062#endif
Heiko Schocherb11f53f2011-03-15 16:52:29 +010063#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
Holger Brunckf41ee962011-03-14 15:49:05 +010064#define CONFIG_SYS_MAXARGS 32 /* max number of command args */
Heiko Schocherb11f53f2011-03-15 16:52:29 +010065#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
66#define CONFIG_CMDLINE_EDITING
67#define CONFIG_AUTO_COMPLETE
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010068
Heiko Schocherb11f53f2011-03-15 16:52:29 +010069#define CONFIG_HUSH_INIT_VAR
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010070
71#define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010072
Heiko Schocherb11f53f2011-03-15 16:52:29 +010073#define CONFIG_SYS_HZ 1000 /* decr. freq: 1 ms ticks */
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010074
Heiko Schocherb11f53f2011-03-15 16:52:29 +010075#define CONFIG_BAUDRATE 115200
Holger Brunck499b1a42011-04-08 02:47:46 +000076#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010077
Heiko Schocherb11f53f2011-03-15 16:52:29 +010078#define CONFIG_LOADS_ECHO
79#define CONFIG_SYS_LOADS_BAUD_CHANGE
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010080
Heiko Schocherb11f53f2011-03-15 16:52:29 +010081#define CONFIG_I2C_MULTI_BUS
Heiko Schocherdc71b242009-07-09 12:04:18 +020082#define CONFIG_SYS_MAX_I2C_BUS 1
Heiko Schocherb11f53f2011-03-15 16:52:29 +010083#define CONFIG_SYS_I2C_INIT_BOARD
84#define CONFIG_I2C_MUX
Heiko Schocher364123d2009-03-12 07:37:18 +010085
Heiko Schocher364123d2009-03-12 07:37:18 +010086/* Support the IVM EEprom */
87#define CONFIG_SYS_IVM_EEPROM_ADR 0x50
88#define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
89#define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
90
Heiko Schocherb11f53f2011-03-15 16:52:29 +010091#define CONFIG_SYS_FLASH_PROTECTION
Heiko Schocher364123d2009-03-12 07:37:18 +010092
Heiko Schocher1e8f4e72008-11-20 09:59:09 +010093/*
94 * BOOTP options
95 */
96#define CONFIG_BOOTP_BOOTFILESIZE
97#define CONFIG_BOOTP_BOOTPATH
98#define CONFIG_BOOTP_GATEWAY
99#define CONFIG_BOOTP_HOSTNAME
100
Heiko Schocherb11f53f2011-03-15 16:52:29 +0100101#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
Heiko Schocherdc71b242009-07-09 12:04:18 +0200102
Heiko Schocherdc71b242009-07-09 12:04:18 +0200103/* UBI Support for all Keymile boards */
104#define CONFIG_CMD_UBI
105#define CONFIG_RBTREE
106#define CONFIG_MTD_PARTITIONS
Heiko Schocherdc71b242009-07-09 12:04:18 +0200107#define CONFIG_MTD_DEVICE
108#define CONFIG_MTD_CONCAT
109
Holger Brunckf7fb46a2011-06-05 22:22:21 +0000110#define CONFIG_CMD_CRAMFS
111#define CONFIG_CRAMFS_CMDLINE
112
Holger Bruncka21b5d42011-03-04 14:56:27 +0100113#ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
114#define CONFIG_KM_DEF_ENV_BOOTPARAMS \
Holger Brunckdb0bb572011-07-04 21:27:16 +0000115 "actual_bank=0\0"
Heiko Schocher364123d2009-03-12 07:37:18 +0100116#endif
117
Holger Brunckde3ad132011-03-14 16:01:04 +0100118#ifndef CONFIG_KM_DEF_NETDEV
119#define CONFIG_KM_DEF_NETDEV \
120 "netdev=eth0\0"
121#endif
122
Andreas Hubercf736392012-05-04 10:30:16 +0200123#ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
124#define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
125#endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
126
127#ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
128/* one flash chip only called boot */
129/* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
130# define CONFIG_KM_UBI_LINUX_MTD \
131 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT
132# define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
133 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
134#else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
135/* two flash chips called boot and app */
136/* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
137/* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
138# define CONFIG_KM_UBI_LINUX_MTD \
139 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT " " \
140 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
141# define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
142 "ubiattach=if test ${boot_bank} -eq 0; then; " \
143 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
144 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
145#endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
Holger Brunckde3ad132011-03-14 16:01:04 +0100146
Andreas Huberdacc1092013-01-21 03:55:20 +0000147#ifdef CONFIG_NAND_ECC_BCH
148#define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
Holger Bruncka7bc9142013-01-21 03:55:24 +0000149#define CONFIG_KM_ECC_MODE " eccmode=bch"
Andreas Huberdacc1092013-01-21 03:55:20 +0000150#else
151#define CONFIG_KM_UIMAGE_NAME "uImage\0"
Holger Bruncka7bc9142013-01-21 03:55:24 +0000152#define CONFIG_KM_ECC_MODE
Andreas Huberdacc1092013-01-21 03:55:20 +0000153#endif
154
Holger Brunckde3ad132011-03-14 16:01:04 +0100155/*
Holger Bruncka21b5d42011-03-04 14:56:27 +0100156 * boottargets
Holger Brunckdb0bb572011-07-04 21:27:16 +0000157 * - set 'subbootcmds'
Holger Bruncka21b5d42011-03-04 14:56:27 +0100158 * - set 'bootcmd' and 'altbootcmd'
159 * available targets:
160 * - 'release': for a standalone system kernel/rootfs from flash
Holger Bruncka21b5d42011-03-04 14:56:27 +0100161 */
162#define CONFIG_KM_DEF_ENV_BOOTTARGETS \
Holger Brunckdb0bb572011-07-04 21:27:16 +0000163 "subbootcmds=ubiattach ubicopy cramfsloadfdt cramfsloadkernel " \
164 "flashargs add_default addpanic boot\0" \
Holger Brunckb648bfc2011-07-04 21:52:52 +0000165 "develop=" \
166 "tftp 200000 scripts/develop-${arch}.txt && " \
Holger Brunck2d9528e2011-05-04 01:47:34 +0000167 "env import -t 200000 ${filesize} && " \
Holger Brunckb648bfc2011-07-04 21:52:52 +0000168 "run setup_debug_env\0" \
169 "ramfs=" \
170 "tftp 200000 scripts/ramfs-${arch}.txt && " \
171 "env import -t 200000 ${filesize} && " \
172 "run setup_debug_env\0" \
Holger Bruncka21b5d42011-03-04 14:56:27 +0100173 ""
174
175/*
Holger Brunckde3ad132011-03-14 16:01:04 +0100176 * bootargs
177 * - modify 'bootargs'
178 *
Holger Brunckdb0bb572011-07-04 21:27:16 +0000179 * - 'add_default': default bootargs common for all arm/ppc boards
Holger Brunckde3ad132011-03-14 16:01:04 +0100180 * - 'addpanic': add kernel panic options
Holger Brunckde3ad132011-03-14 16:01:04 +0100181 * - 'flashargs': defaults arguments for flash base boot
182 *
Holger Brunckde3ad132011-03-14 16:01:04 +0100183 */
184#define CONFIG_KM_DEF_ENV_BOOTARGS \
Holger Brunckdb0bb572011-07-04 21:27:16 +0000185 "add_default=" \
Holger Brunckde3ad132011-03-14 16:01:04 +0100186 "setenv bootargs ${bootargs} " \
187 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
Holger Brunckdb0bb572011-07-04 21:27:16 +0000188 ":${hostname}:${netdev}:off3" \
189 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
Andreas Huber2a7714c2011-09-13 23:06:11 +0000190 " mem=${kernelmem} init=${init}" \
Holger Bruncka7bc9142013-01-21 03:55:24 +0000191 CONFIG_KM_ECC_MODE \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200192 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
Andreas Hubercf736392012-05-04 10:30:16 +0200193 " " CONFIG_KM_UBI_LINUX_MTD " " \
Holger Brunckdb0bb572011-07-04 21:27:16 +0000194 CONFIG_KM_DEF_BOOT_ARGS_CPU \
195 "\0" \
Holger Brunckde3ad132011-03-14 16:01:04 +0100196 "addpanic=" \
Holger Brunck2d9528e2011-05-04 01:47:34 +0000197 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
Holger Brunckde3ad132011-03-14 16:01:04 +0100198 "flashargs=" \
199 "setenv bootargs " \
Thomas Herzmanne80ab3e2011-04-08 02:47:41 +0000200 "root=mtdblock:rootfs${boot_bank} " \
Holger Brunckde3ad132011-03-14 16:01:04 +0100201 "rootfstype=squashfs ro\0" \
202 ""
203
Holger Bruncka21b5d42011-03-04 14:56:27 +0100204/*
Holger Brunckde3ad132011-03-14 16:01:04 +0100205 * flash_boot
206 * - commands for booting from flash
207 *
Holger Brunckde3ad132011-03-14 16:01:04 +0100208 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
209 * - 'ubiattach': attach ubi partition
210 * - 'ubicopy': copy ubi volume to ram
211 * - volume names: bootfs0, bootfs1, bootfs2, ...
Holger Brunckde3ad132011-03-14 16:01:04 +0100212 *
213 * processor specific settings
214 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
215 */
216#define CONFIG_KM_DEF_ENV_FLASH_BOOT \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200217 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
Andreas Huberdacc1092013-01-21 03:55:20 +0000218 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200219 "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
Holger Brunck2d9528e2011-05-04 01:47:34 +0000220 " bootfs${boot_bank}\0" \
Andreas Huberdacc1092013-01-21 03:55:20 +0000221 "uimage=" CONFIG_KM_UIMAGE_NAME \
Andreas Hubercf736392012-05-04 10:30:16 +0200222 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
Holger Brunckde3ad132011-03-14 16:01:04 +0100223
224/*
225 * constants
226 * - KM specific constants and commands
227 *
228 * - 'default': setup default environment
229 */
230#define CONFIG_KM_DEF_ENV_CONSTANTS \
Thomas Herzmanne80ab3e2011-04-08 02:47:41 +0000231 "backup_bank=0\0" \
Holger Brunckdb0bb572011-07-04 21:27:16 +0000232 "release=run newenv; reset\0" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200233 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
Thomas Herzmann0333cfe2011-06-05 22:22:13 +0000234 "testbootcmd=setenv boot_bank ${test_bank}; " \
235 "run ${subbootcmds}; reset\0" \
Holger Brunckde3ad132011-03-14 16:01:04 +0100236 ""
237
Heiko Schocher364123d2009-03-12 07:37:18 +0100238#ifndef CONFIG_KM_DEF_ENV
239#define CONFIG_KM_DEF_ENV \
Holger Bruncka21b5d42011-03-04 14:56:27 +0100240 CONFIG_KM_DEF_ENV_BOOTPARAMS \
Holger Brunckde3ad132011-03-14 16:01:04 +0100241 CONFIG_KM_DEF_NETDEV \
242 CONFIG_KM_DEF_ENV_CPU \
Holger Bruncka21b5d42011-03-04 14:56:27 +0100243 CONFIG_KM_DEF_ENV_BOOTTARGETS \
Holger Brunckde3ad132011-03-14 16:01:04 +0100244 CONFIG_KM_DEF_ENV_BOOTARGS \
Holger Brunckde3ad132011-03-14 16:01:04 +0100245 CONFIG_KM_DEF_ENV_FLASH_BOOT \
Holger Bruncka21b5d42011-03-04 14:56:27 +0100246 CONFIG_KM_DEF_ENV_CONSTANTS \
Holger Brunckde3ad132011-03-14 16:01:04 +0100247 "altbootcmd=run bootcmd\0" \
Holger Brunckdb0bb572011-07-04 21:27:16 +0000248 "bootcmd=km_checkbidhwk && " \
Thomas Herzmannc1b3d842012-05-04 10:55:58 +0200249 "setenv bootcmd \'if km_checktestboot; then; " \
250 "setenv boot_bank ${test_bank}; else; " \
251 "setenv boot_bank ${actual_bank}; fi;" \
Holger Brunckdb0bb572011-07-04 21:27:16 +0000252 "run ${subbootcmds}; reset\' && " \
253 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
254 "run ${subbootcmds}; reset\' && " \
255 "saveenv && saveenv && boot\0" \
Holger Brunck31dd8982012-05-04 10:55:54 +0200256 "bootlimit=3\0" \
Holger Brunckde3ad132011-03-14 16:01:04 +0100257 "init=/sbin/init-overlay.sh\0" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200258 "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
Holger Brunckdb0bb572011-07-04 21:27:16 +0000259 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
Holger Brunckde3ad132011-03-14 16:01:04 +0100260 "mtdids=" MTDIDS_DEFAULT "\0" \
261 "mtdparts=" MTDPARTS_DEFAULT "\0" \
Heiko Schocher364123d2009-03-12 07:37:18 +0100262 ""
263#endif /* CONFIG_KM_DEF_ENV */
264
Holger Brunck499b1a42011-04-08 02:47:46 +0000265#define CONFIG_VERSION_VARIABLE /* include version env variable */
Heiko Schocher364123d2009-03-12 07:37:18 +0100266
Heiko Schocher1e8f4e72008-11-20 09:59:09 +0100267#endif /* __CONFIG_KEYMILE_H */