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 #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
73 #define CONFIG_KM_DEF_ENV_BOOTPARAMS \
77 #ifndef CONFIG_KM_DEF_NETDEV
78 #define CONFIG_KM_DEF_NETDEV \
82 #ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
83 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
84 #endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
86 #ifndef CONFIG_KM_UBI_PART_BOOT_OPTS
87 #define CONFIG_KM_UBI_PART_BOOT_OPTS ""
88 #endif /* CONFIG_KM_UBI_PART_BOOT_OPTS */
90 #ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
91 /* one flash chip only called boot */
92 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
93 # define CONFIG_KM_UBI_LINUX_MTD \
94 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
95 CONFIG_KM_UBI_PART_BOOT_OPTS
96 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
97 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
98 #else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
99 /* two flash chips called boot and app */
100 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
101 /* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
102 # define CONFIG_KM_UBI_LINUX_MTD \
103 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
104 CONFIG_KM_UBI_PART_BOOT_OPTS " " \
105 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
106 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
107 "ubiattach=if test ${boot_bank} -eq 0; then; " \
108 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
109 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
110 #endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
112 #ifdef CONFIG_NAND_ECC_BCH
113 #define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
114 #define CONFIG_KM_ECC_MODE " eccmode=bch"
116 #define CONFIG_KM_UIMAGE_NAME "uImage\0"
117 #define CONFIG_KM_ECC_MODE
122 * - set 'subbootcmds'
123 * - set 'bootcmd' and 'altbootcmd'
125 * - 'release': for a standalone system kernel/rootfs from flash
127 #define CONFIG_KM_DEF_ENV_BOOTTARGETS \
128 "subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt " \
129 "set_fdthigh cramfsloadkernel flashargs add_default " \
132 "tftp 200000 scripts/develop-${arch}.txt && " \
133 "env import -t 200000 ${filesize} && " \
134 "run setup_debug_env\0" \
136 "tftp 200000 scripts/ramfs-${arch}.txt && " \
137 "env import -t 200000 ${filesize} && " \
138 "run setup_debug_env\0" \
143 * - modify 'bootargs'
145 * - 'add_default': default bootargs common for all arm/ppc boards
146 * - 'addpanic': add kernel panic options
147 * - 'flashargs': defaults arguments for flash base boot
150 #define CONFIG_KM_DEF_ENV_BOOTARGS \
152 "setenv bootargs ${bootargs} " \
153 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
154 ":${hostname}:${netdev}:off:" \
155 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
156 " mem=${kernelmem} init=${init}" \
158 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
159 " " CONFIG_KM_UBI_LINUX_MTD " " \
160 CONFIG_KM_DEF_BOOT_ARGS_CPU \
163 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
166 "root=mtdblock:rootfs${boot_bank} " \
167 "rootfstype=squashfs ro\0" \
172 * - commands for booting from flash
174 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
175 * - 'ubiattach': attach ubi partition
176 * - 'ubicopy': copy ubi volume to ram
177 * - volume names: bootfs0, bootfs1, bootfs2, ...
179 * processor specific settings
180 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
182 #define CONFIG_KM_DEF_ENV_FLASH_BOOT \
183 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
184 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
185 "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
186 " bootfs${boot_bank}\0" \
187 "uimage=" CONFIG_KM_UIMAGE_NAME \
188 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
192 * - KM specific constants and commands
194 * - 'default': setup default environment
196 #define CONFIG_KM_DEF_ENV_CONSTANTS \
198 "release=run newenv; reset\0" \
199 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
200 "testbootcmd=setenv boot_bank ${test_bank}; " \
201 "run ${subbootcmds}; reset\0" \
204 #ifndef CONFIG_KM_DEF_ENV
205 #define CONFIG_KM_DEF_ENV \
206 CONFIG_KM_DEF_ENV_BOOTPARAMS \
207 CONFIG_KM_DEF_NETDEV \
208 CONFIG_KM_DEF_ENV_CPU \
209 CONFIG_KM_DEF_ENV_BOOTTARGETS \
210 CONFIG_KM_DEF_ENV_BOOTARGS \
211 CONFIG_KM_DEF_ENV_FLASH_BOOT \
212 CONFIG_KM_DEF_ENV_CONSTANTS \
213 "altbootcmd=run bootcmd\0" \
214 "boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \
215 "bootcmd=km_checkbidhwk && " \
216 "setenv bootcmd \'if km_checktestboot; then; " \
217 "setenv boot_bank ${test_bank}; else; " \
218 "setenv boot_bank ${actual_bank}; fi;" \
219 "run ${subbootcmds}; reset\' && " \
220 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
221 "run ${subbootcmds}; reset\' && " \
222 "saveenv && saveenv && boot\0" \
225 "cramfsload ${fdt_addr_r} " \
226 "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \
227 "fdt_addr_r="__stringify(CONFIG_KM_FDT_ADDR) "\0" \
228 "init=/sbin/init-overlay.sh\0" \
229 "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
230 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
231 "mtdids=" MTDIDS_DEFAULT "\0" \
232 "mtdparts=" MTDPARTS_DEFAULT "\0" \
234 #endif /* CONFIG_KM_DEF_ENV */
236 #endif /* __CONFIG_KEYMILE_H */