1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright 2016-2018 Toradex AG
5 * Configuration settings for the Colibri iMX7 module.
7 * based on mx7dsabresd.h:
8 * Copyright (C) 2015 Freescale Semiconductor, Inc.
11 #ifndef __COLIBRI_IMX7_CONFIG_H
12 #define __COLIBRI_IMX7_CONFIG_H
14 #include "mx7_common.h"
16 /*#define CONFIG_DBG_MONITOR*/
18 /* Size of malloc() pool */
19 #define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M)
22 #define CONFIG_FEC_MXC
23 #define CONFIG_FEC_XCV_TYPE RMII
24 #define CONFIG_ETHPRIME "FEC"
25 #define CONFIG_FEC_MXC_PHYADDR 0
27 #define CONFIG_IP_DEFRAG
28 #define CONFIG_TFTP_BLOCKSIZE 16352
29 #define CONFIG_TFTP_TSIZE
32 #define IMX_FEC_BASE ENET_IPS_BASE_ADDR
35 #define CONFIG_SYS_FSL_ESDHC_ADDR 0
36 #ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND
37 #define CONFIG_SYS_FSL_USDHC_NUM 1
38 #elif CONFIG_TARGET_COLIBRI_IMX7_EMMC
39 #define CONFIG_SYS_FSL_USDHC_NUM 2
41 #define CONFIG_SUPPORT_EMMC_BOOT
44 #undef CONFIG_BOOTM_PLAN9
45 #undef CONFIG_BOOTM_RTEMS
48 #define CONFIG_SYS_I2C_MXC
49 #define CONFIG_SYS_I2C_SPEED 100000
51 #define CONFIG_IPADDR 192.168.10.2
52 #define CONFIG_NETMASK 255.255.255.0
53 #define CONFIG_SERVERIP 192.168.10.1
55 #define EMMC_BOOTCMD \
56 "emmcargs=ip=off root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait\0" \
57 "emmcboot=run setup; " \
58 "setenv bootargs ${defargs} ${emmcargs} ${setupargs} " \
59 "${vidargs}; echo Booting from internal eMMC chip...; " \
61 "load mmc 0:1 ${fdt_addr_r} ${soc}-colibri-emmc-${fdt_board}.dtb && " \
62 "load mmc 0:1 ${kernel_addr_r} ${boot_file} && " \
63 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0"
65 #define MEM_LAYOUT_ENV_SETTINGS \
66 "bootm_size=0x10000000\0" \
67 "fdt_addr_r=0x82000000\0" \
68 "fdt_high=0xffffffff\0" \
69 "initrd_high=0xffffffff\0" \
70 "kernel_addr_r=0x81000000\0" \
71 "ramdisk_addr_r=0x82100000\0"
73 #if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
75 "sdargs=root=/dev/mmcblk0p2 ro rootwait\0" \
76 "sdboot=run setup; setenv bootargs ${defargs} ${sdargs} " \
77 "${setupargs} ${vidargs}; echo Booting from MMC/SD card...; " \
79 "load mmc 0:1 ${kernel_addr_r} ${kernel_file} && " \
80 "load mmc 0:1 ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && " \
81 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0"
82 #elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
84 "sdargs=root=/dev/mmcblk1p2 ro rootwait\0" \
85 "sdboot=run setup; setenv bootargs ${defargs} ${sdargs} " \
86 "${setupargs} ${vidargs}; echo Booting from MMC/SD card...; " \
88 "load mmc 1:1 ${kernel_addr_r} ${kernel_file} && " \
89 "load mmc 1:1 ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && " \
90 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0"
95 "nfsargs=ip=:::::eth0: root=/dev/nfs\0" \
96 "nfsboot=run setup; " \
97 "setenv bootargs ${defargs} ${nfsargs} " \
98 "${setupargs} ${vidargs}; echo Booting from NFS...;" \
99 "dhcp ${kernel_addr_r} && " \
100 "tftp ${fdt_addr_r} ${soc}-colibri${variant}-${fdt_board}.dtb && " \
101 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
103 #define UBI_BOOTCMD \
104 "ubiargs=ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs " \
105 "ubi.fm_autoconvert=1\0" \
106 "ubiboot=run setup; " \
107 "setenv bootargs ${defargs} ${ubiargs} " \
108 "${setupargs} ${vidargs}; echo Booting from NAND...; " \
109 "ubi part ubi && run m4boot && " \
110 "ubi read ${kernel_addr_r} kernel && " \
111 "ubi read ${fdt_addr_r} dtb && " \
112 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
114 #if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
115 #define CONFIG_BOOTCOMMAND "run emmcboot ; echo ; echo emmcboot failed ; " \
116 "setenv fdtfile ${soc}-colibri-${fdt_board}.dtb && run distro_bootcmd;"
117 #define MODULE_EXTRA_ENV_SETTINGS \
118 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
120 #elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
121 #define CONFIG_BOOTCOMMAND "run ubiboot ; echo ; echo ubiboot failed ; " \
122 "setenv fdtfile ${soc}-colibri-emmc-${fdt_board}.dtb && run distro_bootcmd;"
123 #define MODULE_EXTRA_ENV_SETTINGS \
128 #if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
129 #define BOOT_TARGET_DEVICES(func) \
133 #elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
134 #define BOOT_TARGET_DEVICES(func) \
140 #include <config_distro_bootcmd.h>
142 #define CONFIG_EXTRA_ENV_SETTINGS \
144 MEM_LAYOUT_ENV_SETTINGS \
147 MODULE_EXTRA_ENV_SETTINGS \
148 "console=ttymxc0\0" \
150 "fdt_board=eval-v3\0" \
154 "kernel_file=zImage\0" \
155 "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \
156 "00:14:2d:00:00:00; fi; tftpboot ${loadaddr} " \
157 "${board}/flash_eth.img && source ${loadaddr}\0" \
158 "setsdupdate=mmc rescan && setenv interface mmc && " \
159 "fatload ${interface} 0:1 ${loadaddr} " \
160 "${board}/flash_blk.img && source ${loadaddr}\0" \
161 "setup=setenv setupargs " \
162 "console=tty1 console=${console}" \
163 ",${baudrate}n8 ${memargs} consoleblank=0\0" \
164 "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \
165 "setusbupdate=usb start && setenv interface usb && " \
166 "fatload ${interface} 0:1 ${loadaddr} " \
167 "${board}/flash_blk.img && source ${loadaddr}\0" \
169 "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" \
172 /* Miscellaneous configurable options */
174 #define CONFIG_SYS_MEMTEST_START 0x80000000
175 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x0c000000)
177 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
178 #define CONFIG_SYS_HZ 1000
180 /* Physical Memory Map */
181 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
183 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
184 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
185 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
187 #define CONFIG_SYS_INIT_SP_OFFSET \
188 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
189 #define CONFIG_SYS_INIT_SP_ADDR \
190 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
192 /* environment organization */
194 #if defined(CONFIG_ENV_IS_IN_MMC)
195 /* Environment in eMMC, before config block at the end of 1st "boot sector" */
196 #define CONFIG_ENV_SIZE (8 * 1024)
197 #define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE + \
198 CONFIG_TDX_CFG_BLOCK_OFFSET)
199 #define CONFIG_SYS_MMC_ENV_DEV 0
200 #define CONFIG_SYS_MMC_ENV_PART 1
201 #elif defined(CONFIG_ENV_IS_IN_NAND)
202 #define CONFIG_ENV_SECT_SIZE (128 * 1024)
203 #define CONFIG_ENV_OFFSET (28 * CONFIG_ENV_SECT_SIZE)
204 #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
207 #ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND
209 #define CONFIG_SYS_MAX_NAND_DEVICE 1
210 #define CONFIG_SYS_NAND_BASE 0x40000000
211 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
212 #define CONFIG_SYS_NAND_ONFI_DETECTION
213 #define CONFIG_SYS_NAND_MX7_GPMI_62_ECC_BYTES
217 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
219 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
220 #define CONFIG_MXC_USB_FLAGS 0
221 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
223 #define CONFIG_IMX_THERMAL
225 #define CONFIG_USBD_HS
227 /* USB Device Firmware Update support */
228 #define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M
229 #define DFU_DEFAULT_POLL_TIMEOUT 300
232 #define CONFIG_VIDEO_MXS
233 #define CONFIG_VIDEO_LOGO
234 #define CONFIG_SPLASH_SCREEN
235 #define CONFIG_SPLASH_SCREEN_ALIGN
236 #define CONFIG_BMP_16BPP
237 #define CONFIG_VIDEO_BMP_RLE8
238 #define CONFIG_VIDEO_BMP_LOGO