blob: 545f506e97f75bc27c1b6a69f1c0eb56cf5e877a [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Stefan Agnerae440ab2016-07-20 21:27:49 -07002/*
Stefan Agnera62c6062018-08-06 09:19:19 +02003 * Copyright 2016-2018 Toradex AG
Stefan Agnerae440ab2016-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 Agnerae440ab2016-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 Agnerae440ab2016-07-20 21:27:49 -070016/* Size of malloc() pool */
17#define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M)
18
Stefan Agnerae440ab2016-07-20 21:27:49 -070019/* Network */
20#define CONFIG_FEC_MXC
Stefan Agnerae440ab2016-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
Stefan Agnerae440ab2016-07-20 21:27:49 -070025#define CONFIG_IP_DEFRAG
Marcel Ziswilerf7c81e22016-09-15 00:54:00 +020026#define CONFIG_TFTP_BLOCKSIZE 16352
27#define CONFIG_TFTP_TSIZE
Stefan Agnerae440ab2016-07-20 21:27:49 -070028
29/* ENET1 */
30#define IMX_FEC_BASE ENET_IPS_BASE_ADDR
31
32/* MMC Config*/
33#define CONFIG_SYS_FSL_ESDHC_ADDR 0
Stefan Agnera62c6062018-08-06 09:19:19 +020034#ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND
Stefan Agnerae440ab2016-07-20 21:27:49 -070035#define CONFIG_SYS_FSL_USDHC_NUM 1
Stefan Agnera62c6062018-08-06 09:19:19 +020036#elif CONFIG_TARGET_COLIBRI_IMX7_EMMC
37#define CONFIG_SYS_FSL_USDHC_NUM 2
Stefan Agnera62c6062018-08-06 09:19:19 +020038#endif
Stefan Agnerae440ab2016-07-20 21:27:49 -070039
40#undef CONFIG_BOOTM_PLAN9
41#undef CONFIG_BOOTM_RTEMS
42
43/* I2C configs */
Stefan Agnerae440ab2016-07-20 21:27:49 -070044#define CONFIG_SYS_I2C_MXC
Stefan Agnerae440ab2016-07-20 21:27:49 -070045#define CONFIG_SYS_I2C_SPEED 100000
46
47#define CONFIG_IPADDR 192.168.10.2
48#define CONFIG_NETMASK 255.255.255.0
49#define CONFIG_SERVERIP 192.168.10.1
50
Stefan Agnera62c6062018-08-06 09:19:19 +020051#define EMMC_BOOTCMD \
Igor Opaniukc585f8e2019-05-29 13:00:39 +030052 "set_emmcargs=setenv emmcargs ip=off root=PARTUUID=${uuid} ro " \
53 "rootfstype=ext4 rootwait\0" \
54 "emmcboot=run setup; run emmcfinduuid; run set_emmcargs; " \
Stefan Agnera62c6062018-08-06 09:19:19 +020055 "setenv bootargs ${defargs} ${emmcargs} ${setupargs} " \
56 "${vidargs}; echo Booting from internal eMMC chip...; " \
57 "run m4boot && " \
Igor Opaniukc585f8e2019-05-29 13:00:39 +030058 "load mmc ${emmcdev}:${emmcbootpart} ${fdt_addr_r} " \
59 "${soc}-colibri-emmc-${fdt_board}.dtb && " \
60 "load mmc ${emmcdev}:${emmcbootpart} ${kernel_addr_r} " \
61 "${boot_file} && run fdt_fixup && " \
62 "bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
63 "emmcbootpart=1\0" \
64 "emmcdev=0\0" \
65 "emmcfinduuid=part uuid mmc ${emmcdev}:${emmcrootpart} uuid\0" \
66 "emmcrootpart=2\0"
67
Stefan Agnera62c6062018-08-06 09:19:19 +020068
Stefan Agnerae440ab2016-07-20 21:27:49 -070069#define MEM_LAYOUT_ENV_SETTINGS \
Stefan Agner9af131e2017-03-09 17:17:51 -080070 "bootm_size=0x10000000\0" \
Stefan Agnerae440ab2016-07-20 21:27:49 -070071 "fdt_addr_r=0x82000000\0" \
72 "fdt_high=0xffffffff\0" \
73 "initrd_high=0xffffffff\0" \
74 "kernel_addr_r=0x81000000\0" \
75 "ramdisk_addr_r=0x82100000\0"
76
Stefan Agnera62c6062018-08-06 09:19:19 +020077#if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
Igor Opaniukc585f8e2019-05-29 13:00:39 +030078#define SD_BOOTDEV 0
Stefan Agnera62c6062018-08-06 09:19:19 +020079#elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
Igor Opaniukc585f8e2019-05-29 13:00:39 +030080#define SD_BOOTDEV 1
81#endif
82
Stefan Agnera62c6062018-08-06 09:19:19 +020083#define SD_BOOTCMD \
Igor Opaniukc585f8e2019-05-29 13:00:39 +030084 "set_sdargs=setenv sdargs root=PARTUUID=${uuid} ro rootwait\0" \
85 "sdboot=run setup; run sdfinduuid; run set_sdargs; " \
86 "setenv bootargs ${defargs} ${sdargs} " \
Stefan Agnera62c6062018-08-06 09:19:19 +020087 "${setupargs} ${vidargs}; echo Booting from MMC/SD card...; " \
88 "run m4boot && " \
Igor Opaniukc585f8e2019-05-29 13:00:39 +030089 "load mmc ${sddev}:${sdbootpart} ${kernel_addr_r} ${kernel_file} && " \
90 "load mmc ${sddev}:${sdbootpart} ${fdt_addr_r} " \
91 "${soc}-colibri-${fdt_board}.dtb && " \
92 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
93 "sdbootpart=1\0" \
94 "sddev=" __stringify(SD_BOOTDEV) "\0" \
95 "sdfinduuid=part uuid mmc ${sddev}:${sdrootpart} uuid\0" \
96 "sdrootpart=2\0"
Stefan Agnera62c6062018-08-06 09:19:19 +020097
Stefan Agnerae440ab2016-07-20 21:27:49 -070098
99#define NFS_BOOTCMD \
Stefan Agnera62c6062018-08-06 09:19:19 +0200100 "nfsargs=ip=:::::eth0: root=/dev/nfs\0" \
Stefan Agnerae440ab2016-07-20 21:27:49 -0700101 "nfsboot=run setup; " \
102 "setenv bootargs ${defargs} ${nfsargs} " \
103 "${setupargs} ${vidargs}; echo Booting from NFS...;" \
Stefan Agnera62c6062018-08-06 09:19:19 +0200104 "dhcp ${kernel_addr_r} && " \
105 "tftp ${fdt_addr_r} ${soc}-colibri${variant}-${fdt_board}.dtb && " \
Stefan Agnerae440ab2016-07-20 21:27:49 -0700106 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
107
108#define UBI_BOOTCMD \
109 "ubiargs=ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs " \
110 "ubi.fm_autoconvert=1\0" \
111 "ubiboot=run setup; " \
112 "setenv bootargs ${defargs} ${ubiargs} " \
113 "${setupargs} ${vidargs}; echo Booting from NAND...; " \
114 "ubi part ubi && run m4boot && " \
115 "ubi read ${kernel_addr_r} kernel && " \
116 "ubi read ${fdt_addr_r} dtb && " \
117 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
118
Stefan Agnera62c6062018-08-06 09:19:19 +0200119#if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
Stefan Agner2bc18ce2019-01-08 12:42:28 +0100120#define CONFIG_BOOTCOMMAND "run ubiboot ; echo ; echo ubiboot failed ; " \
Stefan Agnera62c6062018-08-06 09:19:19 +0200121 "setenv fdtfile ${soc}-colibri-${fdt_board}.dtb && run distro_bootcmd;"
122#define MODULE_EXTRA_ENV_SETTINGS \
123 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
124 UBI_BOOTCMD
125#elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
Stefan Agner2bc18ce2019-01-08 12:42:28 +0100126#define CONFIG_BOOTCOMMAND "run emmcboot ; echo ; echo emmcboot failed ; " \
Stefan Agnera62c6062018-08-06 09:19:19 +0200127 "setenv fdtfile ${soc}-colibri-emmc-${fdt_board}.dtb && run distro_bootcmd;"
128#define MODULE_EXTRA_ENV_SETTINGS \
129 "variant=-emmc\0" \
130 EMMC_BOOTCMD
131#endif
132
133#if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
134#define BOOT_TARGET_DEVICES(func) \
135 func(MMC, mmc, 0) \
136 func(USB, usb, 0) \
137 func(DHCP, dhcp, na)
138#elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
139#define BOOT_TARGET_DEVICES(func) \
140 func(MMC, mmc, 0) \
141 func(MMC, mmc, 1) \
142 func(USB, usb, 0) \
143 func(DHCP, dhcp, na)
144#endif
145#include <config_distro_bootcmd.h>
Stefan Agnerae440ab2016-07-20 21:27:49 -0700146
147#define CONFIG_EXTRA_ENV_SETTINGS \
Stefan Agnera62c6062018-08-06 09:19:19 +0200148 BOOTENV \
Stefan Agnerae440ab2016-07-20 21:27:49 -0700149 MEM_LAYOUT_ENV_SETTINGS \
150 NFS_BOOTCMD \
151 SD_BOOTCMD \
Stefan Agnera62c6062018-08-06 09:19:19 +0200152 MODULE_EXTRA_ENV_SETTINGS \
Stefan Agner2bc18ce2019-01-08 12:42:28 +0100153 "boot_file=zImage\0" \
Stefan Agnerae440ab2016-07-20 21:27:49 -0700154 "console=ttymxc0\0" \
155 "defargs=\0" \
156 "fdt_board=eval-v3\0" \
157 "fdt_fixup=;\0" \
158 "m4boot=;\0" \
159 "ip_dyn=yes\0" \
160 "kernel_file=zImage\0" \
Stefan Agnerae440ab2016-07-20 21:27:49 -0700161 "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \
162 "00:14:2d:00:00:00; fi; tftpboot ${loadaddr} " \
163 "${board}/flash_eth.img && source ${loadaddr}\0" \
164 "setsdupdate=mmc rescan && setenv interface mmc && " \
165 "fatload ${interface} 0:1 ${loadaddr} " \
166 "${board}/flash_blk.img && source ${loadaddr}\0" \
167 "setup=setenv setupargs " \
168 "console=tty1 console=${console}" \
Stefan Agner64095702017-03-09 17:17:54 -0800169 ",${baudrate}n8 ${memargs} consoleblank=0\0" \
Stefan Agnerae440ab2016-07-20 21:27:49 -0700170 "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \
171 "setusbupdate=usb start && setenv interface usb && " \
172 "fatload ${interface} 0:1 ${loadaddr} " \
173 "${board}/flash_blk.img && source ${loadaddr}\0" \
174 "splashpos=m,m\0" \
175 "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 Agner38045f52017-03-09 17:17:55 -0800176 "updlevel=2\0"
Stefan Agnerae440ab2016-07-20 21:27:49 -0700177
178/* Miscellaneous configurable options */
Stefan Agnerae440ab2016-07-20 21:27:49 -0700179
180#define CONFIG_SYS_MEMTEST_START 0x80000000
181#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x0c000000)
182
183#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
184#define CONFIG_SYS_HZ 1000
185
Stefan Agnerae440ab2016-07-20 21:27:49 -0700186/* Physical Memory Map */
Stefan Agnerae440ab2016-07-20 21:27:49 -0700187#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
188
189#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
190#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
191#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
192
193#define CONFIG_SYS_INIT_SP_OFFSET \
194 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
195#define CONFIG_SYS_INIT_SP_ADDR \
196 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
197
Masahiro Yamadae856bdc2017-02-11 22:43:54 +0900198/* environment organization */
Stefan Agnerae440ab2016-07-20 21:27:49 -0700199
200#if defined(CONFIG_ENV_IS_IN_MMC)
Stefan Agnera62c6062018-08-06 09:19:19 +0200201/* Environment in eMMC, before config block at the end of 1st "boot sector" */
202#define CONFIG_ENV_SIZE (8 * 1024)
203#define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE + \
204 CONFIG_TDX_CFG_BLOCK_OFFSET)
205#define CONFIG_SYS_MMC_ENV_DEV 0
206#define CONFIG_SYS_MMC_ENV_PART 1
Stefan Agnerae440ab2016-07-20 21:27:49 -0700207#elif defined(CONFIG_ENV_IS_IN_NAND)
Stefan Agnerae440ab2016-07-20 21:27:49 -0700208#define CONFIG_ENV_SECT_SIZE (128 * 1024)
Stefan Agner38045f52017-03-09 17:17:55 -0800209#define CONFIG_ENV_OFFSET (28 * CONFIG_ENV_SECT_SIZE)
Stefan Agnerae440ab2016-07-20 21:27:49 -0700210#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
211#endif
212
Stefan Agnera62c6062018-08-06 09:19:19 +0200213#ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND
Stefan Agnerae440ab2016-07-20 21:27:49 -0700214/* NAND stuff */
215#define CONFIG_SYS_MAX_NAND_DEVICE 1
216#define CONFIG_SYS_NAND_BASE 0x40000000
217#define CONFIG_SYS_NAND_5_ADDR_CYCLE
218#define CONFIG_SYS_NAND_ONFI_DETECTION
219#define CONFIG_SYS_NAND_MX7_GPMI_62_ECC_BYTES
Stefan Agnera62c6062018-08-06 09:19:19 +0200220#endif
Stefan Agnerae440ab2016-07-20 21:27:49 -0700221
222/* USB Configs */
Stefan Agnerae440ab2016-07-20 21:27:49 -0700223#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
224
225#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
226#define CONFIG_MXC_USB_FLAGS 0
227#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
228
229#define CONFIG_IMX_THERMAL
230
231#define CONFIG_USBD_HS
232
Stefan Agnerae440ab2016-07-20 21:27:49 -0700233/* USB Device Firmware Update support */
Stefan Agnerae440ab2016-07-20 21:27:49 -0700234#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M
235#define DFU_DEFAULT_POLL_TIMEOUT 300
236
Igor Opaniuk8c1df092019-06-04 00:05:59 +0300237#if defined(CONFIG_VIDEO) || defined(CONFIG_DM_VIDEO)
Stefan Agnerae440ab2016-07-20 21:27:49 -0700238#define CONFIG_VIDEO_MXS
239#define CONFIG_VIDEO_LOGO
Stefan Agnerae440ab2016-07-20 21:27:49 -0700240#define CONFIG_SPLASH_SCREEN
241#define CONFIG_SPLASH_SCREEN_ALIGN
Stefan Agnerae440ab2016-07-20 21:27:49 -0700242#define CONFIG_BMP_16BPP
243#define CONFIG_VIDEO_BMP_RLE8
244#define CONFIG_VIDEO_BMP_LOGO
245#endif
246
247#endif