blob: 40173b18fa77f7acab2cee04ee15eba67e662c15 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Stefan Agner41f75bb2016-07-20 21:27:49 -07002/*
Stefan Agnercbd59fe2018-08-06 09:19:19 +02003 * Copyright 2016-2018 Toradex AG
Stefan Agner41f75bb2016-07-20 21:27:49 -07004 *
5 * Configuration settings for the Colibri iMX7 module.
6 *
7 * based on mx7dsabresd.h:
8 * Copyright (C) 2015 Freescale Semiconductor, Inc.
Stefan Agner41f75bb2016-07-20 21:27:49 -07009 */
10
11#ifndef __COLIBRI_IMX7_CONFIG_H
12#define __COLIBRI_IMX7_CONFIG_H
13
14#include "mx7_common.h"
15
Stefan Agner41f75bb2016-07-20 21:27:49 -070016/* Size of malloc() pool */
17#define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M)
18
Stefan Agner41f75bb2016-07-20 21:27:49 -070019/* Network */
20#define CONFIG_FEC_MXC
Stefan Agner41f75bb2016-07-20 21:27:49 -070021#define CONFIG_FEC_XCV_TYPE RMII
22#define CONFIG_ETHPRIME "FEC"
23#define CONFIG_FEC_MXC_PHYADDR 0
24
Marcel Ziswiler36124b92016-09-15 00:54:00 +020025#define CONFIG_TFTP_TSIZE
Stefan Agner41f75bb2016-07-20 21:27:49 -070026
27/* ENET1 */
28#define IMX_FEC_BASE ENET_IPS_BASE_ADDR
29
30/* MMC Config*/
31#define CONFIG_SYS_FSL_ESDHC_ADDR 0
Stefan Agnercbd59fe2018-08-06 09:19:19 +020032#ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND
Stefan Agner41f75bb2016-07-20 21:27:49 -070033#define CONFIG_SYS_FSL_USDHC_NUM 1
Stefan Agnercbd59fe2018-08-06 09:19:19 +020034#elif CONFIG_TARGET_COLIBRI_IMX7_EMMC
35#define CONFIG_SYS_FSL_USDHC_NUM 2
Stefan Agnercbd59fe2018-08-06 09:19:19 +020036#endif
Stefan Agner41f75bb2016-07-20 21:27:49 -070037
38#undef CONFIG_BOOTM_PLAN9
39#undef CONFIG_BOOTM_RTEMS
40
41/* I2C configs */
Stefan Agner41f75bb2016-07-20 21:27:49 -070042#define CONFIG_SYS_I2C_MXC
Stefan Agner41f75bb2016-07-20 21:27:49 -070043#define CONFIG_SYS_I2C_SPEED 100000
44
45#define CONFIG_IPADDR 192.168.10.2
46#define CONFIG_NETMASK 255.255.255.0
47#define CONFIG_SERVERIP 192.168.10.1
48
Stefan Agnercbd59fe2018-08-06 09:19:19 +020049#define EMMC_BOOTCMD \
Igor Opaniuk4d454b02019-05-29 13:00:39 +030050 "set_emmcargs=setenv emmcargs ip=off root=PARTUUID=${uuid} ro " \
51 "rootfstype=ext4 rootwait\0" \
52 "emmcboot=run setup; run emmcfinduuid; run set_emmcargs; " \
Stefan Agnercbd59fe2018-08-06 09:19:19 +020053 "setenv bootargs ${defargs} ${emmcargs} ${setupargs} " \
54 "${vidargs}; echo Booting from internal eMMC chip...; " \
55 "run m4boot && " \
Igor Opaniuk4d454b02019-05-29 13:00:39 +030056 "load mmc ${emmcdev}:${emmcbootpart} ${fdt_addr_r} " \
57 "${soc}-colibri-emmc-${fdt_board}.dtb && " \
58 "load mmc ${emmcdev}:${emmcbootpart} ${kernel_addr_r} " \
59 "${boot_file} && run fdt_fixup && " \
60 "bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
61 "emmcbootpart=1\0" \
62 "emmcdev=0\0" \
63 "emmcfinduuid=part uuid mmc ${emmcdev}:${emmcrootpart} uuid\0" \
64 "emmcrootpart=2\0"
65
Stefan Agnercbd59fe2018-08-06 09:19:19 +020066
Stefan Agner41f75bb2016-07-20 21:27:49 -070067#define MEM_LAYOUT_ENV_SETTINGS \
Stefan Agner35eebee2017-03-09 17:17:51 -080068 "bootm_size=0x10000000\0" \
Stefan Agner41f75bb2016-07-20 21:27:49 -070069 "fdt_addr_r=0x82000000\0" \
70 "fdt_high=0xffffffff\0" \
71 "initrd_high=0xffffffff\0" \
72 "kernel_addr_r=0x81000000\0" \
73 "ramdisk_addr_r=0x82100000\0"
74
Stefan Agnercbd59fe2018-08-06 09:19:19 +020075#if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
Igor Opaniuk4d454b02019-05-29 13:00:39 +030076#define SD_BOOTDEV 0
Stefan Agnercbd59fe2018-08-06 09:19:19 +020077#elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
Igor Opaniuk4d454b02019-05-29 13:00:39 +030078#define SD_BOOTDEV 1
79#endif
80
Stefan Agnercbd59fe2018-08-06 09:19:19 +020081#define SD_BOOTCMD \
Igor Opaniuk4d454b02019-05-29 13:00:39 +030082 "set_sdargs=setenv sdargs root=PARTUUID=${uuid} ro rootwait\0" \
83 "sdboot=run setup; run sdfinduuid; run set_sdargs; " \
84 "setenv bootargs ${defargs} ${sdargs} " \
Stefan Agnercbd59fe2018-08-06 09:19:19 +020085 "${setupargs} ${vidargs}; echo Booting from MMC/SD card...; " \
86 "run m4boot && " \
Igor Opaniuk4d454b02019-05-29 13:00:39 +030087 "load mmc ${sddev}:${sdbootpart} ${kernel_addr_r} ${kernel_file} && " \
88 "load mmc ${sddev}:${sdbootpart} ${fdt_addr_r} " \
89 "${soc}-colibri-${fdt_board}.dtb && " \
90 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
91 "sdbootpart=1\0" \
92 "sddev=" __stringify(SD_BOOTDEV) "\0" \
93 "sdfinduuid=part uuid mmc ${sddev}:${sdrootpart} uuid\0" \
94 "sdrootpart=2\0"
Stefan Agnercbd59fe2018-08-06 09:19:19 +020095
Stefan Agner41f75bb2016-07-20 21:27:49 -070096
97#define NFS_BOOTCMD \
Stefan Agnercbd59fe2018-08-06 09:19:19 +020098 "nfsargs=ip=:::::eth0: root=/dev/nfs\0" \
Stefan Agner41f75bb2016-07-20 21:27:49 -070099 "nfsboot=run setup; " \
100 "setenv bootargs ${defargs} ${nfsargs} " \
101 "${setupargs} ${vidargs}; echo Booting from NFS...;" \
Stefan Agnercbd59fe2018-08-06 09:19:19 +0200102 "dhcp ${kernel_addr_r} && " \
103 "tftp ${fdt_addr_r} ${soc}-colibri${variant}-${fdt_board}.dtb && " \
Stefan Agner41f75bb2016-07-20 21:27:49 -0700104 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
105
106#define UBI_BOOTCMD \
107 "ubiargs=ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs " \
108 "ubi.fm_autoconvert=1\0" \
109 "ubiboot=run setup; " \
110 "setenv bootargs ${defargs} ${ubiargs} " \
111 "${setupargs} ${vidargs}; echo Booting from NAND...; " \
112 "ubi part ubi && run m4boot && " \
113 "ubi read ${kernel_addr_r} kernel && " \
114 "ubi read ${fdt_addr_r} dtb && " \
115 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
116
Stefan Agnercbd59fe2018-08-06 09:19:19 +0200117#if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
Stefan Agner7df0ce82019-01-08 12:42:28 +0100118#define CONFIG_BOOTCOMMAND "run ubiboot ; echo ; echo ubiboot failed ; " \
Stefan Agnercbd59fe2018-08-06 09:19:19 +0200119 "setenv fdtfile ${soc}-colibri-${fdt_board}.dtb && run distro_bootcmd;"
120#define MODULE_EXTRA_ENV_SETTINGS \
121 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
122 UBI_BOOTCMD
123#elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
Stefan Agner7df0ce82019-01-08 12:42:28 +0100124#define CONFIG_BOOTCOMMAND "run emmcboot ; echo ; echo emmcboot failed ; " \
Stefan Agnercbd59fe2018-08-06 09:19:19 +0200125 "setenv fdtfile ${soc}-colibri-emmc-${fdt_board}.dtb && run distro_bootcmd;"
126#define MODULE_EXTRA_ENV_SETTINGS \
127 "variant=-emmc\0" \
128 EMMC_BOOTCMD
129#endif
130
131#if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
132#define BOOT_TARGET_DEVICES(func) \
133 func(MMC, mmc, 0) \
134 func(USB, usb, 0) \
135 func(DHCP, dhcp, na)
136#elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
137#define BOOT_TARGET_DEVICES(func) \
138 func(MMC, mmc, 0) \
139 func(MMC, mmc, 1) \
140 func(USB, usb, 0) \
141 func(DHCP, dhcp, na)
142#endif
143#include <config_distro_bootcmd.h>
Stefan Agner41f75bb2016-07-20 21:27:49 -0700144
145#define CONFIG_EXTRA_ENV_SETTINGS \
Stefan Agnercbd59fe2018-08-06 09:19:19 +0200146 BOOTENV \
Stefan Agner41f75bb2016-07-20 21:27:49 -0700147 MEM_LAYOUT_ENV_SETTINGS \
148 NFS_BOOTCMD \
149 SD_BOOTCMD \
Stefan Agnercbd59fe2018-08-06 09:19:19 +0200150 MODULE_EXTRA_ENV_SETTINGS \
Stefan Agner7df0ce82019-01-08 12:42:28 +0100151 "boot_file=zImage\0" \
Stefan Agner41f75bb2016-07-20 21:27:49 -0700152 "console=ttymxc0\0" \
153 "defargs=\0" \
154 "fdt_board=eval-v3\0" \
155 "fdt_fixup=;\0" \
156 "m4boot=;\0" \
157 "ip_dyn=yes\0" \
158 "kernel_file=zImage\0" \
Stefan Agner41f75bb2016-07-20 21:27:49 -0700159 "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \
160 "00:14:2d:00:00:00; fi; tftpboot ${loadaddr} " \
161 "${board}/flash_eth.img && source ${loadaddr}\0" \
162 "setsdupdate=mmc rescan && setenv interface mmc && " \
163 "fatload ${interface} 0:1 ${loadaddr} " \
164 "${board}/flash_blk.img && source ${loadaddr}\0" \
165 "setup=setenv setupargs " \
166 "console=tty1 console=${console}" \
Stefan Agner6a667482017-03-09 17:17:54 -0800167 ",${baudrate}n8 ${memargs} consoleblank=0\0" \
Stefan Agner41f75bb2016-07-20 21:27:49 -0700168 "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \
169 "setusbupdate=usb start && setenv interface usb && " \
170 "fatload ${interface} 0:1 ${loadaddr} " \
171 "${board}/flash_blk.img && source ${loadaddr}\0" \
172 "splashpos=m,m\0" \
173 "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" \
Stefan Agner1575b542017-03-09 17:17:55 -0800174 "updlevel=2\0"
Stefan Agner41f75bb2016-07-20 21:27:49 -0700175
176/* Miscellaneous configurable options */
Stefan Agner41f75bb2016-07-20 21:27:49 -0700177
178#define CONFIG_SYS_MEMTEST_START 0x80000000
179#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x0c000000)
180
181#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
182#define CONFIG_SYS_HZ 1000
183
Stefan Agner41f75bb2016-07-20 21:27:49 -0700184/* Physical Memory Map */
Stefan Agner41f75bb2016-07-20 21:27:49 -0700185#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
186
187#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
188#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
189#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
190
191#define CONFIG_SYS_INIT_SP_OFFSET \
192 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
193#define CONFIG_SYS_INIT_SP_ADDR \
194 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
195
Masahiro Yamada8cea9b52017-02-11 22:43:54 +0900196/* environment organization */
Stefan Agner41f75bb2016-07-20 21:27:49 -0700197
198#if defined(CONFIG_ENV_IS_IN_MMC)
Stefan Agnercbd59fe2018-08-06 09:19:19 +0200199/* Environment in eMMC, before config block at the end of 1st "boot sector" */
200#define CONFIG_ENV_SIZE (8 * 1024)
201#define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE + \
202 CONFIG_TDX_CFG_BLOCK_OFFSET)
203#define CONFIG_SYS_MMC_ENV_DEV 0
204#define CONFIG_SYS_MMC_ENV_PART 1
Stefan Agner41f75bb2016-07-20 21:27:49 -0700205#elif defined(CONFIG_ENV_IS_IN_NAND)
Stefan Agner41f75bb2016-07-20 21:27:49 -0700206#define CONFIG_ENV_SECT_SIZE (128 * 1024)
Stefan Agner1575b542017-03-09 17:17:55 -0800207#define CONFIG_ENV_OFFSET (28 * CONFIG_ENV_SECT_SIZE)
Stefan Agner41f75bb2016-07-20 21:27:49 -0700208#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
209#endif
210
Stefan Agnercbd59fe2018-08-06 09:19:19 +0200211#ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND
Stefan Agner41f75bb2016-07-20 21:27:49 -0700212/* NAND stuff */
213#define CONFIG_SYS_MAX_NAND_DEVICE 1
214#define CONFIG_SYS_NAND_BASE 0x40000000
215#define CONFIG_SYS_NAND_5_ADDR_CYCLE
216#define CONFIG_SYS_NAND_ONFI_DETECTION
217#define CONFIG_SYS_NAND_MX7_GPMI_62_ECC_BYTES
Stefan Agnercbd59fe2018-08-06 09:19:19 +0200218#endif
Stefan Agner41f75bb2016-07-20 21:27:49 -0700219
220/* USB Configs */
Stefan Agner41f75bb2016-07-20 21:27:49 -0700221#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
222
223#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
224#define CONFIG_MXC_USB_FLAGS 0
225#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
226
227#define CONFIG_IMX_THERMAL
228
229#define CONFIG_USBD_HS
230
Stefan Agner41f75bb2016-07-20 21:27:49 -0700231/* USB Device Firmware Update support */
Stefan Agner41f75bb2016-07-20 21:27:49 -0700232#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M
233#define DFU_DEFAULT_POLL_TIMEOUT 300
234
Igor Opaniukf5abe402019-06-04 00:05:59 +0300235#if defined(CONFIG_VIDEO) || defined(CONFIG_DM_VIDEO)
Stefan Agner41f75bb2016-07-20 21:27:49 -0700236#define CONFIG_VIDEO_MXS
237#define CONFIG_VIDEO_LOGO
Stefan Agner41f75bb2016-07-20 21:27:49 -0700238#define CONFIG_SPLASH_SCREEN
239#define CONFIG_SPLASH_SCREEN_ALIGN
Stefan Agner41f75bb2016-07-20 21:27:49 -0700240#define CONFIG_BMP_16BPP
241#define CONFIG_VIDEO_BMP_RLE8
242#define CONFIG_VIDEO_BMP_LOGO
243#endif
244
245#endif