blob: 87d201298490e5afb81a5b4a8a88980870c8e98c [file] [log] [blame]
Stefan Agner41f75bb2016-07-20 21:27:49 -07001/*
2 * Copyright 2016 Toradex AG
3 *
4 * Configuration settings for the Colibri iMX7 module.
5 *
6 * based on mx7dsabresd.h:
7 * Copyright (C) 2015 Freescale Semiconductor, Inc.
8 *
9 * SPDX-License-Identifier: GPL-2.0+
10 */
11
12#ifndef __COLIBRI_IMX7_CONFIG_H
13#define __COLIBRI_IMX7_CONFIG_H
14
15#include "mx7_common.h"
16
Stefan Agner41f75bb2016-07-20 21:27:49 -070017/*#define CONFIG_DBG_MONITOR*/
18#define PHYS_SDRAM_SIZE SZ_512M
19
Marcel Ziswilerd92dee52016-11-16 17:49:23 +010020#define CONFIG_DISPLAY_BOARDINFO_LATE /* Calls show_board_info() */
21
22#define CONFIG_ENV_VARS_UBOOT_CONFIG
23#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
Stefan Agner41f75bb2016-07-20 21:27:49 -070024
25/* Size of malloc() pool */
26#define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M)
27
Stefan Agner41f75bb2016-07-20 21:27:49 -070028#define CONFIG_CMD_BMODE
29
30/* Network */
31#define CONFIG_FEC_MXC
32#define CONFIG_MII
33#define CONFIG_FEC_XCV_TYPE RMII
34#define CONFIG_ETHPRIME "FEC"
35#define CONFIG_FEC_MXC_PHYADDR 0
36
37#define CONFIG_PHYLIB
38#define CONFIG_PHY_MICREL
Stefan Agner41f75bb2016-07-20 21:27:49 -070039#define CONFIG_IP_DEFRAG
Marcel Ziswiler36124b92016-09-15 00:54:00 +020040#define CONFIG_TFTP_BLOCKSIZE 16352
41#define CONFIG_TFTP_TSIZE
Stefan Agner41f75bb2016-07-20 21:27:49 -070042
43/* ENET1 */
44#define IMX_FEC_BASE ENET_IPS_BASE_ADDR
45
46/* MMC Config*/
47#define CONFIG_SYS_FSL_ESDHC_ADDR 0
48#define CONFIG_SYS_FSL_USDHC_NUM 1
49
50#undef CONFIG_BOOTM_PLAN9
51#undef CONFIG_BOOTM_RTEMS
52
53/* I2C configs */
Stefan Agner41f75bb2016-07-20 21:27:49 -070054#define CONFIG_SYS_I2C_MXC
Stefan Agner41f75bb2016-07-20 21:27:49 -070055#define CONFIG_SYS_I2C_SPEED 100000
56
57#define CONFIG_IPADDR 192.168.10.2
58#define CONFIG_NETMASK 255.255.255.0
59#define CONFIG_SERVERIP 192.168.10.1
60
61#define MEM_LAYOUT_ENV_SETTINGS \
Stefan Agner35eebee2017-03-09 17:17:51 -080062 "bootm_size=0x10000000\0" \
Stefan Agner41f75bb2016-07-20 21:27:49 -070063 "fdt_addr_r=0x82000000\0" \
64 "fdt_high=0xffffffff\0" \
65 "initrd_high=0xffffffff\0" \
66 "kernel_addr_r=0x81000000\0" \
67 "ramdisk_addr_r=0x82100000\0"
68
69#define SD_BOOTCMD \
70 "sdargs=root=/dev/mmcblk0p2 rw rootwait\0" \
71 "sdboot=run setup; setenv bootargs ${defargs} ${sdargs} " \
72 "${setupargs} ${vidargs}; echo Booting from MMC/SD card...; " \
73 "run m4boot && " \
74 "load mmc 0:1 ${kernel_addr_r} ${kernel_file} && " \
75 "load mmc 0:1 ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && " \
76 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
77
78#define NFS_BOOTCMD \
79 "nfsargs=ip=:::::eth0: root=/dev/nfs\0" \
80 "nfsboot=run setup; " \
81 "setenv bootargs ${defargs} ${nfsargs} " \
82 "${setupargs} ${vidargs}; echo Booting from NFS...;" \
83 "dhcp ${kernel_addr_r} && " \
84 "tftp ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && " \
85 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
86
87#define UBI_BOOTCMD \
88 "ubiargs=ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs " \
89 "ubi.fm_autoconvert=1\0" \
90 "ubiboot=run setup; " \
91 "setenv bootargs ${defargs} ${ubiargs} " \
92 "${setupargs} ${vidargs}; echo Booting from NAND...; " \
93 "ubi part ubi && run m4boot && " \
94 "ubi read ${kernel_addr_r} kernel && " \
95 "ubi read ${fdt_addr_r} dtb && " \
96 "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
97
98#define CONFIG_BOOTCOMMAND "run ubiboot; run sdboot; run nfsboot"
99
100#define CONFIG_EXTRA_ENV_SETTINGS \
101 MEM_LAYOUT_ENV_SETTINGS \
102 NFS_BOOTCMD \
103 SD_BOOTCMD \
104 UBI_BOOTCMD \
105 "console=ttymxc0\0" \
106 "defargs=\0" \
107 "fdt_board=eval-v3\0" \
108 "fdt_fixup=;\0" \
109 "m4boot=;\0" \
110 "ip_dyn=yes\0" \
111 "kernel_file=zImage\0" \
112 "mtdparts=" MTDPARTS_DEFAULT "\0" \
113 "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \
114 "00:14:2d:00:00:00; fi; tftpboot ${loadaddr} " \
115 "${board}/flash_eth.img && source ${loadaddr}\0" \
116 "setsdupdate=mmc rescan && setenv interface mmc && " \
117 "fatload ${interface} 0:1 ${loadaddr} " \
118 "${board}/flash_blk.img && source ${loadaddr}\0" \
119 "setup=setenv setupargs " \
120 "console=tty1 console=${console}" \
Stefan Agner6a667482017-03-09 17:17:54 -0800121 ",${baudrate}n8 ${memargs} consoleblank=0\0" \
Stefan Agner41f75bb2016-07-20 21:27:49 -0700122 "setupdate=run setsdupdate || run setusbupdate || run setethupdate\0" \
123 "setusbupdate=usb start && setenv interface usb && " \
124 "fatload ${interface} 0:1 ${loadaddr} " \
125 "${board}/flash_blk.img && source ${loadaddr}\0" \
126 "splashpos=m,m\0" \
127 "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 -0800128 "updlevel=2\0"
Stefan Agner41f75bb2016-07-20 21:27:49 -0700129
130/* Miscellaneous configurable options */
131#define CONFIG_SYS_LONGHELP
132
133#define CONFIG_SYS_MEMTEST_START 0x80000000
134#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x0c000000)
135
136#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
137#define CONFIG_SYS_HZ 1000
138
Stefan Agner41f75bb2016-07-20 21:27:49 -0700139/* Physical Memory Map */
140#define CONFIG_NR_DRAM_BANKS 1
141#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
142
143#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
144#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
145#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
146
147#define CONFIG_SYS_INIT_SP_OFFSET \
148 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
149#define CONFIG_SYS_INIT_SP_ADDR \
150 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
151
Masahiro Yamada8cea9b52017-02-11 22:43:54 +0900152/* environment organization */
Stefan Agner41f75bb2016-07-20 21:27:49 -0700153#define CONFIG_ENV_IS_IN_NAND
154
155#if defined(CONFIG_ENV_IS_IN_MMC)
156#define CONFIG_SYS_MMC_ENV_DEV 0 /* USDHC1 */
157#define CONFIG_SYS_MMC_ENV_PART 0 /* user area */
158#define CONFIG_MMCROOT "/dev/mmcblk0p2" /* USDHC1 */
159#define CONFIG_ENV_OFFSET (8 * SZ_64K)
160#elif defined(CONFIG_ENV_IS_IN_NAND)
Stefan Agner41f75bb2016-07-20 21:27:49 -0700161#define CONFIG_ENV_SECT_SIZE (128 * 1024)
Stefan Agner1575b542017-03-09 17:17:55 -0800162#define CONFIG_ENV_OFFSET (28 * CONFIG_ENV_SECT_SIZE)
Stefan Agner41f75bb2016-07-20 21:27:49 -0700163#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
164#endif
165
166#define CONFIG_NAND_MXS
167#define CONFIG_CMD_NAND_TRIMFFS
168
169/* NAND stuff */
170#define CONFIG_SYS_MAX_NAND_DEVICE 1
171#define CONFIG_SYS_NAND_BASE 0x40000000
172#define CONFIG_SYS_NAND_5_ADDR_CYCLE
173#define CONFIG_SYS_NAND_ONFI_DETECTION
174#define CONFIG_SYS_NAND_MX7_GPMI_62_ECC_BYTES
175#define CONFIG_CMD_NAND_TORTURE
176
177/* UBI stuff */
178#define CONFIG_RBTREE
179#define CONFIG_LZO
Stefan Agner41f75bb2016-07-20 21:27:49 -0700180#define CONFIG_CMD_UBIFS /* increases size by almost 60 KB */
181
182/* Dynamic MTD partition support */
183#define CONFIG_CMD_MTDPARTS /* Enable 'mtdparts' command line support */
184#define CONFIG_MTD_PARTITIONS
185#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
186#define MTDIDS_DEFAULT "nand0=gpmi-nand"
187#define MTDPARTS_DEFAULT "mtdparts=gpmi-nand:" \
188 "512k(mx7-bcb)," \
Stefan Agner1575b542017-03-09 17:17:55 -0800189 "1536k(u-boot1)ro," \
190 "1536k(u-boot2)ro," \
Stefan Agner41f75bb2016-07-20 21:27:49 -0700191 "512k(u-boot-env)," \
192 "-(ubi)"
193
194/* DMA stuff, needed for GPMI/MXS NAND support */
195#define CONFIG_APBH_DMA
196#define CONFIG_APBH_DMA_BURST
197#define CONFIG_APBH_DMA_BURST8
198
199/* USB Configs */
Stefan Agner41f75bb2016-07-20 21:27:49 -0700200#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
201
202#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
203#define CONFIG_MXC_USB_FLAGS 0
204#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
205
206#define CONFIG_IMX_THERMAL
207
208#define CONFIG_USBD_HS
209
210#define CONFIG_USB_FUNCTION_MASS_STORAGE
211
212/* USB Device Firmware Update support */
Stefan Agner41f75bb2016-07-20 21:27:49 -0700213#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M
214#define DFU_DEFAULT_POLL_TIMEOUT 300
215
Stefan Agner41f75bb2016-07-20 21:27:49 -0700216#ifdef CONFIG_VIDEO
Stefan Agner41f75bb2016-07-20 21:27:49 -0700217#define CONFIG_VIDEO_MXS
218#define CONFIG_VIDEO_LOGO
Stefan Agner41f75bb2016-07-20 21:27:49 -0700219#define CONFIG_SPLASH_SCREEN
220#define CONFIG_SPLASH_SCREEN_ALIGN
221#define CONFIG_CMD_BMP
222#define CONFIG_BMP_16BPP
223#define CONFIG_VIDEO_BMP_RLE8
224#define CONFIG_VIDEO_BMP_LOGO
225#endif
226
227#endif