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