]>
Commit | Line | Data |
---|---|---|
1e8f4e78 | 1 | /* |
b11f53f3 | 2 | * (C) Copyright 2008-2011 |
1e8f4e78 HS |
3 | * Heiko Schocher, DENX Software Engineering, hs@denx.de. |
4 | * | |
3765b3e7 | 5 | * SPDX-License-Identifier: GPL-2.0+ |
1e8f4e78 HS |
6 | */ |
7 | ||
8 | #ifndef __CONFIG_KEYMILE_H | |
9 | #define __CONFIG_KEYMILE_H | |
10 | ||
f1fef1d8 | 11 | #define CONFIG_BOOTCOUNT_LIMIT |
1e8f4e78 | 12 | |
1e8f4e78 HS |
13 | /* |
14 | * Command line configuration. | |
15 | */ | |
1e8f4e78 HS |
16 | #define CONFIG_CMD_ASKENV |
17 | #define CONFIG_CMD_DHCP | |
b0e55d5b | 18 | #define CONFIG_CMD_DEFAULTENV_VARS |
7d77203c | 19 | #define CONFIG_CMD_GREPENV |
1e8f4e78 HS |
20 | #define CONFIG_CMD_IMMAP |
21 | #define CONFIG_CMD_MII | |
22 | #define CONFIG_CMD_PING | |
1e8f4e78 HS |
23 | #define CONFIG_CMD_EEPROM |
24 | #define CONFIG_CMD_I2C | |
364123db | 25 | #define CONFIG_CMD_JFFS2 |
dc71b248 | 26 | #define CONFIG_CMD_MTDPARTS |
1e8f4e78 | 27 | |
b11f53f3 | 28 | #undef CONFIG_WATCHDOG /* disable platform specific watchdog */ |
1e8f4e78 | 29 | |
f41ee960 | 30 | #define CONFIG_BOOTDELAY 2 /* autoboot after 2 seconds */ |
b11f53f3 | 31 | #undef CONFIG_BOOTARGS /* the boot command will set bootargs */ |
1e8f4e78 HS |
32 | |
33 | /* | |
34 | * Miscellaneous configurable options | |
35 | */ | |
b11f53f3 | 36 | #define CONFIG_SYS_LONGHELP /* undef to save memory */ |
1e8f4e78 | 37 | #if defined(CONFIG_CMD_KGDB) |
b11f53f3 | 38 | #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ |
1e8f4e78 | 39 | #else |
f41ee960 | 40 | #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */ |
1e8f4e78 | 41 | #endif |
b11f53f3 | 42 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) |
f41ee960 | 43 | #define CONFIG_SYS_MAXARGS 32 /* max number of command args */ |
b11f53f3 HS |
44 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE |
45 | #define CONFIG_CMDLINE_EDITING | |
46 | #define CONFIG_AUTO_COMPLETE | |
1e8f4e78 | 47 | |
b11f53f3 | 48 | #define CONFIG_HUSH_INIT_VAR |
1e8f4e78 HS |
49 | |
50 | #define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */ | |
1e8f4e78 | 51 | |
b11f53f3 | 52 | #define CONFIG_BAUDRATE 115200 |
499b1a4d | 53 | #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 } |
1e8f4e78 | 54 | |
b11f53f3 HS |
55 | #define CONFIG_LOADS_ECHO |
56 | #define CONFIG_SYS_LOADS_BAUD_CHANGE | |
1e8f4e78 | 57 | |
7f70460e HB |
58 | #define CONFIG_AUTOBOOT_KEYED |
59 | #define CONFIG_AUTOBOOT_PROMPT "Hit <SPACE> key to stop autoboot in %2ds\n" | |
60 | #define CONFIG_AUTOBOOT_STOP_STR " " | |
61 | ||
364123db HS |
62 | /* Support the IVM EEprom */ |
63 | #define CONFIG_SYS_IVM_EEPROM_ADR 0x50 | |
64 | #define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400 | |
65 | #define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100 | |
66 | ||
b11f53f3 | 67 | #define CONFIG_SYS_FLASH_PROTECTION |
364123db | 68 | |
1e8f4e78 HS |
69 | /* |
70 | * BOOTP options | |
71 | */ | |
72 | #define CONFIG_BOOTP_BOOTFILESIZE | |
73 | #define CONFIG_BOOTP_BOOTPATH | |
74 | #define CONFIG_BOOTP_GATEWAY | |
75 | #define CONFIG_BOOTP_HOSTNAME | |
76 | ||
dc71b248 HS |
77 | /* UBI Support for all Keymile boards */ |
78 | #define CONFIG_CMD_UBI | |
79 | #define CONFIG_RBTREE | |
80 | #define CONFIG_MTD_PARTITIONS | |
dc71b248 HS |
81 | #define CONFIG_MTD_DEVICE |
82 | #define CONFIG_MTD_CONCAT | |
83 | ||
f7fb46a8 | 84 | #define CONFIG_CMD_CRAMFS |
f7fb46a8 | 85 | |
a21b5d4b HB |
86 | #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS |
87 | #define CONFIG_KM_DEF_ENV_BOOTPARAMS \ | |
db0bb572 | 88 | "actual_bank=0\0" |
364123db HS |
89 | #endif |
90 | ||
de3ad13d HB |
91 | #ifndef CONFIG_KM_DEF_NETDEV |
92 | #define CONFIG_KM_DEF_NETDEV \ | |
93 | "netdev=eth0\0" | |
94 | #endif | |
95 | ||
cf73639d AH |
96 | #ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT |
97 | #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0" | |
98 | #endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */ | |
99 | ||
cf7707a1 VL |
100 | #ifndef CONFIG_KM_UBI_PART_BOOT_OPTS |
101 | #define CONFIG_KM_UBI_PART_BOOT_OPTS "" | |
102 | #endif /* CONFIG_KM_UBI_PART_BOOT_OPTS */ | |
103 | ||
cf73639d AH |
104 | #ifndef CONFIG_KM_UBI_PARTITION_NAME_APP |
105 | /* one flash chip only called boot */ | |
106 | /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */ | |
107 | # define CONFIG_KM_UBI_LINUX_MTD \ | |
cf7707a1 VL |
108 | "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \ |
109 | CONFIG_KM_UBI_PART_BOOT_OPTS | |
cf73639d AH |
110 | # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \ |
111 | "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0" | |
112 | #else /* CONFIG_KM_UBI_PARTITION_NAME_APP */ | |
113 | /* two flash chips called boot and app */ | |
114 | /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */ | |
115 | /* app: CONFIG_KM_UBI_PARTITION_NAME_APP */ | |
116 | # define CONFIG_KM_UBI_LINUX_MTD \ | |
cf7707a1 VL |
117 | "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT \ |
118 | CONFIG_KM_UBI_PART_BOOT_OPTS " " \ | |
cf73639d AH |
119 | "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP |
120 | # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \ | |
121 | "ubiattach=if test ${boot_bank} -eq 0; then; " \ | |
122 | "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \ | |
123 | "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0" | |
124 | #endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */ | |
de3ad13d | 125 | |
dacc109c AH |
126 | #ifdef CONFIG_NAND_ECC_BCH |
127 | #define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0" | |
a7bc9144 | 128 | #define CONFIG_KM_ECC_MODE " eccmode=bch" |
dacc109c AH |
129 | #else |
130 | #define CONFIG_KM_UIMAGE_NAME "uImage\0" | |
a7bc9144 | 131 | #define CONFIG_KM_ECC_MODE |
dacc109c AH |
132 | #endif |
133 | ||
a21b5d4b HB |
134 | /* |
135 | * boottargets | |
db0bb572 | 136 | * - set 'subbootcmds' |
a21b5d4b HB |
137 | * - set 'bootcmd' and 'altbootcmd' |
138 | * available targets: | |
139 | * - 'release': for a standalone system kernel/rootfs from flash | |
a21b5d4b HB |
140 | */ |
141 | #define CONFIG_KM_DEF_ENV_BOOTTARGETS \ | |
c6d32dfd VL |
142 | "subbootcmds=ubiattach ubicopy checkfdt cramfsloadfdt " \ |
143 | "set_fdthigh cramfsloadkernel flashargs add_default " \ | |
144 | "addpanic boot\0" \ | |
b648bfc2 HB |
145 | "develop=" \ |
146 | "tftp 200000 scripts/develop-${arch}.txt && " \ | |
2d9528e3 | 147 | "env import -t 200000 ${filesize} && " \ |
b648bfc2 HB |
148 | "run setup_debug_env\0" \ |
149 | "ramfs=" \ | |
150 | "tftp 200000 scripts/ramfs-${arch}.txt && " \ | |
151 | "env import -t 200000 ${filesize} && " \ | |
152 | "run setup_debug_env\0" \ | |
a21b5d4b HB |
153 | "" |
154 | ||
de3ad13d HB |
155 | /* |
156 | * bootargs | |
157 | * - modify 'bootargs' | |
158 | * | |
db0bb572 | 159 | * - 'add_default': default bootargs common for all arm/ppc boards |
de3ad13d | 160 | * - 'addpanic': add kernel panic options |
de3ad13d HB |
161 | * - 'flashargs': defaults arguments for flash base boot |
162 | * | |
de3ad13d HB |
163 | */ |
164 | #define CONFIG_KM_DEF_ENV_BOOTARGS \ | |
db0bb572 | 165 | "add_default=" \ |
de3ad13d HB |
166 | "setenv bootargs ${bootargs} " \ |
167 | "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \ | |
7c3d6a29 | 168 | ":${hostname}:${netdev}:off:" \ |
db0bb572 | 169 | " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \ |
2a7714ce | 170 | " mem=${kernelmem} init=${init}" \ |
a7bc9144 | 171 | CONFIG_KM_ECC_MODE \ |
93ea89f0 | 172 | " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\ |
cf73639d | 173 | " " CONFIG_KM_UBI_LINUX_MTD " " \ |
db0bb572 HB |
174 | CONFIG_KM_DEF_BOOT_ARGS_CPU \ |
175 | "\0" \ | |
de3ad13d | 176 | "addpanic=" \ |
2d9528e3 | 177 | "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \ |
de3ad13d HB |
178 | "flashargs=" \ |
179 | "setenv bootargs " \ | |
e80ab3e6 | 180 | "root=mtdblock:rootfs${boot_bank} " \ |
de3ad13d HB |
181 | "rootfstype=squashfs ro\0" \ |
182 | "" | |
183 | ||
de3ad13d HB |
184 | /* |
185 | * flash_boot | |
186 | * - commands for booting from flash | |
187 | * | |
de3ad13d HB |
188 | * - 'cramfsloadkernel': copy kernel from a cramfs to ram |
189 | * - 'ubiattach': attach ubi partition | |
190 | * - 'ubicopy': copy ubi volume to ram | |
191 | * - volume names: bootfs0, bootfs1, bootfs2, ... | |
de3ad13d HB |
192 | * |
193 | * processor specific settings | |
194 | * - 'cramfsloadfdt': copy fdt from a cramfs to ram | |
195 | */ | |
196 | #define CONFIG_KM_DEF_ENV_FLASH_BOOT \ | |
93ea89f0 | 197 | "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \ |
dacc109c | 198 | "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \ |
93ea89f0 | 199 | "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \ |
2d9528e3 | 200 | " bootfs${boot_bank}\0" \ |
dacc109c | 201 | "uimage=" CONFIG_KM_UIMAGE_NAME \ |
cf73639d | 202 | CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI |
de3ad13d HB |
203 | |
204 | /* | |
205 | * constants | |
206 | * - KM specific constants and commands | |
207 | * | |
208 | * - 'default': setup default environment | |
209 | */ | |
210 | #define CONFIG_KM_DEF_ENV_CONSTANTS \ | |
e80ab3e6 | 211 | "backup_bank=0\0" \ |
db0bb572 | 212 | "release=run newenv; reset\0" \ |
93ea89f0 | 213 | "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \ |
0333cfe6 TH |
214 | "testbootcmd=setenv boot_bank ${test_bank}; " \ |
215 | "run ${subbootcmds}; reset\0" \ | |
de3ad13d HB |
216 | "" |
217 | ||
364123db HS |
218 | #ifndef CONFIG_KM_DEF_ENV |
219 | #define CONFIG_KM_DEF_ENV \ | |
a21b5d4b | 220 | CONFIG_KM_DEF_ENV_BOOTPARAMS \ |
de3ad13d HB |
221 | CONFIG_KM_DEF_NETDEV \ |
222 | CONFIG_KM_DEF_ENV_CPU \ | |
a21b5d4b | 223 | CONFIG_KM_DEF_ENV_BOOTTARGETS \ |
de3ad13d | 224 | CONFIG_KM_DEF_ENV_BOOTARGS \ |
de3ad13d | 225 | CONFIG_KM_DEF_ENV_FLASH_BOOT \ |
a21b5d4b | 226 | CONFIG_KM_DEF_ENV_CONSTANTS \ |
de3ad13d | 227 | "altbootcmd=run bootcmd\0" \ |
7b2268b8 | 228 | "boot=bootm ${load_addr_r} - ${fdt_addr_r}\0" \ |
db0bb572 | 229 | "bootcmd=km_checkbidhwk && " \ |
c1b3d841 TH |
230 | "setenv bootcmd \'if km_checktestboot; then; " \ |
231 | "setenv boot_bank ${test_bank}; else; " \ | |
232 | "setenv boot_bank ${actual_bank}; fi;" \ | |
db0bb572 HB |
233 | "run ${subbootcmds}; reset\' && " \ |
234 | "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \ | |
235 | "run ${subbootcmds}; reset\' && " \ | |
236 | "saveenv && saveenv && boot\0" \ | |
31dd8988 | 237 | "bootlimit=3\0" \ |
7b2268b8 GF |
238 | "cramfsloadfdt=" \ |
239 | "cramfsload ${fdt_addr_r} " \ | |
240 | "fdt_0x${IVM_BoardId}_0x${IVM_HWKey}.dtb\0" \ | |
241 | "fdt_addr_r="__stringify(CONFIG_KM_FDT_ADDR) "\0" \ | |
de3ad13d | 242 | "init=/sbin/init-overlay.sh\0" \ |
93ea89f0 | 243 | "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \ |
db0bb572 | 244 | "load=tftpboot ${load_addr_r} ${u-boot}\0" \ |
de3ad13d HB |
245 | "mtdids=" MTDIDS_DEFAULT "\0" \ |
246 | "mtdparts=" MTDPARTS_DEFAULT "\0" \ | |
364123db HS |
247 | "" |
248 | #endif /* CONFIG_KM_DEF_ENV */ | |
249 | ||
499b1a4d | 250 | #define CONFIG_VERSION_VARIABLE /* include version env variable */ |
364123db | 251 | |
1e8f4e78 | 252 | #endif /* __CONFIG_KEYMILE_H */ |