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
13 #undef CONFIG_WATCHDOG /* disable platform specific watchdog */
15 #undef CONFIG_BOOTARGS /* the boot command will set bootargs */
18 * Miscellaneous configurable options
20 #define CONFIG_SYS_LONGHELP /* undef to save memory */
21 #if defined(CONFIG_CMD_KGDB)
22 #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
24 #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
26 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
27 #define CONFIG_SYS_MAXARGS 32 /* max number of command args */
28 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
29 #define CONFIG_CMDLINE_EDITING
30 #define CONFIG_AUTO_COMPLETE
32 #define CONFIG_HUSH_INIT_VAR
34 #define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
36 #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
38 #define CONFIG_LOADS_ECHO
39 #define CONFIG_SYS_LOADS_BAUD_CHANGE
42 /* Support the IVM EEprom */
43 #define CONFIG_SYS_IVM_EEPROM_ADR 0x50
44 #define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
45 #define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
47 #define CONFIG_SYS_FLASH_PROTECTION
52 #define CONFIG_BOOTP_BOOTFILESIZE
53 #define CONFIG_BOOTP_BOOTPATH
54 #define CONFIG_BOOTP_GATEWAY
55 #define CONFIG_BOOTP_HOSTNAME
57 /* UBI Support for all Keymile boards */
58 #define CONFIG_MTD_PARTITIONS
59 #define CONFIG_MTD_DEVICE
60 #define CONFIG_MTD_CONCAT
62 #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
63 #define CONFIG_KM_DEF_ENV_BOOTPARAMS \
67 #ifndef CONFIG_KM_DEF_NETDEV
68 #define CONFIG_KM_DEF_NETDEV \
72 #ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
73 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
74 #endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
76 #ifndef CONFIG_KM_UBI_PART_BOOT_OPTS
77 #define CONFIG_KM_UBI_PART_BOOT_OPTS ""
78 #endif /* CONFIG_KM_UBI_PART_BOOT_OPTS */
80 #ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
81 /* one flash chip only called boot */
82 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
83 # define CONFIG_KM_UBI_LINUX_MTD \
84 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
85 CONFIG_KM_UBI_PART_BOOT_OPTS
86 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
87 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
88 #else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
89 /* two flash chips called boot and app */
90 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
91 /* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
92 # define CONFIG_KM_UBI_LINUX_MTD \
93 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \
94 CONFIG_KM_UBI_PART_BOOT_OPTS " " \
95 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
96 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
97 "ubiattach=if test ${boot_bank} -eq 0; then; " \
98 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
99 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
100 #endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
102 #ifdef CONFIG_NAND_ECC_BCH
103 #define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
104 #define CONFIG_KM_ECC_MODE " eccmode=bch"
106 #define CONFIG_KM_UIMAGE_NAME "uImage\0"
107 #define CONFIG_KM_ECC_MODE
112 * - set 'subbootcmds'
113 * - set 'bootcmd' and 'altbootcmd'
115 * - 'release': for a standalone system kernel/rootfs from flash
117 #define CONFIG_KM_DEF_ENV_BOOTTARGETS \
118 "subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt " \
119 "set_fdthigh cramfsloadkernel flashargs add_default " \
122 "tftp 200000 scripts/develop-${arch}.txt && " \
123 "env import -t 200000 ${filesize} && " \
124 "run setup_debug_env\0" \
126 "tftp 200000 scripts/ramfs-${arch}.txt && " \
127 "env import -t 200000 ${filesize} && " \
128 "run setup_debug_env\0" \
133 * - modify 'bootargs'
135 * - 'add_default': default bootargs common for all arm/ppc boards
136 * - 'addpanic': add kernel panic options
137 * - 'flashargs': defaults arguments for flash base boot
140 #define CONFIG_KM_DEF_ENV_BOOTARGS \
142 "setenv bootargs ${bootargs} " \
143 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
144 ":${hostname}:${netdev}:off:" \
145 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
146 " mem=${kernelmem} init=${init}" \
148 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
149 " " CONFIG_KM_UBI_LINUX_MTD " " \
150 CONFIG_KM_DEF_BOOT_ARGS_CPU \
153 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
156 "root=mtdblock:rootfs${boot_bank} " \
157 "rootfstype=squashfs ro\0" \
162 * - commands for booting from flash
164 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
165 * - 'ubiattach': attach ubi partition
166 * - 'ubicopy': copy ubi volume to ram
167 * - volume names: bootfs0, bootfs1, bootfs2, ...
169 * processor specific settings
170 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
172 #define CONFIG_KM_DEF_ENV_FLASH_BOOT \
173 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
174 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
175 "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
176 " bootfs${boot_bank}\0" \
177 "uimage=" CONFIG_KM_UIMAGE_NAME \
178 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
182 * - KM specific constants and commands
184 * - 'default': setup default environment
186 #define CONFIG_KM_DEF_ENV_CONSTANTS \
188 "release=run newenv; reset\0" \
189 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
190 "testbootcmd=setenv boot_bank ${test_bank}; " \
191 "run ${subbootcmds}; reset\0" \
194 #ifndef CONFIG_KM_DEF_ENV
195 #define CONFIG_KM_DEF_ENV \
196 CONFIG_KM_DEF_ENV_BOOTPARAMS \
197 CONFIG_KM_DEF_NETDEV \
198 CONFIG_KM_DEF_ENV_CPU \
199 CONFIG_KM_DEF_ENV_BOOTTARGETS \
200 CONFIG_KM_DEF_ENV_BOOTARGS \
201 CONFIG_KM_DEF_ENV_FLASH_BOOT \
202 CONFIG_KM_DEF_ENV_CONSTANTS \
203 "altbootcmd=run bootcmd\0" \
204 "boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \
205 "bootcmd=km_checkbidhwk && " \
206 "setenv bootcmd \'if km_checktestboot; then; " \
207 "setenv boot_bank ${test_bank}; else; " \
208 "setenv boot_bank ${actual_bank}; fi;" \
209 "run ${subbootcmds}; reset\' && " \
210 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
211 "run ${subbootcmds}; reset\' && " \
212 "saveenv && saveenv && boot\0" \
215 "cramfsload ${fdt_addr_r} " \
216 "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \
217 "fdt_addr_r="__stringify(CONFIG_KM_FDT_ADDR) "\0" \
218 "init=/sbin/init-overlay.sh\0" \
219 "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
220 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
221 "mtdids=" MTDIDS_DEFAULT "\0" \
222 "mtdparts=" MTDPARTS_DEFAULT "\0" \
224 #endif /* CONFIG_KM_DEF_ENV */
226 #endif /* __CONFIG_KEYMILE_H */