]> git.ipfire.org Git - people/ms/u-boot.git/blob - include/configs/warp.h
warp: Add USB Mass Storage support
[people/ms/u-boot.git] / include / configs / warp.h
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 (3 * SZ_1M)
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
46 #define CONFIG_MMC
47 #define CONFIG_CMD_MMC
48 #define CONFIG_GENERIC_MMC
49 #define CONFIG_CMD_FAT
50 #define CONFIG_DOS_PARTITION
51
52 /* allow to overwrite serial and ethaddr */
53 #define CONFIG_ENV_OVERWRITE
54 #define CONFIG_CONS_INDEX 1
55 #define CONFIG_BAUDRATE 115200
56
57 /* FLASH and environment organization */
58 #define CONFIG_SYS_NO_FLASH
59
60 /* Command definition */
61 #include <config_cmd_default.h>
62 #undef CONFIG_CMD_NET
63 #undef CONFIG_CMD_NFS
64
65 #define CONFIG_BOOTDELAY 3
66
67 #define CONFIG_LOADADDR 0x82000000
68 #define CONFIG_SYS_TEXT_BASE 0x87800000
69
70 /* Miscellaneous configurable options */
71 #define CONFIG_SYS_LONGHELP
72 #define CONFIG_SYS_HUSH_PARSER
73 #define CONFIG_AUTO_COMPLETE
74 #define CONFIG_SYS_CBSIZE 256
75
76 /* Watchdog */
77 #define CONFIG_HW_WATCHDOG
78 #define CONFIG_IMX_WATCHDOG
79 #define CONFIG_WATCHDOG_TIMEOUT_MSECS 30000 /* 30s */
80
81 /* Print Buffer Size */
82 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
83 #define CONFIG_SYS_MAXARGS 16
84 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
85
86 #define CONFIG_SYS_MEMTEST_START 0x80000000
87 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + SZ_256M)
88
89 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
90
91 #define CONFIG_CMDLINE_EDITING
92 #define CONFIG_STACKSIZE SZ_128K
93
94 /* Physical Memory Map */
95 #define CONFIG_NR_DRAM_BANKS 1
96 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
97 #define PHYS_SDRAM_SIZE SZ_512M
98
99 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
100 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
101 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
102
103 #define CONFIG_SYS_INIT_SP_OFFSET \
104 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
105 #define CONFIG_SYS_INIT_SP_ADDR \
106 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
107
108 #define CONFIG_ENV_OFFSET (6 * SZ_64K)
109 #define CONFIG_ENV_SIZE SZ_8K
110 #define CONFIG_ENV_IS_IN_MMC
111 #define CONFIG_SYS_MMC_ENV_DEV 0
112
113 /* VDD voltage 1.65 - 1.95 */
114 #define CONFIG_SYS_SD_VOLTAGE 0x00000080
115
116 #define CONFIG_OF_LIBFDT
117 #define CONFIG_CMD_BOOTZ
118
119 #ifndef CONFIG_SYS_DCACHE_OFF
120 #define CONFIG_CMD_CACHE
121 #endif
122
123 /* USB Configs */
124 #define CONFIG_CMD_USB
125 #ifdef CONFIG_CMD_USB
126 #define CONFIG_USB_EHCI
127 #define CONFIG_USB_EHCI_MX6
128 #define CONFIG_USB_STORAGE
129 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
130 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
131 #define CONFIG_MXC_USB_FLAGS 0
132 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 /* Only OTG2 port enabled */
133 #endif
134
135 #define CONFIG_CI_UDC
136 #define CONFIG_USBD_HS
137 #define CONFIG_USB_GADGET_DUALSPEED
138
139 #define CONFIG_USB_GADGET
140 #define CONFIG_CMD_USB_MASS_STORAGE
141 #define CONFIG_USB_GADGET_MASS_STORAGE
142 #define CONFIG_USBDOWNLOAD_GADGET
143 #define CONFIG_USB_GADGET_VBUS_DRAW 2
144
145 #define CONFIG_G_DNL_VENDOR_NUM 0x0525
146 #define CONFIG_G_DNL_PRODUCT_NUM 0xa4a5
147 #define CONFIG_G_DNL_MANUFACTURER "FSL"
148
149 #define CONFIG_EXTRA_ENV_SETTINGS \
150 "script=boot.scr\0" \
151 "image=zImage\0" \
152 "console=ttymxc0\0" \
153 "fdt_high=0xffffffff\0" \
154 "initrd_high=0xffffffff\0" \
155 "fdt_file=imx6sl-warp.dtb\0" \
156 "fdt_addr=0x88000000\0" \
157 "initrd_addr=0x83800000\0" \
158 "boot_fdt=try\0" \
159 "ip_dyn=yes\0" \
160 "mmcdev=0\0" \
161 "mmcpart=1\0" \
162 "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
163 "mmcargs=setenv bootargs console=${console},${baudrate} " \
164 "root=${mmcroot}\0" \
165 "loadbootscript=" \
166 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
167 "bootscript=echo Running bootscript from mmc ...; " \
168 "source\0" \
169 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
170 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
171 "mmcboot=echo Booting from mmc ...; " \
172 "run mmcargs; " \
173 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
174 "if run loadfdt; then " \
175 "bootz ${loadaddr} - ${fdt_addr}; " \
176 "else " \
177 "if test ${boot_fdt} = try; then " \
178 "bootz; " \
179 "else " \
180 "echo WARN: Cannot load the DT; " \
181 "fi; " \
182 "fi; " \
183 "else " \
184 "bootz; " \
185 "fi;\0" \
186 "netargs=setenv bootargs console=${console},${baudrate} " \
187 "root=/dev/nfs " \
188 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
189 "netboot=echo Booting from net ...; " \
190 "run netargs; " \
191 "if test ${ip_dyn} = yes; then " \
192 "setenv get_cmd dhcp; " \
193 "else " \
194 "setenv get_cmd tftp; " \
195 "fi; " \
196 "${get_cmd} ${image}; " \
197 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
198 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
199 "bootz ${loadaddr} - ${fdt_addr}; " \
200 "else " \
201 "if test ${boot_fdt} = try; then " \
202 "bootz; " \
203 "else " \
204 "echo WARN: Cannot load the DT; " \
205 "fi; " \
206 "fi; " \
207 "else " \
208 "bootz; " \
209 "fi;\0"
210
211 #define CONFIG_BOOTCOMMAND \
212 "mmc dev ${mmcdev};" \
213 "mmc dev ${mmcdev}; if mmc rescan; then " \
214 "if run loadbootscript; then " \
215 "run bootscript; " \
216 "else " \
217 "if run loadimage; then " \
218 "run mmcboot; " \
219 "else run netboot; " \
220 "fi; " \
221 "fi; " \
222 "else run netboot; fi"
223
224 #endif /* __CONFIG_H */