xref: /openbmc/u-boot/include/configs/warp.h (revision ed09a554)
1 /*
2  * Copyright (C) 2014 O.S. Systems Software LTDA.
3  * Copyright (C) 2014 Kynetics LLC.
4  * Copyright (C) 2014 Revolution Robotics, Inc.
5  *
6  * Author: Otavio Salvador <otavio@ossystems.com.br>
7  *
8  * Configuration settings for the WaRP Board
9  *
10  * SPDX-License-Identifier:	GPL-2.0+
11  */
12 
13 #ifndef __CONFIG_H
14 #define __CONFIG_H
15 
16 #include <asm/arch/imx-regs.h>
17 #include <linux/sizes.h>
18 #include "mx6_common.h"
19 
20 #define CONFIG_MX6
21 #define CONFIG_DISPLAY_CPUINFO
22 #define CONFIG_DISPLAY_BOARDINFO
23 #define CONFIG_SYS_GENERIC_BOARD
24 
25 #define CONFIG_CMDLINE_TAG
26 #define CONFIG_SETUP_MEMORY_TAGS
27 #define CONFIG_INITRD_TAG
28 #define CONFIG_REVISION_TAG
29 
30 /* Size of malloc() pool */
31 #define CONFIG_SYS_MALLOC_LEN		(35 * SZ_1M) /* Increase due to DFU */
32 
33 #define CONFIG_BOARD_EARLY_INIT_F
34 #define CONFIG_BOARD_LATE_INIT
35 #define CONFIG_MXC_GPIO
36 
37 #define CONFIG_MXC_UART
38 #define CONFIG_MXC_UART_BASE		UART1_IPS_BASE_ADDR
39 
40 /* MMC Configs */
41 #define CONFIG_FSL_ESDHC
42 #define CONFIG_FSL_USDHC
43 #define CONFIG_SYS_FSL_ESDHC_ADDR	0
44 #define CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT
45 #define CONFIG_SYS_FSL_ESDHC_HAS_DDR_MODE
46 
47 #define CONFIG_MMC
48 #define CONFIG_CMD_MMC
49 #define CONFIG_GENERIC_MMC
50 #define CONFIG_BOUNCE_BUFFER
51 #define CONFIG_CMD_EXT2
52 #define CONFIG_CMD_EXT4
53 #define CONFIG_CMD_EXT4_WRITE
54 #define CONFIG_CMD_FAT
55 #define CONFIG_DOS_PARTITION
56 
57 /* allow to overwrite serial and ethaddr */
58 #define CONFIG_ENV_OVERWRITE
59 #define CONFIG_CONS_INDEX		1
60 #define CONFIG_BAUDRATE			115200
61 
62 /* FLASH and environment organization */
63 #define CONFIG_SYS_NO_FLASH
64 
65 /* Command definition */
66 #include <config_cmd_default.h>
67 #undef CONFIG_CMD_NET
68 #undef CONFIG_CMD_NFS
69 
70 #define CONFIG_BOOTDELAY		3
71 
72 #define CONFIG_LOADADDR			0x82000000
73 #define CONFIG_SYS_TEXT_BASE		0x87800000
74 
75 /* Miscellaneous configurable options */
76 #define CONFIG_SYS_LONGHELP
77 #define CONFIG_SYS_HUSH_PARSER
78 #define CONFIG_AUTO_COMPLETE
79 #define CONFIG_SYS_CBSIZE		256
80 
81 /* Watchdog */
82 #define CONFIG_HW_WATCHDOG
83 #define CONFIG_IMX_WATCHDOG
84 #define CONFIG_WATCHDOG_TIMEOUT_MSECS 30000 /* 30s */
85 #define CONFIG_SYS_MAXARGS		16
86 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
87 
88 #define CONFIG_SYS_MEMTEST_START	0x80000000
89 #define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + SZ_256M)
90 
91 #define CONFIG_SYS_LOAD_ADDR		CONFIG_LOADADDR
92 
93 #define CONFIG_CMDLINE_EDITING
94 #define CONFIG_STACKSIZE		SZ_128K
95 
96 /* Physical Memory Map */
97 #define CONFIG_NR_DRAM_BANKS		1
98 #define PHYS_SDRAM			MMDC0_ARB_BASE_ADDR
99 #define PHYS_SDRAM_SIZE			SZ_512M
100 
101 #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM
102 #define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR
103 #define CONFIG_SYS_INIT_RAM_SIZE	IRAM_SIZE
104 
105 #define CONFIG_SYS_INIT_SP_OFFSET \
106 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
107 #define CONFIG_SYS_INIT_SP_ADDR \
108 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
109 
110 #define CONFIG_ENV_OFFSET		(6 * SZ_64K)
111 #define CONFIG_ENV_SIZE			SZ_8K
112 #define CONFIG_ENV_IS_IN_MMC
113 #define CONFIG_SYS_MMC_ENV_DEV		0
114 
115 /* VDD voltage 1.65 - 1.95 */
116 #define CONFIG_SYS_SD_VOLTAGE		0x00000080
117 
118 #define CONFIG_OF_LIBFDT
119 #define CONFIG_CMD_BOOTZ
120 
121 #ifndef CONFIG_SYS_DCACHE_OFF
122 #define CONFIG_CMD_CACHE
123 #endif
124 
125 /* USB Configs */
126 #define CONFIG_CMD_USB
127 #ifdef CONFIG_CMD_USB
128 #define CONFIG_USB_EHCI
129 #define CONFIG_USB_EHCI_MX6
130 #define CONFIG_USB_STORAGE
131 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
132 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
133 #define CONFIG_MXC_USB_FLAGS		0
134 #define CONFIG_USB_MAX_CONTROLLER_COUNT	1 /* Only OTG2 port enabled */
135 #endif
136 
137 #define CONFIG_CI_UDC
138 #define CONFIG_USBD_HS
139 #define CONFIG_USB_GADGET_DUALSPEED
140 
141 #define CONFIG_USB_GADGET
142 #define CONFIG_CMD_USB_MASS_STORAGE
143 #define CONFIG_USB_GADGET_MASS_STORAGE
144 #define CONFIG_USBDOWNLOAD_GADGET
145 #define CONFIG_USB_GADGET_VBUS_DRAW	2
146 
147 #define CONFIG_G_DNL_VENDOR_NUM		0x0525
148 #define CONFIG_G_DNL_PRODUCT_NUM	0xa4a5
149 #define CONFIG_G_DNL_MANUFACTURER	"FSL"
150 
151 #define CONFIG_CMD_DFU
152 #define CONFIG_DFU_FUNCTION
153 #define CONFIG_DFU_MMC
154 #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
155 #define DFU_DEFAULT_POLL_TIMEOUT 300
156 
157 #define CONFIG_EXTRA_ENV_SETTINGS \
158 	"script=boot.scr\0" \
159 	"image=zImage\0" \
160 	"console=ttymxc0\0" \
161 	"fdt_high=0xffffffff\0" \
162 	"initrd_high=0xffffffff\0" \
163 	"fdt_file=imx6sl-warp.dtb\0" \
164 	"fdt_addr=0x88000000\0" \
165 	"initrd_addr=0x83800000\0" \
166 	"boot_fdt=try\0" \
167 	"ip_dyn=yes\0" \
168 	"mmcdev=0\0" \
169 	"mmcpart=1\0" \
170 	"mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
171 	"dfu_alt_info=boot raw 0x2 0x400 mmcpart 1\0" \
172 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
173 		"root=${mmcroot}\0" \
174 	"loadbootscript=" \
175 		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
176 	"bootscript=echo Running bootscript from mmc ...; " \
177 		"source\0" \
178 	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
179 	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
180 	"mmcboot=echo Booting from mmc ...; " \
181 		"run mmcargs; " \
182 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
183 			"if run loadfdt; then " \
184 				"bootz ${loadaddr} - ${fdt_addr}; " \
185 			"else " \
186 				"if test ${boot_fdt} = try; then " \
187 					"bootz; " \
188 				"else " \
189 					"echo WARN: Cannot load the DT; " \
190 				"fi; " \
191 			"fi; " \
192 		"else " \
193 			"bootz; " \
194 		"fi;\0" \
195 	"netargs=setenv bootargs console=${console},${baudrate} " \
196 		"root=/dev/nfs " \
197 	"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
198 		"netboot=echo Booting from net ...; " \
199 		"run netargs; " \
200 		"if test ${ip_dyn} = yes; then " \
201 			"setenv get_cmd dhcp; " \
202 		"else " \
203 			"setenv get_cmd tftp; " \
204 		"fi; " \
205 		"${get_cmd} ${image}; " \
206 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
207 			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
208 				"bootz ${loadaddr} - ${fdt_addr}; " \
209 			"else " \
210 				"if test ${boot_fdt} = try; then " \
211 					"bootz; " \
212 				"else " \
213 					"echo WARN: Cannot load the DT; " \
214 				"fi; " \
215 			"fi; " \
216 		"else " \
217 			"bootz; " \
218 		"fi;\0"
219 
220 #define CONFIG_BOOTCOMMAND \
221 	   "mmc dev ${mmcdev};" \
222 	   "mmc dev ${mmcdev}; if mmc rescan; then " \
223 		   "if run loadbootscript; then " \
224 			   "run bootscript; " \
225 		   "else " \
226 			   "if run loadimage; then " \
227 				   "run mmcboot; " \
228 			   "else run netboot; " \
229 			   "fi; " \
230 		   "fi; " \
231 	   "else run netboot; fi"
232 
233 #endif				/* __CONFIG_H */
234