blob: fccd29dc26ce8fba8d81dc410168be090a1d6e48 [file] [log] [blame]
Marek Vasutfc102722011-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 Denk3765b3e2013-10-07 13:07:26 +02005 * SPDX-License-Identifier: GPL-2.0+
Marek Vasutfc102722011-11-08 23:18:20 +00006 */
Marek Vasut5434caf2013-06-16 15:39:02 +02007#ifndef __CONFIGS_M28EVK_H__
8#define __CONFIGS_M28EVK_H__
Marek Vasutfc102722011-11-08 23:18:20 +00009
Marek Vasut5434caf2013-06-16 15:39:02 +020010/* System configurations */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000011#define CONFIG_MX28 /* i.MX28 SoC */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000012#define MACH_TYPE_M28EVK 3613
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000013#define CONFIG_MACH_TYPE MACH_TYPE_M28EVK
Marek Vasutfc102722011-11-08 23:18:20 +000014
Marek Vasut31b57a52014-06-26 11:01:27 +020015#define CONFIG_FIT
16
17#define CONFIG_TIMESTAMP /* Print image info with timestamp */
18
Marek Vasut5434caf2013-06-16 15:39:02 +020019/* U-Boot Commands */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000020#define CONFIG_SYS_NO_FLASH
Marek Vasutfc102722011-11-08 23:18:20 +000021#include <config_cmd_default.h>
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000022#define CONFIG_DISPLAY_CPUINFO
23#define CONFIG_DOS_PARTITION
Marek Vasut31b57a52014-06-26 11:01:27 +020024#define CONFIG_FAT_WRITE
Marek Vasutfc102722011-11-08 23:18:20 +000025
Marek Vasut31b57a52014-06-26 11:01:27 +020026#define CONFIG_CMD_ASKENV
27#define CONFIG_CMD_BMP
Wolfgang Denk5f71bca2013-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 Vasut31b57a52014-06-26 11:01:27 +020032#define CONFIG_CMD_EXT4
33#define CONFIG_CMD_EXT4_WRITE
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000034#define CONFIG_CMD_FAT
35#define CONFIG_CMD_GPIO
Wolfgang Denkee747a22013-03-23 23:50:36 +000036#define CONFIG_CMD_GREPENV
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000037#define CONFIG_CMD_I2C
38#define CONFIG_CMD_MII
39#define CONFIG_CMD_MMC
40#define CONFIG_CMD_NAND
Marek Vasut32cc24d2013-07-07 20:20:26 +020041#define CONFIG_CMD_NAND_TRIMFFS
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000042#define CONFIG_CMD_NET
43#define CONFIG_CMD_NFS
44#define CONFIG_CMD_PING
45#define CONFIG_CMD_SETEXPR
46#define CONFIG_CMD_SF
47#define CONFIG_CMD_SPI
48#define CONFIG_CMD_USB
Marek Vasutd782c1f2013-04-28 09:20:04 +000049#define CONFIG_VIDEO
Marek Vasutfc102722011-11-08 23:18:20 +000050
Wolfgang Denkee747a22013-03-23 23:50:36 +000051#define CONFIG_REGEX /* Enable regular expression support */
52
Marek Vasut5434caf2013-06-16 15:39:02 +020053/* Memory configuration */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000054#define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
55#define PHYS_SDRAM_1 0x40000000 /* Base address */
56#define PHYS_SDRAM_1_SIZE 0x20000000 /* Max 512 MB RAM */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000057#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
Fabio Estevam10846062011-12-29 03:35:38 +000058
Marek Vasut5434caf2013-06-16 15:39:02 +020059/* Environment */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000060#define CONFIG_ENV_SIZE (16 * 1024)
Marek Vasut5434caf2013-06-16 15:39:02 +020061#define CONFIG_ENV_IS_IN_NAND
Marek Vasutfc102722011-11-08 23:18:20 +000062
63/* Environment is in NAND */
Marek Vasut5434caf2013-06-16 15:39:02 +020064#if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND)
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000065#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
66#define CONFIG_ENV_SECT_SIZE (128 * 1024)
Marek Vasut76582f92014-06-26 11:01:28 +020067#define CONFIG_ENV_RANGE (4 * CONFIG_ENV_SECT_SIZE)
68#define CONFIG_ENV_OFFSET (24 * CONFIG_ENV_SECT_SIZE) /* 3 MiB */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000069#define CONFIG_ENV_OFFSET_REDUND \
Marek Vasutfc102722011-11-08 23:18:20 +000070 (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
71
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000072#define CONFIG_CMD_UBI
73#define CONFIG_CMD_UBIFS
74#define CONFIG_CMD_MTDPARTS
75#define CONFIG_RBTREE
76#define CONFIG_LZO
77#define CONFIG_MTD_DEVICE
78#define CONFIG_MTD_PARTITIONS
79#define MTDIDS_DEFAULT "nand0=gpmi-nand"
80#define MTDPARTS_DEFAULT \
Marek Vasutc16ecb02012-08-28 15:12:48 +000081 "mtdparts=gpmi-nand:" \
Marek Vasut76582f92014-06-26 11:01:28 +020082 "3m(u-boot)," \
83 "512k(env1)," \
84 "512k(env2)," \
85 "14m(boot)," \
86 "238m(data)," \
87 "-@4096k(UBI)"
Marek Vasutc660a542011-12-31 18:28:22 +000088#else
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000089#define CONFIG_ENV_IS_NOWHERE
Marek Vasutfc102722011-11-08 23:18:20 +000090#endif
91
Marek Vasut5434caf2013-06-16 15:39:02 +020092/* FEC Ethernet on SoC */
93#ifdef CONFIG_CMD_NET
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000094#define CONFIG_FEC_MXC
Marek Vasutfc102722011-11-08 23:18:20 +000095#endif
96
Marek Vasut5434caf2013-06-16 15:39:02 +020097/* EEPROM */
98#ifdef CONFIG_CMD_EEPROM
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000099#define CONFIG_SYS_I2C_MULTI_EEPROMS
100#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
Marek Vasutfc102722011-11-08 23:18:20 +0000101#endif
102
Marek Vasut5434caf2013-06-16 15:39:02 +0200103/* RTC */
104#ifdef CONFIG_CMD_DATE
Marek Vasutfc102722011-11-08 23:18:20 +0000105/* Use the internal RTC in the MXS chip */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000106#define CONFIG_RTC_INTERNAL
Marek Vasut5434caf2013-06-16 15:39:02 +0200107#ifdef CONFIG_RTC_INTERNAL
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000108#define CONFIG_RTC_MXS
Marek Vasutfc102722011-11-08 23:18:20 +0000109#else
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000110#define CONFIG_RTC_M41T62
111#define CONFIG_SYS_I2C_RTC_ADDR 0x68
112#define CONFIG_SYS_M41T11_BASE_YEAR 2000
Marek Vasutfc102722011-11-08 23:18:20 +0000113#endif
114#endif
115
Marek Vasut5434caf2013-06-16 15:39:02 +0200116/* USB */
117#ifdef CONFIG_CMD_USB
Marek Vasutafa87212013-02-23 02:43:02 +0000118#define CONFIG_EHCI_MXS_PORT0
119#define CONFIG_EHCI_MXS_PORT1
120#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000121#define CONFIG_USB_STORAGE
Marek Vasut8f59bc12011-11-08 23:18:27 +0000122#endif
123
Marek Vasut5434caf2013-06-16 15:39:02 +0200124/* SPI */
125#ifdef CONFIG_CMD_SPI
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000126#define CONFIG_DEFAULT_SPI_BUS 2
127#define CONFIG_DEFAULT_SPI_CS 0
128#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
Marek Vasutfc102722011-11-08 23:18:20 +0000129
130/* SPI FLASH */
Marek Vasut5434caf2013-06-16 15:39:02 +0200131#ifdef CONFIG_CMD_SF
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000132#define CONFIG_SPI_FLASH
133#define CONFIG_SPI_FLASH_STMICRO
134#define CONFIG_SF_DEFAULT_BUS 2
135#define CONFIG_SF_DEFAULT_CS 0
136#define CONFIG_SF_DEFAULT_SPEED 40000000
137#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
Marek Vasutfc102722011-11-08 23:18:20 +0000138
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000139#define CONFIG_ENV_SPI_BUS 2
140#define CONFIG_ENV_SPI_CS 0
141#define CONFIG_ENV_SPI_MAX_HZ 40000000
142#define CONFIG_ENV_SPI_MODE SPI_MODE_0
Marek Vasutfc102722011-11-08 23:18:20 +0000143#endif
Marek Vasut5434caf2013-06-16 15:39:02 +0200144
Marek Vasutfc102722011-11-08 23:18:20 +0000145#endif
146
Marek Vasut5434caf2013-06-16 15:39:02 +0200147/* LCD */
148#ifdef CONFIG_VIDEO
Marek Vasutd782c1f2013-04-28 09:20:04 +0000149#define CONFIG_VIDEO_LOGO
Marek Vasutd782c1f2013-04-28 09:20:04 +0000150#define CONFIG_SPLASH_SCREEN
151#define CONFIG_CMD_BMP
152#define CONFIG_BMP_16BPP
153#define CONFIG_VIDEO_BMP_RLE8
154#define CONFIG_VIDEO_BMP_GZIP
Marek Vasut31b57a52014-06-26 11:01:27 +0200155#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (2 << 20)
Marek Vasutd782c1f2013-04-28 09:20:04 +0000156#endif
157
Marek Vasut5434caf2013-06-16 15:39:02 +0200158/* Booting Linux */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000159#define CONFIG_BOOTDELAY 3
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200160#define CONFIG_BOOTFILE "fitImage"
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000161#define CONFIG_BOOTARGS "console=ttyAMA0,115200n8 "
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200162#define CONFIG_BOOTCOMMAND "run mmc_mmc"
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000163#define CONFIG_LOADADDR 0x42000000
164#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
Marek Vasutfc102722011-11-08 23:18:20 +0000165
Marek Vasut5434caf2013-06-16 15:39:02 +0200166/* Extra Environment */
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200167#define CONFIG_PREBOOT "run try_bootscript"
168#define CONFIG_HOSTNAME m28evk
169
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000170#define CONFIG_EXTRA_ENV_SETTINGS \
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200171 "consdev=ttyAMA0\0" \
172 "baudrate=115200\0" \
173 "bootdev=/dev/mmcblk0p2\0" \
174 "rootdev=/dev/mmcblk0p3\0" \
175 "netdev=eth0\0" \
176 "hostname=m28evk\0" \
177 "rootpath=/opt/eldk-5.5/armv5te/rootfs-qte-sdk\0" \
178 "kernel_addr_r=0x42000000\0" \
179 "videomode=video=ctfb:x:800,y:480,depth:18,mode:0,pclk:30066," \
180 "le:0,ri:256,up:0,lo:45,hs:1,vs:1,sync:100663296," \
181 "vmode:0\0" \
Marek Vasutfc102722011-11-08 23:18:20 +0000182 "update_nand_full_filename=u-boot.nand\0" \
183 "update_nand_firmware_filename=u-boot.sb\0" \
Marek Vasut9a0f98d2012-05-01 11:09:43 +0000184 "update_sd_firmware_filename=u-boot.sd\0" \
Marek Vasutfc102722011-11-08 23:18:20 +0000185 "update_nand_firmware_maxsz=0x100000\0" \
186 "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \
187 "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \
188 "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \
189 "nand device 0 ; " \
190 "nand info ; " \
191 "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
192 "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
193 "update_nand_full=" /* Update FCB, DBBT and FW */ \
194 "if tftp ${update_nand_full_filename} ; then " \
195 "run update_nand_get_fcb_size ; " \
196 "nand scrub -y 0x0 ${filesize} ; " \
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200197 "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
Marek Vasutfc102722011-11-08 23:18:20 +0000198 "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
199 "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
200 "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
201 "fi\0" \
202 "update_nand_firmware=" /* Update only firmware */ \
203 "if tftp ${update_nand_firmware_filename} ; then " \
204 "run update_nand_get_fcb_size ; " \
205 "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \
206 "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \
207 "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \
208 "nand erase ${fcb_sz} ${fw_sz} ; " \
209 "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
210 "nand write ${loadaddr} ${fw_off} ${filesize} ; " \
Marek Vasut9a0f98d2012-05-01 11:09:43 +0000211 "fi\0" \
212 "update_sd_firmware=" /* Update the SD firmware partition */ \
213 "if mmc rescan ; then " \
214 "if tftp ${update_sd_firmware_filename} ; then " \
215 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
216 "setexpr fw_sz ${fw_sz} + 1 ; " \
217 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
218 "fi ; " \
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200219 "fi\0" \
220 "addcons=" \
221 "setenv bootargs ${bootargs} " \
222 "console=${consdev},${baudrate}\0" \
223 "addip=" \
224 "setenv bootargs ${bootargs} " \
225 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
226 "${netmask}:${hostname}:${netdev}:off\0" \
227 "addmisc=" \
228 "setenv bootargs ${bootargs} ${miscargs}\0" \
229 "adddfltmtd=" \
230 "if test \"x${mtdparts}\" == \"x\" ; then " \
231 "mtdparts default ; " \
232 "fi\0" \
233 "addmtd=" \
234 "run adddfltmtd ; " \
235 "setenv bootargs ${bootargs} ${mtdparts}\0" \
236 "addargs=run addcons addmtd addmisc\0" \
237 "mmcload=" \
238 "mmc rescan ; " \
239 "ext4load mmc 0:2 ${kernel_addr_r} ${bootfile}\0" \
240 "ubiload=" \
241 "ubi part UBI ; ubifsmount ubi0:rootfs ; " \
242 "ubifsload ${kernel_addr_r} /boot/${bootfile}\0" \
243 "netload=" \
244 "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \
245 "miscargs=nohlt panic=1\0" \
246 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
247 "ubiargs=" \
248 "setenv bootargs ubi.mtd=5 " \
249 "root=ubi0:rootfs rootfstype=ubifs\0" \
250 "nfsargs=" \
251 "setenv bootargs root=/dev/nfs rw " \
252 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
253 "mmc_mmc=" \
254 "run mmcload mmcargs addargs ; " \
255 "bootm ${kernel_addr_r}\0" \
256 "mmc_ubi=" \
257 "run mmcload ubiargs addargs ; " \
258 "bootm ${kernel_addr_r}\0" \
259 "mmc_nfs=" \
260 "run mmcload nfsargs addip addargs ; " \
261 "bootm ${kernel_addr_r}\0" \
262 "ubi_mmc=" \
263 "run ubiload mmcargs addargs ; " \
264 "bootm ${kernel_addr_r}\0" \
265 "ubi_ubi=" \
266 "run ubiload ubiargs addargs ; " \
267 "bootm ${kernel_addr_r}\0" \
268 "ubi_nfs=" \
269 "run ubiload nfsargs addip addargs ; " \
270 "bootm ${kernel_addr_r}\0" \
271 "net_mmc=" \
272 "run netload mmcargs addargs ; " \
273 "bootm ${kernel_addr_r}\0" \
274 "net_ubi=" \
275 "run netload ubiargs addargs ; " \
276 "bootm ${kernel_addr_r}\0" \
277 "net_nfs=" \
278 "run netload nfsargs addip addargs ; " \
279 "bootm ${kernel_addr_r}\0" \
280 "try_bootscript=" \
281 "mmc rescan;" \
282 "if ext4load mmc 0:2 ${kernel_addr_r} ${bootscript};" \
283 "then;" \
284 "\techo Running bootscript...;" \
285 "\tsource ${kernel_addr_r};" \
Marek Vasutfc102722011-11-08 23:18:20 +0000286 "fi\0"
287
Marek Vasut5434caf2013-06-16 15:39:02 +0200288/* The rest of the configuration is shared */
289#include <configs/mxs.h>
290
291#endif /* __CONFIGS_M28EVK_H__ */