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