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