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