blob: 5a4b9801cb7720ae14a15fa44c39fb3e047e89af [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
Stefan Agner41f75bb2016-07-20 21:27:49 -070025#define CONFIG_IP_DEFRAG
Marcel Ziswiler36124b92016-09-15 00:54:00 +020026#define CONFIG_TFTP_BLOCKSIZE 16352
27#define CONFIG_TFTP_TSIZE
Stefan Agner41f75bb2016-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 Agnercbd59fe2018-08-06 09:19:19 +020034#ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND
Stefan Agner41f75bb2016-07-20 21:27:49 -070035#define CONFIG_SYS_FSL_USDHC_NUM 1
Stefan Agnercbd59fe2018-08-06 09:19:19 +020036#elif CONFIG_TARGET_COLIBRI_IMX7_EMMC
37#define CONFIG_SYS_FSL_USDHC_NUM 2
38
39#define CONFIG_SUPPORT_EMMC_BOOT
40#endif
Stefan Agner41f75bb2016-07-20 21:27:49 -070041
42#undef CONFIG_BOOTM_PLAN9
43#undef CONFIG_BOOTM_RTEMS
44
45/* I2C configs */
Stefan Agner41f75bb2016-07-20 21:27:49 -070046#define CONFIG_SYS_I2C_MXC
Stefan Agner41f75bb2016-07-20 21:27:49 -070047#define CONFIG_SYS_I2C_SPEED 100000
48
49#define CONFIG_IPADDR 192.168.10.2
50#define CONFIG_NETMASK 255.255.255.0
51#define CONFIG_SERVERIP 192.168.10.1
52
Stefan Agnercbd59fe2018-08-06 09:19:19 +020053#define EMMC_BOOTCMD \
54 "emmcargs=ip=off root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait\0" \
55 "emmcboot=run setup; " \
56 "setenv bootargs ${defargs} ${emmcargs} ${setupargs} " \
57 "${vidargs}; echo Booting from internal eMMC chip...; " \
58 "run m4boot && " \
59 "load mmc 0:1 ${fdt_addr_r} ${soc}-colibri-emmc-${fdt_board}.dtb && " \
60 "load mmc 0:1 ${kernel_addr_r} ${boot_file} && " \
61 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0"
62
Stefan Agner41f75bb2016-07-20 21:27:49 -070063#define MEM_LAYOUT_ENV_SETTINGS \
Stefan Agner35eebee2017-03-09 17:17:51 -080064 "bootm_size=0x10000000\0" \
Stefan Agner41f75bb2016-07-20 21:27:49 -070065 "fdt_addr_r=0x82000000\0" \
66 "fdt_high=0xffffffff\0" \
67 "initrd_high=0xffffffff\0" \
68 "kernel_addr_r=0x81000000\0" \
69 "ramdisk_addr_r=0x82100000\0"
70
Stefan Agnercbd59fe2018-08-06 09:19:19 +020071#if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
Stefan Agner41f75bb2016-07-20 21:27:49 -070072#define SD_BOOTCMD \
Stefan Agnercbd59fe2018-08-06 09:19:19 +020073 "sdargs=root=/dev/mmcblk0p2 ro rootwait\0" \
Stefan Agner41f75bb2016-07-20 21:27:49 -070074 "sdboot=run setup; setenv bootargs ${defargs} ${sdargs} " \
75 "${setupargs} ${vidargs}; echo Booting from MMC/SD card...; " \
76 "run m4boot && " \
77 "load mmc 0:1 ${kernel_addr_r} ${kernel_file} && " \
78 "load mmc 0:1 ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && " \
Stefan Agnercbd59fe2018-08-06 09:19:19 +020079 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0"
80#elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
81#define SD_BOOTCMD \
82 "sdargs=root=/dev/mmcblk1p2 ro rootwait\0" \
83 "sdboot=run setup; setenv bootargs ${defargs} ${sdargs} " \
84 "${setupargs} ${vidargs}; echo Booting from MMC/SD card...; " \
85 "run m4boot && " \
86 "load mmc 1:1 ${kernel_addr_r} ${kernel_file} && " \
87 "load mmc 1:1 ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && " \
88 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0"
89#endif
90
Stefan Agner41f75bb2016-07-20 21:27:49 -070091
92#define NFS_BOOTCMD \
Stefan Agnercbd59fe2018-08-06 09:19:19 +020093 "nfsargs=ip=:::::eth0: root=/dev/nfs\0" \
Stefan Agner41f75bb2016-07-20 21:27:49 -070094 "nfsboot=run setup; " \
95 "setenv bootargs ${defargs} ${nfsargs} " \
96 "${setupargs} ${vidargs}; echo Booting from NFS...;" \
Stefan Agnercbd59fe2018-08-06 09:19:19 +020097 "dhcp ${kernel_addr_r} && " \
98 "tftp ${fdt_addr_r} ${soc}-colibri${variant}-${fdt_board}.dtb && " \
Stefan Agner41f75bb2016-07-20 21:27:49 -070099 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
100
101#define UBI_BOOTCMD \
102 "ubiargs=ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs " \
103 "ubi.fm_autoconvert=1\0" \
104 "ubiboot=run setup; " \
105 "setenv bootargs ${defargs} ${ubiargs} " \
106 "${setupargs} ${vidargs}; echo Booting from NAND...; " \
107 "ubi part ubi && run m4boot && " \
108 "ubi read ${kernel_addr_r} kernel && " \
109 "ubi read ${fdt_addr_r} dtb && " \
110 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
111
Stefan Agnercbd59fe2018-08-06 09:19:19 +0200112#if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
Stefan Agner7df0ce82019-01-08 12:42:28 +0100113#define CONFIG_BOOTCOMMAND "run ubiboot ; echo ; echo ubiboot failed ; " \
Stefan Agnercbd59fe2018-08-06 09:19:19 +0200114 "setenv fdtfile ${soc}-colibri-${fdt_board}.dtb && run distro_bootcmd;"
115#define MODULE_EXTRA_ENV_SETTINGS \
116 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
117 UBI_BOOTCMD
118#elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
Stefan Agner7df0ce82019-01-08 12:42:28 +0100119#define CONFIG_BOOTCOMMAND "run emmcboot ; echo ; echo emmcboot failed ; " \
Stefan Agnercbd59fe2018-08-06 09:19:19 +0200120 "setenv fdtfile ${soc}-colibri-emmc-${fdt_board}.dtb && run distro_bootcmd;"
121#define MODULE_EXTRA_ENV_SETTINGS \
122 "variant=-emmc\0" \
123 EMMC_BOOTCMD
124#endif
125
126#if defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
127#define BOOT_TARGET_DEVICES(func) \
128 func(MMC, mmc, 0) \
129 func(USB, usb, 0) \
130 func(DHCP, dhcp, na)
131#elif defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
132#define BOOT_TARGET_DEVICES(func) \
133 func(MMC, mmc, 0) \
134 func(MMC, mmc, 1) \
135 func(USB, usb, 0) \
136 func(DHCP, dhcp, na)
137#endif
138#include <config_distro_bootcmd.h>
Stefan Agner41f75bb2016-07-20 21:27:49 -0700139
140#define CONFIG_EXTRA_ENV_SETTINGS \
Stefan Agnercbd59fe2018-08-06 09:19:19 +0200141 BOOTENV \
Stefan Agner41f75bb2016-07-20 21:27:49 -0700142 MEM_LAYOUT_ENV_SETTINGS \
143 NFS_BOOTCMD \
144 SD_BOOTCMD \
Stefan Agnercbd59fe2018-08-06 09:19:19 +0200145 MODULE_EXTRA_ENV_SETTINGS \
Stefan Agner7df0ce82019-01-08 12:42:28 +0100146 "boot_file=zImage\0" \
Stefan Agner41f75bb2016-07-20 21:27:49 -0700147 "console=ttymxc0\0" \
148 "defargs=\0" \
149 "fdt_board=eval-v3\0" \
150 "fdt_fixup=;\0" \
151 "m4boot=;\0" \
152 "ip_dyn=yes\0" \
153 "kernel_file=zImage\0" \
Stefan Agner41f75bb2016-07-20 21:27:49 -0700154 "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \
155 "00:14:2d:00:00:00; fi; tftpboot ${loadaddr} " \
156 "${board}/flash_eth.img && source ${loadaddr}\0" \
157 "setsdupdate=mmc rescan && setenv interface mmc && " \
158 "fatload ${interface} 0:1 ${loadaddr} " \
159 "${board}/flash_blk.img && source ${loadaddr}\0" \
160 "setup=setenv setupargs " \
161 "console=tty1 console=${console}" \
Stefan Agner6a667482017-03-09 17:17:54 -0800162 ",${baudrate}n8 ${memargs} consoleblank=0\0" \
Stefan Agner41f75bb2016-07-20 21:27:49 -0700163 "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \
164 "setusbupdate=usb start && setenv interface usb && " \
165 "fatload ${interface} 0:1 ${loadaddr} " \
166 "${board}/flash_blk.img && source ${loadaddr}\0" \
167 "splashpos=m,m\0" \
168 "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 -0800169 "updlevel=2\0"
Stefan Agner41f75bb2016-07-20 21:27:49 -0700170
171/* Miscellaneous configurable options */
Stefan Agner41f75bb2016-07-20 21:27:49 -0700172
173#define CONFIG_SYS_MEMTEST_START 0x80000000
174#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x0c000000)
175
176#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
177#define CONFIG_SYS_HZ 1000
178
Stefan Agner41f75bb2016-07-20 21:27:49 -0700179/* Physical Memory Map */
Stefan Agner41f75bb2016-07-20 21:27:49 -0700180#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
181
182#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
183#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
184#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
185
186#define CONFIG_SYS_INIT_SP_OFFSET \
187 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
188#define CONFIG_SYS_INIT_SP_ADDR \
189 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
190
Masahiro Yamada8cea9b52017-02-11 22:43:54 +0900191/* environment organization */
Stefan Agner41f75bb2016-07-20 21:27:49 -0700192
193#if defined(CONFIG_ENV_IS_IN_MMC)
Stefan Agnercbd59fe2018-08-06 09:19:19 +0200194/* Environment in eMMC, before config block at the end of 1st "boot sector" */
195#define CONFIG_ENV_SIZE (8 * 1024)
196#define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE + \
197 CONFIG_TDX_CFG_BLOCK_OFFSET)
198#define CONFIG_SYS_MMC_ENV_DEV 0
199#define CONFIG_SYS_MMC_ENV_PART 1
Stefan Agner41f75bb2016-07-20 21:27:49 -0700200#elif defined(CONFIG_ENV_IS_IN_NAND)
Stefan Agner41f75bb2016-07-20 21:27:49 -0700201#define CONFIG_ENV_SECT_SIZE (128 * 1024)
Stefan Agner1575b542017-03-09 17:17:55 -0800202#define CONFIG_ENV_OFFSET (28 * CONFIG_ENV_SECT_SIZE)
Stefan Agner41f75bb2016-07-20 21:27:49 -0700203#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
204#endif
205
Stefan Agnercbd59fe2018-08-06 09:19:19 +0200206#ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND
Stefan Agner41f75bb2016-07-20 21:27:49 -0700207/* NAND stuff */
208#define CONFIG_SYS_MAX_NAND_DEVICE 1
209#define CONFIG_SYS_NAND_BASE 0x40000000
210#define CONFIG_SYS_NAND_5_ADDR_CYCLE
211#define CONFIG_SYS_NAND_ONFI_DETECTION
212#define CONFIG_SYS_NAND_MX7_GPMI_62_ECC_BYTES
Stefan Agnercbd59fe2018-08-06 09:19:19 +0200213#endif
Stefan Agner41f75bb2016-07-20 21:27:49 -0700214
215/* USB Configs */
Stefan Agner41f75bb2016-07-20 21:27:49 -0700216#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
217
218#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
219#define CONFIG_MXC_USB_FLAGS 0
220#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
221
222#define CONFIG_IMX_THERMAL
223
224#define CONFIG_USBD_HS
225
Stefan Agner41f75bb2016-07-20 21:27:49 -0700226/* USB Device Firmware Update support */
Stefan Agner41f75bb2016-07-20 21:27:49 -0700227#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M
228#define DFU_DEFAULT_POLL_TIMEOUT 300
229
Stefan Agner41f75bb2016-07-20 21:27:49 -0700230#ifdef CONFIG_VIDEO
Stefan Agner41f75bb2016-07-20 21:27:49 -0700231#define CONFIG_VIDEO_MXS
232#define CONFIG_VIDEO_LOGO
Stefan Agner41f75bb2016-07-20 21:27:49 -0700233#define CONFIG_SPLASH_SCREEN
234#define CONFIG_SPLASH_SCREEN_ALIGN
Stefan Agner41f75bb2016-07-20 21:27:49 -0700235#define CONFIG_BMP_16BPP
236#define CONFIG_VIDEO_BMP_RLE8
237#define CONFIG_VIDEO_BMP_LOGO
238#endif
239
240#endif