blob: 4b95af33174497e7b2b36201b44cd2eb95e84307 [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_TIMESTAMP /* Print image info with timestamp */
16
Marek Vasut5434caf2013-06-16 15:39:02 +020017/* U-Boot Commands */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000018#define CONFIG_SYS_NO_FLASH
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000019#define CONFIG_DISPLAY_CPUINFO
20#define CONFIG_DOS_PARTITION
Marek Vasut31b57a52014-06-26 11:01:27 +020021#define CONFIG_FAT_WRITE
Marek Vasutfc102722011-11-08 23:18:20 +000022
Marek Vasut31b57a52014-06-26 11:01:27 +020023#define CONFIG_CMD_BMP
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000024#define CONFIG_CMD_DATE
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000025#define CONFIG_CMD_EEPROM
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000026#define CONFIG_CMD_NAND
Marek Vasut32cc24d2013-07-07 20:20:26 +020027#define CONFIG_CMD_NAND_TRIMFFS
Marek Vasutd782c1f2013-04-28 09:20:04 +000028#define CONFIG_VIDEO
Marek Vasutfc102722011-11-08 23:18:20 +000029
Marek Vasut5434caf2013-06-16 15:39:02 +020030/* Memory configuration */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000031#define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
32#define PHYS_SDRAM_1 0x40000000 /* Base address */
33#define PHYS_SDRAM_1_SIZE 0x20000000 /* Max 512 MB RAM */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000034#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
Fabio Estevam1084606c2011-12-29 03:35:38 +000035
Marek Vasut5434caf2013-06-16 15:39:02 +020036/* Environment */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000037#define CONFIG_ENV_SIZE (16 * 1024)
Marek Vasut5434caf2013-06-16 15:39:02 +020038#define CONFIG_ENV_IS_IN_NAND
Marek Vasutfc102722011-11-08 23:18:20 +000039
40/* Environment is in NAND */
Marek Vasut5434caf2013-06-16 15:39:02 +020041#if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND)
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000042#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
43#define CONFIG_ENV_SECT_SIZE (128 * 1024)
Marek Vasut76582f92014-06-26 11:01:28 +020044#define CONFIG_ENV_RANGE (4 * CONFIG_ENV_SECT_SIZE)
45#define CONFIG_ENV_OFFSET (24 * CONFIG_ENV_SECT_SIZE) /* 3 MiB */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000046#define CONFIG_ENV_OFFSET_REDUND \
Marek Vasutfc102722011-11-08 23:18:20 +000047 (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
48
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000049#define CONFIG_CMD_UBIFS
50#define CONFIG_CMD_MTDPARTS
51#define CONFIG_RBTREE
52#define CONFIG_LZO
53#define CONFIG_MTD_DEVICE
54#define CONFIG_MTD_PARTITIONS
55#define MTDIDS_DEFAULT "nand0=gpmi-nand"
56#define MTDPARTS_DEFAULT \
Marek Vasutc16ecb02012-08-28 15:12:48 +000057 "mtdparts=gpmi-nand:" \
Marek Vasut76582f92014-06-26 11:01:28 +020058 "3m(u-boot)," \
59 "512k(env1)," \
60 "512k(env2)," \
61 "14m(boot)," \
62 "238m(data)," \
63 "-@4096k(UBI)"
Marek Vasutc660a542011-12-31 18:28:22 +000064#else
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000065#define CONFIG_ENV_IS_NOWHERE
Marek Vasutfc102722011-11-08 23:18:20 +000066#endif
67
Marek Vasut5434caf2013-06-16 15:39:02 +020068/* FEC Ethernet on SoC */
69#ifdef CONFIG_CMD_NET
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000070#define CONFIG_FEC_MXC
Marek Vasutfc102722011-11-08 23:18:20 +000071#endif
72
Marek Vasut5434caf2013-06-16 15:39:02 +020073/* EEPROM */
74#ifdef CONFIG_CMD_EEPROM
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000075#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
Marek Vasutfc102722011-11-08 23:18:20 +000076#endif
77
Marek Vasut5434caf2013-06-16 15:39:02 +020078/* RTC */
79#ifdef CONFIG_CMD_DATE
Marek Vasutfc102722011-11-08 23:18:20 +000080/* Use the internal RTC in the MXS chip */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000081#define CONFIG_RTC_INTERNAL
Marek Vasut5434caf2013-06-16 15:39:02 +020082#ifdef CONFIG_RTC_INTERNAL
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000083#define CONFIG_RTC_MXS
Marek Vasutfc102722011-11-08 23:18:20 +000084#else
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000085#define CONFIG_RTC_M41T62
86#define CONFIG_SYS_I2C_RTC_ADDR 0x68
87#define CONFIG_SYS_M41T11_BASE_YEAR 2000
Marek Vasutfc102722011-11-08 23:18:20 +000088#endif
89#endif
90
Marek Vasut5434caf2013-06-16 15:39:02 +020091/* USB */
92#ifdef CONFIG_CMD_USB
Marek Vasutafa87212013-02-23 02:43:02 +000093#define CONFIG_EHCI_MXS_PORT0
94#define CONFIG_EHCI_MXS_PORT1
95#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
Marek Vasut8f59bc12011-11-08 23:18:27 +000096#endif
97
Marek Vasut5434caf2013-06-16 15:39:02 +020098/* SPI */
99#ifdef CONFIG_CMD_SPI
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000100#define CONFIG_DEFAULT_SPI_BUS 2
101#define CONFIG_DEFAULT_SPI_CS 0
102#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
Marek Vasutfc102722011-11-08 23:18:20 +0000103
104/* SPI FLASH */
Marek Vasut5434caf2013-06-16 15:39:02 +0200105#ifdef CONFIG_CMD_SF
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000106#define CONFIG_SF_DEFAULT_BUS 2
107#define CONFIG_SF_DEFAULT_CS 0
108#define CONFIG_SF_DEFAULT_SPEED 40000000
109#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
Marek Vasutfc102722011-11-08 23:18:20 +0000110
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000111#define CONFIG_ENV_SPI_BUS 2
112#define CONFIG_ENV_SPI_CS 0
113#define CONFIG_ENV_SPI_MAX_HZ 40000000
114#define CONFIG_ENV_SPI_MODE SPI_MODE_0
Marek Vasutfc102722011-11-08 23:18:20 +0000115#endif
Marek Vasut5434caf2013-06-16 15:39:02 +0200116
Marek Vasutfc102722011-11-08 23:18:20 +0000117#endif
118
Marek Vasut5434caf2013-06-16 15:39:02 +0200119/* LCD */
120#ifdef CONFIG_VIDEO
Marek Vasutd782c1f2013-04-28 09:20:04 +0000121#define CONFIG_VIDEO_LOGO
Marek Vasutd782c1f2013-04-28 09:20:04 +0000122#define CONFIG_SPLASH_SCREEN
123#define CONFIG_CMD_BMP
124#define CONFIG_BMP_16BPP
125#define CONFIG_VIDEO_BMP_RLE8
126#define CONFIG_VIDEO_BMP_GZIP
Marek Vasut31b57a52014-06-26 11:01:27 +0200127#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (2 << 20)
Marek Vasutd782c1f2013-04-28 09:20:04 +0000128#endif
129
Marek Vasut5434caf2013-06-16 15:39:02 +0200130/* Booting Linux */
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200131#define CONFIG_BOOTFILE "fitImage"
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000132#define CONFIG_BOOTARGS "console=ttyAMA0,115200n8 "
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200133#define CONFIG_BOOTCOMMAND "run mmc_mmc"
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000134#define CONFIG_LOADADDR 0x42000000
135#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
Marek Vasutfc102722011-11-08 23:18:20 +0000136
Marek Vasut5434caf2013-06-16 15:39:02 +0200137/* Extra Environment */
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200138#define CONFIG_PREBOOT "run try_bootscript"
139#define CONFIG_HOSTNAME m28evk
140
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000141#define CONFIG_EXTRA_ENV_SETTINGS \
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200142 "consdev=ttyAMA0\0" \
143 "baudrate=115200\0" \
Marek Vasutd12159b2014-10-12 00:00:50 +0200144 "bootscript=boot.scr\0" \
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200145 "bootdev=/dev/mmcblk0p2\0" \
146 "rootdev=/dev/mmcblk0p3\0" \
147 "netdev=eth0\0" \
148 "hostname=m28evk\0" \
149 "rootpath=/opt/eldk-5.5/armv5te/rootfs-qte-sdk\0" \
150 "kernel_addr_r=0x42000000\0" \
151 "videomode=video=ctfb:x:800,y:480,depth:18,mode:0,pclk:30066," \
152 "le:0,ri:256,up:0,lo:45,hs:1,vs:1,sync:100663296," \
153 "vmode:0\0" \
Marek Vasutfc102722011-11-08 23:18:20 +0000154 "update_nand_full_filename=u-boot.nand\0" \
155 "update_nand_firmware_filename=u-boot.sb\0" \
Marek Vasut9a0f98d2012-05-01 11:09:43 +0000156 "update_sd_firmware_filename=u-boot.sd\0" \
Marek Vasutfc102722011-11-08 23:18:20 +0000157 "update_nand_firmware_maxsz=0x100000\0" \
158 "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \
159 "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \
160 "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \
161 "nand device 0 ; " \
162 "nand info ; " \
163 "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
164 "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
165 "update_nand_full=" /* Update FCB, DBBT and FW */ \
166 "if tftp ${update_nand_full_filename} ; then " \
167 "run update_nand_get_fcb_size ; " \
168 "nand scrub -y 0x0 ${filesize} ; " \
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200169 "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
Marek Vasutfc102722011-11-08 23:18:20 +0000170 "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
171 "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
172 "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
173 "fi\0" \
174 "update_nand_firmware=" /* Update only firmware */ \
175 "if tftp ${update_nand_firmware_filename} ; then " \
176 "run update_nand_get_fcb_size ; " \
177 "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \
178 "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \
179 "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \
180 "nand erase ${fcb_sz} ${fw_sz} ; " \
181 "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
182 "nand write ${loadaddr} ${fw_off} ${filesize} ; " \
Marek Vasut9a0f98d2012-05-01 11:09:43 +0000183 "fi\0" \
184 "update_sd_firmware=" /* Update the SD firmware partition */ \
185 "if mmc rescan ; then " \
186 "if tftp ${update_sd_firmware_filename} ; then " \
187 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
188 "setexpr fw_sz ${fw_sz} + 1 ; " \
189 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
190 "fi ; " \
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200191 "fi\0" \
192 "addcons=" \
193 "setenv bootargs ${bootargs} " \
194 "console=${consdev},${baudrate}\0" \
195 "addip=" \
196 "setenv bootargs ${bootargs} " \
197 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
198 "${netmask}:${hostname}:${netdev}:off\0" \
199 "addmisc=" \
200 "setenv bootargs ${bootargs} ${miscargs}\0" \
201 "adddfltmtd=" \
202 "if test \"x${mtdparts}\" == \"x\" ; then " \
203 "mtdparts default ; " \
204 "fi\0" \
205 "addmtd=" \
206 "run adddfltmtd ; " \
207 "setenv bootargs ${bootargs} ${mtdparts}\0" \
208 "addargs=run addcons addmtd addmisc\0" \
209 "mmcload=" \
210 "mmc rescan ; " \
Marek Vasutfc532a92014-09-23 13:18:20 +0200211 "load mmc 0:2 ${kernel_addr_r} ${bootfile}\0" \
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200212 "ubiload=" \
213 "ubi part UBI ; ubifsmount ubi0:rootfs ; " \
214 "ubifsload ${kernel_addr_r} /boot/${bootfile}\0" \
215 "netload=" \
216 "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \
217 "miscargs=nohlt panic=1\0" \
218 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
219 "ubiargs=" \
220 "setenv bootargs ubi.mtd=5 " \
221 "root=ubi0:rootfs rootfstype=ubifs\0" \
222 "nfsargs=" \
223 "setenv bootargs root=/dev/nfs rw " \
224 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
225 "mmc_mmc=" \
226 "run mmcload mmcargs addargs ; " \
227 "bootm ${kernel_addr_r}\0" \
228 "mmc_ubi=" \
229 "run mmcload ubiargs addargs ; " \
230 "bootm ${kernel_addr_r}\0" \
231 "mmc_nfs=" \
232 "run mmcload nfsargs addip addargs ; " \
233 "bootm ${kernel_addr_r}\0" \
234 "ubi_mmc=" \
235 "run ubiload mmcargs addargs ; " \
236 "bootm ${kernel_addr_r}\0" \
237 "ubi_ubi=" \
238 "run ubiload ubiargs addargs ; " \
239 "bootm ${kernel_addr_r}\0" \
240 "ubi_nfs=" \
241 "run ubiload nfsargs addip addargs ; " \
242 "bootm ${kernel_addr_r}\0" \
243 "net_mmc=" \
244 "run netload mmcargs addargs ; " \
245 "bootm ${kernel_addr_r}\0" \
246 "net_ubi=" \
247 "run netload ubiargs addargs ; " \
248 "bootm ${kernel_addr_r}\0" \
249 "net_nfs=" \
250 "run netload nfsargs addip addargs ; " \
251 "bootm ${kernel_addr_r}\0" \
252 "try_bootscript=" \
253 "mmc rescan;" \
Marek Vasut4ba9b1c2014-09-23 13:18:18 +0200254 "if test -e mmc 0:2 ${bootscript} ; then " \
Marek Vasutfc532a92014-09-23 13:18:20 +0200255 "if load mmc 0:2 ${kernel_addr_r} ${bootscript};" \
Marek Vasut46f8a4b2014-09-25 21:14:16 +0200256 "then ; " \
257 "echo Running bootscript... ; " \
258 "source ${kernel_addr_r} ; " \
Marek Vasut4ba9b1c2014-09-23 13:18:18 +0200259 "fi ; " \
Marek Vasutfc102722011-11-08 23:18:20 +0000260 "fi\0"
261
Marek Vasut5434caf2013-06-16 15:39:02 +0200262/* The rest of the configuration is shared */
263#include <configs/mxs.h>
264
265#endif /* __CONFIGS_M28EVK_H__ */