]>
Commit | Line | Data |
---|---|---|
592f4aed MK |
1 | /* |
2 | * Copyright 2013-2015 Toradex, Inc. | |
3 | * | |
4 | * Configuration settings for the Toradex Apalis iMX6 | |
5 | * | |
6 | * SPDX-License-Identifier: GPL-2.0+ | |
7 | */ | |
8 | ||
9 | #ifndef __CONFIG_H | |
10 | #define __CONFIG_H | |
11 | ||
12 | #include "mx6_common.h" | |
592f4aed MK |
13 | |
14 | #undef CONFIG_DISPLAY_BOARDINFO | |
592f4aed MK |
15 | |
16 | #define CONFIG_MACH_TYPE 4886 | |
17 | ||
18 | #define CONFIG_SYS_GENERIC_BOARD | |
19 | ||
20 | #include <asm/arch/imx-regs.h> | |
552a848e | 21 | #include <asm/mach-imx/gpio.h> |
592f4aed MK |
22 | |
23 | #ifdef CONFIG_SPL | |
24 | #include "imx6_spl.h" | |
592f4aed MK |
25 | #endif |
26 | ||
27 | #define CONFIG_CMDLINE_TAG | |
28 | #define CONFIG_SETUP_MEMORY_TAGS | |
29 | #define CONFIG_INITRD_TAG | |
30 | #define CONFIG_REVISION_TAG | |
31 | #define CONFIG_SERIAL_TAG | |
32 | ||
33 | /* Size of malloc() pool */ | |
34 | #define CONFIG_SYS_MALLOC_LEN (32 * 1024 * 1024) | |
35 | ||
592f4aed MK |
36 | #define CONFIG_MISC_INIT_R |
37 | ||
38 | #define CONFIG_MXC_UART | |
39 | #define CONFIG_MXC_UART_BASE UART1_BASE | |
40 | ||
592f4aed MK |
41 | /* I2C Configs */ |
42 | #define CONFIG_SYS_I2C | |
43 | #define CONFIG_SYS_I2C_MXC | |
44 | #define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */ | |
45 | #define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */ | |
46 | #define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */ | |
47 | #define CONFIG_SYS_I2C_SPEED 100000 | |
48 | ||
49 | /* OCOTP Configs */ | |
592f4aed MK |
50 | #ifdef CONFIG_CMD_FUSE |
51 | #define CONFIG_MXC_OCOTP | |
52 | #endif | |
53 | ||
54 | /* MMC Configs */ | |
592f4aed MK |
55 | #define CONFIG_FSL_USDHC |
56 | #define CONFIG_SYS_FSL_ESDHC_ADDR 0 | |
57 | #define CONFIG_SYS_FSL_USDHC_NUM 3 | |
58 | ||
59 | #define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */ | |
592f4aed | 60 | #define CONFIG_BOUNCE_BUFFER |
592f4aed | 61 | |
592f4aed MK |
62 | /* |
63 | * SATA Configs | |
64 | */ | |
65 | #ifdef CONFIG_CMD_SATA | |
592f4aed MK |
66 | #define CONFIG_SYS_SATA_MAX_DEVICE 1 |
67 | #define CONFIG_DWC_AHSATA_PORT_ID 0 | |
68 | #define CONFIG_DWC_AHSATA_BASE_ADDR SATA_ARB_BASE_ADDR | |
69 | #define CONFIG_LBA48 | |
592f4aed MK |
70 | #endif |
71 | ||
72 | /* Network */ | |
73 | #define CONFIG_FEC_MXC | |
74 | #define CONFIG_MII | |
75 | #define IMX_FEC_BASE ENET_BASE_ADDR | |
76 | #define CONFIG_FEC_XCV_TYPE RGMII | |
77 | #define CONFIG_ETHPRIME "FEC" | |
78 | #define CONFIG_FEC_MXC_PHYADDR 6 | |
592f4aed MK |
79 | #define CONFIG_IP_DEFRAG |
80 | #define CONFIG_TFTP_BLOCKSIZE 4096 | |
81 | #define CONFIG_TFTP_TSIZE | |
82 | ||
83 | /* USB Configs */ | |
84 | /* Host */ | |
592f4aed MK |
85 | #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 |
86 | #define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */ | |
87 | #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) | |
88 | #define CONFIG_MXC_USB_FLAGS 0 | |
592f4aed | 89 | /* Client */ |
592f4aed MK |
90 | #define CONFIG_USBD_HS |
91 | ||
92 | #define CONFIG_USB_GADGET_MASS_STORAGE | |
592f4aed MK |
93 | /* USB DFU */ |
94 | #define CONFIG_DFU_MMC | |
95 | ||
96 | /* Miscellaneous commands */ | |
592f4aed MK |
97 | |
98 | /* Framebuffer and LCD */ | |
99 | #define CONFIG_VIDEO_IPUV3 | |
100 | #define CONFIG_SYS_CONSOLE_IS_IN_ENV | |
101 | #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE | |
102 | #define CONFIG_VIDEO_BMP_RLE8 | |
103 | #define CONFIG_SPLASH_SCREEN | |
104 | #define CONFIG_SPLASH_SCREEN_ALIGN | |
105 | #define CONFIG_BMP_16BPP | |
106 | #define CONFIG_VIDEO_LOGO | |
107 | #define CONFIG_VIDEO_BMP_LOGO | |
592f4aed MK |
108 | #define CONFIG_CONSOLE_MUX |
109 | #define CONFIG_IMX_HDMI | |
110 | #define CONFIG_IMX_VIDEO_SKIP | |
592f4aed MK |
111 | |
112 | /* allow to overwrite serial and ethaddr */ | |
113 | #define CONFIG_ENV_OVERWRITE | |
592f4aed MK |
114 | |
115 | /* Command definition */ | |
116 | #undef CONFIG_CMD_LOADB | |
117 | #undef CONFIG_CMD_LOADS | |
118 | #undef CONFIG_CMD_NFS | |
119 | #undef CONFIG_CMD_FLASH | |
120 | ||
121 | #undef CONFIG_IPADDR | |
122 | #define CONFIG_IPADDR 192.168.10.2 | |
123 | #define CONFIG_NETMASK 255.255.255.0 | |
124 | #undef CONFIG_SERVERIP | |
125 | #define CONFIG_SERVERIP 192.168.10.1 | |
126 | ||
127 | #define CONFIG_LOADADDR 0x12000000 | |
592f4aed MK |
128 | |
129 | #ifdef CONFIG_CMD_SATA | |
130 | #define CONFIG_DRIVE_SATA "sata " | |
131 | #else | |
132 | #define CONFIG_DRIVE_SATA | |
133 | #endif | |
134 | ||
135 | #ifdef CONFIG_CMD_MMC | |
136 | #define CONFIG_DRIVE_MMC "mmc " | |
137 | #else | |
138 | #define CONFIG_DRIVE_MMC | |
139 | #endif | |
140 | ||
141 | #define CONFIG_DRIVE_TYPES CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC | |
142 | ||
143 | #define DFU_ALT_EMMC_INFO \ | |
144 | "u-boot.imx raw 0x2 0x3ff mmcpart 0;" \ | |
145 | "boot part 0 1;" \ | |
146 | "rootfs part 0 2;" \ | |
147 | "uImage fat 0 1;" \ | |
148 | "imx6q-colibri-eval-v3.dtb fat 0 1;" \ | |
149 | "imx6q-colibri-cam-eval-v3.dtb fat 0 1" | |
150 | ||
151 | #define EMMC_BOOTCMD \ | |
152 | "emmcargs=ip=off root=/dev/mmcblk0p2 rw,noatime rootfstype=ext3 " \ | |
153 | "rootwait\0" \ | |
154 | "emmcboot=run setup; " \ | |
155 | "setenv bootargs ${defargs} ${emmcargs} ${setupargs} " \ | |
156 | "${vidargs}; echo Booting from internal eMMC chip...; " \ | |
157 | "run emmcdtbload; load mmc 0:1 ${kernel_addr_r} " \ | |
158 | "${boot_file} && run fdt_fixup && " \ | |
159 | "bootm ${kernel_addr_r} ${dtbparam}\0" \ | |
160 | "emmcdtbload=setenv dtbparam; load mmc 0:1 ${fdt_addr_r} " \ | |
161 | "${fdt_file} && setenv dtbparam \" - ${fdt_addr_r}\" && true\0" | |
162 | ||
163 | #define MEM_LAYOUT_ENV_SETTINGS \ | |
9af131e3 | 164 | "bootm_size=0x20000000\0" \ |
592f4aed MK |
165 | "fdt_addr_r=0x12000000\0" \ |
166 | "fdt_high=0xffffffff\0" \ | |
167 | "initrd_high=0xffffffff\0" \ | |
168 | "kernel_addr_r=0x11000000\0" \ | |
169 | "ramdisk_addr_r=0x12100000\0" | |
170 | ||
171 | #define NFS_BOOTCMD \ | |
172 | "nfsargs=ip=:::::eth0:on root=/dev/nfs rw\0" \ | |
173 | "nfsboot=run setup; " \ | |
174 | "setenv bootargs ${defargs} ${nfsargs} ${setupargs} " \ | |
175 | "${vidargs}; echo Booting via DHCP/TFTP/NFS...; " \ | |
176 | "run nfsdtbload; dhcp ${kernel_addr_r} " \ | |
177 | "&& run fdt_fixup && bootm ${kernel_addr_r} ${dtbparam}\0" \ | |
178 | "nfsdtbload=setenv dtbparam; tftp ${fdt_addr_r} ${fdt_file} " \ | |
179 | "&& setenv dtbparam \" - ${fdt_addr_r}\" && true\0" | |
180 | ||
181 | #define SD_BOOTCMD \ | |
182 | "sdargs=ip=off root=/dev/mmcblk1p2 rw,noatime rootfstype=ext3 " \ | |
183 | "rootwait\0" \ | |
184 | "sdboot=run setup; " \ | |
185 | "setenv bootargs ${defargs} ${sdargs} ${setupargs} " \ | |
186 | "${vidargs}; echo Booting from SD card; " \ | |
187 | "run sddtbload; load mmc 1:1 ${kernel_addr_r} " \ | |
188 | "${boot_file} && run fdt_fixup && " \ | |
189 | "bootm ${kernel_addr_r} ${dtbparam}\0" \ | |
190 | "sddtbload=setenv dtbparam; load mmc 1:1 ${fdt_addr_r} " \ | |
191 | "${fdt_file} && setenv dtbparam \" - ${fdt_addr_r}\" && true\0" | |
192 | ||
193 | #define USB_BOOTCMD \ | |
194 | "usbargs=ip=off root=/dev/sda2 rw,noatime rootfstype=ext3 " \ | |
195 | "rootwait\0" \ | |
196 | "usbboot=run setup; setenv bootargs ${defargs} ${setupargs} " \ | |
197 | "${usbargs} ${vidargs}; echo Booting from USB stick...; " \ | |
198 | "usb start && run usbdtbload; load usb 0:1 ${kernel_addr_r} " \ | |
199 | "${boot_file} && run fdt_fixup && " \ | |
200 | "bootm ${kernel_addr_r} ${dtbparam}\0" \ | |
201 | "usbdtbload=setenv dtbparam; load usb 0:1 ${fdt_addr_r} " \ | |
202 | "${fdt_file} && setenv dtbparam \" - ${fdt_addr_r}\" && true\0" | |
203 | ||
204 | #ifndef CONFIG_TDX_APALIS_IMX6_V1_0 | |
205 | #define FDT_FILE "imx6q-apalis-eval.dtb" | |
206 | #define FDT_FILE_V1_0 "imx6q-apalis_v1_0-eval.dtb" | |
207 | #else | |
208 | #define FDT_FILE "imx6q-apalis_v1_0-eval.dtb" | |
209 | #endif | |
210 | #define CONFIG_EXTRA_ENV_SETTINGS \ | |
211 | "bootcmd=run emmcboot ; echo ; echo emmcboot failed ; " \ | |
212 | "run nfsboot ; echo ; echo nfsboot failed ; " \ | |
213 | "usb start ;" \ | |
214 | "setenv stdout serial,vga ; setenv stdin serial,usbkbd\0" \ | |
215 | "boot_file=uImage\0" \ | |
216 | "console=ttymxc0\0" \ | |
217 | "defargs=enable_wait_mode=off vmalloc=400M\0" \ | |
218 | "dfu_alt_info=" DFU_ALT_EMMC_INFO "\0" \ | |
219 | EMMC_BOOTCMD \ | |
220 | "fdt_file=" FDT_FILE "\0" \ | |
221 | "fdt_fixup=;\0" \ | |
222 | MEM_LAYOUT_ENV_SETTINGS \ | |
223 | NFS_BOOTCMD \ | |
224 | SD_BOOTCMD \ | |
225 | "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \ | |
226 | "00:14:2d:00:00:00; fi; tftpboot ${loadaddr} " \ | |
227 | "flash_eth.img && source ${loadaddr}\0" \ | |
228 | "setsdupdate=setenv interface mmc; setenv drive 1; mmc rescan; load " \ | |
229 | "${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \ | |
230 | "source ${loadaddr}\0" \ | |
231 | "setup=setenv setupargs fec_mac=${ethaddr} " \ | |
232 | "consoleblank=0 no_console_suspend=1 console=tty1 " \ | |
233 | "console=${console},${baudrate}n8\0 " \ | |
234 | "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \ | |
235 | "setusbupdate=usb start && setenv interface usb; setenv drive 0; " \ | |
236 | "load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && " \ | |
237 | "source ${loadaddr}\0" \ | |
238 | "splashpos=m,m\0" \ | |
239 | "vidargs=mxc_hdmi.only_cea=1 " \ | |
240 | "video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24 " \ | |
241 | "video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off " \ | |
242 | "fbmem=32M\0 " | |
243 | ||
244 | /* Miscellaneous configurable options */ | |
592f4aed MK |
245 | #undef CONFIG_SYS_CBSIZE |
246 | #define CONFIG_SYS_CBSIZE 1024 | |
247 | #undef CONFIG_SYS_MAXARGS | |
248 | #define CONFIG_SYS_MAXARGS 48 | |
249 | ||
592f4aed MK |
250 | #define CONFIG_SYS_MEMTEST_START 0x10000000 |
251 | #define CONFIG_SYS_MEMTEST_END 0x10010000 | |
252 | #define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000 | |
253 | ||
254 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR | |
255 | ||
592f4aed MK |
256 | /* Physical Memory Map */ |
257 | #define CONFIG_NR_DRAM_BANKS 1 | |
258 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR | |
259 | ||
260 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM | |
261 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR | |
262 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE | |
263 | ||
264 | #define CONFIG_SYS_INIT_SP_OFFSET \ | |
265 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) | |
266 | #define CONFIG_SYS_INIT_SP_ADDR \ | |
267 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) | |
268 | ||
e856bdcf | 269 | /* environment organization */ |
592f4aed MK |
270 | |
271 | #define CONFIG_ENV_SIZE (8 * 1024) | |
272 | ||
592f4aed MK |
273 | #if defined(CONFIG_ENV_IS_IN_MMC) |
274 | /* Environment in eMMC, before config block at the end of 1st "boot sector" */ | |
275 | #define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE + \ | |
276 | CONFIG_TDX_CFG_BLOCK_OFFSET) | |
277 | #define CONFIG_SYS_MMC_ENV_DEV 0 | |
278 | #define CONFIG_SYS_MMC_ENV_PART 1 | |
279 | #endif | |
280 | ||
281 | #define CONFIG_OF_SYSTEM_SETUP | |
282 | ||
283 | #define CONFIG_CMD_TIME | |
284 | ||
592f4aed | 285 | #endif /* __CONFIG_H */ |