xref: /openbmc/u-boot/include/configs/mx6sabre_common.h (revision a2bc4321e49fa90933029596dd5fa322aad99de4)
1 /*
2  * Copyright (C) 2012 Freescale Semiconductor, Inc.
3  *
4  * Configuration settings for the Freescale i.MX6Q SabreSD board.
5  *
6  * SPDX-License-Identifier:	GPL-2.0+
7  */
8 
9 #ifndef __MX6QSABRE_COMMON_CONFIG_H
10 #define __MX6QSABRE_COMMON_CONFIG_H
11 
12 #define CONFIG_MX6
13 
14 #include "mx6_common.h"
15 #include <linux/sizes.h>
16 
17 #define CONFIG_DISPLAY_CPUINFO
18 #define CONFIG_DISPLAY_BOARDINFO
19 
20 #include <asm/arch/imx-regs.h>
21 #include <asm/imx-common/gpio.h>
22 
23 #define CONFIG_CMDLINE_TAG
24 #define CONFIG_SETUP_MEMORY_TAGS
25 #define CONFIG_INITRD_TAG
26 #define CONFIG_REVISION_TAG
27 
28 #define CONFIG_IMX6_THERMAL
29 
30 #define CONFIG_SYS_GENERIC_BOARD
31 
32 /* Size of malloc() pool */
33 #define CONFIG_SYS_MALLOC_LEN		(10 * SZ_1M)
34 
35 #define CONFIG_BOARD_EARLY_INIT_F
36 #define CONFIG_BOARD_LATE_INIT
37 #define CONFIG_MXC_GPIO
38 
39 #define CONFIG_MXC_UART
40 
41 #define CONFIG_CMD_FUSE
42 #if defined(CONFIG_CMD_FUSE) || defined(CONFIG_IMX6_THERMAL)
43 #define CONFIG_MXC_OCOTP
44 #endif
45 
46 /* MMC Configs */
47 #define CONFIG_FSL_ESDHC
48 #define CONFIG_FSL_USDHC
49 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
50 
51 #define CONFIG_MMC
52 #define CONFIG_CMD_MMC
53 #define CONFIG_GENERIC_MMC
54 #define CONFIG_BOUNCE_BUFFER
55 #define CONFIG_CMD_EXT2
56 #define CONFIG_CMD_EXT4
57 #define CONFIG_CMD_EXT4_WRITE
58 #define CONFIG_CMD_FAT
59 #define CONFIG_DOS_PARTITION
60 
61 #define CONFIG_CMD_PING
62 #define CONFIG_CMD_DHCP
63 #define CONFIG_CMD_MII
64 #define CONFIG_CMD_NET
65 #define CONFIG_FEC_MXC
66 #define CONFIG_MII
67 #define IMX_FEC_BASE			ENET_BASE_ADDR
68 #define CONFIG_FEC_XCV_TYPE		RGMII
69 #define CONFIG_ETHPRIME			"FEC"
70 #define CONFIG_FEC_MXC_PHYADDR		1
71 
72 #define CONFIG_PHYLIB
73 #define CONFIG_PHY_ATHEROS
74 
75 #define CONFIG_CMD_SF
76 #ifdef CONFIG_CMD_SF
77 #define CONFIG_SPI_FLASH
78 #define CONFIG_SPI_FLASH_STMICRO
79 #define CONFIG_MXC_SPI
80 #define CONFIG_SF_DEFAULT_BUS		0
81 #define CONFIG_SF_DEFAULT_CS		0
82 #define CONFIG_SF_DEFAULT_SPEED		20000000
83 #define CONFIG_SF_DEFAULT_MODE		SPI_MODE_0
84 #endif
85 
86 /* allow to overwrite serial and ethaddr */
87 #define CONFIG_ENV_OVERWRITE
88 #define CONFIG_CONS_INDEX              1
89 #define CONFIG_BAUDRATE                        115200
90 
91 /* Command definition */
92 #include <config_cmd_default.h>
93 
94 #define CONFIG_CMD_BMODE
95 #define CONFIG_CMD_BOOTZ
96 #define CONFIG_CMD_SETEXPR
97 #undef CONFIG_CMD_IMLS
98 
99 #define CONFIG_BOOTDELAY               1
100 
101 #define CONFIG_LOADADDR                        0x12000000
102 #define CONFIG_SYS_TEXT_BASE           0x17800000
103 
104 #ifdef CONFIG_SUPPORT_EMMC_BOOT
105 #define EMMC_ENV \
106 	"emmcdev=2\0" \
107 	"update_emmc_firmware=" \
108 		"if test ${ip_dyn} = yes; then " \
109 			"setenv get_cmd dhcp; " \
110 		"else " \
111 			"setenv get_cmd tftp; " \
112 		"fi; " \
113 		"if ${get_cmd} ${update_sd_firmware_filename}; then " \
114 			"if mmc dev ${emmcdev} && " \
115 				"mmc open ${emmcdev} 1; then "	\
116 				"setexpr fw_sz ${filesize} / 0x200; " \
117 				"setexpr fw_sz ${fw_sz} + 1; "	\
118 				"mmc write ${loadaddr} 0x2 ${fw_sz}; " \
119 				"mmc close ${emmcdev} 1; " \
120 			"fi; "	\
121 		"fi\0"
122 #else
123 #define EMMC_ENV ""
124 #endif
125 
126 #define CONFIG_EXTRA_ENV_SETTINGS \
127 	"script=boot.scr\0" \
128 	"image=zImage\0" \
129 	"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
130 	"fdt_addr=0x18000000\0" \
131 	"boot_fdt=try\0" \
132 	"ip_dyn=yes\0" \
133 	"console=" CONFIG_CONSOLE_DEV "\0" \
134 	"fdt_high=0xffffffff\0"	  \
135 	"initrd_high=0xffffffff\0" \
136 	"mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
137 	"mmcpart=1\0" \
138 	"mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
139 	"update_sd_firmware=" \
140 		"if test ${ip_dyn} = yes; then " \
141 			"setenv get_cmd dhcp; " \
142 		"else " \
143 			"setenv get_cmd tftp; " \
144 		"fi; " \
145 		"if mmc dev ${mmcdev}; then "	\
146 			"if ${get_cmd} ${update_sd_firmware_filename}; then " \
147 				"setexpr fw_sz ${filesize} / 0x200; " \
148 				"setexpr fw_sz ${fw_sz} + 1; "	\
149 				"mmc write ${loadaddr} 0x2 ${fw_sz}; " \
150 			"fi; "	\
151 		"fi\0" \
152 	EMMC_ENV	  \
153 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
154 		"root=${mmcroot}\0" \
155 	"loadbootscript=" \
156 		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
157 	"bootscript=echo Running bootscript from mmc ...; " \
158 		"source\0" \
159 	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
160 	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
161 	"mmcboot=echo Booting from mmc ...; " \
162 		"run mmcargs; " \
163 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
164 			"if run loadfdt; then " \
165 				"bootz ${loadaddr} - ${fdt_addr}; " \
166 			"else " \
167 				"if test ${boot_fdt} = try; then " \
168 					"bootz; " \
169 				"else " \
170 					"echo WARN: Cannot load the DT; " \
171 				"fi; " \
172 			"fi; " \
173 		"else " \
174 			"bootz; " \
175 		"fi;\0" \
176 	"netargs=setenv bootargs console=${console},${baudrate} " \
177 		"root=/dev/nfs " \
178 		"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
179 	"netboot=echo Booting from net ...; " \
180 		"run netargs; " \
181 		"if test ${ip_dyn} = yes; then " \
182 			"setenv get_cmd dhcp; " \
183 		"else " \
184 			"setenv get_cmd tftp; " \
185 		"fi; " \
186 		"${get_cmd} ${image}; " \
187 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
188 			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
189 				"bootz ${loadaddr} - ${fdt_addr}; " \
190 			"else " \
191 				"if test ${boot_fdt} = try; then " \
192 					"bootz; " \
193 				"else " \
194 					"echo WARN: Cannot load the DT; " \
195 				"fi; " \
196 			"fi; " \
197 		"else " \
198 			"bootz; " \
199 		"fi;\0"
200 
201 #define CONFIG_BOOTCOMMAND \
202 	"mmc dev ${mmcdev};" \
203 	"if mmc rescan; then " \
204 		"if run loadbootscript; then " \
205 		"run bootscript; " \
206 		"else " \
207 			"if run loadimage; then " \
208 				"run mmcboot; " \
209 			"else run netboot; " \
210 			"fi; " \
211 		"fi; " \
212 	"else run netboot; fi"
213 
214 #define CONFIG_ARP_TIMEOUT     200UL
215 
216 /* Miscellaneous configurable options */
217 #define CONFIG_SYS_LONGHELP
218 #define CONFIG_SYS_HUSH_PARSER
219 #define CONFIG_SYS_PROMPT_HUSH_PS2     "> "
220 #define CONFIG_AUTO_COMPLETE
221 #define CONFIG_SYS_CBSIZE              256
222 #define CONFIG_SYS_MAXARGS             16
223 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
224 
225 #define CONFIG_SYS_MEMTEST_START       0x10000000
226 #define CONFIG_SYS_MEMTEST_END         0x10010000
227 #define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
228 
229 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
230 
231 #define CONFIG_CMDLINE_EDITING
232 #define CONFIG_STACKSIZE               (128 * 1024)
233 
234 /* Physical Memory Map */
235 #define CONFIG_NR_DRAM_BANKS           1
236 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
237 
238 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
239 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
240 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
241 
242 #define CONFIG_SYS_INIT_SP_OFFSET \
243 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
244 #define CONFIG_SYS_INIT_SP_ADDR \
245 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
246 
247 /* FLASH and environment organization */
248 #define CONFIG_SYS_NO_FLASH
249 
250 #define CONFIG_ENV_SIZE			(8 * 1024)
251 
252 #define CONFIG_ENV_IS_IN_MMC
253 
254 #if defined(CONFIG_ENV_IS_IN_MMC)
255 #define CONFIG_ENV_OFFSET		(8 * 64 * 1024)
256 #endif
257 
258 #define CONFIG_OF_LIBFDT
259 
260 #ifndef CONFIG_SYS_DCACHE_OFF
261 #define CONFIG_CMD_CACHE
262 #endif
263 
264 /* Framebuffer */
265 #define CONFIG_VIDEO
266 #define CONFIG_VIDEO_IPUV3
267 #define CONFIG_CFB_CONSOLE
268 #define CONFIG_VGA_AS_SINGLE_DEVICE
269 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
270 #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
271 #define CONFIG_VIDEO_BMP_RLE8
272 #define CONFIG_SPLASH_SCREEN
273 #define CONFIG_SPLASH_SCREEN_ALIGN
274 #define CONFIG_BMP_16BPP
275 #define CONFIG_VIDEO_LOGO
276 #define CONFIG_VIDEO_BMP_LOGO
277 #define CONFIG_IPUV3_CLK 260000000
278 #define CONFIG_IMX_HDMI
279 #define CONFIG_IMX_VIDEO_SKIP
280 
281 #define CONFIG_CI_UDC
282 #define CONFIG_USBD_HS
283 #define CONFIG_USB_GADGET_DUALSPEED
284 
285 #define CONFIG_USB_GADGET
286 #define CONFIG_CMD_USB_MASS_STORAGE
287 #define CONFIG_USB_GADGET_MASS_STORAGE
288 #define CONFIG_USBDOWNLOAD_GADGET
289 #define CONFIG_USB_GADGET_VBUS_DRAW	2
290 
291 #define CONFIG_G_DNL_VENDOR_NUM		0x0525
292 #define CONFIG_G_DNL_PRODUCT_NUM	0xa4a5
293 #define CONFIG_G_DNL_MANUFACTURER	"FSL"
294 
295 #endif                         /* __MX6QSABRE_COMMON_CONFIG_H */
296