xref: /rk3399_rockchip-uboot/include/configs/km/keymile-common.h (revision b0e55d5b5afae64d27c421243e5efbcb3e818649)
1264eaa0eSValentin Longchamp /*
2264eaa0eSValentin Longchamp  * (C) Copyright 2008-2011
3264eaa0eSValentin Longchamp  * Heiko Schocher, DENX Software Engineering, hs@denx.de.
4264eaa0eSValentin Longchamp  *
5264eaa0eSValentin Longchamp  * See file CREDITS for list of people who contributed to this
6264eaa0eSValentin Longchamp  * project.
7264eaa0eSValentin Longchamp  *
8264eaa0eSValentin Longchamp  * This program is free software; you can redistribute it and/or
9264eaa0eSValentin Longchamp  * modify it under the terms of the GNU General Public License as
10264eaa0eSValentin Longchamp  * published by the Free Software Foundation; either version 2 of
11264eaa0eSValentin Longchamp  * the License, or (at your option) any later version.
12264eaa0eSValentin Longchamp  *
13264eaa0eSValentin Longchamp  * This program is distributed in the hope that it will be useful,
14264eaa0eSValentin Longchamp  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15264eaa0eSValentin Longchamp  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
16264eaa0eSValentin Longchamp  * GNU General Public License for more details.
17264eaa0eSValentin Longchamp  *
18264eaa0eSValentin Longchamp  * You should have received a copy of the GNU General Public License
19264eaa0eSValentin Longchamp  * along with this program; if not, write to the Free Software
20264eaa0eSValentin Longchamp  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21264eaa0eSValentin Longchamp  * MA 02111-1307 USA
22264eaa0eSValentin Longchamp  */
23264eaa0eSValentin Longchamp 
24264eaa0eSValentin Longchamp #ifndef __CONFIG_KEYMILE_H
25264eaa0eSValentin Longchamp #define __CONFIG_KEYMILE_H
26264eaa0eSValentin Longchamp 
27264eaa0eSValentin Longchamp /* Do boardspecific init for all boards */
28264eaa0eSValentin Longchamp #define CONFIG_BOARD_EARLY_INIT_R
29264eaa0eSValentin Longchamp #define CONFIG_LAST_STAGE_INIT
30264eaa0eSValentin Longchamp 
31264eaa0eSValentin Longchamp #define CONFIG_BOOTCOUNT_LIMIT
32264eaa0eSValentin Longchamp 
33264eaa0eSValentin Longchamp /*
34264eaa0eSValentin Longchamp  * Command line configuration.
35264eaa0eSValentin Longchamp  */
36264eaa0eSValentin Longchamp #include <config_cmd_default.h>
37264eaa0eSValentin Longchamp 
38264eaa0eSValentin Longchamp #define CONFIG_CMD_ASKENV
39264eaa0eSValentin Longchamp #define CONFIG_CMD_DHCP
40*b0e55d5bSGerlando Falauto #define CONFIG_CMD_DEFAULTENV_VARS
41264eaa0eSValentin Longchamp #define CONFIG_CMD_ECHO
42264eaa0eSValentin Longchamp #define CONFIG_CMD_IMMAP
43264eaa0eSValentin Longchamp #define CONFIG_CMD_MII
44264eaa0eSValentin Longchamp #define CONFIG_CMD_PING
45264eaa0eSValentin Longchamp #define CONFIG_CMD_EEPROM
46264eaa0eSValentin Longchamp #define CONFIG_CMD_I2C
47264eaa0eSValentin Longchamp #define CONFIG_CMD_JFFS2
48264eaa0eSValentin Longchamp #define CONFIG_CMD_MTDPARTS
49264eaa0eSValentin Longchamp #define CONFIG_CMD_SETEXPR
50264eaa0eSValentin Longchamp 
51264eaa0eSValentin Longchamp #undef	CONFIG_WATCHDOG		/* disable platform specific watchdog */
52264eaa0eSValentin Longchamp 
53264eaa0eSValentin Longchamp #define CONFIG_BOOTDELAY	2 /* autoboot after 2 seconds */
54264eaa0eSValentin Longchamp #undef	CONFIG_BOOTARGS		/* the boot command will set bootargs */
55264eaa0eSValentin Longchamp 
56264eaa0eSValentin Longchamp /*
57264eaa0eSValentin Longchamp  * Miscellaneous configurable options
58264eaa0eSValentin Longchamp  */
59264eaa0eSValentin Longchamp #define CONFIG_SYS_HUSH_PARSER
60264eaa0eSValentin Longchamp #define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
61264eaa0eSValentin Longchamp #define CONFIG_SYS_LONGHELP			/* undef to save memory	  */
62264eaa0eSValentin Longchamp #define CONFIG_SYS_PROMPT		"=> "	/* Monitor Command Prompt */
63264eaa0eSValentin Longchamp #if defined(CONFIG_CMD_KGDB)
64264eaa0eSValentin Longchamp #define CONFIG_SYS_CBSIZE		1024	/* Console I/O Buffer Size */
65264eaa0eSValentin Longchamp #else
66264eaa0eSValentin Longchamp #define CONFIG_SYS_CBSIZE		512	/* Console I/O Buffer Size  */
67264eaa0eSValentin Longchamp #endif
68264eaa0eSValentin Longchamp #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
69264eaa0eSValentin Longchamp #define CONFIG_SYS_MAXARGS		32 /* max number of command args */
70264eaa0eSValentin Longchamp #define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE
71264eaa0eSValentin Longchamp #define CONFIG_CMDLINE_EDITING
72264eaa0eSValentin Longchamp #define CONFIG_AUTO_COMPLETE
73264eaa0eSValentin Longchamp 
74264eaa0eSValentin Longchamp #define CONFIG_HUSH_INIT_VAR
75264eaa0eSValentin Longchamp 
76264eaa0eSValentin Longchamp #define CONFIG_SYS_ALT_MEMTEST		/* memory test, takes time */
77264eaa0eSValentin Longchamp 
78264eaa0eSValentin Longchamp #define CONFIG_SYS_HZ			1000	/* decr. freq: 1 ms ticks */
79264eaa0eSValentin Longchamp 
80264eaa0eSValentin Longchamp #define CONFIG_BAUDRATE			115200
81264eaa0eSValentin Longchamp #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 }
82264eaa0eSValentin Longchamp 
83264eaa0eSValentin Longchamp #define CONFIG_LOADS_ECHO
84264eaa0eSValentin Longchamp #define CONFIG_SYS_LOADS_BAUD_CHANGE
85264eaa0eSValentin Longchamp #define CONFIG_SYS_BOARD_DRAM_INIT	/* Used board specific dram_init */
86264eaa0eSValentin Longchamp 
87264eaa0eSValentin Longchamp #define CONFIG_I2C_MULTI_BUS
88264eaa0eSValentin Longchamp #define CONFIG_SYS_MAX_I2C_BUS		1
89264eaa0eSValentin Longchamp #define CONFIG_SYS_I2C_INIT_BOARD
90264eaa0eSValentin Longchamp #define CONFIG_I2C_MUX
91264eaa0eSValentin Longchamp 
92264eaa0eSValentin Longchamp /* Support the IVM EEprom */
93264eaa0eSValentin Longchamp #define	CONFIG_SYS_IVM_EEPROM_ADR	0x50
94264eaa0eSValentin Longchamp #define CONFIG_SYS_IVM_EEPROM_MAX_LEN	0x400
95264eaa0eSValentin Longchamp #define CONFIG_SYS_IVM_EEPROM_PAGE_LEN	0x100
96264eaa0eSValentin Longchamp 
97264eaa0eSValentin Longchamp #define	CONFIG_SYS_FLASH_PROTECTION
98264eaa0eSValentin Longchamp 
99264eaa0eSValentin Longchamp /*
100264eaa0eSValentin Longchamp  * BOOTP options
101264eaa0eSValentin Longchamp  */
102264eaa0eSValentin Longchamp #define CONFIG_BOOTP_BOOTFILESIZE
103264eaa0eSValentin Longchamp #define CONFIG_BOOTP_BOOTPATH
104264eaa0eSValentin Longchamp #define CONFIG_BOOTP_GATEWAY
105264eaa0eSValentin Longchamp #define CONFIG_BOOTP_HOSTNAME
106264eaa0eSValentin Longchamp 
107264eaa0eSValentin Longchamp #define CONFIG_SYS_MALLOC_LEN		(4 * 1024 * 1024)
108264eaa0eSValentin Longchamp 
109264eaa0eSValentin Longchamp /* UBI Support for all Keymile boards */
110264eaa0eSValentin Longchamp #define CONFIG_CMD_UBI
111264eaa0eSValentin Longchamp #define CONFIG_RBTREE
112264eaa0eSValentin Longchamp #define CONFIG_MTD_PARTITIONS
113264eaa0eSValentin Longchamp #define CONFIG_MTD_DEVICE
114264eaa0eSValentin Longchamp #define CONFIG_MTD_CONCAT
115264eaa0eSValentin Longchamp 
116f7fb46a8SHolger Brunck #define CONFIG_CMD_CRAMFS
117f7fb46a8SHolger Brunck #define CONFIG_CRAMFS_CMDLINE
118f7fb46a8SHolger Brunck 
119264eaa0eSValentin Longchamp #ifndef CONFIG_KM_DEF_ENV_BOOTPARAMS
120264eaa0eSValentin Longchamp #define CONFIG_KM_DEF_ENV_BOOTPARAMS \
121db0bb572SHolger Brunck 	"actual_bank=0\0"
122264eaa0eSValentin Longchamp #endif
123264eaa0eSValentin Longchamp 
124264eaa0eSValentin Longchamp #ifndef CONFIG_KM_DEF_NETDEV
125264eaa0eSValentin Longchamp #define CONFIG_KM_DEF_NETDEV	\
126264eaa0eSValentin Longchamp 	"netdev=eth0\0"
127264eaa0eSValentin Longchamp #endif
128264eaa0eSValentin Longchamp 
129264eaa0eSValentin Longchamp #ifndef CONFIG_KM_UBI_PARTITION_NAME
130264eaa0eSValentin Longchamp #define CONFIG_KM_UBI_PARTITION_NAME	"ubi0"
131264eaa0eSValentin Longchamp #endif
132264eaa0eSValentin Longchamp #ifndef CONFIG_KM_UBI_LINUX_MTD_NAME
133264eaa0eSValentin Longchamp #define CONFIG_KM_UBI_LINUX_MTD_NAME	"ubi0"
134264eaa0eSValentin Longchamp #endif
135264eaa0eSValentin Longchamp 
136264eaa0eSValentin Longchamp #define xstr(s)	str(s)
137264eaa0eSValentin Longchamp #define str(s)	#s
138264eaa0eSValentin Longchamp 
139264eaa0eSValentin Longchamp /*
140264eaa0eSValentin Longchamp  * boottargets
141db0bb572SHolger Brunck  * - set 'subbootcmds'
142264eaa0eSValentin Longchamp  * - set 'bootcmd' and 'altbootcmd'
143264eaa0eSValentin Longchamp  * available targets:
144264eaa0eSValentin Longchamp  * - 'release': for a standalone system		kernel/rootfs from flash
145264eaa0eSValentin Longchamp  */
146264eaa0eSValentin Longchamp #define CONFIG_KM_DEF_ENV_BOOTTARGETS					\
147db0bb572SHolger Brunck 	"subbootcmds=ubiattach ubicopy cramfsloadfdt cramfsloadkernel "	\
148db0bb572SHolger Brunck 		"flashargs add_default addpanic boot\0"			\
149b648bfc2SHolger Brunck 	"develop="							\
150b648bfc2SHolger Brunck 		"tftp 200000 scripts/develop-${arch}.txt && "		\
1512d9528e3SHolger Brunck 		"env import -t 200000 ${filesize} && "			\
152b648bfc2SHolger Brunck 		"run setup_debug_env\0"					\
153b648bfc2SHolger Brunck 	"ramfs="							\
154b648bfc2SHolger Brunck 		"tftp 200000 scripts/ramfs-${arch}.txt && "		\
155b648bfc2SHolger Brunck 		"env import -t 200000 ${filesize} && "			\
156b648bfc2SHolger Brunck 		"run setup_debug_env\0"					\
157264eaa0eSValentin Longchamp 	""
158264eaa0eSValentin Longchamp 
159264eaa0eSValentin Longchamp /*
160264eaa0eSValentin Longchamp  * bootargs
161264eaa0eSValentin Longchamp  * - modify 'bootargs'
162264eaa0eSValentin Longchamp  *
163db0bb572SHolger Brunck  * - 'add_default': default bootargs common for all arm/ppc boards
164264eaa0eSValentin Longchamp  * - 'addpanic': add kernel panic options
165264eaa0eSValentin Longchamp  * - 'flashargs': defaults arguments for flash base boot
166264eaa0eSValentin Longchamp  *
167264eaa0eSValentin Longchamp  */
168264eaa0eSValentin Longchamp #define CONFIG_KM_DEF_ENV_BOOTARGS					\
169db0bb572SHolger Brunck 	"add_default="							\
170264eaa0eSValentin Longchamp 		"setenv bootargs ${bootargs} "				\
171264eaa0eSValentin Longchamp 		"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"	\
172db0bb572SHolger Brunck 		":${hostname}:${netdev}:off3"				\
173db0bb572SHolger Brunck 		" console=" CONFIG_KM_CONSOLE_TTY ",${baudrate}"	\
1742a7714ceSAndreas Huber 		" mem=${kernelmem} init=${init}"			\
175db0bb572SHolger Brunck 		" phram.phram=phvar,${varaddr}," xstr(CONFIG_KM_PHRAM)	\
176db0bb572SHolger Brunck 		" ubi.mtd=" CONFIG_KM_UBI_LINUX_MTD_NAME " "		\
177db0bb572SHolger Brunck 		CONFIG_KM_DEF_BOOT_ARGS_CPU				\
178db0bb572SHolger Brunck 		"\0"							\
179264eaa0eSValentin Longchamp 	"addpanic="							\
1802d9528e3SHolger Brunck 		"setenv bootargs ${bootargs} panic=1 panic_on_oops=1\0"	\
181264eaa0eSValentin Longchamp 	"flashargs="							\
182264eaa0eSValentin Longchamp 		"setenv bootargs "					\
183264eaa0eSValentin Longchamp 		"root=mtdblock:rootfs${boot_bank} "			\
184264eaa0eSValentin Longchamp 		"rootfstype=squashfs ro\0"				\
185264eaa0eSValentin Longchamp 	""
186264eaa0eSValentin Longchamp 
187264eaa0eSValentin Longchamp /*
188264eaa0eSValentin Longchamp  * flash_boot
189264eaa0eSValentin Longchamp  * - commands for booting from flash
190264eaa0eSValentin Longchamp  *
191264eaa0eSValentin Longchamp  * - 'cramfsloadkernel': copy kernel from a cramfs to ram
192264eaa0eSValentin Longchamp  * - 'ubiattach': attach ubi partition
193264eaa0eSValentin Longchamp  * - 'ubicopy': copy ubi volume to ram
194264eaa0eSValentin Longchamp  *              - volume names: bootfs0, bootfs1, bootfs2, ...
195264eaa0eSValentin Longchamp  *
196264eaa0eSValentin Longchamp  * processor specific settings
197264eaa0eSValentin Longchamp  * - 'cramfsloadfdt': copy fdt from a cramfs to ram
198264eaa0eSValentin Longchamp  */
199264eaa0eSValentin Longchamp #define CONFIG_KM_DEF_ENV_FLASH_BOOT					\
200264eaa0eSValentin Longchamp 	"cramfsaddr=" xstr(CONFIG_KM_CRAMFS_ADDR) "\0"			\
201db0bb572SHolger Brunck 	"cramfsloadkernel=cramfsload ${load_addr_r} uImage\0"		\
2022d9528e3SHolger Brunck 	"ubiattach=ubi part " CONFIG_KM_UBI_PARTITION_NAME "\0"		\
2032d9528e3SHolger Brunck 	"ubicopy=ubi read "xstr(CONFIG_KM_CRAMFS_ADDR)			\
2042d9528e3SHolger Brunck 			" bootfs${boot_bank}\0"				\
205264eaa0eSValentin Longchamp 	""
206264eaa0eSValentin Longchamp 
207264eaa0eSValentin Longchamp /*
208264eaa0eSValentin Longchamp  * constants
209264eaa0eSValentin Longchamp  * - KM specific constants and commands
210264eaa0eSValentin Longchamp  *
211264eaa0eSValentin Longchamp  * - 'default': setup default environment
212264eaa0eSValentin Longchamp  */
213264eaa0eSValentin Longchamp #define CONFIG_KM_DEF_ENV_CONSTANTS					\
214264eaa0eSValentin Longchamp 	"backup_bank=0\0"						\
215db0bb572SHolger Brunck 	"release=run newenv; reset\0"					\
216638a48edSHolger Brunck 	"pnvramsize=" xstr(CONFIG_KM_PNVRAM) "\0"			\
2170333cfe6SThomas Herzmann 	"testbootcmd=setenv boot_bank ${test_bank}; "			\
2180333cfe6SThomas Herzmann 		"run ${subbootcmds}; reset\0"				\
219264eaa0eSValentin Longchamp 	""
220264eaa0eSValentin Longchamp 
221264eaa0eSValentin Longchamp #ifndef CONFIG_KM_DEF_ENV
222264eaa0eSValentin Longchamp #define CONFIG_KM_DEF_ENV	\
223264eaa0eSValentin Longchamp 	CONFIG_KM_DEF_ENV_BOOTPARAMS					\
224264eaa0eSValentin Longchamp 	CONFIG_KM_DEF_NETDEV						\
225264eaa0eSValentin Longchamp 	CONFIG_KM_DEF_ENV_CPU						\
226264eaa0eSValentin Longchamp 	CONFIG_KM_DEF_ENV_BOOTTARGETS					\
227264eaa0eSValentin Longchamp 	CONFIG_KM_DEF_ENV_BOOTARGS					\
228264eaa0eSValentin Longchamp 	CONFIG_KM_DEF_ENV_FLASH_BOOT					\
229264eaa0eSValentin Longchamp 	CONFIG_KM_DEF_ENV_CONSTANTS					\
230264eaa0eSValentin Longchamp 	"altbootcmd=run bootcmd\0"					\
231db0bb572SHolger Brunck 	"bootcmd=km_checkbidhwk &&  "					\
232db0bb572SHolger Brunck 	"	setenv bootcmd \'setenv boot_bank ${actual_bank}; "	\
233db0bb572SHolger Brunck 			"run ${subbootcmds}; reset\' && "		\
234db0bb572SHolger Brunck 		"setenv altbootcmd \'setenv boot_bank ${backup_bank}; "	\
235db0bb572SHolger Brunck 			"run ${subbootcmds}; reset\' && "		\
236db0bb572SHolger Brunck 		"saveenv && saveenv && boot\0"				\
237264eaa0eSValentin Longchamp 	"bootlimit=2\0"							\
238264eaa0eSValentin Longchamp 	"init=/sbin/init-overlay.sh\0"					\
239db0bb572SHolger Brunck 	"load_addr_r="xstr(CONFIG_KM_KERNEL_ADDR) "\0"			\
240db0bb572SHolger Brunck 	"load=tftpboot ${load_addr_r} ${u-boot}\0"			\
241264eaa0eSValentin Longchamp 	"mtdids=" MTDIDS_DEFAULT "\0"					\
242264eaa0eSValentin Longchamp 	"mtdparts=" MTDPARTS_DEFAULT "\0"				\
243264eaa0eSValentin Longchamp 	"stderr=serial\0"						\
244264eaa0eSValentin Longchamp 	"stdin=serial\0"						\
245264eaa0eSValentin Longchamp 	"stdout=serial\0"						\
246264eaa0eSValentin Longchamp 	""
247264eaa0eSValentin Longchamp #endif /* CONFIG_KM_DEF_ENV */
248264eaa0eSValentin Longchamp 
249264eaa0eSValentin Longchamp #define CONFIG_VERSION_VARIABLE	/* include version env variable */
250264eaa0eSValentin Longchamp 
251264eaa0eSValentin Longchamp #endif /* __CONFIG_KEYMILE_H */
252