blob: 7361072c98275bfc8c8345f8586eb34265d1c8f4 [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 */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010042#if defined(CONFIG_CMD_KGDB)
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010043#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010044#else
Holger Brunck0bd82022011-03-14 15:49:05 +010045#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010046#endif
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010047#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
Holger Brunck0bd82022011-03-14 15:49:05 +010048#define CONFIG_SYS_MAXARGS 32 /* max number of command args */
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010049#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
50#define CONFIG_CMDLINE_EDITING
51#define CONFIG_AUTO_COMPLETE
Heiko Schocher7937e4f2008-11-20 09:59:09 +010052
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010053#define CONFIG_HUSH_INIT_VAR
Heiko Schocher7937e4f2008-11-20 09:59:09 +010054
55#define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
Heiko Schocher7937e4f2008-11-20 09:59:09 +010056
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010057#define CONFIG_BAUDRATE 115200
Holger Brunck4559d1f2011-04-08 02:47:46 +000058#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
Heiko Schocher7937e4f2008-11-20 09:59:09 +010059
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010060#define CONFIG_LOADS_ECHO
61#define CONFIG_SYS_LOADS_BAUD_CHANGE
Heiko Schocher7937e4f2008-11-20 09:59:09 +010062
Heiko Schochera8d51892009-03-12 07:37:18 +010063/* Support the IVM EEprom */
64#define CONFIG_SYS_IVM_EEPROM_ADR 0x50
65#define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
66#define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
67
Heiko Schocher8ce3dd52011-03-15 16:52:29 +010068#define CONFIG_SYS_FLASH_PROTECTION
Heiko Schochera8d51892009-03-12 07:37:18 +010069
Heiko Schocher7937e4f2008-11-20 09:59:09 +010070/*
71 * BOOTP options
72 */
73#define CONFIG_BOOTP_BOOTFILESIZE
74#define CONFIG_BOOTP_BOOTPATH
75#define CONFIG_BOOTP_GATEWAY
76#define CONFIG_BOOTP_HOSTNAME
77
Heiko Schocher875f47282009-07-09 12:04:18 +020078/* UBI Support for all Keymile boards */
79#define CONFIG_CMD_UBI
80#define CONFIG_RBTREE
81#define CONFIG_MTD_PARTITIONS
Heiko Schocher875f47282009-07-09 12:04:18 +020082#define CONFIG_MTD_DEVICE
83#define CONFIG_MTD_CONCAT
84
Holger Brunck40562652011-06-05 22:22:21 +000085#define CONFIG_CMD_CRAMFS
86#define CONFIG_CRAMFS_CMDLINE
87
Holger Bruncke7c1fdc2011-03-04 14:56:27 +010088#ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
89#define CONFIG_KM_DEF_ENV_BOOTPARAMS \
Holger Brunck2ff59ee2011-07-04 21:27:16 +000090 "actual_bank=0\0"
Heiko Schochera8d51892009-03-12 07:37:18 +010091#endif
92
Holger Brunck752ba312011-03-14 16:01:04 +010093#ifndef CONFIG_KM_DEF_NETDEV
94#define CONFIG_KM_DEF_NETDEV \
95 "netdev=eth0\0"
96#endif
97
Andreas Hubera81548a2012-05-04 10:30:16 +020098#ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
99#define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
100#endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
101
102#ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
103/* one flash chip only called boot */
104/* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
105# define CONFIG_KM_UBI_LINUX_MTD \
106 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT
107# define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
108 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
109#else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
110/* two flash chips called boot and app */
111/* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
112/* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
113# define CONFIG_KM_UBI_LINUX_MTD \
114 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT " " \
115 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
116# define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
117 "ubiattach=if test ${boot_bank} -eq 0; then; " \
118 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
119 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
120#endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
Holger Brunck752ba312011-03-14 16:01:04 +0100121
Andreas Huberc31a7572013-01-21 03:55:20 +0000122#ifdef CONFIG_NAND_ECC_BCH
123#define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
Holger Brunckffcbb932013-01-21 03:55:24 +0000124#define CONFIG_KM_ECC_MODE " eccmode=bch"
Andreas Huberc31a7572013-01-21 03:55:20 +0000125#else
126#define CONFIG_KM_UIMAGE_NAME "uImage\0"
Holger Brunckffcbb932013-01-21 03:55:24 +0000127#define CONFIG_KM_ECC_MODE
Andreas Huberc31a7572013-01-21 03:55:20 +0000128#endif
129
Holger Brunck752ba312011-03-14 16:01:04 +0100130/*
Holger Bruncke7c1fdc2011-03-04 14:56:27 +0100131 * boottargets
Holger Brunck2ff59ee2011-07-04 21:27:16 +0000132 * - set 'subbootcmds'
Holger Bruncke7c1fdc2011-03-04 14:56:27 +0100133 * - set 'bootcmd' and 'altbootcmd'
134 * available targets:
135 * - 'release': for a standalone system kernel/rootfs from flash
Holger Bruncke7c1fdc2011-03-04 14:56:27 +0100136 */
137#define CONFIG_KM_DEF_ENV_BOOTTARGETS \
Gerlando Falauto18a74ec2014-01-27 16:58:28 +0100138 "subbootcmds=ubiattach ubicopy cramfsloadfdt set_fdthigh " \
139 "cramfsloadkernel flashargs add_default addpanic boot\0"\
Holger Bruncke7bec9b2011-07-04 21:52:52 +0000140 "develop=" \
141 "tftp 200000 scripts/develop-${arch}.txt && " \
142 "env import -t 200000 ${filesize} && " \
143 "run setup_debug_env\0" \
144 "ramfs=" \
145 "tftp 200000 scripts/ramfs-${arch}.txt && " \
Holger Brunck0b539022011-05-04 01:47:34 +0000146 "env import -t 200000 ${filesize} && " \
Holger Bruncke7bec9b2011-07-04 21:52:52 +0000147 "run setup_debug_env\0" \
Holger Bruncke7c1fdc2011-03-04 14:56:27 +0100148 ""
149
150/*
Holger Brunck752ba312011-03-14 16:01:04 +0100151 * bootargs
152 * - modify 'bootargs'
153 *
Holger Brunck2ff59ee2011-07-04 21:27:16 +0000154 * - 'add_default': default bootargs common for all arm/ppc boards
Holger Brunck752ba312011-03-14 16:01:04 +0100155 * - 'addpanic': add kernel panic options
Holger Brunck752ba312011-03-14 16:01:04 +0100156 * - 'flashargs': defaults arguments for flash base boot
157 *
Holger Brunck752ba312011-03-14 16:01:04 +0100158 */
159#define CONFIG_KM_DEF_ENV_BOOTARGS \
Holger Brunck2ff59ee2011-07-04 21:27:16 +0000160 "add_default=" \
Holger Brunck752ba312011-03-14 16:01:04 +0100161 "setenv bootargs ${bootargs} " \
162 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
Valentin Longchamp1d399592013-10-18 11:47:16 +0200163 ":${hostname}:${netdev}:off:" \
Holger Brunck2ff59ee2011-07-04 21:27:16 +0000164 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
Andreas Huber28c63c72011-09-13 23:06:11 +0000165 " mem=${kernelmem} init=${init}" \
Holger Brunckffcbb932013-01-21 03:55:24 +0000166 CONFIG_KM_ECC_MODE \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200167 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
Andreas Hubera81548a2012-05-04 10:30:16 +0200168 " " CONFIG_KM_UBI_LINUX_MTD " " \
Holger Brunck2ff59ee2011-07-04 21:27:16 +0000169 CONFIG_KM_DEF_BOOT_ARGS_CPU \
170 "\0" \
Holger Brunck752ba312011-03-14 16:01:04 +0100171 "addpanic=" \
Holger Brunck0b539022011-05-04 01:47:34 +0000172 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
Holger Brunck752ba312011-03-14 16:01:04 +0100173 "flashargs=" \
174 "setenv bootargs " \
Thomas Herzmann1d253c12011-04-08 02:47:41 +0000175 "root=mtdblock:rootfs${boot_bank} " \
Holger Brunck752ba312011-03-14 16:01:04 +0100176 "rootfstype=squashfs ro\0" \
177 ""
178
Holger Bruncke7c1fdc2011-03-04 14:56:27 +0100179/*
Holger Brunck752ba312011-03-14 16:01:04 +0100180 * flash_boot
181 * - commands for booting from flash
182 *
Holger Brunck752ba312011-03-14 16:01:04 +0100183 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
184 * - 'ubiattach': attach ubi partition
185 * - 'ubicopy': copy ubi volume to ram
186 * - volume names: bootfs0, bootfs1, bootfs2, ...
Holger Brunck752ba312011-03-14 16:01:04 +0100187 *
188 * processor specific settings
189 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
190 */
191#define CONFIG_KM_DEF_ENV_FLASH_BOOT \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200192 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
Andreas Huberc31a7572013-01-21 03:55:20 +0000193 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200194 "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
Holger Brunck0b539022011-05-04 01:47:34 +0000195 " bootfs${boot_bank}\0" \
Andreas Huberc31a7572013-01-21 03:55:20 +0000196 "uimage=" CONFIG_KM_UIMAGE_NAME \
Andreas Hubera81548a2012-05-04 10:30:16 +0200197 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
Holger Brunck752ba312011-03-14 16:01:04 +0100198
199/*
Holger Brunck752ba312011-03-14 16:01:04 +0100200 * constants
201 * - KM specific constants and commands
202 *
203 * - 'default': setup default environment
204 */
205#define CONFIG_KM_DEF_ENV_CONSTANTS \
Thomas Herzmann1d253c12011-04-08 02:47:41 +0000206 "backup_bank=0\0" \
Holger Brunck2ff59ee2011-07-04 21:27:16 +0000207 "release=run newenv; reset\0" \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200208 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
Thomas Herzmann80d5c9e2011-06-05 22:22:13 +0000209 "testbootcmd=setenv boot_bank ${test_bank}; " \
210 "run ${subbootcmds}; reset\0" \
Holger Brunck752ba312011-03-14 16:01:04 +0100211 ""
212
Heiko Schochera8d51892009-03-12 07:37:18 +0100213#ifndef CONFIG_KM_DEF_ENV
214#define CONFIG_KM_DEF_ENV \
Holger Bruncke7c1fdc2011-03-04 14:56:27 +0100215 CONFIG_KM_DEF_ENV_BOOTPARAMS \
Holger Brunck752ba312011-03-14 16:01:04 +0100216 CONFIG_KM_DEF_NETDEV \
217 CONFIG_KM_DEF_ENV_CPU \
Holger Bruncke7c1fdc2011-03-04 14:56:27 +0100218 CONFIG_KM_DEF_ENV_BOOTTARGETS \
Holger Brunck752ba312011-03-14 16:01:04 +0100219 CONFIG_KM_DEF_ENV_BOOTARGS \
Holger Brunck752ba312011-03-14 16:01:04 +0100220 CONFIG_KM_DEF_ENV_FLASH_BOOT \
Holger Bruncke7c1fdc2011-03-04 14:56:27 +0100221 CONFIG_KM_DEF_ENV_CONSTANTS \
Holger Brunck752ba312011-03-14 16:01:04 +0100222 "altbootcmd=run bootcmd\0" \
Gerlando Falautoae2adaf2014-01-27 16:58:27 +0100223 "boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \
Holger Brunck2ff59ee2011-07-04 21:27:16 +0000224 "bootcmd=km_checkbidhwk && " \
Thomas Herzmannb2c31602012-05-04 10:55:58 +0200225 "setenv bootcmd \'if km_checktestboot; then; " \
226 "setenv boot_bank ${test_bank}; else; " \
227 "setenv boot_bank ${actual_bank}; fi;" \
Holger Brunck2ff59ee2011-07-04 21:27:16 +0000228 "run ${subbootcmds}; reset\' && " \
229 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
230 "run ${subbootcmds}; reset\' && " \
231 "saveenv && saveenv && boot\0" \
Holger Brunckca907c92012-05-04 10:55:54 +0200232 "bootlimit=3\0" \
Gerlando Falautoae2adaf2014-01-27 16:58:27 +0100233 "cramfsloadfdt=" \
234 "cramfsload ${fdt_addr_r} " \
235 "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \
236 "fdt_addr_r="__stringify(CONFIG_KM_FDT_ADDR) "\0" \
Holger Brunck752ba312011-03-14 16:01:04 +0100237 "init=/sbin/init-overlay.sh\0" \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200238 "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
Holger Brunck2ff59ee2011-07-04 21:27:16 +0000239 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
Holger Brunck752ba312011-03-14 16:01:04 +0100240 "mtdids=" MTDIDS_DEFAULT "\0" \
241 "mtdparts=" MTDPARTS_DEFAULT "\0" \
Heiko Schochera8d51892009-03-12 07:37:18 +0100242 ""
243#endif /* CONFIG_KM_DEF_ENV */
244
Holger Brunck4559d1f2011-04-08 02:47:46 +0000245#define CONFIG_VERSION_VARIABLE /* include version env variable */
Heiko Schochera8d51892009-03-12 07:37:18 +0100246
Heiko Schocher7937e4f2008-11-20 09:59:09 +0100247#endif /* __CONFIG_KEYMILE_H */