blob: efe770b81b394dad46a2498e9c4574c273477ed9 [file] [log] [blame]
Marek Vasut78687b72011-11-08 23:18:20 +00001/*
2 * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
3 * on behalf of DENX Software Engineering GmbH
4 *
Wolfgang Denkbd8ec7e2013-10-07 13:07:26 +02005 * SPDX-License-Identifier: GPL-2.0+
Marek Vasut78687b72011-11-08 23:18:20 +00006 */
Marek Vasutb51f8ae2013-06-16 15:39:02 +02007#ifndef __CONFIGS_M28EVK_H__
8#define __CONFIGS_M28EVK_H__
Marek Vasut78687b72011-11-08 23:18:20 +00009
Marek Vasutb51f8ae2013-06-16 15:39:02 +020010/* System configurations */
11#define CONFIG_MX28 /* i.MX28 SoC */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000012#define MACH_TYPE_M28EVK 3613
Wolfgang Denkbed617d2013-03-23 23:50:35 +000013#define CONFIG_MACH_TYPE MACH_TYPE_M28EVK
Marek Vasut78687b72011-11-08 23:18:20 +000014
Marek Vasuteb0c7012014-06-26 11:01:27 +020015#define CONFIG_FIT
16
17#define CONFIG_TIMESTAMP /* Print image info with timestamp */
18
Marek Vasutb51f8ae2013-06-16 15:39:02 +020019/* U-Boot Commands */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000020#define CONFIG_SYS_NO_FLASH
Marek Vasut78687b72011-11-08 23:18:20 +000021#include <config_cmd_default.h>
Wolfgang Denkbed617d2013-03-23 23:50:35 +000022#define CONFIG_DISPLAY_CPUINFO
23#define CONFIG_DOS_PARTITION
Marek Vasuteb0c7012014-06-26 11:01:27 +020024#define CONFIG_FAT_WRITE
Marek Vasut78687b72011-11-08 23:18:20 +000025
Marek Vasuteb0c7012014-06-26 11:01:27 +020026#define CONFIG_CMD_ASKENV
27#define CONFIG_CMD_BMP
Wolfgang Denkbed617d2013-03-23 23:50:35 +000028#define CONFIG_CMD_CACHE
29#define CONFIG_CMD_DATE
30#define CONFIG_CMD_DHCP
31#define CONFIG_CMD_EEPROM
Marek Vasuteb0c7012014-06-26 11:01:27 +020032#define CONFIG_CMD_EXT4
33#define CONFIG_CMD_EXT4_WRITE
Wolfgang Denkbed617d2013-03-23 23:50:35 +000034#define CONFIG_CMD_FAT
Marek Vasutbfbeff22014-09-23 13:18:20 +020035#define CONFIG_CMD_FS_GENERIC
Wolfgang Denkbed617d2013-03-23 23:50:35 +000036#define CONFIG_CMD_GPIO
Wolfgang Denkcc1c9e72013-03-23 23:50:36 +000037#define CONFIG_CMD_GREPENV
Wolfgang Denkbed617d2013-03-23 23:50:35 +000038#define CONFIG_CMD_I2C
39#define CONFIG_CMD_MII
40#define CONFIG_CMD_MMC
41#define CONFIG_CMD_NAND
Marek Vasute154c712013-07-07 20:20:26 +020042#define CONFIG_CMD_NAND_TRIMFFS
Wolfgang Denkbed617d2013-03-23 23:50:35 +000043#define CONFIG_CMD_NET
44#define CONFIG_CMD_NFS
45#define CONFIG_CMD_PING
46#define CONFIG_CMD_SETEXPR
47#define CONFIG_CMD_SF
48#define CONFIG_CMD_SPI
49#define CONFIG_CMD_USB
Marek Vasut34ce0e12013-04-28 09:20:04 +000050#define CONFIG_VIDEO
Marek Vasut78687b72011-11-08 23:18:20 +000051
Wolfgang Denkcc1c9e72013-03-23 23:50:36 +000052#define CONFIG_REGEX /* Enable regular expression support */
53
Marek Vasutb51f8ae2013-06-16 15:39:02 +020054/* Memory configuration */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000055#define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
56#define PHYS_SDRAM_1 0x40000000 /* Base address */
57#define PHYS_SDRAM_1_SIZE 0x20000000 /* Max 512 MB RAM */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000058#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
Marek Vasut78687b72011-11-08 23:18:20 +000059
Marek Vasutb51f8ae2013-06-16 15:39:02 +020060/* Environment */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000061#define CONFIG_ENV_SIZE (16 * 1024)
Marek Vasutb51f8ae2013-06-16 15:39:02 +020062#define CONFIG_ENV_IS_IN_NAND
Marek Vasut78687b72011-11-08 23:18:20 +000063
64/* Environment is in NAND */
Marek Vasutb51f8ae2013-06-16 15:39:02 +020065#if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND)
Wolfgang Denkbed617d2013-03-23 23:50:35 +000066#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
67#define CONFIG_ENV_SECT_SIZE (128 * 1024)
Marek Vasut72d2dee2014-06-26 11:01:28 +020068#define CONFIG_ENV_RANGE (4 * CONFIG_ENV_SECT_SIZE)
69#define CONFIG_ENV_OFFSET (24 * CONFIG_ENV_SECT_SIZE) /* 3 MiB */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000070#define CONFIG_ENV_OFFSET_REDUND \
Marek Vasut78687b72011-11-08 23:18:20 +000071 (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
72
Wolfgang Denkbed617d2013-03-23 23:50:35 +000073#define CONFIG_CMD_UBI
74#define CONFIG_CMD_UBIFS
75#define CONFIG_CMD_MTDPARTS
76#define CONFIG_RBTREE
77#define CONFIG_LZO
78#define CONFIG_MTD_DEVICE
79#define CONFIG_MTD_PARTITIONS
80#define MTDIDS_DEFAULT "nand0=gpmi-nand"
81#define MTDPARTS_DEFAULT \
Marek Vasut94be3652012-08-28 15:12:48 +000082 "mtdparts=gpmi-nand:" \
Marek Vasut72d2dee2014-06-26 11:01:28 +020083 "3m(u-boot)," \
84 "512k(env1)," \
85 "512k(env2)," \
86 "14m(boot)," \
87 "238m(data)," \
88 "-@4096k(UBI)"
Marek Vasut173825c2011-12-31 18:28:22 +000089#else
Wolfgang Denkbed617d2013-03-23 23:50:35 +000090#define CONFIG_ENV_IS_NOWHERE
Marek Vasut78687b72011-11-08 23:18:20 +000091#endif
92
Marek Vasutb51f8ae2013-06-16 15:39:02 +020093/* FEC Ethernet on SoC */
94#ifdef CONFIG_CMD_NET
Wolfgang Denkbed617d2013-03-23 23:50:35 +000095#define CONFIG_FEC_MXC
Marek Vasut78687b72011-11-08 23:18:20 +000096#endif
97
Marek Vasutb51f8ae2013-06-16 15:39:02 +020098/* EEPROM */
99#ifdef CONFIG_CMD_EEPROM
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000100#define CONFIG_SYS_I2C_MULTI_EEPROMS
101#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
Marek Vasut78687b72011-11-08 23:18:20 +0000102#endif
103
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200104/* RTC */
105#ifdef CONFIG_CMD_DATE
Marek Vasut78687b72011-11-08 23:18:20 +0000106/* Use the internal RTC in the MXS chip */
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000107#define CONFIG_RTC_INTERNAL
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200108#ifdef CONFIG_RTC_INTERNAL
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000109#define CONFIG_RTC_MXS
Marek Vasut78687b72011-11-08 23:18:20 +0000110#else
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000111#define CONFIG_RTC_M41T62
112#define CONFIG_SYS_I2C_RTC_ADDR 0x68
113#define CONFIG_SYS_M41T11_BASE_YEAR 2000
Marek Vasut78687b72011-11-08 23:18:20 +0000114#endif
115#endif
116
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200117/* USB */
118#ifdef CONFIG_CMD_USB
Marek Vasut191a2ce2013-02-23 02:43:02 +0000119#define CONFIG_EHCI_MXS_PORT0
120#define CONFIG_EHCI_MXS_PORT1
121#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000122#define CONFIG_USB_STORAGE
Marek Vasutbf4362f2011-11-08 23:18:27 +0000123#endif
124
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200125/* SPI */
126#ifdef CONFIG_CMD_SPI
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000127#define CONFIG_DEFAULT_SPI_BUS 2
128#define CONFIG_DEFAULT_SPI_CS 0
129#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
Marek Vasut78687b72011-11-08 23:18:20 +0000130
131/* SPI FLASH */
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200132#ifdef CONFIG_CMD_SF
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000133#define CONFIG_SPI_FLASH
134#define CONFIG_SPI_FLASH_STMICRO
135#define CONFIG_SF_DEFAULT_BUS 2
136#define CONFIG_SF_DEFAULT_CS 0
137#define CONFIG_SF_DEFAULT_SPEED 40000000
138#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
Marek Vasut78687b72011-11-08 23:18:20 +0000139
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000140#define CONFIG_ENV_SPI_BUS 2
141#define CONFIG_ENV_SPI_CS 0
142#define CONFIG_ENV_SPI_MAX_HZ 40000000
143#define CONFIG_ENV_SPI_MODE SPI_MODE_0
Marek Vasut78687b72011-11-08 23:18:20 +0000144#endif
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200145
Marek Vasut78687b72011-11-08 23:18:20 +0000146#endif
147
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200148/* LCD */
149#ifdef CONFIG_VIDEO
Marek Vasut34ce0e12013-04-28 09:20:04 +0000150#define CONFIG_VIDEO_LOGO
Marek Vasut34ce0e12013-04-28 09:20:04 +0000151#define CONFIG_SPLASH_SCREEN
152#define CONFIG_CMD_BMP
153#define CONFIG_BMP_16BPP
154#define CONFIG_VIDEO_BMP_RLE8
155#define CONFIG_VIDEO_BMP_GZIP
Marek Vasuteb0c7012014-06-26 11:01:27 +0200156#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (2 << 20)
Marek Vasut34ce0e12013-04-28 09:20:04 +0000157#endif
158
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200159/* Booting Linux */
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000160#define CONFIG_BOOTDELAY 3
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200161#define CONFIG_BOOTFILE "fitImage"
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000162#define CONFIG_BOOTARGS "console=ttyAMA0,115200n8 "
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200163#define CONFIG_BOOTCOMMAND "run mmc_mmc"
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000164#define CONFIG_LOADADDR 0x42000000
165#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
Marek Vasut78687b72011-11-08 23:18:20 +0000166
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200167/* Extra Environment */
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200168#define CONFIG_PREBOOT "run try_bootscript"
169#define CONFIG_HOSTNAME m28evk
170
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000171#define CONFIG_EXTRA_ENV_SETTINGS \
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200172 "consdev=ttyAMA0\0" \
173 "baudrate=115200\0" \
174 "bootdev=/dev/mmcblk0p2\0" \
175 "rootdev=/dev/mmcblk0p3\0" \
176 "netdev=eth0\0" \
177 "hostname=m28evk\0" \
178 "rootpath=/opt/eldk-5.5/armv5te/rootfs-qte-sdk\0" \
179 "kernel_addr_r=0x42000000\0" \
180 "videomode=video=ctfb:x:800,y:480,depth:18,mode:0,pclk:30066," \
181 "le:0,ri:256,up:0,lo:45,hs:1,vs:1,sync:100663296," \
182 "vmode:0\0" \
Marek Vasut78687b72011-11-08 23:18:20 +0000183 "update_nand_full_filename=u-boot.nand\0" \
184 "update_nand_firmware_filename=u-boot.sb\0" \
Marek Vasutf5013862012-05-01 11:09:43 +0000185 "update_sd_firmware_filename=u-boot.sd\0" \
Marek Vasut78687b72011-11-08 23:18:20 +0000186 "update_nand_firmware_maxsz=0x100000\0" \
187 "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \
188 "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \
189 "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \
190 "nand device 0 ; " \
191 "nand info ; " \
192 "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
193 "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
194 "update_nand_full=" /* Update FCB, DBBT and FW */ \
195 "if tftp ${update_nand_full_filename} ; then " \
196 "run update_nand_get_fcb_size ; " \
197 "nand scrub -y 0x0 ${filesize} ; " \
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200198 "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
Marek Vasut78687b72011-11-08 23:18:20 +0000199 "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
200 "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
201 "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
202 "fi\0" \
203 "update_nand_firmware=" /* Update only firmware */ \
204 "if tftp ${update_nand_firmware_filename} ; then " \
205 "run update_nand_get_fcb_size ; " \
206 "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \
207 "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \
208 "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \
209 "nand erase ${fcb_sz} ${fw_sz} ; " \
210 "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
211 "nand write ${loadaddr} ${fw_off} ${filesize} ; " \
Marek Vasutf5013862012-05-01 11:09:43 +0000212 "fi\0" \
213 "update_sd_firmware=" /* Update the SD firmware partition */ \
214 "if mmc rescan ; then " \
215 "if tftp ${update_sd_firmware_filename} ; then " \
216 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
217 "setexpr fw_sz ${fw_sz} + 1 ; " \
218 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
219 "fi ; " \
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200220 "fi\0" \
221 "addcons=" \
222 "setenv bootargs ${bootargs} " \
223 "console=${consdev},${baudrate}\0" \
224 "addip=" \
225 "setenv bootargs ${bootargs} " \
226 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
227 "${netmask}:${hostname}:${netdev}:off\0" \
228 "addmisc=" \
229 "setenv bootargs ${bootargs} ${miscargs}\0" \
230 "adddfltmtd=" \
231 "if test \"x${mtdparts}\" == \"x\" ; then " \
232 "mtdparts default ; " \
233 "fi\0" \
234 "addmtd=" \
235 "run adddfltmtd ; " \
236 "setenv bootargs ${bootargs} ${mtdparts}\0" \
237 "addargs=run addcons addmtd addmisc\0" \
238 "mmcload=" \
239 "mmc rescan ; " \
Marek Vasutbfbeff22014-09-23 13:18:20 +0200240 "load mmc 0:2 ${kernel_addr_r} ${bootfile}\0" \
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200241 "ubiload=" \
242 "ubi part UBI ; ubifsmount ubi0:rootfs ; " \
243 "ubifsload ${kernel_addr_r} /boot/${bootfile}\0" \
244 "netload=" \
245 "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \
246 "miscargs=nohlt panic=1\0" \
247 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
248 "ubiargs=" \
249 "setenv bootargs ubi.mtd=5 " \
250 "root=ubi0:rootfs rootfstype=ubifs\0" \
251 "nfsargs=" \
252 "setenv bootargs root=/dev/nfs rw " \
253 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
254 "mmc_mmc=" \
255 "run mmcload mmcargs addargs ; " \
256 "bootm ${kernel_addr_r}\0" \
257 "mmc_ubi=" \
258 "run mmcload ubiargs addargs ; " \
259 "bootm ${kernel_addr_r}\0" \
260 "mmc_nfs=" \
261 "run mmcload nfsargs addip addargs ; " \
262 "bootm ${kernel_addr_r}\0" \
263 "ubi_mmc=" \
264 "run ubiload mmcargs addargs ; " \
265 "bootm ${kernel_addr_r}\0" \
266 "ubi_ubi=" \
267 "run ubiload ubiargs addargs ; " \
268 "bootm ${kernel_addr_r}\0" \
269 "ubi_nfs=" \
270 "run ubiload nfsargs addip addargs ; " \
271 "bootm ${kernel_addr_r}\0" \
272 "net_mmc=" \
273 "run netload mmcargs addargs ; " \
274 "bootm ${kernel_addr_r}\0" \
275 "net_ubi=" \
276 "run netload ubiargs addargs ; " \
277 "bootm ${kernel_addr_r}\0" \
278 "net_nfs=" \
279 "run netload nfsargs addip addargs ; " \
280 "bootm ${kernel_addr_r}\0" \
281 "try_bootscript=" \
282 "mmc rescan;" \
Marek Vasuteab2cb62014-09-23 13:18:18 +0200283 "if test -e mmc 0:2 ${bootscript} ; then " \
Marek Vasutbfbeff22014-09-23 13:18:20 +0200284 "if load mmc 0:2 ${kernel_addr_r} ${bootscript};" \
Marek Vasuta977f482014-09-25 21:14:16 +0200285 "then ; " \
286 "echo Running bootscript... ; " \
287 "source ${kernel_addr_r} ; " \
Marek Vasuteab2cb62014-09-23 13:18:18 +0200288 "fi ; " \
Marek Vasut78687b72011-11-08 23:18:20 +0000289 "fi\0"
290
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200291/* The rest of the configuration is shared */
292#include <configs/mxs.h>
293
294#endif /* __CONFIGS_M28EVK_H__ */