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