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