blob: 57599f9856941e8618ba26ac973b3ed5b228cf21 [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_TIMESTAMP /* Print image info with timestamp */
16
Marek Vasutb51f8ae2013-06-16 15:39:02 +020017/* U-Boot Commands */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000018#define CONFIG_SYS_NO_FLASH
Wolfgang Denkbed617d2013-03-23 23:50:35 +000019#define CONFIG_DISPLAY_CPUINFO
20#define CONFIG_DOS_PARTITION
Marek Vasuteb0c7012014-06-26 11:01:27 +020021#define CONFIG_FAT_WRITE
Marek Vasut78687b72011-11-08 23:18:20 +000022
Marek Vasuteb0c7012014-06-26 11:01:27 +020023#define CONFIG_CMD_ASKENV
24#define CONFIG_CMD_BMP
Wolfgang Denkbed617d2013-03-23 23:50:35 +000025#define CONFIG_CMD_CACHE
26#define CONFIG_CMD_DATE
27#define CONFIG_CMD_DHCP
28#define CONFIG_CMD_EEPROM
Marek Vasuteb0c7012014-06-26 11:01:27 +020029#define CONFIG_CMD_EXT4
30#define CONFIG_CMD_EXT4_WRITE
Wolfgang Denkbed617d2013-03-23 23:50:35 +000031#define CONFIG_CMD_FAT
Marek Vasutbfbeff22014-09-23 13:18:20 +020032#define CONFIG_CMD_FS_GENERIC
Wolfgang Denkcc1c9e72013-03-23 23:50:36 +000033#define CONFIG_CMD_GREPENV
Wolfgang Denkbed617d2013-03-23 23:50:35 +000034#define CONFIG_CMD_I2C
35#define CONFIG_CMD_MII
36#define CONFIG_CMD_MMC
37#define CONFIG_CMD_NAND
Marek Vasute154c712013-07-07 20:20:26 +020038#define CONFIG_CMD_NAND_TRIMFFS
Wolfgang Denkbed617d2013-03-23 23:50:35 +000039#define CONFIG_CMD_PING
Wolfgang Denkbed617d2013-03-23 23:50:35 +000040#define CONFIG_CMD_SF
41#define CONFIG_CMD_SPI
42#define CONFIG_CMD_USB
Marek Vasut34ce0e12013-04-28 09:20:04 +000043#define CONFIG_VIDEO
Marek Vasut78687b72011-11-08 23:18:20 +000044
Wolfgang Denkcc1c9e72013-03-23 23:50:36 +000045
Marek Vasutb51f8ae2013-06-16 15:39:02 +020046/* Memory configuration */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000047#define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
48#define PHYS_SDRAM_1 0x40000000 /* Base address */
49#define PHYS_SDRAM_1_SIZE 0x20000000 /* Max 512 MB RAM */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000050#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
Marek Vasut78687b72011-11-08 23:18:20 +000051
Marek Vasutb51f8ae2013-06-16 15:39:02 +020052/* Environment */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000053#define CONFIG_ENV_SIZE (16 * 1024)
Marek Vasutb51f8ae2013-06-16 15:39:02 +020054#define CONFIG_ENV_IS_IN_NAND
Marek Vasut78687b72011-11-08 23:18:20 +000055
56/* Environment is in NAND */
Marek Vasutb51f8ae2013-06-16 15:39:02 +020057#if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND)
Wolfgang Denkbed617d2013-03-23 23:50:35 +000058#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
59#define CONFIG_ENV_SECT_SIZE (128 * 1024)
Marek Vasut72d2dee2014-06-26 11:01:28 +020060#define CONFIG_ENV_RANGE (4 * CONFIG_ENV_SECT_SIZE)
61#define CONFIG_ENV_OFFSET (24 * CONFIG_ENV_SECT_SIZE) /* 3 MiB */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000062#define CONFIG_ENV_OFFSET_REDUND \
Marek Vasut78687b72011-11-08 23:18:20 +000063 (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
64
Wolfgang Denkbed617d2013-03-23 23:50:35 +000065#define CONFIG_CMD_UBI
66#define CONFIG_CMD_UBIFS
67#define CONFIG_CMD_MTDPARTS
68#define CONFIG_RBTREE
69#define CONFIG_LZO
70#define CONFIG_MTD_DEVICE
71#define CONFIG_MTD_PARTITIONS
72#define MTDIDS_DEFAULT "nand0=gpmi-nand"
73#define MTDPARTS_DEFAULT \
Marek Vasut94be3652012-08-28 15:12:48 +000074 "mtdparts=gpmi-nand:" \
Marek Vasut72d2dee2014-06-26 11:01:28 +020075 "3m(u-boot)," \
76 "512k(env1)," \
77 "512k(env2)," \
78 "14m(boot)," \
79 "238m(data)," \
80 "-@4096k(UBI)"
Marek Vasut173825c2011-12-31 18:28:22 +000081#else
Wolfgang Denkbed617d2013-03-23 23:50:35 +000082#define CONFIG_ENV_IS_NOWHERE
Marek Vasut78687b72011-11-08 23:18:20 +000083#endif
84
Marek Vasutb51f8ae2013-06-16 15:39:02 +020085/* FEC Ethernet on SoC */
86#ifdef CONFIG_CMD_NET
Wolfgang Denkbed617d2013-03-23 23:50:35 +000087#define CONFIG_FEC_MXC
Marek Vasut78687b72011-11-08 23:18:20 +000088#endif
89
Marek Vasutb51f8ae2013-06-16 15:39:02 +020090/* EEPROM */
91#ifdef CONFIG_CMD_EEPROM
Wolfgang Denkbed617d2013-03-23 23:50:35 +000092#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
Marek Vasut78687b72011-11-08 23:18:20 +000093#endif
94
Marek Vasutb51f8ae2013-06-16 15:39:02 +020095/* RTC */
96#ifdef CONFIG_CMD_DATE
Marek Vasut78687b72011-11-08 23:18:20 +000097/* Use the internal RTC in the MXS chip */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000098#define CONFIG_RTC_INTERNAL
Marek Vasutb51f8ae2013-06-16 15:39:02 +020099#ifdef CONFIG_RTC_INTERNAL
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000100#define CONFIG_RTC_MXS
Marek Vasut78687b72011-11-08 23:18:20 +0000101#else
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000102#define CONFIG_RTC_M41T62
103#define CONFIG_SYS_I2C_RTC_ADDR 0x68
104#define CONFIG_SYS_M41T11_BASE_YEAR 2000
Marek Vasut78687b72011-11-08 23:18:20 +0000105#endif
106#endif
107
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200108/* USB */
109#ifdef CONFIG_CMD_USB
Marek Vasut191a2ce2013-02-23 02:43:02 +0000110#define CONFIG_EHCI_MXS_PORT0
111#define CONFIG_EHCI_MXS_PORT1
112#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000113#define CONFIG_USB_STORAGE
Marek Vasutbf4362f2011-11-08 23:18:27 +0000114#endif
115
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200116/* SPI */
117#ifdef CONFIG_CMD_SPI
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000118#define CONFIG_DEFAULT_SPI_BUS 2
119#define CONFIG_DEFAULT_SPI_CS 0
120#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
Marek Vasut78687b72011-11-08 23:18:20 +0000121
122/* SPI FLASH */
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200123#ifdef CONFIG_CMD_SF
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000124#define CONFIG_SF_DEFAULT_BUS 2
125#define CONFIG_SF_DEFAULT_CS 0
126#define CONFIG_SF_DEFAULT_SPEED 40000000
127#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
Marek Vasut78687b72011-11-08 23:18:20 +0000128
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000129#define CONFIG_ENV_SPI_BUS 2
130#define CONFIG_ENV_SPI_CS 0
131#define CONFIG_ENV_SPI_MAX_HZ 40000000
132#define CONFIG_ENV_SPI_MODE SPI_MODE_0
Marek Vasut78687b72011-11-08 23:18:20 +0000133#endif
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200134
Marek Vasut78687b72011-11-08 23:18:20 +0000135#endif
136
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200137/* LCD */
138#ifdef CONFIG_VIDEO
Marek Vasut34ce0e12013-04-28 09:20:04 +0000139#define CONFIG_VIDEO_LOGO
Marek Vasut34ce0e12013-04-28 09:20:04 +0000140#define CONFIG_SPLASH_SCREEN
141#define CONFIG_CMD_BMP
142#define CONFIG_BMP_16BPP
143#define CONFIG_VIDEO_BMP_RLE8
144#define CONFIG_VIDEO_BMP_GZIP
Marek Vasuteb0c7012014-06-26 11:01:27 +0200145#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (2 << 20)
Marek Vasut34ce0e12013-04-28 09:20:04 +0000146#endif
147
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200148/* Booting Linux */
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000149#define CONFIG_BOOTDELAY 3
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200150#define CONFIG_BOOTFILE "fitImage"
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000151#define CONFIG_BOOTARGS "console=ttyAMA0,115200n8 "
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200152#define CONFIG_BOOTCOMMAND "run mmc_mmc"
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000153#define CONFIG_LOADADDR 0x42000000
154#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
Marek Vasut78687b72011-11-08 23:18:20 +0000155
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200156/* Extra Environment */
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200157#define CONFIG_PREBOOT "run try_bootscript"
158#define CONFIG_HOSTNAME m28evk
159
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000160#define CONFIG_EXTRA_ENV_SETTINGS \
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200161 "consdev=ttyAMA0\0" \
162 "baudrate=115200\0" \
Marek Vasut04457b72014-10-12 00:00:50 +0200163 "bootscript=boot.scr\0" \
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200164 "bootdev=/dev/mmcblk0p2\0" \
165 "rootdev=/dev/mmcblk0p3\0" \
166 "netdev=eth0\0" \
167 "hostname=m28evk\0" \
168 "rootpath=/opt/eldk-5.5/armv5te/rootfs-qte-sdk\0" \
169 "kernel_addr_r=0x42000000\0" \
170 "videomode=video=ctfb:x:800,y:480,depth:18,mode:0,pclk:30066," \
171 "le:0,ri:256,up:0,lo:45,hs:1,vs:1,sync:100663296," \
172 "vmode:0\0" \
Marek Vasut78687b72011-11-08 23:18:20 +0000173 "update_nand_full_filename=u-boot.nand\0" \
174 "update_nand_firmware_filename=u-boot.sb\0" \
Marek Vasutf5013862012-05-01 11:09:43 +0000175 "update_sd_firmware_filename=u-boot.sd\0" \
Marek Vasut78687b72011-11-08 23:18:20 +0000176 "update_nand_firmware_maxsz=0x100000\0" \
177 "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \
178 "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \
179 "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \
180 "nand device 0 ; " \
181 "nand info ; " \
182 "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
183 "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
184 "update_nand_full=" /* Update FCB, DBBT and FW */ \
185 "if tftp ${update_nand_full_filename} ; then " \
186 "run update_nand_get_fcb_size ; " \
187 "nand scrub -y 0x0 ${filesize} ; " \
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200188 "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
Marek Vasut78687b72011-11-08 23:18:20 +0000189 "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
190 "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
191 "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
192 "fi\0" \
193 "update_nand_firmware=" /* Update only firmware */ \
194 "if tftp ${update_nand_firmware_filename} ; then " \
195 "run update_nand_get_fcb_size ; " \
196 "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \
197 "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \
198 "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \
199 "nand erase ${fcb_sz} ${fw_sz} ; " \
200 "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
201 "nand write ${loadaddr} ${fw_off} ${filesize} ; " \
Marek Vasutf5013862012-05-01 11:09:43 +0000202 "fi\0" \
203 "update_sd_firmware=" /* Update the SD firmware partition */ \
204 "if mmc rescan ; then " \
205 "if tftp ${update_sd_firmware_filename} ; then " \
206 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
207 "setexpr fw_sz ${fw_sz} + 1 ; " \
208 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
209 "fi ; " \
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200210 "fi\0" \
211 "addcons=" \
212 "setenv bootargs ${bootargs} " \
213 "console=${consdev},${baudrate}\0" \
214 "addip=" \
215 "setenv bootargs ${bootargs} " \
216 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
217 "${netmask}:${hostname}:${netdev}:off\0" \
218 "addmisc=" \
219 "setenv bootargs ${bootargs} ${miscargs}\0" \
220 "adddfltmtd=" \
221 "if test \"x${mtdparts}\" == \"x\" ; then " \
222 "mtdparts default ; " \
223 "fi\0" \
224 "addmtd=" \
225 "run adddfltmtd ; " \
226 "setenv bootargs ${bootargs} ${mtdparts}\0" \
227 "addargs=run addcons addmtd addmisc\0" \
228 "mmcload=" \
229 "mmc rescan ; " \
Marek Vasutbfbeff22014-09-23 13:18:20 +0200230 "load mmc 0:2 ${kernel_addr_r} ${bootfile}\0" \
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200231 "ubiload=" \
232 "ubi part UBI ; ubifsmount ubi0:rootfs ; " \
233 "ubifsload ${kernel_addr_r} /boot/${bootfile}\0" \
234 "netload=" \
235 "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \
236 "miscargs=nohlt panic=1\0" \
237 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
238 "ubiargs=" \
239 "setenv bootargs ubi.mtd=5 " \
240 "root=ubi0:rootfs rootfstype=ubifs\0" \
241 "nfsargs=" \
242 "setenv bootargs root=/dev/nfs rw " \
243 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
244 "mmc_mmc=" \
245 "run mmcload mmcargs addargs ; " \
246 "bootm ${kernel_addr_r}\0" \
247 "mmc_ubi=" \
248 "run mmcload ubiargs addargs ; " \
249 "bootm ${kernel_addr_r}\0" \
250 "mmc_nfs=" \
251 "run mmcload nfsargs addip addargs ; " \
252 "bootm ${kernel_addr_r}\0" \
253 "ubi_mmc=" \
254 "run ubiload mmcargs addargs ; " \
255 "bootm ${kernel_addr_r}\0" \
256 "ubi_ubi=" \
257 "run ubiload ubiargs addargs ; " \
258 "bootm ${kernel_addr_r}\0" \
259 "ubi_nfs=" \
260 "run ubiload nfsargs addip addargs ; " \
261 "bootm ${kernel_addr_r}\0" \
262 "net_mmc=" \
263 "run netload mmcargs addargs ; " \
264 "bootm ${kernel_addr_r}\0" \
265 "net_ubi=" \
266 "run netload ubiargs addargs ; " \
267 "bootm ${kernel_addr_r}\0" \
268 "net_nfs=" \
269 "run netload nfsargs addip addargs ; " \
270 "bootm ${kernel_addr_r}\0" \
271 "try_bootscript=" \
272 "mmc rescan;" \
Marek Vasuteab2cb62014-09-23 13:18:18 +0200273 "if test -e mmc 0:2 ${bootscript} ; then " \
Marek Vasutbfbeff22014-09-23 13:18:20 +0200274 "if load mmc 0:2 ${kernel_addr_r} ${bootscript};" \
Marek Vasuta977f482014-09-25 21:14:16 +0200275 "then ; " \
276 "echo Running bootscript... ; " \
277 "source ${kernel_addr_r} ; " \
Marek Vasuteab2cb62014-09-23 13:18:18 +0200278 "fi ; " \
Marek Vasut78687b72011-11-08 23:18:20 +0000279 "fi\0"
280
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200281/* The rest of the configuration is shared */
282#include <configs/mxs.h>
283
284#endif /* __CONFIGS_M28EVK_H__ */