]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
ae440ab0 | 2 | /* |
a62c6061 | 3 | * Copyright 2016-2018 Toradex AG |
ae440ab0 SA |
4 | * |
5 | * Configuration settings for the Colibri iMX7 module. | |
6 | * | |
7 | * based on mx7dsabresd.h: | |
8 | * Copyright (C) 2015 Freescale Semiconductor, Inc. | |
ae440ab0 SA |
9 | */ |
10 | ||
11 | #ifndef __COLIBRI_IMX7_CONFIG_H | |
12 | #define __COLIBRI_IMX7_CONFIG_H | |
13 | ||
14 | #include "mx7_common.h" | |
15 | ||
ae440ab0 SA |
16 | /* Size of malloc() pool */ |
17 | #define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M) | |
18 | ||
ae440ab0 SA |
19 | /* Network */ |
20 | #define CONFIG_FEC_MXC | |
ae440ab0 SA |
21 | #define CONFIG_FEC_XCV_TYPE RMII |
22 | #define CONFIG_ETHPRIME "FEC" | |
23 | #define CONFIG_FEC_MXC_PHYADDR 0 | |
24 | ||
f7c81e28 MZ |
25 | #define CONFIG_TFTP_BLOCKSIZE 16352 |
26 | #define CONFIG_TFTP_TSIZE | |
ae440ab0 SA |
27 | |
28 | /* ENET1 */ | |
29 | #define IMX_FEC_BASE ENET_IPS_BASE_ADDR | |
30 | ||
31 | /* MMC Config*/ | |
32 | #define CONFIG_SYS_FSL_ESDHC_ADDR 0 | |
a62c6061 | 33 | #ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND |
ae440ab0 | 34 | #define CONFIG_SYS_FSL_USDHC_NUM 1 |
a62c6061 SA |
35 | #elif CONFIG_TARGET_COLIBRI_IMX7_EMMC |
36 | #define CONFIG_SYS_FSL_USDHC_NUM 2 | |
a62c6061 | 37 | #endif |
ae440ab0 SA |
38 | |
39 | #undef CONFIG_BOOTM_PLAN9 | |
40 | #undef CONFIG_BOOTM_RTEMS | |
41 | ||
42 | /* I2C configs */ | |
ae440ab0 | 43 | #define CONFIG_SYS_I2C_MXC |
ae440ab0 SA |
44 | #define CONFIG_SYS_I2C_SPEED 100000 |
45 | ||
46 | #define CONFIG_IPADDR 192.168.10.2 | |
47 | #define CONFIG_NETMASK 255.255.255.0 | |
48 | #define CONFIG_SERVERIP 192.168.10.1 | |
49 | ||
a62c6061 | 50 | #define EMMC_BOOTCMD \ |
c585f8e2 IO |
51 | "set_emmcargs=setenv emmcargs ip=off root=PARTUUID=${uuid} ro " \ |
52 | "rootfstype=ext4 rootwait\0" \ | |
53 | "emmcboot=run setup; run emmcfinduuid; run set_emmcargs; " \ | |
a62c6061 SA |
54 | "setenv bootargs ${defargs} ${emmcargs} ${setupargs} " \ |
55 | "${vidargs}; echo Booting from internal eMMC chip...; " \ | |
56 | "run m4boot && " \ | |
c585f8e2 IO |
57 | "load mmc ${emmcdev}:${emmcbootpart} ${fdt_addr_r} " \ |
58 | "${soc}-colibri-emmc-${fdt_board}.dtb && " \ | |
59 | "load mmc ${emmcdev}:${emmcbootpart} ${kernel_addr_r} " \ | |
60 | "${boot_file} && run fdt_fixup && " \ | |
61 | "bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \ | |
62 | "emmcbootpart=1\0" \ | |
63 | "emmcdev=0\0" \ | |
64 | "emmcfinduuid=part uuid mmc ${emmcdev}:${emmcrootpart} uuid\0" \ | |
65 | "emmcrootpart=2\0" | |
66 | ||
a62c6061 | 67 | |
ae440ab0 | 68 | #define MEM_LAYOUT_ENV_SETTINGS \ |
9af131e3 | 69 | "bootm_size=0x10000000\0" \ |
ae440ab0 SA |
70 | "fdt_addr_r=0x82000000\0" \ |
71 | "fdt_high=0xffffffff\0" \ | |
72 | "initrd_high=0xffffffff\0" \ | |
73 | "kernel_addr_r=0x81000000\0" \ | |
74 | "ramdisk_addr_r=0x82100000\0" | |
75 | ||
a62c6061 | 76 | #if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND) |
c585f8e2 | 77 | #define SD_BOOTDEV 0 |
a62c6061 | 78 | #elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC) |
c585f8e2 IO |
79 | #define SD_BOOTDEV 1 |
80 | #endif | |
81 | ||
a62c6061 | 82 | #define SD_BOOTCMD \ |
c585f8e2 IO |
83 | "set_sdargs=setenv sdargs root=PARTUUID=${uuid} ro rootwait\0" \ |
84 | "sdboot=run setup; run sdfinduuid; run set_sdargs; " \ | |
85 | "setenv bootargs ${defargs} ${sdargs} " \ | |
a62c6061 SA |
86 | "${setupargs} ${vidargs}; echo Booting from MMC/SD card...; " \ |
87 | "run m4boot && " \ | |
c585f8e2 IO |
88 | "load mmc ${sddev}:${sdbootpart} ${kernel_addr_r} ${kernel_file} && " \ |
89 | "load mmc ${sddev}:${sdbootpart} ${fdt_addr_r} " \ | |
90 | "${soc}-colibri-${fdt_board}.dtb && " \ | |
91 | "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \ | |
92 | "sdbootpart=1\0" \ | |
93 | "sddev=" __stringify(SD_BOOTDEV) "\0" \ | |
94 | "sdfinduuid=part uuid mmc ${sddev}:${sdrootpart} uuid\0" \ | |
95 | "sdrootpart=2\0" | |
a62c6061 | 96 | |
ae440ab0 SA |
97 | |
98 | #define NFS_BOOTCMD \ | |
a62c6061 | 99 | "nfsargs=ip=:::::eth0: root=/dev/nfs\0" \ |
ae440ab0 SA |
100 | "nfsboot=run setup; " \ |
101 | "setenv bootargs ${defargs} ${nfsargs} " \ | |
102 | "${setupargs} ${vidargs}; echo Booting from NFS...;" \ | |
a62c6061 SA |
103 | "dhcp ${kernel_addr_r} && " \ |
104 | "tftp ${fdt_addr_r} ${soc}-colibri${variant}-${fdt_board}.dtb && " \ | |
ae440ab0 SA |
105 | "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \ |
106 | ||
107 | #define UBI_BOOTCMD \ | |
108 | "ubiargs=ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs " \ | |
109 | "ubi.fm_autoconvert=1\0" \ | |
110 | "ubiboot=run setup; " \ | |
111 | "setenv bootargs ${defargs} ${ubiargs} " \ | |
112 | "${setupargs} ${vidargs}; echo Booting from NAND...; " \ | |
113 | "ubi part ubi && run m4boot && " \ | |
114 | "ubi read ${kernel_addr_r} kernel && " \ | |
115 | "ubi read ${fdt_addr_r} dtb && " \ | |
116 | "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \ | |
117 | ||
a62c6061 | 118 | #if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND) |
2bc18ce5 | 119 | #define CONFIG_BOOTCOMMAND "run ubiboot ; echo ; echo ubiboot failed ; " \ |
a62c6061 SA |
120 | "setenv fdtfile ${soc}-colibri-${fdt_board}.dtb && run distro_bootcmd;" |
121 | #define MODULE_EXTRA_ENV_SETTINGS \ | |
122 | "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \ | |
123 | UBI_BOOTCMD | |
124 | #elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC) | |
2bc18ce5 | 125 | #define CONFIG_BOOTCOMMAND "run emmcboot ; echo ; echo emmcboot failed ; " \ |
a62c6061 SA |
126 | "setenv fdtfile ${soc}-colibri-emmc-${fdt_board}.dtb && run distro_bootcmd;" |
127 | #define MODULE_EXTRA_ENV_SETTINGS \ | |
128 | "variant=-emmc\0" \ | |
129 | EMMC_BOOTCMD | |
130 | #endif | |
131 | ||
132 | #if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND) | |
133 | #define BOOT_TARGET_DEVICES(func) \ | |
134 | func(MMC, mmc, 0) \ | |
135 | func(USB, usb, 0) \ | |
136 | func(DHCP, dhcp, na) | |
137 | #elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC) | |
138 | #define BOOT_TARGET_DEVICES(func) \ | |
139 | func(MMC, mmc, 0) \ | |
140 | func(MMC, mmc, 1) \ | |
141 | func(USB, usb, 0) \ | |
142 | func(DHCP, dhcp, na) | |
143 | #endif | |
144 | #include <config_distro_bootcmd.h> | |
ae440ab0 SA |
145 | |
146 | #define CONFIG_EXTRA_ENV_SETTINGS \ | |
a62c6061 | 147 | BOOTENV \ |
ae440ab0 SA |
148 | MEM_LAYOUT_ENV_SETTINGS \ |
149 | NFS_BOOTCMD \ | |
150 | SD_BOOTCMD \ | |
a62c6061 | 151 | MODULE_EXTRA_ENV_SETTINGS \ |
2bc18ce5 | 152 | "boot_file=zImage\0" \ |
ae440ab0 SA |
153 | "console=ttymxc0\0" \ |
154 | "defargs=\0" \ | |
155 | "fdt_board=eval-v3\0" \ | |
156 | "fdt_fixup=;\0" \ | |
157 | "m4boot=;\0" \ | |
158 | "ip_dyn=yes\0" \ | |
159 | "kernel_file=zImage\0" \ | |
ae440ab0 SA |
160 | "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \ |
161 | "00:14:2d:00:00:00; fi; tftpboot ${loadaddr} " \ | |
162 | "${board}/flash_eth.img && source ${loadaddr}\0" \ | |
163 | "setsdupdate=mmc rescan && setenv interface mmc && " \ | |
164 | "fatload ${interface} 0:1 ${loadaddr} " \ | |
165 | "${board}/flash_blk.img && source ${loadaddr}\0" \ | |
166 | "setup=setenv setupargs " \ | |
167 | "console=tty1 console=${console}" \ | |
64095704 | 168 | ",${baudrate}n8 ${memargs} consoleblank=0\0" \ |
ae440ab0 SA |
169 | "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \ |
170 | "setusbupdate=usb start && setenv interface usb && " \ | |
171 | "fatload ${interface} 0:1 ${loadaddr} " \ | |
172 | "${board}/flash_blk.img && source ${loadaddr}\0" \ | |
173 | "splashpos=m,m\0" \ | |
174 | "videomode=video=ctfb:x:640,y:480,depth:18,pclk:39722,le:48,ri:16,up:33,lo:10,hs:96,vs:2,sync:0,vmode:0\0" \ | |
38045f54 | 175 | "updlevel=2\0" |
ae440ab0 SA |
176 | |
177 | /* Miscellaneous configurable options */ | |
ae440ab0 SA |
178 | |
179 | #define CONFIG_SYS_MEMTEST_START 0x80000000 | |
180 | #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x0c000000) | |
181 | ||
182 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR | |
183 | #define CONFIG_SYS_HZ 1000 | |
184 | ||
ae440ab0 | 185 | /* Physical Memory Map */ |
ae440ab0 SA |
186 | #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR |
187 | ||
188 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM | |
189 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR | |
190 | #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE | |
191 | ||
192 | #define CONFIG_SYS_INIT_SP_OFFSET \ | |
193 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) | |
194 | #define CONFIG_SYS_INIT_SP_ADDR \ | |
195 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) | |
196 | ||
e856bdcf | 197 | /* environment organization */ |
ae440ab0 SA |
198 | |
199 | #if defined(CONFIG_ENV_IS_IN_MMC) | |
a62c6061 SA |
200 | /* Environment in eMMC, before config block at the end of 1st "boot sector" */ |
201 | #define CONFIG_ENV_SIZE (8 * 1024) | |
202 | #define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE + \ | |
203 | CONFIG_TDX_CFG_BLOCK_OFFSET) | |
204 | #define CONFIG_SYS_MMC_ENV_DEV 0 | |
205 | #define CONFIG_SYS_MMC_ENV_PART 1 | |
ae440ab0 | 206 | #elif defined(CONFIG_ENV_IS_IN_NAND) |
ae440ab0 | 207 | #define CONFIG_ENV_SECT_SIZE (128 * 1024) |
38045f54 | 208 | #define CONFIG_ENV_OFFSET (28 * CONFIG_ENV_SECT_SIZE) |
ae440ab0 SA |
209 | #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE |
210 | #endif | |
211 | ||
a62c6061 | 212 | #ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND |
ae440ab0 SA |
213 | /* NAND stuff */ |
214 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 | |
215 | #define CONFIG_SYS_NAND_BASE 0x40000000 | |
216 | #define CONFIG_SYS_NAND_5_ADDR_CYCLE | |
217 | #define CONFIG_SYS_NAND_ONFI_DETECTION | |
218 | #define CONFIG_SYS_NAND_MX7_GPMI_62_ECC_BYTES | |
a62c6061 | 219 | #endif |
ae440ab0 SA |
220 | |
221 | /* USB Configs */ | |
ae440ab0 SA |
222 | #define CONFIG_EHCI_HCD_INIT_AFTER_RESET |
223 | ||
224 | #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) | |
225 | #define CONFIG_MXC_USB_FLAGS 0 | |
226 | #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 | |
227 | ||
228 | #define CONFIG_IMX_THERMAL | |
229 | ||
230 | #define CONFIG_USBD_HS | |
231 | ||
ae440ab0 | 232 | /* USB Device Firmware Update support */ |
ae440ab0 SA |
233 | #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M |
234 | #define DFU_DEFAULT_POLL_TIMEOUT 300 | |
235 | ||
8c1df09f | 236 | #if defined(CONFIG_VIDEO) || defined(CONFIG_DM_VIDEO) |
ae440ab0 SA |
237 | #define CONFIG_VIDEO_MXS |
238 | #define CONFIG_VIDEO_LOGO | |
ae440ab0 SA |
239 | #define CONFIG_SPLASH_SCREEN |
240 | #define CONFIG_SPLASH_SCREEN_ALIGN | |
ae440ab0 SA |
241 | #define CONFIG_BMP_16BPP |
242 | #define CONFIG_VIDEO_BMP_RLE8 | |
243 | #define CONFIG_VIDEO_BMP_LOGO | |
244 | #endif | |
245 | ||
246 | #endif |