blob: 50f7c21ac2b5d12f0620b9bf86026119589ec0b6 [file] [log] [blame]
Sanchayan Maitye7b860f2015-04-15 16:24:26 +05301/*
2 * Copyright 2015 Toradex, Inc.
3 *
4 * Configuration settings for the Toradex VF50/VF61 module.
5 *
6 * Based on vf610twr.h:
7 * Copyright 2013 Freescale Semiconductor, Inc.
8 *
9 * SPDX-License-Identifier: GPL-2.0+
10 */
11
12#ifndef __CONFIG_H
13#define __CONFIG_H
14
Albert ARIBAUD37098442016-01-27 08:46:11 +010015#define CONFIG_SYS_CACHELINE_SIZE 32
16
Sanchayan Maitye7b860f2015-04-15 16:24:26 +053017#include <asm/arch/imx-regs.h>
Sanchayan Maitye7b860f2015-04-15 16:24:26 +053018
19#define CONFIG_VF610
20#define CONFIG_SYS_THUMB_BUILD
21#define CONFIG_USE_ARCH_MEMCPY
22#define CONFIG_USE_ARCH_MEMSET
Gong Qianyu18fb0e32015-10-26 19:47:42 +080023#define CONFIG_SYS_FSL_CLK
Sanchayan Maitye7b860f2015-04-15 16:24:26 +053024
Sanchayan Maitye7b860f2015-04-15 16:24:26 +053025#define CONFIG_ARCH_MISC_INIT
26#define CONFIG_DISPLAY_CPUINFO
27#define CONFIG_DISPLAY_BOARDINFO
28
29#define CONFIG_SKIP_LOWLEVEL_INIT
30
31#define CONFIG_CMD_FUSE
32#ifdef CONFIG_CMD_FUSE
33#define CONFIG_MXC_OCOTP
34#endif
35
36/* Size of malloc() pool */
37#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
38
39#define CONFIG_BOARD_EARLY_INIT_F
40
Sanchayan Maitye7b860f2015-04-15 16:24:26 +053041/* Allow to overwrite serial and ethaddr */
42#define CONFIG_ENV_OVERWRITE
43#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
44#define CONFIG_VERSION_VARIABLE
Sanchayan Maitye7b860f2015-04-15 16:24:26 +053045#define CONFIG_BAUDRATE 115200
Sanchayan Maitye7b860f2015-04-15 16:24:26 +053046
47/* NAND support */
48#define CONFIG_CMD_NAND
Stefan Agner8fca2d82015-05-08 19:07:13 +020049#define CONFIG_SYS_NAND_ONFI_DETECTION
Sanchayan Maitye7b860f2015-04-15 16:24:26 +053050#define CONFIG_SYS_MAX_NAND_DEVICE 1
51#define CONFIG_SYS_NAND_BASE NFC_BASE_ADDR
52
53/* Dynamic MTD partition support */
54#define CONFIG_CMD_MTDPARTS /* Enable 'mtdparts' command line support */
55#define CONFIG_MTD_PARTITIONS
56#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
57#define MTDIDS_DEFAULT "nand0=vf610_nfc"
58#define MTDPARTS_DEFAULT "mtdparts=vf610_nfc:" \
59 "128k(vf-bcb)ro," \
60 "1408k(u-boot)ro," \
61 "512k(u-boot-env)," \
62 "-(ubi)"
63
Sanchayan Maitye7b860f2015-04-15 16:24:26 +053064#define CONFIG_MMC
65#define CONFIG_FSL_ESDHC
66#define CONFIG_SYS_FSL_ESDHC_ADDR 0
67#define CONFIG_SYS_FSL_ESDHC_NUM 1
68
69#define CONFIG_SYS_FSL_ERRATUM_ESDHC111
70
Sanchayan Maitye7b860f2015-04-15 16:24:26 +053071#define CONFIG_GENERIC_MMC
Sanchayan Maitye7b860f2015-04-15 16:24:26 +053072#define CONFIG_DOS_PARTITION
73
74#define CONFIG_RBTREE
75#define CONFIG_LZO
Sanchayan Maitye7b860f2015-04-15 16:24:26 +053076#define CONFIG_CMD_UBI
77#define CONFIG_MTD_UBI_FASTMAP
78#define CONFIG_CMD_UBIFS /* increases size by almost 60 KB */
79
Sanchayan Maitye7b860f2015-04-15 16:24:26 +053080#define CONFIG_FEC_MXC
81#define CONFIG_MII
82#define IMX_FEC_BASE ENET1_BASE_ADDR
83#define CONFIG_FEC_XCV_TYPE RMII
84#define CONFIG_FEC_MXC_PHYADDR 0
85#define CONFIG_PHYLIB
86#define CONFIG_PHY_MICREL
87
88#define CONFIG_IPADDR 192.168.10.2
89#define CONFIG_NETMASK 255.255.255.0
90#define CONFIG_SERVERIP 192.168.10.1
91
92#define CONFIG_BOOTDELAY 1
93#define CONFIG_BOARD_LATE_INIT
94
95#define CONFIG_LOADADDR 0x80008000
96#define CONFIG_FDTADDR 0x84000000
97
98/* We boot from the gfxRAM area of the OCRAM. */
99#define CONFIG_SYS_TEXT_BASE 0x3f408000
100#define CONFIG_BOARD_SIZE_LIMIT 524288
101
102#define SD_BOOTCMD \
103 "sdargs=root=/dev/mmcblk0p2 rw rootwait\0" \
104 "sdboot=run setup; setenv bootargs ${defargs} ${sdargs} ${mtdparts} " \
105 "${setupargs} ${vidargs}; echo Booting from MMC/SD card...; " \
106 "load mmc 0:2 ${kernel_addr_r} /boot/${kernel_file} && " \
107 "load mmc 0:2 ${fdt_addr_r} /boot/${soc}-colibri-${fdt_board}.dtb && " \
108 "bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
109
110#define NFS_BOOTCMD \
111 "nfsargs=ip=:::::eth0: root=/dev/nfs\0" \
112 "nfsboot=run setup; " \
113 "setenv bootargs ${defargs} ${nfsargs} ${mtdparts} " \
114 "${setupargs} ${vidargs}; echo Booting from NFS...;" \
115 "dhcp ${kernel_addr_r} && " \
116 "tftp ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && " \
117 "bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
118
119#define UBI_BOOTCMD \
120 "ubiargs=ubi.mtd=ubi root=ubi0:rootfs rootfstype=ubifs " \
121 "ubi.fm_autoconvert=1\0" \
122 "ubiboot=run setup; " \
123 "setenv bootargs ${defargs} ${ubiargs} ${mtdparts} " \
124 "${setupargs} ${vidargs}; echo Booting from NAND...; " \
125 "ubi part ubi && ubifsmount ubi0:rootfs && " \
126 "ubifsload ${kernel_addr_r} /boot/${kernel_file} && " \
127 "ubifsload ${fdt_addr_r} /boot/${soc}-colibri-${fdt_board}.dtb && " \
128 "bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
129
130#define CONFIG_BOOTCOMMAND "run ubiboot; run sdboot; run nfsboot"
131
Sanchayan Maitybba97cd2015-04-17 18:56:42 +0530132#define DFU_ALT_NAND_INFO "vf-bcb part 0,1;u-boot part 0,2;ubi part 0,4"
133
Sanchayan Maitye7b860f2015-04-15 16:24:26 +0530134#define CONFIG_EXTRA_ENV_SETTINGS \
135 "kernel_addr_r=0x82000000\0" \
136 "fdt_addr_r=0x84000000\0" \
137 "kernel_file=zImage\0" \
138 "fdt_file=${soc}-colibri-${fdt_board}.dtb\0" \
139 "fdt_board=eval-v3\0" \
140 "defargs=\0" \
141 "console=ttyLP0\0" \
142 "setup=setenv setupargs " \
143 "console=tty1 console=${console}" \
144 ",${baudrate}n8 ${memargs}\0" \
145 "setsdupdate=mmc rescan && set interface mmc && " \
146 "fatload ${interface} 0:1 ${loadaddr} flash_blk.img && " \
147 "source ${loadaddr}\0" \
148 "setusbupdate=usb start && set interface usb && " \
149 "fatload ${interface} 0:1 ${loadaddr} flash_blk.img && " \
150 "source ${loadaddr}\0" \
151 "setupdate=run setsdupdate || run setusbupdate\0" \
152 "mtdparts=" MTDPARTS_DEFAULT "\0" \
Sanchayan Maitybba97cd2015-04-17 18:56:42 +0530153 "dfu_alt_info=" DFU_ALT_NAND_INFO "\0" \
Sanchayan Maitye7b860f2015-04-15 16:24:26 +0530154 SD_BOOTCMD \
155 NFS_BOOTCMD \
156 UBI_BOOTCMD
157
158/* Miscellaneous configurable options */
159#define CONFIG_SYS_LONGHELP /* undef to save memory */
Sanchayan Maitye7b860f2015-04-15 16:24:26 +0530160#undef CONFIG_AUTO_COMPLETE
Sanchayan Maityaa5a0d92015-06-08 12:40:41 +0530161#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
Sanchayan Maitye7b860f2015-04-15 16:24:26 +0530162#define CONFIG_SYS_PBSIZE \
163 (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
164#define CONFIG_SYS_MAXARGS 16 /* max number of command args */
165#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
166
Sanchayan Maitye7b860f2015-04-15 16:24:26 +0530167#define CONFIG_SYS_MEMTEST_START 0x80010000
168#define CONFIG_SYS_MEMTEST_END 0x87C00000
169
170#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
171#define CONFIG_SYS_HZ 1000
172#define CONFIG_CMDLINE_EDITING
173
174/*
175 * Stack sizes
176 * The stack sizes are set up in start.S using the settings below
177 */
178#define CONFIG_STACKSIZE (128 * 1024) /* regular stack */
179
180/* Physical memory map */
181#define CONFIG_NR_DRAM_BANKS 1
182#define PHYS_SDRAM (0x80000000)
183#define PHYS_SDRAM_SIZE (256 * 1024 * 1024)
184
185#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
186#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
187#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
188
189#define CONFIG_SYS_INIT_SP_OFFSET \
190 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
191#define CONFIG_SYS_INIT_SP_ADDR \
192 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
193
194/* Environment organization */
195#define CONFIG_SYS_NO_FLASH
196
197#ifdef CONFIG_ENV_IS_IN_MMC
198#define CONFIG_SYS_MMC_ENV_DEV 0
199#define CONFIG_ENV_OFFSET (12 * 64 * 1024)
200#define CONFIG_ENV_SIZE (8 * 1024)
201#endif
202
203#ifdef CONFIG_ENV_IS_IN_NAND
204#define CONFIG_ENV_SIZE (64 * 2048)
205#define CONFIG_ENV_RANGE (4 * 64 * 2048)
206#define CONFIG_ENV_OFFSET (12 * 64 * 2048)
207#endif
208
Sanchayan Maitye7b860f2015-04-15 16:24:26 +0530209#define CONFIG_SYS_NO_FLASH
210
211#define CONFIG_SYS_CACHELINE_SIZE 32
212
Sanchayan Maitybba97cd2015-04-17 18:56:42 +0530213/* USB Host Support */
Sanchayan Maitybba97cd2015-04-17 18:56:42 +0530214#define CONFIG_USB_EHCI
215#define CONFIG_USB_EHCI_VF
216#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
217#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
218
219/* USB Client Support */
Sanchayan Maitybba97cd2015-04-17 18:56:42 +0530220#define CONFIG_TRDX_VID 0x1B67
221#define CONFIG_TRDX_PID_COLIBRI_VF50 0x0016
222#define CONFIG_TRDX_PID_COLIBRI_VF61 0x0017
223#define CONFIG_TRDX_PID_COLIBRI_VF61IT 0x0018
224#define CONFIG_TRDX_PID_COLIBRI_VF50IT 0x0019
Sanchayan Maitybba97cd2015-04-17 18:56:42 +0530225
226/* USB DFU */
Paul Kocialkowski01acd6a2015-06-12 19:56:58 +0200227#define CONFIG_USB_FUNCTION_DFU
Sanchayan Maitybba97cd2015-04-17 18:56:42 +0530228#define CONFIG_DFU_NAND
229#define CONFIG_DFU_MMC
230#define CONFIG_SYS_DFU_DATA_BUF_SIZE (1024 * 1024)
231
232/* USB Storage */
233#define CONFIG_USB_STORAGE
Paul Kocialkowski01acd6a2015-06-12 19:56:58 +0200234#define CONFIG_USB_FUNCTION_MASS_STORAGE
Sanchayan Maitybba97cd2015-04-17 18:56:42 +0530235
Sanchayan Maitye7b860f2015-04-15 16:24:26 +0530236#endif /* __CONFIG_H */