1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2015 Freescale Semiconductor, Inc.
4  *
5  * Configuration settings for the Freescale i.MX6UL 14x14 EVK board.
6  */
7 #ifndef __MX6UL_14X14_EVK_CONFIG_H
8 #define __MX6UL_14X14_EVK_CONFIG_H
9 
10 #include <asm/arch/imx-regs.h>
11 #include <linux/sizes.h>
12 #include <linux/stringify.h>
13 #include "mx6_common.h"
14 #include <asm/mach-imx/gpio.h>
15 
16 #define is_mx6ul_9x9_evk()	CONFIG_IS_ENABLED(TARGET_MX6UL_9X9_EVK)
17 
18 /* SPL options */
19 #include "imx6_spl.h"
20 
21 /* Size of malloc() pool */
22 #define CONFIG_SYS_MALLOC_LEN		(16 * SZ_1M)
23 
24 #define CONFIG_MXC_UART_BASE		UART1_BASE
25 
26 /* MMC Configs */
27 #ifdef CONFIG_FSL_USDHC
28 #define CONFIG_SYS_FSL_ESDHC_ADDR	USDHC2_BASE_ADDR
29 
30 /* NAND pin conflicts with usdhc2 */
31 #ifdef CONFIG_NAND_MXS
32 #define CONFIG_SYS_FSL_USDHC_NUM	1
33 #else
34 #define CONFIG_SYS_FSL_USDHC_NUM	2
35 #endif
36 
37 #endif
38 
39 /* I2C configs */
40 #ifdef CONFIG_CMD_I2C
41 #define CONFIG_SYS_I2C_MXC
42 #define CONFIG_SYS_I2C_MXC_I2C1		/* enable I2C bus 1 */
43 #define CONFIG_SYS_I2C_MXC_I2C2		/* enable I2C bus 2 */
44 #define CONFIG_SYS_I2C_SPEED		100000
45 #endif
46 
47 #define CONFIG_SYS_MMC_IMG_LOAD_PART	1
48 
49 #define CONFIG_EXTRA_ENV_SETTINGS \
50 	"script=boot.scr\0" \
51 	"image=zImage\0" \
52 	"console=ttymxc0\0" \
53 	"fdt_high=0xffffffff\0" \
54 	"initrd_high=0xffffffff\0" \
55 	"fdt_file=undefined\0" \
56 	"fdt_addr=0x83000000\0" \
57 	"boot_fdt=try\0" \
58 	"ip_dyn=yes\0" \
59 	"splashimage=" __stringify(CONFIG_LOADADDR) "\0" \
60 	"videomode=video=ctfb:x:480,y:272,depth:24,pclk:108695,le:8,ri:4,up:2,lo:4,hs:41,vs:10,sync:0,vmode:0\0" \
61 	"mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
62 	"mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
63 	"mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
64 	"mmcautodetect=yes\0" \
65 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
66 		"root=${mmcroot}\0" \
67 	"loadbootscript=" \
68 		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
69 	"bootscript=echo Running bootscript from mmc ...; " \
70 		"source\0" \
71 	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
72 	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
73 	"mmcboot=echo Booting from mmc ...; " \
74 		"run mmcargs; " \
75 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
76 			"if run loadfdt; then " \
77 				"bootz ${loadaddr} - ${fdt_addr}; " \
78 			"else " \
79 				"if test ${boot_fdt} = try; then " \
80 					"bootz; " \
81 				"else " \
82 					"echo WARN: Cannot load the DT; " \
83 				"fi; " \
84 			"fi; " \
85 		"else " \
86 			"bootz; " \
87 		"fi;\0" \
88 	"netargs=setenv bootargs console=${console},${baudrate} " \
89 		"root=/dev/nfs " \
90 	"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
91 		"netboot=echo Booting from net ...; " \
92 		"run netargs; " \
93 		"if test ${ip_dyn} = yes; then " \
94 			"setenv get_cmd dhcp; " \
95 		"else " \
96 			"setenv get_cmd tftp; " \
97 		"fi; " \
98 		"${get_cmd} ${image}; " \
99 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
100 			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
101 				"bootz ${loadaddr} - ${fdt_addr}; " \
102 			"else " \
103 				"if test ${boot_fdt} = try; then " \
104 					"bootz; " \
105 				"else " \
106 					"echo WARN: Cannot load the DT; " \
107 				"fi; " \
108 			"fi; " \
109 		"else " \
110 			"bootz; " \
111 		"fi;\0" \
112 		"findfdt="\
113 			"if test $fdt_file = undefined; then " \
114 				"if test $board_name = EVK && test $board_rev = 9X9; then " \
115 					"setenv fdt_file imx6ul-9x9-evk.dtb; fi; " \
116 				"if test $board_name = EVK && test $board_rev = 14X14; then " \
117 					"setenv fdt_file imx6ul-14x14-evk.dtb; fi; " \
118 				"if test $fdt_file = undefined; then " \
119 					"echo WARNING: Could not determine dtb to use; fi; " \
120 			"fi;\0" \
121 
122 #define CONFIG_BOOTCOMMAND \
123 	   "run findfdt;" \
124 	   "mmc dev ${mmcdev};" \
125 	   "mmc dev ${mmcdev}; if mmc rescan; then " \
126 		   "if run loadbootscript; then " \
127 			   "run bootscript; " \
128 		   "else " \
129 			   "if run loadimage; then " \
130 				   "run mmcboot; " \
131 			   "else run netboot; " \
132 			   "fi; " \
133 		   "fi; " \
134 	   "else run netboot; fi"
135 
136 /* Miscellaneous configurable options */
137 
138 #define CONFIG_SYS_LOAD_ADDR		CONFIG_LOADADDR
139 #define CONFIG_SYS_HZ			1000
140 
141 /* Physical Memory Map */
142 #define PHYS_SDRAM			MMDC0_ARB_BASE_ADDR
143 
144 #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM
145 #define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR
146 #define CONFIG_SYS_INIT_RAM_SIZE	IRAM_SIZE
147 
148 #define CONFIG_SYS_INIT_SP_OFFSET \
149 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
150 #define CONFIG_SYS_INIT_SP_ADDR \
151 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
152 
153 /* environment organization */
154 #define CONFIG_MMCROOT			"/dev/mmcblk1p2"  /* USDHC2 */
155 
156 /* USB Configs */
157 #ifdef CONFIG_CMD_USB
158 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
159 #define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI | PORT_PTS_PTW)
160 #define CONFIG_MXC_USB_FLAGS   0
161 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
162 #endif
163 
164 #ifdef CONFIG_CMD_NET
165 #define CONFIG_FEC_ENET_DEV		1
166 
167 #if (CONFIG_FEC_ENET_DEV == 0)
168 #define IMX_FEC_BASE			ENET_BASE_ADDR
169 #define CONFIG_FEC_MXC_PHYADDR          0x2
170 #define CONFIG_FEC_XCV_TYPE             RMII
171 #define CONFIG_ETHPRIME			"eth0"
172 #elif (CONFIG_FEC_ENET_DEV == 1)
173 #define IMX_FEC_BASE			ENET2_BASE_ADDR
174 #define CONFIG_FEC_MXC_PHYADDR		0x1
175 #define CONFIG_FEC_XCV_TYPE		RMII
176 #define CONFIG_ETHPRIME			"eth1"
177 #endif
178 #endif
179 
180 #ifndef CONFIG_SPL_BUILD
181 #if defined(CONFIG_DM_VIDEO)
182 #define CONFIG_VIDEO_MXS
183 #define CONFIG_VIDEO_LOGO
184 #define CONFIG_VIDEO_BMP_LOGO
185 #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR
186 #endif
187 #endif
188 
189 #endif
190