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