]> git.ipfire.org Git - people/ms/u-boot.git/blob - include/configs/km/keymile-common.h
Merge branch 'master' of git://git.denx.de/u-boot-i2c
[people/ms/u-boot.git] / include / configs / km / keymile-common.h
1 /*
2 * (C) Copyright 2008-2011
3 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8 #ifndef __CONFIG_KEYMILE_H
9 #define __CONFIG_KEYMILE_H
10
11 #define CONFIG_BOOTCOUNT_LIMIT
12
13 /*
14 * Command line configuration.
15 */
16 #include <config_cmd_default.h>
17
18 #define CONFIG_CMD_ASKENV
19 #define CONFIG_CMD_DHCP
20 #define CONFIG_CMD_DEFAULTENV_VARS
21 #define CONFIG_CMD_ECHO
22 #define CONFIG_CMD_IMMAP
23 #define CONFIG_CMD_MII
24 #define CONFIG_CMD_PING
25 #define CONFIG_CMD_EEPROM
26 #define CONFIG_CMD_I2C
27 #define CONFIG_CMD_JFFS2
28 #define CONFIG_CMD_MTDPARTS
29 #define CONFIG_CMD_SETEXPR
30
31 #undef CONFIG_WATCHDOG /* disable platform specific watchdog */
32
33 #define CONFIG_BOOTDELAY 2 /* autoboot after 2 seconds */
34 #undef CONFIG_BOOTARGS /* the boot command will set bootargs */
35
36 /*
37 * Miscellaneous configurable options
38 */
39 #define CONFIG_SYS_HUSH_PARSER
40 #define CONFIG_SYS_LONGHELP /* undef to save memory */
41 #define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */
42 #if defined(CONFIG_CMD_KGDB)
43 #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
44 #else
45 #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
46 #endif
47 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
48 #define CONFIG_SYS_MAXARGS 32 /* max number of command args */
49 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
50 #define CONFIG_CMDLINE_EDITING
51 #define CONFIG_AUTO_COMPLETE
52
53 #define CONFIG_HUSH_INIT_VAR
54
55 #define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */
56
57 #define CONFIG_SYS_HZ 1000 /* decr. freq: 1 ms ticks */
58
59 #define CONFIG_BAUDRATE 115200
60 #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
61
62 #define CONFIG_LOADS_ECHO
63 #define CONFIG_SYS_LOADS_BAUD_CHANGE
64
65 #define CONFIG_SYS_I2C_INIT_BOARD
66
67 /* Support the IVM EEprom */
68 #define CONFIG_SYS_IVM_EEPROM_ADR 0x50
69 #define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400
70 #define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100
71
72 #define CONFIG_SYS_FLASH_PROTECTION
73
74 /*
75 * BOOTP options
76 */
77 #define CONFIG_BOOTP_BOOTFILESIZE
78 #define CONFIG_BOOTP_BOOTPATH
79 #define CONFIG_BOOTP_GATEWAY
80 #define CONFIG_BOOTP_HOSTNAME
81
82 #define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
83
84 /* UBI Support for all Keymile boards */
85 #define CONFIG_CMD_UBI
86 #define CONFIG_RBTREE
87 #define CONFIG_MTD_PARTITIONS
88 #define CONFIG_MTD_DEVICE
89 #define CONFIG_MTD_CONCAT
90
91 #define CONFIG_CMD_CRAMFS
92 #define CONFIG_CRAMFS_CMDLINE
93
94 #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
95 #define CONFIG_KM_DEF_ENV_BOOTPARAMS \
96 "actual_bank=0\0"
97 #endif
98
99 #ifndef CONFIG_KM_DEF_NETDEV
100 #define CONFIG_KM_DEF_NETDEV \
101 "netdev=eth0\0"
102 #endif
103
104 #ifndef CONFIG_KM_UBI_PARTITION_NAME_BOOT
105 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT "ubi0"
106 #endif /* CONFIG_KM_UBI_PARTITION_NAME_BOOT */
107
108 #ifndef CONFIG_KM_UBI_PARTITION_NAME_APP
109 /* one flash chip only called boot */
110 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
111 # define CONFIG_KM_UBI_LINUX_MTD \
112 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT
113 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
114 "ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "\0"
115 #else /* CONFIG_KM_UBI_PARTITION_NAME_APP */
116 /* two flash chips called boot and app */
117 /* boot: CONFIG_KM_UBI_PARTITION_NAME_BOOT */
118 /* app: CONFIG_KM_UBI_PARTITION_NAME_APP */
119 # define CONFIG_KM_UBI_LINUX_MTD \
120 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_BOOT " " \
121 "ubi.mtd=" CONFIG_KM_UBI_PARTITION_NAME_APP
122 # define CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI \
123 "ubiattach=if test ${boot_bank} -eq 0; then; " \
124 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_BOOT "; else; " \
125 "ubi part " CONFIG_KM_UBI_PARTITION_NAME_APP "; fi\0"
126 #endif /* CONFIG_KM_UBI_PARTITION_NAME_APP */
127
128 #ifdef CONFIG_NAND_ECC_BCH
129 #define CONFIG_KM_UIMAGE_NAME "ecc_bch_uImage\0"
130 #define CONFIG_KM_ECC_MODE " eccmode=bch"
131 #else
132 #define CONFIG_KM_UIMAGE_NAME "uImage\0"
133 #define CONFIG_KM_ECC_MODE
134 #endif
135
136 /*
137 * boottargets
138 * - set 'subbootcmds'
139 * - set 'bootcmd' and 'altbootcmd'
140 * available targets:
141 * - 'release': for a standalone system kernel/rootfs from flash
142 */
143 #define CONFIG_KM_DEF_ENV_BOOTTARGETS \
144 "subbootcmds=ubiattach ubicopy cramfsloadfdt cramfsloadkernel " \
145 "flashargs add_default addpanic boot\0" \
146 "develop=" \
147 "tftp 200000 scripts/develop-${arch}.txt && " \
148 "env import -t 200000 ${filesize} && " \
149 "run setup_debug_env\0" \
150 "ramfs=" \
151 "tftp 200000 scripts/ramfs-${arch}.txt && " \
152 "env import -t 200000 ${filesize} && " \
153 "run setup_debug_env\0" \
154 ""
155
156 /*
157 * bootargs
158 * - modify 'bootargs'
159 *
160 * - 'add_default': default bootargs common for all arm/ppc boards
161 * - 'addpanic': add kernel panic options
162 * - 'flashargs': defaults arguments for flash base boot
163 *
164 */
165 #define CONFIG_KM_DEF_ENV_BOOTARGS \
166 "add_default=" \
167 "setenv bootargs ${bootargs} " \
168 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
169 ":${hostname}:${netdev}:off3" \
170 " console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}" \
171 " mem=${kernelmem} init=${init}" \
172 CONFIG_KM_ECC_MODE \
173 " phram.phram=phvar,${varaddr}," __stringify(CONFIG_KM_PHRAM)\
174 " " CONFIG_KM_UBI_LINUX_MTD " " \
175 CONFIG_KM_DEF_BOOT_ARGS_CPU \
176 "\0" \
177 "addpanic=" \
178 "setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0" \
179 "flashargs=" \
180 "setenv bootargs " \
181 "root=mtdblock:rootfs${boot_bank} " \
182 "rootfstype=squashfs ro\0" \
183 ""
184
185 /*
186 * flash_boot
187 * - commands for booting from flash
188 *
189 * - 'cramfsloadkernel': copy kernel from a cramfs to ram
190 * - 'ubiattach': attach ubi partition
191 * - 'ubicopy': copy ubi volume to ram
192 * - volume names: bootfs0, bootfs1, bootfs2, ...
193 *
194 * processor specific settings
195 * - 'cramfsloadfdt': copy fdt from a cramfs to ram
196 */
197 #define CONFIG_KM_DEF_ENV_FLASH_BOOT \
198 "cramfsaddr=" __stringify(CONFIG_KM_CRAMFS_ADDR) "\0" \
199 "cramfsloadkernel=cramfsload ${load_addr_r} ${uimage}\0" \
200 "ubicopy=ubi read "__stringify(CONFIG_KM_CRAMFS_ADDR) \
201 " bootfs${boot_bank}\0" \
202 "uimage=" CONFIG_KM_UIMAGE_NAME \
203 CONFIG_KM_DEV_ENV_FLASH_BOOT_UBI
204
205 /*
206 * constants
207 * - KM specific constants and commands
208 *
209 * - 'default': setup default environment
210 */
211 #define CONFIG_KM_DEF_ENV_CONSTANTS \
212 "backup_bank=0\0" \
213 "release=run newenv; reset\0" \
214 "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0" \
215 "testbootcmd=setenv boot_bank ${test_bank}; " \
216 "run ${subbootcmds}; reset\0" \
217 ""
218
219 #ifndef CONFIG_KM_DEF_ENV
220 #define CONFIG_KM_DEF_ENV \
221 CONFIG_KM_DEF_ENV_BOOTPARAMS \
222 CONFIG_KM_DEF_NETDEV \
223 CONFIG_KM_DEF_ENV_CPU \
224 CONFIG_KM_DEF_ENV_BOOTTARGETS \
225 CONFIG_KM_DEF_ENV_BOOTARGS \
226 CONFIG_KM_DEF_ENV_FLASH_BOOT \
227 CONFIG_KM_DEF_ENV_CONSTANTS \
228 "altbootcmd=run bootcmd\0" \
229 "bootcmd=km_checkbidhwk && " \
230 "setenv bootcmd \'if km_checktestboot; then; " \
231 "setenv boot_bank ${test_bank}; else; " \
232 "setenv boot_bank ${actual_bank}; fi;" \
233 "run ${subbootcmds}; reset\' && " \
234 "setenv altbootcmd \'setenv boot_bank ${backup_bank}; " \
235 "run ${subbootcmds}; reset\' && " \
236 "saveenv && saveenv && boot\0" \
237 "bootlimit=3\0" \
238 "init=/sbin/init-overlay.sh\0" \
239 "load_addr_r="__stringify(CONFIG_KM_KERNEL_ADDR) "\0" \
240 "load=tftpboot ${load_addr_r} ${u-boot}\0" \
241 "mtdids=" MTDIDS_DEFAULT "\0" \
242 "mtdparts=" MTDPARTS_DEFAULT "\0" \
243 ""
244 #endif /* CONFIG_KM_DEF_ENV */
245
246 #define CONFIG_VERSION_VARIABLE /* include version env variable */
247
248 #endif /* __CONFIG_KEYMILE_H */