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_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
47 #define CONFIG_LOADS_ECHO
48 #define CONFIG_SYS_LOADS_BAUD_CHANGE
51 /* Support the IVM EEprom */
52 #define CONFIG_SYS_IVM_EEPROM_ADR 0x50
53 #define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
54 #define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
56 #define CONFIG_SYS_FLASH_PROTECTION
61 #define CONFIG_BOOTP_BOOTFILESIZE
62 #define CONFIG_BOOTP_BOOTPATH
63 #define CONFIG_BOOTP_GATEWAY
64 #define CONFIG_BOOTP_HOSTNAME
66 /* UBI Support for all Keymile boards */
68 #define CONFIG_MTD_PARTITIONS
69 #define CONFIG_MTD_DEVICE
70 #define CONFIG_MTD_CONCAT
72 #define CONFIG_CMD_CRAMFS
74 #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
75 #define CONFIG_KM_DEF_ENV_BOOTPARAMS \
79 #ifndef CONFIG_KM_DEF_NETDEV
80 #define CONFIG_KM_DEF_NETDEV \
84 #ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
85 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
86 #endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
88 #ifndef CONFIG_KM_UBI_PART_BOOT_OPTS
89 #define CONFIG_KM_UBI_PART_BOOT_OPTS ""
90 #endif /* CONFIG_KM_UBI_PART_BOOT_OPTS */
92 #ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
93 /* one flash chip only called boot */
94 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
95 # define CONFIG_KM_UBI_LINUX_MTD \
96 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
97 CONFIG_KM_UBI_PART_BOOT_OPTS
98 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
99 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
100 #else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
101 /* two flash chips called boot and app */
102 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
103 /* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
104 # define CONFIG_KM_UBI_LINUX_MTD \
105 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
106 CONFIG_KM_UBI_PART_BOOT_OPTS " " \
107 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
108 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
109 "ubiattach=if test ${boot_bank} -eq 0; then; " \
110 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
111 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
112 #endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
114 #ifdef CONFIG_NAND_ECC_BCH
115 #define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
116 #define CONFIG_KM_ECC_MODE " eccmode=bch"
118 #define CONFIG_KM_UIMAGE_NAME "uImage\0"
119 #define CONFIG_KM_ECC_MODE
124 * - set 'subbootcmds'
125 * - set 'bootcmd' and 'altbootcmd'
127 * - 'release': for a standalone system kernel/rootfs from flash
129 #define CONFIG_KM_DEF_ENV_BOOTTARGETS \
130 "subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt " \
131 "set_fdthigh cramfsloadkernel flashargs add_default " \
134 "tftp 200000 scripts/develop-${arch}.txt && " \
135 "env import -t 200000 ${filesize} && " \
136 "run setup_debug_env\0" \
138 "tftp 200000 scripts/ramfs-${arch}.txt && " \
139 "env import -t 200000 ${filesize} && " \
140 "run setup_debug_env\0" \
145 * - modify 'bootargs'
147 * - 'add_default': default bootargs common for all arm/ppc boards
148 * - 'addpanic': add kernel panic options
149 * - 'flashargs': defaults arguments for flash base boot
152 #define CONFIG_KM_DEF_ENV_BOOTARGS \
154 "setenv bootargs ${bootargs} " \
155 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
156 ":${hostname}:${netdev}:off:" \
157 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
158 " mem=${kernelmem} init=${init}" \
160 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
161 " " CONFIG_KM_UBI_LINUX_MTD " " \
162 CONFIG_KM_DEF_BOOT_ARGS_CPU \
165 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
168 "root=mtdblock:rootfs${boot_bank} " \
169 "rootfstype=squashfs ro\0" \
174 * - commands for booting from flash
176 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
177 * - 'ubiattach': attach ubi partition
178 * - 'ubicopy': copy ubi volume to ram
179 * - volume names: bootfs0, bootfs1, bootfs2, ...
181 * processor specific settings
182 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
184 #define CONFIG_KM_DEF_ENV_FLASH_BOOT \
185 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
186 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
187 "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
188 " bootfs${boot_bank}\0" \
189 "uimage=" CONFIG_KM_UIMAGE_NAME \
190 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
194 * - KM specific constants and commands
196 * - 'default': setup default environment
198 #define CONFIG_KM_DEF_ENV_CONSTANTS \
200 "release=run newenv; reset\0" \
201 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
202 "testbootcmd=setenv boot_bank ${test_bank}; " \
203 "run ${subbootcmds}; reset\0" \
206 #ifndef CONFIG_KM_DEF_ENV
207 #define CONFIG_KM_DEF_ENV \
208 CONFIG_KM_DEF_ENV_BOOTPARAMS \
209 CONFIG_KM_DEF_NETDEV \
210 CONFIG_KM_DEF_ENV_CPU \
211 CONFIG_KM_DEF_ENV_BOOTTARGETS \
212 CONFIG_KM_DEF_ENV_BOOTARGS \
213 CONFIG_KM_DEF_ENV_FLASH_BOOT \
214 CONFIG_KM_DEF_ENV_CONSTANTS \
215 "altbootcmd=run bootcmd\0" \
216 "boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \
217 "bootcmd=km_checkbidhwk && " \
218 "setenv bootcmd \'if km_checktestboot; then; " \
219 "setenv boot_bank ${test_bank}; else; " \
220 "setenv boot_bank ${actual_bank}; fi;" \
221 "run ${subbootcmds}; reset\' && " \
222 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
223 "run ${subbootcmds}; reset\' && " \
224 "saveenv && saveenv && boot\0" \
227 "cramfsload ${fdt_addr_r} " \
228 "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \
229 "fdt_addr_r="__stringify(CONFIG_KM_FDT_ADDR) "\0" \
230 "init=/sbin/init-overlay.sh\0" \
231 "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
232 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
233 "mtdids=" MTDIDS_DEFAULT "\0" \
234 "mtdparts=" MTDPARTS_DEFAULT "\0" \
236 #endif /* CONFIG_KM_DEF_ENV */
238 #endif /* __CONFIG_KEYMILE_H */