2 * (C) Copyright 2008-2011
3 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
5 * SPDX-License-Identifier: GPL-2.0+
8 #ifndef __CONFIG_KEYMILE_H
9 #define __CONFIG_KEYMILE_H
11 #define CONFIG_BOOTCOUNT_LIMIT
14 * Command line configuration.
16 #include <config_cmd_default.h>
18 #define CONFIG_CMD_ASKENV
19 #define CONFIG_CMD_DHCP
20 #define CONFIG_CMD_DEFAULTENV_VARS
21 #define CONFIG_CMD_GREPENV
22 #define CONFIG_CMD_ECHO
23 #define CONFIG_CMD_IMMAP
24 #define CONFIG_CMD_MII
25 #define CONFIG_CMD_PING
26 #define CONFIG_CMD_EEPROM
27 #define CONFIG_CMD_I2C
28 #define CONFIG_CMD_JFFS2
29 #define CONFIG_CMD_MTDPARTS
30 #define CONFIG_CMD_SETEXPR
32 #undef CONFIG_WATCHDOG /* disable platform specific watchdog */
34 #define CONFIG_BOOTDELAY 2 /* autoboot after 2 seconds */
35 #undef CONFIG_BOOTARGS /* the boot command will set bootargs */
38 * Miscellaneous configurable options
40 #define CONFIG_SYS_HUSH_PARSER
41 #define CONFIG_SYS_LONGHELP /* undef to save memory */
42 #define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */
43 #if defined(CONFIG_CMD_KGDB)
44 #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
46 #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
48 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
49 #define CONFIG_SYS_MAXARGS 32 /* max number of command args */
50 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
51 #define CONFIG_CMDLINE_EDITING
52 #define CONFIG_AUTO_COMPLETE
54 #define CONFIG_HUSH_INIT_VAR
56 #define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
58 #define CONFIG_SYS_HZ 1000 /* decr. freq: 1 ms ticks */
60 #define CONFIG_BAUDRATE 115200
61 #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
63 #define CONFIG_LOADS_ECHO
64 #define CONFIG_SYS_LOADS_BAUD_CHANGE
66 #define CONFIG_SYS_I2C_INIT_BOARD
68 /* 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
73 #define CONFIG_SYS_FLASH_PROTECTION
78 #define CONFIG_BOOTP_BOOTFILESIZE
79 #define CONFIG_BOOTP_BOOTPATH
80 #define CONFIG_BOOTP_GATEWAY
81 #define CONFIG_BOOTP_HOSTNAME
83 #define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
85 /* UBI Support for all Keymile boards */
86 #define CONFIG_CMD_UBI
88 #define CONFIG_MTD_PARTITIONS
89 #define CONFIG_MTD_DEVICE
90 #define CONFIG_MTD_CONCAT
92 #define CONFIG_CMD_CRAMFS
93 #define CONFIG_CRAMFS_CMDLINE
95 #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
96 #define CONFIG_KM_DEF_ENV_BOOTPARAMS \
100 #ifndef CONFIG_KM_DEF_NETDEV
101 #define CONFIG_KM_DEF_NETDEV \
105 #ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
106 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
107 #endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
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 */
129 #ifdef CONFIG_NAND_ECC_BCH
130 #define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
131 #define CONFIG_KM_ECC_MODE " eccmode=bch"
133 #define CONFIG_KM_UIMAGE_NAME "uImage\0"
134 #define CONFIG_KM_ECC_MODE
139 * - set 'subbootcmds'
140 * - set 'bootcmd' and 'altbootcmd'
142 * - 'release': for a standalone system kernel/rootfs from flash
144 #define CONFIG_KM_DEF_ENV_BOOTTARGETS \
145 "subbootcmds=ubiattach ubicopy cramfsloadfdt cramfsloadkernel " \
146 "flashargs add_default addpanic boot\0" \
148 "tftp 200000 scripts/develop-${arch}.txt && " \
149 "env import -t 200000 ${filesize} && " \
150 "run setup_debug_env\0" \
152 "tftp 200000 scripts/ramfs-${arch}.txt && " \
153 "env import -t 200000 ${filesize} && " \
154 "run setup_debug_env\0" \
159 * - modify 'bootargs'
161 * - 'add_default': default bootargs common for all arm/ppc boards
162 * - 'addpanic': add kernel panic options
163 * - 'flashargs': defaults arguments for flash base boot
166 #define CONFIG_KM_DEF_ENV_BOOTARGS \
168 "setenv bootargs ${bootargs} " \
169 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
170 ":${hostname}:${netdev}:off3" \
171 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
172 " mem=${kernelmem} init=${init}" \
174 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
175 " " CONFIG_KM_UBI_LINUX_MTD " " \
176 CONFIG_KM_DEF_BOOT_ARGS_CPU \
179 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
182 "root=mtdblock:rootfs${boot_bank} " \
183 "rootfstype=squashfs ro\0" \
188 * - commands for booting from flash
190 * - '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, ...
195 * processor specific settings
196 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
198 #define CONFIG_KM_DEF_ENV_FLASH_BOOT \
199 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
200 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
201 "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
202 " bootfs${boot_bank}\0" \
203 "uimage=" CONFIG_KM_UIMAGE_NAME \
204 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
208 * - KM specific constants and commands
210 * - 'default': setup default environment
212 #define CONFIG_KM_DEF_ENV_CONSTANTS \
214 "release=run newenv; reset\0" \
215 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
216 "testbootcmd=setenv boot_bank ${test_bank}; " \
217 "run ${subbootcmds}; reset\0" \
220 #ifndef CONFIG_KM_DEF_ENV
221 #define CONFIG_KM_DEF_ENV \
222 CONFIG_KM_DEF_ENV_BOOTPARAMS \
223 CONFIG_KM_DEF_NETDEV \
224 CONFIG_KM_DEF_ENV_CPU \
225 CONFIG_KM_DEF_ENV_BOOTTARGETS \
226 CONFIG_KM_DEF_ENV_BOOTARGS \
227 CONFIG_KM_DEF_ENV_FLASH_BOOT \
228 CONFIG_KM_DEF_ENV_CONSTANTS \
229 "altbootcmd=run bootcmd\0" \
230 "bootcmd=km_checkbidhwk && " \
231 "setenv bootcmd \'if km_checktestboot; then; " \
232 "setenv boot_bank ${test_bank}; else; " \
233 "setenv boot_bank ${actual_bank}; fi;" \
234 "run ${subbootcmds}; reset\' && " \
235 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
236 "run ${subbootcmds}; reset\' && " \
237 "saveenv && saveenv && boot\0" \
239 "init=/sbin/init-overlay.sh\0" \
240 "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
241 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
242 "mtdids=" MTDIDS_DEFAULT "\0" \
243 "mtdparts=" MTDPARTS_DEFAULT "\0" \
245 #endif /* CONFIG_KM_DEF_ENV */
247 #define CONFIG_VERSION_VARIABLE /* include version env variable */
249 #endif /* __CONFIG_KEYMILE_H */