xref: /rk3399_rockchip-uboot/include/configs/MCR3000.h (revision e090579d0a2d1aa38eab94b98877de9bcdd4f31d)
1*53193a4fSChristophe Leroy /*
2*53193a4fSChristophe Leroy  * Copyright (C) 2010-2017 CS Systemes d'Information
3*53193a4fSChristophe Leroy  * Christophe Leroy <christophe.leroy@c-s.fr>
4*53193a4fSChristophe Leroy  *
5*53193a4fSChristophe Leroy  * SPDX-License-Identifier:	GPL-2.0+
6*53193a4fSChristophe Leroy  */
7*53193a4fSChristophe Leroy 
8*53193a4fSChristophe Leroy #ifndef __CONFIG_H
9*53193a4fSChristophe Leroy #define __CONFIG_H
10*53193a4fSChristophe Leroy 
11*53193a4fSChristophe Leroy /* High Level Configuration Options */
12*53193a4fSChristophe Leroy #define CONFIG_BOARD_EARLY_INIT_F	1	/* Call board_early_init_f */
13*53193a4fSChristophe Leroy #define CONFIG_MISC_INIT_R		1	/* Call misc_init_r	*/
14*53193a4fSChristophe Leroy 
15*53193a4fSChristophe Leroy #define CONFIG_EXTRA_ENV_SETTINGS					\
16*53193a4fSChristophe Leroy 	"sdram_type=SDRAM\0"						\
17*53193a4fSChristophe Leroy 	"flash_type=AM29LV160DB\0"					\
18*53193a4fSChristophe Leroy 	"loadaddr=0x400000\0"						\
19*53193a4fSChristophe Leroy 	"filename=uImage.lzma\0"					\
20*53193a4fSChristophe Leroy 	"nfsroot=/opt/ofs\0"						\
21*53193a4fSChristophe Leroy 	"dhcp_ip=ip=:::::eth0:dhcp\0"					\
22*53193a4fSChristophe Leroy 	"console_args=console=ttyCPM0,115200N8\0"			\
23*53193a4fSChristophe Leroy 	"flashboot=setenv bootargs "					\
24*53193a4fSChristophe Leroy 		"${console_args} "					\
25*53193a4fSChristophe Leroy 		"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:"	\
26*53193a4fSChristophe Leroy 		"mcr3k:eth0:off;"					\
27*53193a4fSChristophe Leroy 		"${ofl_args}; "						\
28*53193a4fSChristophe Leroy 		"bootm 0x04060000 - 0x04050000\0"			\
29*53193a4fSChristophe Leroy 	"tftpboot=setenv bootargs "					\
30*53193a4fSChristophe Leroy 		"${console_args} "					\
31*53193a4fSChristophe Leroy 		"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:"	\
32*53193a4fSChristophe Leroy 		"mcr3k:eth0:off "					\
33*53193a4fSChristophe Leroy 		"${ofl_args}; "						\
34*53193a4fSChristophe Leroy 		"tftp ${loadaddr} ${filename};"				\
35*53193a4fSChristophe Leroy 		"tftp 0xf00000 mcr3000.dtb;"				\
36*53193a4fSChristophe Leroy 		"bootm ${loadaddr} - 0xf00000\0"			\
37*53193a4fSChristophe Leroy 	"netboot=dhcp ${loadaddr} ${filename};"				\
38*53193a4fSChristophe Leroy 		"tftp 0xf00000 mcr3000.dtb;"				\
39*53193a4fSChristophe Leroy 		"setenv bootargs "					\
40*53193a4fSChristophe Leroy 		"root=/dev/nfs rw "					\
41*53193a4fSChristophe Leroy 		"${console_args} "					\
42*53193a4fSChristophe Leroy 		"${dhcp_ip};"						\
43*53193a4fSChristophe Leroy 		"bootm ${loadaddr} - 0xf00000\0"			\
44*53193a4fSChristophe Leroy 	"nfsboot=setenv bootargs "					\
45*53193a4fSChristophe Leroy 		"root=/dev/nfs rw nfsroot=${serverip}:${nfsroot} "	\
46*53193a4fSChristophe Leroy 		"${console_args} "					\
47*53193a4fSChristophe Leroy 		"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:"	\
48*53193a4fSChristophe Leroy 		"mcr3k:eth0:off;"					\
49*53193a4fSChristophe Leroy 		"bootm 0x04060000 - 0x04050000\0"			\
50*53193a4fSChristophe Leroy 	"dhcpboot=dhcp ${loadaddr} ${filename};"			\
51*53193a4fSChristophe Leroy 		"tftp 0xf00000 mcr3000.dtb;"				\
52*53193a4fSChristophe Leroy 		"setenv bootargs "					\
53*53193a4fSChristophe Leroy 		"${console_args} "					\
54*53193a4fSChristophe Leroy 		"${dhcp_ip} "						\
55*53193a4fSChristophe Leroy 		"${ofl_args}; "						\
56*53193a4fSChristophe Leroy 		"bootm ${loadaddr} - 0xf00000\0"
57*53193a4fSChristophe Leroy 
58*53193a4fSChristophe Leroy #define CONFIG_BOOTDELAY		5
59*53193a4fSChristophe Leroy 
60*53193a4fSChristophe Leroy #define CONFIG_IPADDR			192.168.0.3
61*53193a4fSChristophe Leroy #define CONFIG_SERVERIP			192.168.0.1
62*53193a4fSChristophe Leroy #define CONFIG_NETMASK			255.0.0.0
63*53193a4fSChristophe Leroy 
64*53193a4fSChristophe Leroy #define CONFIG_BOOTCOMMAND		"run flashboot"
65*53193a4fSChristophe Leroy 
66*53193a4fSChristophe Leroy #define CONFIG_LOADS_ECHO	1	/* echo on for serial download	*/
67*53193a4fSChristophe Leroy #undef	CONFIG_LOADS_BAUD_CHANGE	/* don't allow baudrate change	*/
68*53193a4fSChristophe Leroy 
69*53193a4fSChristophe Leroy #define CONFIG_WATCHDOG		1	/* watchdog enabled */
70*53193a4fSChristophe Leroy 
71*53193a4fSChristophe Leroy /* Miscellaneous configurable options */
72*53193a4fSChristophe Leroy #define	CONFIG_SYS_LONGHELP
73*53193a4fSChristophe Leroy 
74*53193a4fSChristophe Leroy #define CONFIG_CMDLINE_EDITING		1
75*53193a4fSChristophe Leroy #ifdef	CONFIG_HUSH_PARSER
76*53193a4fSChristophe Leroy #define	CONFIG_SYS_PROMPT_HUSH_PS2	"S3K> "
77*53193a4fSChristophe Leroy #endif
78*53193a4fSChristophe Leroy 
79*53193a4fSChristophe Leroy #define CONFIG_SYS_MEMTEST_START	0x00002000
80*53193a4fSChristophe Leroy #define CONFIG_SYS_MEMTEST_END		0x00800000
81*53193a4fSChristophe Leroy 
82*53193a4fSChristophe Leroy #define	CONFIG_SYS_LOAD_ADDR		0x200000
83*53193a4fSChristophe Leroy 
84*53193a4fSChristophe Leroy #define	CONFIG_SYS_HZ			1000
85*53193a4fSChristophe Leroy 
86*53193a4fSChristophe Leroy /* Definitions for initial stack pointer and data area (in DPRAM) */
87*53193a4fSChristophe Leroy #define CONFIG_SYS_INIT_RAM_ADDR	CONFIG_SYS_IMMR
88*53193a4fSChristophe Leroy #define	CONFIG_SYS_INIT_RAM_SIZE	0x2f00
89*53193a4fSChristophe Leroy #define	CONFIG_SYS_GBL_DATA_SIZE	64
90*53193a4fSChristophe Leroy #define CONFIG_SYS_GBL_DATA_OFFSET	(CONFIG_SYS_INIT_RAM_SIZE - \
91*53193a4fSChristophe Leroy 					 CONFIG_SYS_GBL_DATA_SIZE)
92*53193a4fSChristophe Leroy #define CONFIG_SYS_INIT_SP_OFFSET	CONFIG_SYS_GBL_DATA_OFFSET
93*53193a4fSChristophe Leroy 
94*53193a4fSChristophe Leroy /* RAM configuration (note that CONFIG_SYS_SDRAM_BASE must be zero) */
95*53193a4fSChristophe Leroy #define	CONFIG_SYS_SDRAM_BASE		0x00000000
96*53193a4fSChristophe Leroy #define SDRAM_MAX_SIZE			(32 * 1024 * 1024)
97*53193a4fSChristophe Leroy 
98*53193a4fSChristophe Leroy /* FLASH organization */
99*53193a4fSChristophe Leroy #define CONFIG_SYS_FLASH_BASE		CONFIG_SYS_TEXT_BASE
100*53193a4fSChristophe Leroy #define CONFIG_SYS_FLASH_CFI		1
101*53193a4fSChristophe Leroy #define CONFIG_FLASH_CFI_DRIVER		1
102*53193a4fSChristophe Leroy #define CONFIG_SYS_MAX_FLASH_BANKS	1
103*53193a4fSChristophe Leroy #define CONFIG_SYS_MAX_FLASH_SECT	35
104*53193a4fSChristophe Leroy #define CONFIG_SYS_FLASH_ERASE_TOUT	120000
105*53193a4fSChristophe Leroy #define CONFIG_SYS_FLASH_WRITE_TOUT	500
106*53193a4fSChristophe Leroy 
107*53193a4fSChristophe Leroy /*
108*53193a4fSChristophe Leroy  * For booting Linux, the board info and command line data
109*53193a4fSChristophe Leroy  * have to be in the first 8 MB of memory, since this is
110*53193a4fSChristophe Leroy  * the maximum mapped by the Linux kernel during initialization.
111*53193a4fSChristophe Leroy  */
112*53193a4fSChristophe Leroy #define	CONFIG_SYS_BOOTMAPSZ		(8 << 20)
113*53193a4fSChristophe Leroy #define	CONFIG_SYS_MONITOR_LEN		(256 << 10)
114*53193a4fSChristophe Leroy #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_TEXT_BASE
115*53193a4fSChristophe Leroy #define CONFIG_SYS_MALLOC_LEN		(4096 << 10)
116*53193a4fSChristophe Leroy 
117*53193a4fSChristophe Leroy /* Environment Configuration */
118*53193a4fSChristophe Leroy 
119*53193a4fSChristophe Leroy /* environment is in FLASH */
120*53193a4fSChristophe Leroy #define CONFIG_ENV_SECT_SIZE	(64 * 1024)
121*53193a4fSChristophe Leroy #define CONFIG_ENV_SIZE		CONFIG_ENV_SECT_SIZE
122*53193a4fSChristophe Leroy #define CONFIG_ENV_ADDR		(CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN)
123*53193a4fSChristophe Leroy #define CONFIG_ENV_OFFSET	(CONFIG_ENV_ADDR - CONFIG_SYS_FLASH_BASE)
124*53193a4fSChristophe Leroy #define CONFIG_ENV_OVERWRITE	1
125*53193a4fSChristophe Leroy 
126*53193a4fSChristophe Leroy /* Cache Configuration */
127*53193a4fSChristophe Leroy #define CONFIG_SYS_CACHELINE_SIZE	16
128*53193a4fSChristophe Leroy 
129*53193a4fSChristophe Leroy /* Ethernet configuration part */
130*53193a4fSChristophe Leroy #define CONFIG_SYS_DISCOVER_PHY		1
131*53193a4fSChristophe Leroy #ifdef CONFIG_MPC8XX_FEC
132*53193a4fSChristophe Leroy #define CONFIG_MII_INIT			1
133*53193a4fSChristophe Leroy #endif
134*53193a4fSChristophe Leroy 
135*53193a4fSChristophe Leroy /* NAND configuration part */
136*53193a4fSChristophe Leroy #define CONFIG_SYS_MAX_NAND_DEVICE	1
137*53193a4fSChristophe Leroy #define CONFIG_SYS_NAND_MAX_CHIPS	1
138*53193a4fSChristophe Leroy #define CONFIG_SYS_NAND_BASE		0x0C000000
139*53193a4fSChristophe Leroy 
140*53193a4fSChristophe Leroy /* Internal Definitions */
141*53193a4fSChristophe Leroy 
142*53193a4fSChristophe Leroy /* Boot Flags*/
143*53193a4fSChristophe Leroy #define	BOOTFLAG_COLD			0x01
144*53193a4fSChristophe Leroy #define BOOTFLAG_WARM			0x02
145*53193a4fSChristophe Leroy 
146*53193a4fSChristophe Leroy #endif /* __CONFIG_H */
147