blob: 91ca480f48de5d850955f2531941b1c50db72eca [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 *
Wolfgang Denkbd8ec7e2013-10-07 13:07:26 +02005 * SPDX-License-Identifier: GPL-2.0+
Heiko Schocher7937e4f2008-11-20 09:59:09 +01006 */
7
8#ifndef __CONFIG_KEYMILE_H
9#define __CONFIG_KEYMILE_H
10
Heiko Schochercfc58042010-04-26 13:07:28 +020011#define CONFIG_BOOTCOUNT_LIMIT
Heiko Schocher7937e4f2008-11-20 09:59:09 +010012
Heiko Schocher7937e4f2008-11-20 09:59:09 +010013/*
14 * Command line configuration.
15 */
16#include <config_cmd_default.h>
17
18#define CONFIG_CMD_ASKENV
19#define CONFIG_CMD_DHCP
Gerlando Falauto069b52b2011-09-22 05:06:12 +000020#define CONFIG_CMD_DEFAULTENV_VARS
Holger Brunck3791b042013-07-04 15:37:32 +020021#define CONFIG_CMD_GREPENV
Heiko Schocher7937e4f2008-11-20 09:59:09 +010022#define CONFIG_CMD_ECHO
23#define CONFIG_CMD_IMMAP
24#define CONFIG_CMD_MII
25#define CONFIG_CMD_PING
Heiko Schocher7937e4f2008-11-20 09:59:09 +010026#define CONFIG_CMD_EEPROM
27#define CONFIG_CMD_I2C
Heiko Schochera8d51892009-03-12 07:37:18 +010028#define CONFIG_CMD_JFFS2
Heiko Schocher875f47282009-07-09 12:04:18 +020029#define CONFIG_CMD_MTDPARTS
Holger Brunck0bd82022011-03-14 15:49:05 +010030#define CONFIG_CMD_SETEXPR
Heiko Schocher7937e4f2008-11-20 09:59:09 +010031
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010032#undef CONFIG_WATCHDOG /* disable platform specific watchdog */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010033
Holger Brunck0bd82022011-03-14 15:49:05 +010034#define CONFIG_BOOTDELAY 2 /* autoboot after 2 seconds */
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010035#undef CONFIG_BOOTARGS /* the boot command will set bootargs */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010036
37/*
38 * Miscellaneous configurable options
39 */
40#define CONFIG_SYS_HUSH_PARSER
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010041#define CONFIG_SYS_LONGHELP /* undef to save memory */
42#define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010043#if defined(CONFIG_CMD_KGDB)
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010044#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010045#else
Holger Brunck0bd82022011-03-14 15:49:05 +010046#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010047#endif
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010048#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
Holger Brunck0bd82022011-03-14 15:49:05 +010049#define CONFIG_SYS_MAXARGS 32 /* max number of command args */
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010050#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
51#define CONFIG_CMDLINE_EDITING
52#define CONFIG_AUTO_COMPLETE
Heiko Schocher7937e4f2008-11-20 09:59:09 +010053
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010054#define CONFIG_HUSH_INIT_VAR
Heiko Schocher7937e4f2008-11-20 09:59:09 +010055
56#define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010057
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010058#define CONFIG_SYS_HZ 1000 /* decr. freq: 1 ms ticks */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010059
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010060#define CONFIG_BAUDRATE 115200
Holger Brunck4559d1f2011-04-08 02:47:46 +000061#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
Heiko Schocher7937e4f2008-11-20 09:59:09 +010062
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010063#define CONFIG_LOADS_ECHO
64#define CONFIG_SYS_LOADS_BAUD_CHANGE
Heiko Schocher7937e4f2008-11-20 09:59:09 +010065
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010066#define CONFIG_SYS_I2C_INIT_BOARD
Heiko Schochera8d51892009-03-12 07:37:18 +010067
Heiko Schochera8d51892009-03-12 07:37:18 +010068/* Support the IVM EEprom */
69#define CONFIG_SYS_IVM_EEPROM_ADR 0x50
70#define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
71#define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
72
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010073#define CONFIG_SYS_FLASH_PROTECTION
Heiko Schochera8d51892009-03-12 07:37:18 +010074
Heiko Schocher7937e4f2008-11-20 09:59:09 +010075/*
76 * BOOTP options
77 */
78#define CONFIG_BOOTP_BOOTFILESIZE
79#define CONFIG_BOOTP_BOOTPATH
80#define CONFIG_BOOTP_GATEWAY
81#define CONFIG_BOOTP_HOSTNAME
82
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010083#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
Heiko Schocher875f47282009-07-09 12:04:18 +020084
Heiko Schocher875f47282009-07-09 12:04:18 +020085/* UBI Support for all Keymile boards */
86#define CONFIG_CMD_UBI
87#define CONFIG_RBTREE
88#define CONFIG_MTD_PARTITIONS
Heiko Schocher875f47282009-07-09 12:04:18 +020089#define CONFIG_MTD_DEVICE
90#define CONFIG_MTD_CONCAT
91
Holger Brunck40562652011-06-05 22:22:21 +000092#define CONFIG_CMD_CRAMFS
93#define CONFIG_CRAMFS_CMDLINE
94
Holger Bruncke7c1fdc2011-03-04 14:56:27 +010095#ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
96#define CONFIG_KM_DEF_ENV_BOOTPARAMS \
Holger Brunck2ff59ee2011-07-04 21:27:16 +000097 "actual_bank=0\0"
Heiko Schochera8d51892009-03-12 07:37:18 +010098#endif
99
Holger Brunck752ba312011-03-14 16:01:04 +0100100#ifndef CONFIG_KM_DEF_NETDEV
101#define CONFIG_KM_DEF_NETDEV \
102 "netdev=eth0\0"
103#endif
104
Andreas Hubera81548a2012-05-04 10:30:16 +0200105#ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
106#define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
107#endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
108
109#ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
110/* one flash chip only called boot */
111/* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
112# define CONFIG_KM_UBI_LINUX_MTD \
113 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT
114# define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
115 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
116#else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
117/* two flash chips called boot and app */
118/* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
119/* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
120# define CONFIG_KM_UBI_LINUX_MTD \
121 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT " " \
122 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
123# define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
124 "ubiattach=if test ${boot_bank} -eq 0; then; " \
125 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
126 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
127#endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
Holger Brunck752ba312011-03-14 16:01:04 +0100128
Andreas Huberc31a7572013-01-21 03:55:20 +0000129#ifdef CONFIG_NAND_ECC_BCH
130#define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
Holger Brunckffcbb932013-01-21 03:55:24 +0000131#define CONFIG_KM_ECC_MODE " eccmode=bch"
Andreas Huberc31a7572013-01-21 03:55:20 +0000132#else
133#define CONFIG_KM_UIMAGE_NAME "uImage\0"
Holger Brunckffcbb932013-01-21 03:55:24 +0000134#define CONFIG_KM_ECC_MODE
Andreas Huberc31a7572013-01-21 03:55:20 +0000135#endif
136
Holger Brunck752ba312011-03-14 16:01:04 +0100137/*
Holger Bruncke7c1fdc2011-03-04 14:56:27 +0100138 * boottargets
Holger Brunck2ff59ee2011-07-04 21:27:16 +0000139 * - set 'subbootcmds'
Holger Bruncke7c1fdc2011-03-04 14:56:27 +0100140 * - set 'bootcmd' and 'altbootcmd'
141 * available targets:
142 * - 'release': for a standalone system kernel/rootfs from flash
Holger Bruncke7c1fdc2011-03-04 14:56:27 +0100143 */
144#define CONFIG_KM_DEF_ENV_BOOTTARGETS \
Holger Brunck2ff59ee2011-07-04 21:27:16 +0000145 "subbootcmds=ubiattach ubicopy cramfsloadfdt cramfsloadkernel " \
146 "flashargs add_default addpanic boot\0" \
Holger Bruncke7bec9b2011-07-04 21:52:52 +0000147 "develop=" \
148 "tftp 200000 scripts/develop-${arch}.txt && " \
149 "env import -t 200000 ${filesize} && " \
150 "run setup_debug_env\0" \
151 "ramfs=" \
152 "tftp 200000 scripts/ramfs-${arch}.txt && " \
Holger Brunck0b539022011-05-04 01:47:34 +0000153 "env import -t 200000 ${filesize} && " \
Holger Bruncke7bec9b2011-07-04 21:52:52 +0000154 "run setup_debug_env\0" \
Holger Bruncke7c1fdc2011-03-04 14:56:27 +0100155 ""
156
157/*
Holger Brunck752ba312011-03-14 16:01:04 +0100158 * bootargs
159 * - modify 'bootargs'
160 *
Holger Brunck2ff59ee2011-07-04 21:27:16 +0000161 * - 'add_default': default bootargs common for all arm/ppc boards
Holger Brunck752ba312011-03-14 16:01:04 +0100162 * - 'addpanic': add kernel panic options
Holger Brunck752ba312011-03-14 16:01:04 +0100163 * - 'flashargs': defaults arguments for flash base boot
164 *
Holger Brunck752ba312011-03-14 16:01:04 +0100165 */
166#define CONFIG_KM_DEF_ENV_BOOTARGS \
Holger Brunck2ff59ee2011-07-04 21:27:16 +0000167 "add_default=" \
Holger Brunck752ba312011-03-14 16:01:04 +0100168 "setenv bootargs ${bootargs} " \
169 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
Holger Brunck2ff59ee2011-07-04 21:27:16 +0000170 ":${hostname}:${netdev}:off3" \
171 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
Andreas Huber28c63c72011-09-13 23:06:11 +0000172 " mem=${kernelmem} init=${init}" \
Holger Brunckffcbb932013-01-21 03:55:24 +0000173 CONFIG_KM_ECC_MODE \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200174 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
Andreas Hubera81548a2012-05-04 10:30:16 +0200175 " " CONFIG_KM_UBI_LINUX_MTD " " \
Holger Brunck2ff59ee2011-07-04 21:27:16 +0000176 CONFIG_KM_DEF_BOOT_ARGS_CPU \
177 "\0" \
Holger Brunck752ba312011-03-14 16:01:04 +0100178 "addpanic=" \
Holger Brunck0b539022011-05-04 01:47:34 +0000179 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
Holger Brunck752ba312011-03-14 16:01:04 +0100180 "flashargs=" \
181 "setenv bootargs " \
Thomas Herzmann1d253c12011-04-08 02:47:41 +0000182 "root=mtdblock:rootfs${boot_bank} " \
Holger Brunck752ba312011-03-14 16:01:04 +0100183 "rootfstype=squashfs ro\0" \
184 ""
185
Holger Bruncke7c1fdc2011-03-04 14:56:27 +0100186/*
Holger Brunck752ba312011-03-14 16:01:04 +0100187 * flash_boot
188 * - commands for booting from flash
189 *
Holger Brunck752ba312011-03-14 16:01:04 +0100190 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
191 * - 'ubiattach': attach ubi partition
192 * - 'ubicopy': copy ubi volume to ram
193 * - volume names: bootfs0, bootfs1, bootfs2, ...
Holger Brunck752ba312011-03-14 16:01:04 +0100194 *
195 * processor specific settings
196 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
197 */
198#define CONFIG_KM_DEF_ENV_FLASH_BOOT \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200199 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
Andreas Huberc31a7572013-01-21 03:55:20 +0000200 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200201 "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
Holger Brunck0b539022011-05-04 01:47:34 +0000202 " bootfs${boot_bank}\0" \
Andreas Huberc31a7572013-01-21 03:55:20 +0000203 "uimage=" CONFIG_KM_UIMAGE_NAME \
Andreas Hubera81548a2012-05-04 10:30:16 +0200204 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
Holger Brunck752ba312011-03-14 16:01:04 +0100205
206/*
Holger Brunck752ba312011-03-14 16:01:04 +0100207 * constants
208 * - KM specific constants and commands
209 *
210 * - 'default': setup default environment
211 */
212#define CONFIG_KM_DEF_ENV_CONSTANTS \
Thomas Herzmann1d253c12011-04-08 02:47:41 +0000213 "backup_bank=0\0" \
Holger Brunck2ff59ee2011-07-04 21:27:16 +0000214 "release=run newenv; reset\0" \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200215 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
Thomas Herzmann80d5c9e2011-06-05 22:22:13 +0000216 "testbootcmd=setenv boot_bank ${test_bank}; " \
217 "run ${subbootcmds}; reset\0" \
Holger Brunck752ba312011-03-14 16:01:04 +0100218 ""
219
Heiko Schochera8d51892009-03-12 07:37:18 +0100220#ifndef CONFIG_KM_DEF_ENV
221#define CONFIG_KM_DEF_ENV \
Holger Bruncke7c1fdc2011-03-04 14:56:27 +0100222 CONFIG_KM_DEF_ENV_BOOTPARAMS \
Holger Brunck752ba312011-03-14 16:01:04 +0100223 CONFIG_KM_DEF_NETDEV \
224 CONFIG_KM_DEF_ENV_CPU \
Holger Bruncke7c1fdc2011-03-04 14:56:27 +0100225 CONFIG_KM_DEF_ENV_BOOTTARGETS \
Holger Brunck752ba312011-03-14 16:01:04 +0100226 CONFIG_KM_DEF_ENV_BOOTARGS \
Holger Brunck752ba312011-03-14 16:01:04 +0100227 CONFIG_KM_DEF_ENV_FLASH_BOOT \
Holger Bruncke7c1fdc2011-03-04 14:56:27 +0100228 CONFIG_KM_DEF_ENV_CONSTANTS \
Holger Brunck752ba312011-03-14 16:01:04 +0100229 "altbootcmd=run bootcmd\0" \
Holger Brunck2ff59ee2011-07-04 21:27:16 +0000230 "bootcmd=km_checkbidhwk && " \
Thomas Herzmannb2c31602012-05-04 10:55:58 +0200231 "setenv bootcmd \'if km_checktestboot; then; " \
232 "setenv boot_bank ${test_bank}; else; " \
233 "setenv boot_bank ${actual_bank}; fi;" \
Holger Brunck2ff59ee2011-07-04 21:27:16 +0000234 "run ${subbootcmds}; reset\' && " \
235 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
236 "run ${subbootcmds}; reset\' && " \
237 "saveenv && saveenv && boot\0" \
Holger Brunckca907c92012-05-04 10:55:54 +0200238 "bootlimit=3\0" \
Holger Brunck752ba312011-03-14 16:01:04 +0100239 "init=/sbin/init-overlay.sh\0" \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200240 "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
Holger Brunck2ff59ee2011-07-04 21:27:16 +0000241 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
Holger Brunck752ba312011-03-14 16:01:04 +0100242 "mtdids=" MTDIDS_DEFAULT "\0" \
243 "mtdparts=" MTDPARTS_DEFAULT "\0" \
Heiko Schochera8d51892009-03-12 07:37:18 +0100244 ""
245#endif /* CONFIG_KM_DEF_ENV */
246
Holger Brunck4559d1f2011-04-08 02:47:46 +0000247#define CONFIG_VERSION_VARIABLE /* include version env variable */
Heiko Schochera8d51892009-03-12 07:37:18 +0100248
Heiko Schocher7937e4f2008-11-20 09:59:09 +0100249#endif /* __CONFIG_KEYMILE_H */