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 #undef CONFIG_BOOTARGS /* the boot command will set bootargs */
27 * Miscellaneous configurable options
29 #define CONFIG_SYS_LONGHELP /* undef to save memory */
30 #if defined(CONFIG_CMD_KGDB)
31 #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
33 #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
35 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
36 #define CONFIG_SYS_MAXARGS 32 /* max number of command args */
37 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
38 #define CONFIG_CMDLINE_EDITING
39 #define CONFIG_AUTO_COMPLETE
41 #define CONFIG_HUSH_INIT_VAR
43 #define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
45 #define CONFIG_BAUDRATE 115200
46 #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
48 #define CONFIG_LOADS_ECHO
49 #define CONFIG_SYS_LOADS_BAUD_CHANGE
52 /* Support the IVM EEprom */
53 #define CONFIG_SYS_IVM_EEPROM_ADR 0x50
54 #define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
55 #define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
57 #define CONFIG_SYS_FLASH_PROTECTION
62 #define CONFIG_BOOTP_BOOTFILESIZE
63 #define CONFIG_BOOTP_BOOTPATH
64 #define CONFIG_BOOTP_GATEWAY
65 #define CONFIG_BOOTP_HOSTNAME
67 /* UBI Support for all Keymile boards */
69 #define CONFIG_MTD_PARTITIONS
70 #define CONFIG_MTD_DEVICE
71 #define CONFIG_MTD_CONCAT
73 #define CONFIG_CMD_CRAMFS
75 #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
76 #define CONFIG_KM_DEF_ENV_BOOTPARAMS \
80 #ifndef CONFIG_KM_DEF_NETDEV
81 #define CONFIG_KM_DEF_NETDEV \
85 #ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
86 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
87 #endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
89 #ifndef CONFIG_KM_UBI_PART_BOOT_OPTS
90 #define CONFIG_KM_UBI_PART_BOOT_OPTS ""
91 #endif /* CONFIG_KM_UBI_PART_BOOT_OPTS */
93 #ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
94 /* one flash chip only called boot */
95 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
96 # define CONFIG_KM_UBI_LINUX_MTD \
97 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
98 CONFIG_KM_UBI_PART_BOOT_OPTS
99 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
100 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
101 #else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
102 /* two flash chips called boot and app */
103 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
104 /* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
105 # define CONFIG_KM_UBI_LINUX_MTD \
106 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
107 CONFIG_KM_UBI_PART_BOOT_OPTS " " \
108 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
109 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
110 "ubiattach=if test ${boot_bank} -eq 0; then; " \
111 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
112 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
113 #endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
115 #ifdef CONFIG_NAND_ECC_BCH
116 #define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
117 #define CONFIG_KM_ECC_MODE " eccmode=bch"
119 #define CONFIG_KM_UIMAGE_NAME "uImage\0"
120 #define CONFIG_KM_ECC_MODE
125 * - set 'subbootcmds'
126 * - set 'bootcmd' and 'altbootcmd'
128 * - 'release': for a standalone system kernel/rootfs from flash
130 #define CONFIG_KM_DEF_ENV_BOOTTARGETS \
131 "subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt " \
132 "set_fdthigh cramfsloadkernel flashargs add_default " \
135 "tftp 200000 scripts/develop-${arch}.txt && " \
136 "env import -t 200000 ${filesize} && " \
137 "run setup_debug_env\0" \
139 "tftp 200000 scripts/ramfs-${arch}.txt && " \
140 "env import -t 200000 ${filesize} && " \
141 "run setup_debug_env\0" \
146 * - modify 'bootargs'
148 * - 'add_default': default bootargs common for all arm/ppc boards
149 * - 'addpanic': add kernel panic options
150 * - 'flashargs': defaults arguments for flash base boot
153 #define CONFIG_KM_DEF_ENV_BOOTARGS \
155 "setenv bootargs ${bootargs} " \
156 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
157 ":${hostname}:${netdev}:off:" \
158 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
159 " mem=${kernelmem} init=${init}" \
161 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
162 " " CONFIG_KM_UBI_LINUX_MTD " " \
163 CONFIG_KM_DEF_BOOT_ARGS_CPU \
166 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
169 "root=mtdblock:rootfs${boot_bank} " \
170 "rootfstype=squashfs ro\0" \
175 * - commands for booting from flash
177 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
178 * - 'ubiattach': attach ubi partition
179 * - 'ubicopy': copy ubi volume to ram
180 * - volume names: bootfs0, bootfs1, bootfs2, ...
182 * processor specific settings
183 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
185 #define CONFIG_KM_DEF_ENV_FLASH_BOOT \
186 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
187 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
188 "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
189 " bootfs${boot_bank}\0" \
190 "uimage=" CONFIG_KM_UIMAGE_NAME \
191 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
195 * - KM specific constants and commands
197 * - 'default': setup default environment
199 #define CONFIG_KM_DEF_ENV_CONSTANTS \
201 "release=run newenv; reset\0" \
202 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
203 "testbootcmd=setenv boot_bank ${test_bank}; " \
204 "run ${subbootcmds}; reset\0" \
207 #ifndef CONFIG_KM_DEF_ENV
208 #define CONFIG_KM_DEF_ENV \
209 CONFIG_KM_DEF_ENV_BOOTPARAMS \
210 CONFIG_KM_DEF_NETDEV \
211 CONFIG_KM_DEF_ENV_CPU \
212 CONFIG_KM_DEF_ENV_BOOTTARGETS \
213 CONFIG_KM_DEF_ENV_BOOTARGS \
214 CONFIG_KM_DEF_ENV_FLASH_BOOT \
215 CONFIG_KM_DEF_ENV_CONSTANTS \
216 "altbootcmd=run bootcmd\0" \
217 "boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \
218 "bootcmd=km_checkbidhwk && " \
219 "setenv bootcmd \'if km_checktestboot; then; " \
220 "setenv boot_bank ${test_bank}; else; " \
221 "setenv boot_bank ${actual_bank}; fi;" \
222 "run ${subbootcmds}; reset\' && " \
223 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
224 "run ${subbootcmds}; reset\' && " \
225 "saveenv && saveenv && boot\0" \
228 "cramfsload ${fdt_addr_r} " \
229 "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \
230 "fdt_addr_r="__stringify(CONFIG_KM_FDT_ADDR) "\0" \
231 "init=/sbin/init-overlay.sh\0" \
232 "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
233 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
234 "mtdids=" MTDIDS_DEFAULT "\0" \
235 "mtdparts=" MTDPARTS_DEFAULT "\0" \
237 #endif /* CONFIG_KM_DEF_ENV */
239 #endif /* __CONFIG_KEYMILE_H */