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 #define CONFIG_CMD_DEFAULTENV_VARS
17 #define CONFIG_CMD_IMMAP
18 #define CONFIG_CMD_EEPROM
19 #define CONFIG_CMD_JFFS2
20 #define CONFIG_CMD_MTDPARTS
22 #undef CONFIG_WATCHDOG /* disable platform specific watchdog */
24 #define CONFIG_BOOTDELAY 2 /* autoboot after 2 seconds */
25 #undef CONFIG_BOOTARGS /* the boot command will set bootargs */
28 * Miscellaneous configurable options
30 #define CONFIG_SYS_LONGHELP /* undef to save memory */
31 #if defined(CONFIG_CMD_KGDB)
32 #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
34 #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
36 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
37 #define CONFIG_SYS_MAXARGS 32 /* max number of command args */
38 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
39 #define CONFIG_CMDLINE_EDITING
40 #define CONFIG_AUTO_COMPLETE
42 #define CONFIG_HUSH_INIT_VAR
44 #define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
46 #define CONFIG_BAUDRATE 115200
47 #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
49 #define CONFIG_LOADS_ECHO
50 #define CONFIG_SYS_LOADS_BAUD_CHANGE
53 /* Support the IVM EEprom */
54 #define CONFIG_SYS_IVM_EEPROM_ADR 0x50
55 #define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
56 #define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
58 #define CONFIG_SYS_FLASH_PROTECTION
63 #define CONFIG_BOOTP_BOOTFILESIZE
64 #define CONFIG_BOOTP_BOOTPATH
65 #define CONFIG_BOOTP_GATEWAY
66 #define CONFIG_BOOTP_HOSTNAME
68 /* UBI Support for all Keymile boards */
69 #define CONFIG_CMD_UBI
71 #define CONFIG_MTD_PARTITIONS
72 #define CONFIG_MTD_DEVICE
73 #define CONFIG_MTD_CONCAT
75 #define CONFIG_CMD_CRAMFS
77 #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
78 #define CONFIG_KM_DEF_ENV_BOOTPARAMS \
82 #ifndef CONFIG_KM_DEF_NETDEV
83 #define CONFIG_KM_DEF_NETDEV \
87 #ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
88 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
89 #endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
91 #ifndef CONFIG_KM_UBI_PART_BOOT_OPTS
92 #define CONFIG_KM_UBI_PART_BOOT_OPTS ""
93 #endif /* CONFIG_KM_UBI_PART_BOOT_OPTS */
95 #ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
96 /* one flash chip only called boot */
97 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
98 # define CONFIG_KM_UBI_LINUX_MTD \
99 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
100 CONFIG_KM_UBI_PART_BOOT_OPTS
101 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
102 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
103 #else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
104 /* two flash chips called boot and app */
105 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
106 /* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
107 # define CONFIG_KM_UBI_LINUX_MTD \
108 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
109 CONFIG_KM_UBI_PART_BOOT_OPTS " " \
110 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
111 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
112 "ubiattach=if test ${boot_bank} -eq 0; then; " \
113 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
114 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
115 #endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
117 #ifdef CONFIG_NAND_ECC_BCH
118 #define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
119 #define CONFIG_KM_ECC_MODE " eccmode=bch"
121 #define CONFIG_KM_UIMAGE_NAME "uImage\0"
122 #define CONFIG_KM_ECC_MODE
127 * - set 'subbootcmds'
128 * - set 'bootcmd' and 'altbootcmd'
130 * - 'release': for a standalone system kernel/rootfs from flash
132 #define CONFIG_KM_DEF_ENV_BOOTTARGETS \
133 "subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt " \
134 "set_fdthigh cramfsloadkernel flashargs add_default " \
137 "tftp 200000 scripts/develop-${arch}.txt && " \
138 "env import -t 200000 ${filesize} && " \
139 "run setup_debug_env\0" \
141 "tftp 200000 scripts/ramfs-${arch}.txt && " \
142 "env import -t 200000 ${filesize} && " \
143 "run setup_debug_env\0" \
148 * - modify 'bootargs'
150 * - 'add_default': default bootargs common for all arm/ppc boards
151 * - 'addpanic': add kernel panic options
152 * - 'flashargs': defaults arguments for flash base boot
155 #define CONFIG_KM_DEF_ENV_BOOTARGS \
157 "setenv bootargs ${bootargs} " \
158 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
159 ":${hostname}:${netdev}:off:" \
160 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
161 " mem=${kernelmem} init=${init}" \
163 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
164 " " CONFIG_KM_UBI_LINUX_MTD " " \
165 CONFIG_KM_DEF_BOOT_ARGS_CPU \
168 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
171 "root=mtdblock:rootfs${boot_bank} " \
172 "rootfstype=squashfs ro\0" \
177 * - commands for booting from flash
179 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
180 * - 'ubiattach': attach ubi partition
181 * - 'ubicopy': copy ubi volume to ram
182 * - volume names: bootfs0, bootfs1, bootfs2, ...
184 * processor specific settings
185 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
187 #define CONFIG_KM_DEF_ENV_FLASH_BOOT \
188 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
189 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
190 "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
191 " bootfs${boot_bank}\0" \
192 "uimage=" CONFIG_KM_UIMAGE_NAME \
193 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
197 * - KM specific constants and commands
199 * - 'default': setup default environment
201 #define CONFIG_KM_DEF_ENV_CONSTANTS \
203 "release=run newenv; reset\0" \
204 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
205 "testbootcmd=setenv boot_bank ${test_bank}; " \
206 "run ${subbootcmds}; reset\0" \
209 #ifndef CONFIG_KM_DEF_ENV
210 #define CONFIG_KM_DEF_ENV \
211 CONFIG_KM_DEF_ENV_BOOTPARAMS \
212 CONFIG_KM_DEF_NETDEV \
213 CONFIG_KM_DEF_ENV_CPU \
214 CONFIG_KM_DEF_ENV_BOOTTARGETS \
215 CONFIG_KM_DEF_ENV_BOOTARGS \
216 CONFIG_KM_DEF_ENV_FLASH_BOOT \
217 CONFIG_KM_DEF_ENV_CONSTANTS \
218 "altbootcmd=run bootcmd\0" \
219 "boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \
220 "bootcmd=km_checkbidhwk && " \
221 "setenv bootcmd \'if km_checktestboot; then; " \
222 "setenv boot_bank ${test_bank}; else; " \
223 "setenv boot_bank ${actual_bank}; fi;" \
224 "run ${subbootcmds}; reset\' && " \
225 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
226 "run ${subbootcmds}; reset\' && " \
227 "saveenv && saveenv && boot\0" \
230 "cramfsload ${fdt_addr_r} " \
231 "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \
232 "fdt_addr_r="__stringify(CONFIG_KM_FDT_ADDR) "\0" \
233 "init=/sbin/init-overlay.sh\0" \
234 "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
235 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
236 "mtdids=" MTDIDS_DEFAULT "\0" \
237 "mtdparts=" MTDPARTS_DEFAULT "\0" \
239 #endif /* CONFIG_KM_DEF_ENV */
241 #define CONFIG_VERSION_VARIABLE /* include version env variable */
243 #endif /* __CONFIG_KEYMILE_H */