xref: /openbmc/u-boot/include/configs/vf610twr.h (revision ea818dbb)
1 /*
2  * Copyright 2013 Freescale Semiconductor, Inc.
3  *
4  * Configuration settings for the Freescale Vybrid vf610twr board.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19  * MA 02111-1307 USA
20  */
21 
22 #ifndef __CONFIG_H
23 #define __CONFIG_H
24 
25 #include <asm/arch/imx-regs.h>
26 #include <config_cmd_default.h>
27 
28 #define CONFIG_VF610
29 
30 #define CONFIG_DISPLAY_CPUINFO
31 #define CONFIG_DISPLAY_BOARDINFO
32 
33 #define CONFIG_MACH_TYPE		4146
34 
35 #define CONFIG_SKIP_LOWLEVEL_INIT
36 
37 /* Enable passing of ATAGs */
38 #define CONFIG_CMDLINE_TAG
39 
40 #define CONFIG_CMD_FUSE
41 #ifdef CONFIG_CMD_FUSE
42 #define CONFIG_MXC_OCOTP
43 #endif
44 
45 /* Size of malloc() pool */
46 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 2 * 1024 * 1024)
47 
48 #define CONFIG_BOARD_EARLY_INIT_F
49 
50 #define CONFIG_FSL_LPUART
51 #define LPUART_BASE			UART1_BASE
52 
53 /* Allow to overwrite serial and ethaddr */
54 #define CONFIG_ENV_OVERWRITE
55 #define CONFIG_SYS_UART_PORT		(1)
56 #define CONFIG_BAUDRATE			115200
57 
58 #undef CONFIG_CMD_IMLS
59 
60 #define CONFIG_MMC
61 #define CONFIG_FSL_ESDHC
62 #define CONFIG_SYS_FSL_ESDHC_ADDR	0
63 #define CONFIG_SYS_FSL_ESDHC_NUM	1
64 
65 #define CONFIG_SYS_FSL_ERRATUM_ESDHC111
66 
67 #define CONFIG_CMD_MMC
68 #define CONFIG_GENERIC_MMC
69 #define CONFIG_CMD_FAT
70 #define CONFIG_DOS_PARTITION
71 
72 #define CONFIG_CMD_PING
73 #define CONFIG_CMD_DHCP
74 #define CONFIG_CMD_MII
75 #define CONFIG_CMD_NET
76 #define CONFIG_FEC_MXC
77 #define CONFIG_MII
78 #define IMX_FEC_BASE			ENET_BASE_ADDR
79 #define CONFIG_FEC_XCV_TYPE		RMII
80 #define CONFIG_FEC_MXC_PHYADDR          0
81 #define CONFIG_PHYLIB
82 #define CONFIG_PHY_MICREL
83 
84 #define CONFIG_BOOTDELAY		3
85 
86 #define CONFIG_LOADADDR			0x82000000
87 #define CONFIG_SYS_TEXT_BASE		0x3f008000
88 
89 #define CONFIG_EXTRA_ENV_SETTINGS \
90 	"script=boot.scr\0" \
91 	"uimage=uImage\0" \
92 	"console=ttyLP1\0" \
93 	"fdt_high=0xffffffff\0" \
94 	"initrd_high=0xffffffff\0" \
95 	"fdt_file=vf610-twr.dtb\0" \
96 	"fdt_addr=0x81000000\0" \
97 	"boot_fdt=try\0" \
98 	"ip_dyn=yes\0" \
99 	"mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
100 	"mmcpart=1\0" \
101 	"mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
102 	"update_sd_firmware_filename=u-boot.imx\0" \
103 	"update_sd_firmware=" \
104 		"if test ${ip_dyn} = yes; then " \
105 			"setenv get_cmd dhcp; " \
106 		"else " \
107 			"setenv get_cmd tftp; " \
108 		"fi; " \
109 		"if mmc dev ${mmcdev}; then "	\
110 			"if ${get_cmd} ${update_sd_firmware_filename}; then " \
111 				"setexpr fw_sz ${filesize} / 0x200; " \
112 				"setexpr fw_sz ${fw_sz} + 1; "	\
113 				"mmc write ${loadaddr} 0x2 ${fw_sz}; " \
114 			"fi; "	\
115 		"fi\0" \
116 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
117 		"root=${mmcroot}\0" \
118 	"loadbootscript=" \
119 		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
120 	"bootscript=echo Running bootscript from mmc ...; " \
121 		"source\0" \
122 	"loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
123 	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
124 	"mmcboot=echo Booting from mmc ...; " \
125 		"run mmcargs; " \
126 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
127 			"if run loadfdt; then " \
128 				"bootm ${loadaddr} - ${fdt_addr}; " \
129 			"else " \
130 				"if test ${boot_fdt} = try; then " \
131 					"bootm; " \
132 				"else " \
133 					"echo WARN: Cannot load the DT; " \
134 				"fi; " \
135 			"fi; " \
136 		"else " \
137 			"bootm; " \
138 		"fi;\0" \
139 	"netargs=setenv bootargs console=${console},${baudrate} " \
140 		"root=/dev/nfs " \
141 	"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
142 		"netboot=echo Booting from net ...; " \
143 		"run netargs; " \
144 		"if test ${ip_dyn} = yes; then " \
145 			"setenv get_cmd dhcp; " \
146 		"else " \
147 			"setenv get_cmd tftp; " \
148 		"fi; " \
149 		"${get_cmd} ${uimage}; " \
150 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
151 			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
152 				"bootm ${loadaddr} - ${fdt_addr}; " \
153 			"else " \
154 				"if test ${boot_fdt} = try; then " \
155 					"bootm; " \
156 				"else " \
157 					"echo WARN: Cannot load the DT; " \
158 				"fi; " \
159 			"fi; " \
160 		"else " \
161 			"bootm; " \
162 		"fi;\0"
163 
164 #define CONFIG_BOOTCOMMAND \
165 	   "mmc dev ${mmcdev}; if mmc rescan; then " \
166 		   "if run loadbootscript; then " \
167 			   "run bootscript; " \
168 		   "else " \
169 			   "if run loaduimage; then " \
170 				   "run mmcboot; " \
171 			   "else run netboot; " \
172 			   "fi; " \
173 		   "fi; " \
174 	   "else run netboot; fi"
175 
176 /* Miscellaneous configurable options */
177 #define CONFIG_SYS_LONGHELP		/* undef to save memory */
178 #define CONFIG_SYS_HUSH_PARSER		/* use "hush" command parser */
179 #define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
180 #define CONFIG_SYS_PROMPT		"=> "
181 #undef CONFIG_AUTO_COMPLETE
182 #define CONFIG_SYS_CBSIZE		256	/* Console I/O Buffer Size */
183 #define CONFIG_SYS_PBSIZE		\
184 			(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
185 #define CONFIG_SYS_MAXARGS		16	/* max number of command args */
186 #define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE
187 
188 #define CONFIG_CMD_MEMTEST
189 #define CONFIG_SYS_MEMTEST_START	0x80010000
190 #define CONFIG_SYS_MEMTEST_END		0x87C00000
191 
192 #define CONFIG_SYS_LOAD_ADDR		CONFIG_LOADADDR
193 #define CONFIG_SYS_HZ			1000
194 
195 /*
196  * Stack sizes
197  * The stack sizes are set up in start.S using the settings below
198  */
199 #define CONFIG_STACKSIZE		(128 * 1024)	/* regular stack */
200 
201 /* Physical memory map */
202 #define CONFIG_NR_DRAM_BANKS		1
203 #define PHYS_SDRAM			(0x80000000)
204 #define PHYS_SDRAM_SIZE			(128 * 1024 * 1024)
205 
206 #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM
207 #define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR
208 #define CONFIG_SYS_INIT_RAM_SIZE	IRAM_SIZE
209 
210 #define CONFIG_SYS_INIT_SP_OFFSET \
211 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
212 #define CONFIG_SYS_INIT_SP_ADDR \
213 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
214 
215 /* FLASH and environment organization */
216 #define CONFIG_SYS_NO_FLASH
217 
218 #define CONFIG_ENV_SIZE			(8 * 1024)
219 #define CONFIG_ENV_IS_IN_MMC
220 
221 #define CONFIG_ENV_OFFSET		(12 * 64 * 1024)
222 #define CONFIG_SYS_MMC_ENV_DEV		0
223 
224 #define CONFIG_OF_LIBFDT
225 #define CONFIG_CMD_BOOTZ
226 
227 #endif
228