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