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 #include "mx6_common.h"
13 
14 #define CONFIG_IMX6_THERMAL
15 
16 /* Size of malloc() pool */
17 #define CONFIG_SYS_MALLOC_LEN		(10 * SZ_1M)
18 
19 #define CONFIG_BOARD_EARLY_INIT_F
20 #define CONFIG_BOARD_LATE_INIT
21 
22 #define CONFIG_MXC_UART
23 
24 #define CONFIG_CMD_FUSE
25 #if defined(CONFIG_CMD_FUSE) || defined(CONFIG_IMX6_THERMAL)
26 #define CONFIG_MXC_OCOTP
27 #endif
28 
29 /* MMC Configs */
30 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
31 
32 #define CONFIG_CMD_PING
33 #define CONFIG_CMD_DHCP
34 #define CONFIG_CMD_MII
35 #define CONFIG_CMD_NET
36 #define CONFIG_FEC_MXC
37 #define CONFIG_MII
38 #define IMX_FEC_BASE			ENET_BASE_ADDR
39 #define CONFIG_FEC_XCV_TYPE		RGMII
40 #define CONFIG_ETHPRIME			"FEC"
41 #define CONFIG_FEC_MXC_PHYADDR		1
42 
43 #define CONFIG_PHYLIB
44 #define CONFIG_PHY_ATHEROS
45 
46 #define CONFIG_CMD_SF
47 #ifdef CONFIG_CMD_SF
48 #define CONFIG_SPI_FLASH
49 #define CONFIG_SPI_FLASH_STMICRO
50 #define CONFIG_MXC_SPI
51 #define CONFIG_SF_DEFAULT_BUS		0
52 #define CONFIG_SF_DEFAULT_CS		0
53 #define CONFIG_SF_DEFAULT_SPEED		20000000
54 #define CONFIG_SF_DEFAULT_MODE		SPI_MODE_0
55 #endif
56 
57 /* Command definition */
58 #define CONFIG_CMD_BMODE
59 #define CONFIG_CMD_SETEXPR
60 
61 #ifdef CONFIG_SUPPORT_EMMC_BOOT
62 #define EMMC_ENV \
63 	"emmcdev=2\0" \
64 	"update_emmc_firmware=" \
65 		"if test ${ip_dyn} = yes; then " \
66 			"setenv get_cmd dhcp; " \
67 		"else " \
68 			"setenv get_cmd tftp; " \
69 		"fi; " \
70 		"if ${get_cmd} ${update_sd_firmware_filename}; then " \
71 			"if mmc dev ${emmcdev} 1; then "	\
72 				"setexpr fw_sz ${filesize} / 0x200; " \
73 				"setexpr fw_sz ${fw_sz} + 1; "	\
74 				"mmc write ${loadaddr} 0x2 ${fw_sz}; " \
75 			"fi; "	\
76 		"fi\0"
77 #else
78 #define EMMC_ENV ""
79 #endif
80 
81 #define CONFIG_EXTRA_ENV_SETTINGS \
82 	"script=boot.scr\0" \
83 	"image=zImage\0" \
84 	"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
85 	"fdt_addr=0x18000000\0" \
86 	"boot_fdt=try\0" \
87 	"ip_dyn=yes\0" \
88 	"console=" CONFIG_CONSOLE_DEV "\0" \
89 	"fdt_high=0xffffffff\0"	  \
90 	"initrd_high=0xffffffff\0" \
91 	"mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
92 	"mmcpart=1\0" \
93 	"mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
94 	"update_sd_firmware=" \
95 		"if test ${ip_dyn} = yes; then " \
96 			"setenv get_cmd dhcp; " \
97 		"else " \
98 			"setenv get_cmd tftp; " \
99 		"fi; " \
100 		"if mmc dev ${mmcdev}; then "	\
101 			"if ${get_cmd} ${update_sd_firmware_filename}; then " \
102 				"setexpr fw_sz ${filesize} / 0x200; " \
103 				"setexpr fw_sz ${fw_sz} + 1; "	\
104 				"mmc write ${loadaddr} 0x2 ${fw_sz}; " \
105 			"fi; "	\
106 		"fi\0" \
107 	EMMC_ENV	  \
108 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
109 		"root=${mmcroot}\0" \
110 	"loadbootscript=" \
111 		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
112 	"bootscript=echo Running bootscript from mmc ...; " \
113 		"source\0" \
114 	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
115 	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
116 	"mmcboot=echo Booting from mmc ...; " \
117 		"run mmcargs; " \
118 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
119 			"if run loadfdt; then " \
120 				"bootz ${loadaddr} - ${fdt_addr}; " \
121 			"else " \
122 				"if test ${boot_fdt} = try; then " \
123 					"bootz; " \
124 				"else " \
125 					"echo WARN: Cannot load the DT; " \
126 				"fi; " \
127 			"fi; " \
128 		"else " \
129 			"bootz; " \
130 		"fi;\0" \
131 	"netargs=setenv bootargs console=${console},${baudrate} " \
132 		"root=/dev/nfs " \
133 		"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
134 	"netboot=echo Booting from net ...; " \
135 		"run netargs; " \
136 		"if test ${ip_dyn} = yes; then " \
137 			"setenv get_cmd dhcp; " \
138 		"else " \
139 			"setenv get_cmd tftp; " \
140 		"fi; " \
141 		"${get_cmd} ${image}; " \
142 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
143 			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
144 				"bootz ${loadaddr} - ${fdt_addr}; " \
145 			"else " \
146 				"if test ${boot_fdt} = try; then " \
147 					"bootz; " \
148 				"else " \
149 					"echo WARN: Cannot load the DT; " \
150 				"fi; " \
151 			"fi; " \
152 		"else " \
153 			"bootz; " \
154 		"fi;\0"
155 
156 #define CONFIG_BOOTCOMMAND \
157 	"mmc dev ${mmcdev};" \
158 	"if mmc rescan; then " \
159 		"if run loadbootscript; then " \
160 		"run bootscript; " \
161 		"else " \
162 			"if run loadimage; then " \
163 				"run mmcboot; " \
164 			"else run netboot; " \
165 			"fi; " \
166 		"fi; " \
167 	"else run netboot; fi"
168 
169 #define CONFIG_ARP_TIMEOUT     200UL
170 
171 #define CONFIG_SYS_MEMTEST_START       0x10000000
172 #define CONFIG_SYS_MEMTEST_END         0x10010000
173 #define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
174 
175 #define CONFIG_STACKSIZE               (128 * 1024)
176 
177 /* Physical Memory Map */
178 #define CONFIG_NR_DRAM_BANKS           1
179 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
180 
181 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
182 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
183 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
184 
185 #define CONFIG_SYS_INIT_SP_OFFSET \
186 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
187 #define CONFIG_SYS_INIT_SP_ADDR \
188 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
189 
190 /* Environment organization */
191 #define CONFIG_ENV_SIZE			(8 * 1024)
192 
193 #define CONFIG_ENV_IS_IN_MMC
194 
195 #if defined(CONFIG_ENV_IS_IN_MMC)
196 #define CONFIG_ENV_OFFSET		(8 * 64 * 1024)
197 #endif
198 
199 /* Framebuffer */
200 #define CONFIG_VIDEO
201 #define CONFIG_VIDEO_IPUV3
202 #define CONFIG_CFB_CONSOLE
203 #define CONFIG_VGA_AS_SINGLE_DEVICE
204 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
205 #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
206 #define CONFIG_VIDEO_BMP_RLE8
207 #define CONFIG_SPLASH_SCREEN
208 #define CONFIG_SPLASH_SCREEN_ALIGN
209 #define CONFIG_BMP_16BPP
210 #define CONFIG_VIDEO_LOGO
211 #define CONFIG_VIDEO_BMP_LOGO
212 #define CONFIG_IPUV3_CLK 260000000
213 #define CONFIG_IMX_HDMI
214 #define CONFIG_IMX_VIDEO_SKIP
215 
216 #ifndef CONFIG_SPL
217 #define CONFIG_CI_UDC
218 #define CONFIG_USBD_HS
219 #define CONFIG_USB_GADGET_DUALSPEED
220 
221 #define CONFIG_USB_GADGET
222 #define CONFIG_CMD_USB_MASS_STORAGE
223 #define CONFIG_USB_GADGET_MASS_STORAGE
224 #define CONFIG_USBDOWNLOAD_GADGET
225 #define CONFIG_USB_GADGET_VBUS_DRAW	2
226 
227 #define CONFIG_G_DNL_VENDOR_NUM		0x0525
228 #define CONFIG_G_DNL_PRODUCT_NUM	0xa4a5
229 #define CONFIG_G_DNL_MANUFACTURER	"FSL"
230 #endif
231 
232 #endif                         /* __MX6QSABRE_COMMON_CONFIG_H */
233