xref: /openbmc/u-boot/include/configs/ge_bx50v3.h (revision 8aea45a7)
1 /*
2  * Copyright (C) 2015 Timesys Corporation
3  * Copyright (C) 2015 General Electric Company
4  * Copyright (C) 2014 Advantech
5  * Copyright (C) 2012 Freescale Semiconductor, Inc.
6  *
7  * Configuration settings for the GE MX6Q Bx50v3 boards.
8  *
9  * SPDX-License-Identifier:	GPL-2.0+
10  */
11 
12 #ifndef __GE_BX50V3_CONFIG_H
13 #define __GE_BX50V3_CONFIG_H
14 
15 #include <asm/arch/imx-regs.h>
16 #include <asm/imx-common/gpio.h>
17 
18 #define BX50V3_BOOTARGS_EXTRA
19 #if defined(CONFIG_TARGET_GE_B450V3)
20 #define CONFIG_BOARD_NAME	"General Electric B450v3"
21 #elif defined(CONFIG_TARGET_GE_B650V3)
22 #define CONFIG_BOARD_NAME	"General Electric B650v3"
23 #elif defined(CONFIG_TARGET_GE_B850V3)
24 #define CONFIG_BOARD_NAME	"General Electric B850v3"
25 #undef BX50V3_BOOTARGS_EXTRA
26 #define BX50V3_BOOTARGS_EXTRA	"video=DP-1:1024x768@60 " \
27 				"video=HDMI-A-1:1024x768@60 "
28 #else
29 #define CONFIG_BOARD_NAME	"General Electric BA16 Generic"
30 #endif
31 
32 #define CONFIG_MXC_UART_BASE	UART3_BASE
33 #define CONSOLE_DEV	"ttymxc2"
34 
35 #define CONFIG_SUPPORT_EMMC_BOOT
36 
37 
38 #include "mx6_common.h"
39 #include <linux/sizes.h>
40 
41 #define CONFIG_CMDLINE_TAG
42 #define CONFIG_SETUP_MEMORY_TAGS
43 #define CONFIG_INITRD_TAG
44 #define CONFIG_REVISION_TAG
45 #define CONFIG_SYS_MALLOC_LEN		(10 * SZ_1M)
46 
47 #define CONFIG_BOARD_EARLY_INIT_F
48 #define CONFIG_BOARD_LATE_INIT
49 
50 #define CONFIG_MXC_GPIO
51 #define CONFIG_MXC_UART
52 
53 #define CONFIG_CMD_FUSE
54 #define CONFIG_MXC_OCOTP
55 
56 /* SATA Configs */
57 #ifdef CONFIG_CMD_SATA
58 #define CONFIG_DWC_AHSATA
59 #define CONFIG_SYS_SATA_MAX_DEVICE	1
60 #define CONFIG_DWC_AHSATA_PORT_ID	0
61 #define CONFIG_DWC_AHSATA_BASE_ADDR	SATA_ARB_BASE_ADDR
62 #define CONFIG_LBA48
63 #define CONFIG_LIBATA
64 #endif
65 
66 /* MMC Configs */
67 #define CONFIG_FSL_ESDHC
68 #define CONFIG_FSL_USDHC
69 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
70 #define CONFIG_MMC
71 #define CONFIG_GENERIC_MMC
72 #define CONFIG_BOUNCE_BUFFER
73 #define CONFIG_DOS_PARTITION
74 
75 /* USB Configs */
76 #ifdef CONFIG_USB
77 #define CONFIG_USB_EHCI
78 #define CONFIG_USB_EHCI_MX6
79 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
80 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
81 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
82 #define CONFIG_MXC_USB_FLAGS	0
83 #define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
84 
85 #define CONFIG_CI_UDC
86 #define CONFIG_USBD_HS
87 #define CONFIG_USB_GADGET_DUALSPEED
88 #define CONFIG_USB_GADGET
89 #define CONFIG_USB_GADGET_DOWNLOAD
90 #define CONFIG_USB_GADGET_MASS_STORAGE
91 #define CONFIG_USB_FUNCTION_MASS_STORAGE
92 #define CONFIG_USB_GADGET_VBUS_DRAW 2
93 #define CONFIG_G_DNL_VENDOR_NUM   0x0525
94 #define CONFIG_G_DNL_PRODUCT_NUM  0xa4a5
95 #define CONFIG_G_DNL_MANUFACTURER "Advantech"
96 #endif
97 
98 /* Networking Configs */
99 #ifdef CONFIG_NET
100 #define CONFIG_FEC_MXC
101 #define CONFIG_MII
102 #define IMX_FEC_BASE			ENET_BASE_ADDR
103 #define CONFIG_FEC_XCV_TYPE		RGMII
104 #define CONFIG_ETHPRIME		"FEC"
105 #define CONFIG_FEC_MXC_PHYADDR		4
106 #define CONFIG_PHYLIB
107 #define CONFIG_PHY_ATHEROS
108 #endif
109 
110 /* Serial Flash */
111 #ifdef CONFIG_CMD_SF
112 #define CONFIG_MXC_SPI
113 #define CONFIG_SF_DEFAULT_BUS		0
114 #define CONFIG_SF_DEFAULT_CS		0
115 #define CONFIG_SF_DEFAULT_SPEED	20000000
116 #define CONFIG_SF_DEFAULT_MODE		SPI_MODE_0
117 #endif
118 
119 /* allow to overwrite serial and ethaddr */
120 #define CONFIG_ENV_OVERWRITE
121 #define CONFIG_CONS_INDEX	1
122 #define CONFIG_BAUDRATE	115200
123 
124 /* Command definition */
125 #define CONFIG_CMD_BMODE
126 
127 #define CONFIG_LOADADDR	0x12000000
128 #define CONFIG_SYS_TEXT_BASE	0x17800000
129 
130 #define CONFIG_EXTRA_ENV_SETTINGS \
131 	"script=boot.scr\0" \
132 	"image=/boot/uImage\0" \
133 	"uboot=u-boot.imx\0" \
134 	"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
135 	"fdt_addr=0x18000000\0" \
136 	"boot_fdt=yes\0" \
137 	"ip_dyn=yes\0" \
138 	"console=" CONSOLE_DEV "\0" \
139 	"fdt_high=0xffffffff\0"	  \
140 	"initrd_high=0xffffffff\0" \
141 	"sddev=0\0" \
142 	"emmcdev=1\0" \
143 	"partnum=1\0" \
144 	"update_sd_firmware=" \
145 		"if test ${ip_dyn} = yes; then " \
146 			"setenv get_cmd dhcp; " \
147 		"else " \
148 			"setenv get_cmd tftp; " \
149 		"fi; " \
150 		"if mmc dev ${mmcdev}; then "	\
151 			"if ${get_cmd} ${update_sd_firmware_filename}; then " \
152 				"setexpr fw_sz ${filesize} / 0x200; " \
153 				"setexpr fw_sz ${fw_sz} + 1; "	\
154 				"mmc write ${loadaddr} 0x2 ${fw_sz}; " \
155 			"fi; "	\
156 		"fi\0" \
157 	"update_sf_uboot=" \
158 		"if tftp $loadaddr $uboot; then " \
159 			"sf probe; " \
160 			"sf erase 0 0xC0000; " \
161 			"sf write $loadaddr 0x400 $filesize; " \
162 			"echo 'U-Boot upgraded. Please reset'; " \
163 		"fi\0" \
164 	"setargs=setenv bootargs console=${console},${baudrate} " \
165 		"root=/dev/${rootdev} rw rootwait cma=128M " \
166 		BX50V3_BOOTARGS_EXTRA "\0" \
167 	"loadbootscript=" \
168 		"ext2load ${dev} ${devnum}:${partnum} ${loadaddr} ${script};\0" \
169 	"bootscript=echo Running bootscript from ${dev}:${devnum}:${partnum};" \
170 		" source\0" \
171 	"loadimage=" \
172 		"ext2load ${dev} ${devnum}:${partnum} ${loadaddr} ${image}\0" \
173 	"loadfdt=ext2load ${dev} ${devnum}:${partnum} ${fdt_addr} ${fdt_file}\0" \
174 	"tryboot=" \
175 		"if run loadbootscript; then " \
176 			"run bootscript; " \
177 		"else " \
178 			"if run loadimage; then " \
179 				"run doboot; " \
180 			"fi; " \
181 		"fi;\0" \
182 	"doboot=echo Booting from ${dev}:${devnum}:${partnum} ...; " \
183 		"run setargs; " \
184 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
185 			"if run loadfdt; then " \
186 				"bootm ${loadaddr} - ${fdt_addr}; " \
187 			"else " \
188 				"if test ${boot_fdt} = try; then " \
189 					"bootm; " \
190 				"else " \
191 					"echo WARN: Cannot load the DT; " \
192 				"fi; " \
193 			"fi; " \
194 		"else " \
195 			"bootm; " \
196 		"fi;\0" \
197 	"netargs=setenv bootargs console=${console},${baudrate} " \
198 		"root=/dev/nfs " \
199 		"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
200 	"netboot=echo Booting from net ...; " \
201 		"run netargs; " \
202 		"if test ${ip_dyn} = yes; then " \
203 			"setenv get_cmd dhcp; " \
204 		"else " \
205 			"setenv get_cmd tftp; " \
206 		"fi; " \
207 		"${get_cmd} ${image}; " \
208 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
209 			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
210 				"bootm ${loadaddr} - ${fdt_addr}; " \
211 			"else " \
212 				"if test ${boot_fdt} = try; then " \
213 					"bootm; " \
214 				"else " \
215 					"echo WARN: Cannot load the DT; " \
216 				"fi; " \
217 			"fi; " \
218 		"else " \
219 			"bootm; " \
220 		"fi;\0" \
221 
222 #define CONFIG_MMCBOOTCOMMAND \
223 	"setenv dev mmc; " \
224 	"setenv rootdev mmcblk0p${partnum}; " \
225 	\
226 	"setenv devnum ${sddev}; " \
227 	"if mmc dev ${devnum}; then " \
228 		"run tryboot; " \
229 		"setenv rootdev mmcblk1p${partnum}; " \
230 	"fi; " \
231 	\
232 	"setenv devnum ${emmcdev}; " \
233 	"if mmc dev ${devnum}; then " \
234 		"run tryboot; " \
235 	"fi; " \
236 
237 #define CONFIG_USBBOOTCOMMAND \
238 	"usb start; " \
239 	"setenv dev usb; " \
240 	"setenv devnum 0; " \
241 	"setenv rootdev sda${partnum}; " \
242 	"run tryboot; " \
243 	\
244 	CONFIG_MMCBOOTCOMMAND \
245 	"bmode usb; " \
246 
247 #ifdef CONFIG_CMD_USB
248 #define CONFIG_BOOTCOMMAND CONFIG_USBBOOTCOMMAND
249 #else
250 #define CONFIG_BOOTCOMMAND CONFIG_MMCBOOTCOMMAND
251 #endif
252 
253 #define CONFIG_ARP_TIMEOUT     200UL
254 
255 /* Miscellaneous configurable options */
256 #define CONFIG_SYS_LONGHELP
257 #define CONFIG_AUTO_COMPLETE
258 
259 /* Print Buffer Size */
260 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
261 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
262 
263 #define CONFIG_SYS_MEMTEST_START       0x10000000
264 #define CONFIG_SYS_MEMTEST_END         0x10010000
265 #define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
266 
267 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
268 
269 #define CONFIG_CMDLINE_EDITING
270 #define CONFIG_STACKSIZE               (128 * 1024)
271 
272 /* Physical Memory Map */
273 #define CONFIG_NR_DRAM_BANKS           1
274 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
275 
276 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
277 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
278 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
279 
280 #define CONFIG_SYS_INIT_SP_OFFSET \
281 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
282 #define CONFIG_SYS_INIT_SP_ADDR \
283 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
284 
285 /* FLASH and environment organization */
286 #define CONFIG_SYS_NO_FLASH
287 
288 #define CONFIG_ENV_IS_IN_SPI_FLASH
289 #define CONFIG_ENV_SIZE		(8 * 1024)
290 #define CONFIG_ENV_OFFSET		(768 * 1024)
291 #define CONFIG_ENV_SECT_SIZE		(64 * 1024)
292 #define CONFIG_ENV_SPI_BUS		CONFIG_SF_DEFAULT_BUS
293 #define CONFIG_ENV_SPI_CS		CONFIG_SF_DEFAULT_CS
294 #define CONFIG_ENV_SPI_MODE		CONFIG_SF_DEFAULT_MODE
295 #define CONFIG_ENV_SPI_MAX_HZ		CONFIG_SF_DEFAULT_SPEED
296 
297 #ifndef CONFIG_SYS_DCACHE_OFF
298 #endif
299 
300 #define CONFIG_SYS_FSL_USDHC_NUM	3
301 
302 /* Framebuffer */
303 #ifdef CONFIG_VIDEO
304 #define CONFIG_VIDEO_IPUV3
305 #define CONFIG_VIDEO_BMP_RLE8
306 #define CONFIG_SPLASH_SCREEN
307 #define CONFIG_SPLASH_SCREEN_ALIGN
308 #define CONFIG_BMP_16BPP
309 #define CONFIG_VIDEO_LOGO
310 #define CONFIG_VIDEO_BMP_LOGO
311 #define CONFIG_IPUV3_CLK 260000000
312 #define CONFIG_IMX_HDMI
313 #define CONFIG_IMX_VIDEO_SKIP
314 #endif
315 
316 #define CONFIG_PWM_IMX
317 #define CONFIG_IMX6_PWM_PER_CLK	66000000
318 
319 #undef CONFIG_CMD_PCI
320 #ifdef CONFIG_CMD_PCI
321 #define CONFIG_PCI_SCAN_SHOW
322 #define CONFIG_PCIE_IMX
323 #define CONFIG_PCIE_IMX_PERST_GPIO	IMX_GPIO_NR(7, 12)
324 #define CONFIG_PCIE_IMX_POWER_GPIO	IMX_GPIO_NR(1, 5)
325 #endif
326 
327 /* I2C Configs */
328 #define CONFIG_SYS_I2C
329 #define CONFIG_SYS_I2C_MXC
330 #define CONFIG_SYS_I2C_SPEED		  100000
331 #define CONFIG_SYS_I2C_MXC_I2C1
332 #define CONFIG_SYS_I2C_MXC_I2C2
333 #define CONFIG_SYS_I2C_MXC_I2C3
334 
335 #endif	/* __GE_BX50V3_CONFIG_H */
336