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