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