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