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