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