blob: 1d2350e96c0fa85ca2e3fd88235a7e214ffdf70c [file] [log] [blame]
Fabio Estevam29f75a52011-12-20 05:46:34 +00001/*
2 * (C) Copyright 2011 Freescale Semiconductor, Inc.
3 * Author: Fabio Estevam <fabio.estevam@freescale.com>
4 *
5 * Based on m28evk.h:
6 * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
7 * on behalf of DENX Software Engineering GmbH
8 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02009 * SPDX-License-Identifier: GPL-2.0+
Fabio Estevam29f75a52011-12-20 05:46:34 +000010 */
Marek Vasut5434caf2013-06-16 15:39:02 +020011#ifndef __CONFIGS_MX28EVK_H__
12#define __CONFIGS_MX28EVK_H__
Fabio Estevam29f75a52011-12-20 05:46:34 +000013
Marek Vasut5434caf2013-06-16 15:39:02 +020014/* System configurations */
Fabio Estevam29f75a52011-12-20 05:46:34 +000015#define CONFIG_MX28 /* i.MX28 SoC */
Fabio Estevam29f75a52011-12-20 05:46:34 +000016#define CONFIG_MACH_TYPE MACH_TYPE_MX28EVK
Fabio Estevam29f75a52011-12-20 05:46:34 +000017
Fabio Estevam40f1daa2013-01-27 05:52:05 +000018/* U-Boot Commands */
Fabio Estevam29f75a52011-12-20 05:46:34 +000019
Matthias Fuchs9588d942012-01-18 01:33:07 +000020#define CONFIG_CMD_DATE
Fabio Estevamab461be2013-03-07 11:28:19 +000021#define CONFIG_CMD_NAND
Eric Benard8b360c02013-04-08 08:59:28 +000022#define CONFIG_CMD_NAND_TRIMFFS
Fabio Estevam29f75a52011-12-20 05:46:34 +000023
Marek Vasut5434caf2013-06-16 15:39:02 +020024/* Memory configuration */
Fabio Estevam29f75a52011-12-20 05:46:34 +000025#define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
26#define PHYS_SDRAM_1 0x40000000 /* Base address */
27#define PHYS_SDRAM_1_SIZE 0x40000000 /* Max 1 GB RAM */
Fabio Estevam29f75a52011-12-20 05:46:34 +000028#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
Fabio Estevam29f75a52011-12-20 05:46:34 +000029
Marek Vasut5434caf2013-06-16 15:39:02 +020030/* Environment */
Fabio Estevam3aa89052014-06-10 00:03:57 -030031#ifndef CONFIG_ENV_IS_IN_SPI_FLASH
Fabio Estevamab461be2013-03-07 11:28:19 +000032#define CONFIG_ENV_SIZE (16 * 1024)
Fabio Estevam3aa89052014-06-10 00:03:57 -030033#else
34#define CONFIG_ENV_SIZE (4 * 1024)
35#endif
Marek Vasut5434caf2013-06-16 15:39:02 +020036#define CONFIG_ENV_OVERWRITE
37
38/* Environment is in MMC */
39#if defined(CONFIG_CMD_MMC) && defined(CONFIG_ENV_IS_IN_MMC)
40#define CONFIG_ENV_OFFSET (256 * 1024)
41#define CONFIG_SYS_MMC_ENV_DEV 0
42#endif
Fabio Estevamab461be2013-03-07 11:28:19 +000043
44/* Environment is in NAND */
Marek Vasut5434caf2013-06-16 15:39:02 +020045#if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND)
Fabio Estevamab461be2013-03-07 11:28:19 +000046#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
47#define CONFIG_ENV_SECT_SIZE (128 * 1024)
48#define CONFIG_ENV_RANGE (512 * 1024)
Fabio Estevamab461be2013-03-07 11:28:19 +000049#define CONFIG_ENV_OFFSET 0x300000
Fabio Estevamab461be2013-03-07 11:28:19 +000050#define CONFIG_ENV_OFFSET_REDUND \
51 (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
Tom Rinida85c9c2013-04-30 16:00:15 -040052#endif
Fabio Estevamab461be2013-03-07 11:28:19 +000053
Marek Vasut5434caf2013-06-16 15:39:02 +020054/* Environemnt is in SPI flash */
55#if defined(CONFIG_CMD_SF) && defined(CONFIG_ENV_IS_IN_SPI_FLASH)
56#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
Marek Vasut5434caf2013-06-16 15:39:02 +020057#define CONFIG_ENV_OFFSET 0x40000 /* 256K */
58#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
59#define CONFIG_ENV_SECT_SIZE 0x1000
60#define CONFIG_ENV_SPI_CS 0
61#define CONFIG_ENV_SPI_BUS 2
62#define CONFIG_ENV_SPI_MAX_HZ 24000000
63#define CONFIG_ENV_SPI_MODE SPI_MODE_0
64#endif
65
66/* UBI and NAND partitioning */
67#ifdef CONFIG_CMD_NAND
Fabio Estevamab461be2013-03-07 11:28:19 +000068#define CONFIG_CMD_UBIFS
69#define CONFIG_CMD_MTDPARTS
70#define CONFIG_RBTREE
71#define CONFIG_LZO
72#define CONFIG_MTD_DEVICE
73#define CONFIG_MTD_PARTITIONS
74#define MTDIDS_DEFAULT "nand0=gpmi-nand"
75#define MTDPARTS_DEFAULT \
76 "mtdparts=gpmi-nand:" \
77 "3m(bootloader)ro," \
78 "512k(environment)," \
79 "512k(redundant-environment)," \
80 "4m(kernel)," \
Otavio Salvador4d640502013-12-16 20:44:01 -020081 "512k(fdt)," \
Fabio Estevamab461be2013-03-07 11:28:19 +000082 "8m(ramdisk)," \
83 "-(filesystem)"
Lauri Hintsalaecb7be22012-04-17 00:35:46 +000084#endif
85
Marek Vasut5434caf2013-06-16 15:39:02 +020086/* FEC Ethernet on SoC */
Fabio Estevam29f75a52011-12-20 05:46:34 +000087#ifdef CONFIG_CMD_NET
Fabio Estevam29f75a52011-12-20 05:46:34 +000088#define CONFIG_FEC_MXC
Fabio Estevam29f75a52011-12-20 05:46:34 +000089#define CONFIG_MX28_FEC_MAC_IN_OCOTP
90#endif
91
Fabio Estevam40f1daa2013-01-27 05:52:05 +000092/* RTC */
Matthias Fuchs9588d942012-01-18 01:33:07 +000093#ifdef CONFIG_CMD_DATE
94#define CONFIG_RTC_MXS
95#endif
96
Fabio Estevam40f1daa2013-01-27 05:52:05 +000097/* USB */
Matthias Fuchs598aa2b2012-01-18 01:33:08 +000098#ifdef CONFIG_CMD_USB
Marek Vasutafa87212013-02-23 02:43:02 +000099#define CONFIG_EHCI_MXS_PORT1
100#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
Fabio Estevam91dd7ca2012-08-29 06:20:03 +0000101#define CONFIG_USB_HOST_ETHER
102#define CONFIG_USB_ETHER_ASIX
103#define CONFIG_USB_ETHER_SMSC95XX
Matthias Fuchs598aa2b2012-01-18 01:33:08 +0000104#endif
105
Fabio Estevam40f1daa2013-01-27 05:52:05 +0000106/* SPI */
Matthias Fuchsed97abe2012-01-18 01:33:09 +0000107#ifdef CONFIG_CMD_SPI
Matthias Fuchsed97abe2012-01-18 01:33:09 +0000108#define CONFIG_DEFAULT_SPI_BUS 2
109#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
110
111/* SPI Flash */
112#ifdef CONFIG_CMD_SF
Marek Vasut5434caf2013-06-16 15:39:02 +0200113#define CONFIG_SF_DEFAULT_BUS 2
114#define CONFIG_SF_DEFAULT_CS 0
Matthias Fuchsed97abe2012-01-18 01:33:09 +0000115/* this may vary and depends on the installed chip */
Matthias Fuchsed97abe2012-01-18 01:33:09 +0000116#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
117#define CONFIG_SF_DEFAULT_SPEED 24000000
Marek Vasut5434caf2013-06-16 15:39:02 +0200118#endif
Matthias Fuchsed97abe2012-01-18 01:33:09 +0000119
Matthias Fuchsed97abe2012-01-18 01:33:09 +0000120#endif
121
Fabio Estevam68661db2013-05-10 09:14:09 +0000122/* Framebuffer support */
123#ifdef CONFIG_VIDEO
Fabio Estevam68661db2013-05-10 09:14:09 +0000124#define CONFIG_VIDEO_LOGO
Fabio Estevam68661db2013-05-10 09:14:09 +0000125#define CONFIG_SPLASH_SCREEN
Fabio Estevam68661db2013-05-10 09:14:09 +0000126#define CONFIG_BMP_16BPP
127#define CONFIG_VIDEO_BMP_RLE8
128#define CONFIG_VIDEO_BMP_GZIP
129#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (512 << 10)
130#endif
131
Fabio Estevam40f1daa2013-01-27 05:52:05 +0000132/* Boot Linux */
Marek Vasut5434caf2013-06-16 15:39:02 +0200133#define CONFIG_BOOTFILE "uImage"
134#define CONFIG_LOADADDR 0x42000000
Fabio Estevam29f75a52011-12-20 05:46:34 +0000135#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
Fabio Estevam29f75a52011-12-20 05:46:34 +0000136
Marek Vasut5434caf2013-06-16 15:39:02 +0200137/* Extra Environment */
Fabio Estevam29f75a52011-12-20 05:46:34 +0000138#define CONFIG_EXTRA_ENV_SETTINGS \
Otavio Salvador8ae269d2013-12-16 20:44:03 -0200139 "ubifs_file=filesystem.ubifs\0" \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000140 "update_nand_full_filename=u-boot.nand\0" \
141 "update_nand_firmware_filename=u-boot.sb\0" \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000142 "update_nand_firmware_maxsz=0x100000\0" \
143 "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \
144 "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \
145 "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \
146 "nand device 0 ; " \
147 "nand info ; " \
148 "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
149 "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
Otavio Salvador8ae269d2013-12-16 20:44:03 -0200150 "update_nand_firmware_full=" /* Update FCB, DBBT and FW */ \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000151 "if tftp ${update_nand_full_filename} ; then " \
152 "run update_nand_get_fcb_size ; " \
153 "nand scrub -y 0x0 ${filesize} ; " \
Eric Benard71779d52012-12-11 11:36:21 +0000154 "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000155 "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
156 "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
157 "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
158 "fi\0" \
159 "update_nand_firmware=" /* Update only firmware */ \
160 "if tftp ${update_nand_firmware_filename} ; then " \
161 "run update_nand_get_fcb_size ; " \
162 "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \
163 "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \
164 "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \
165 "nand erase ${fcb_sz} ${fw_sz} ; " \
166 "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
167 "nand write ${loadaddr} ${fw_off} ${filesize} ; " \
168 "fi\0" \
Otavio Salvador8ae269d2013-12-16 20:44:03 -0200169 "update_nand_kernel=" /* Update kernel */ \
170 "mtdparts default; " \
171 "nand erase.part kernel; " \
172 "if test ${ip_dyn} = yes; then " \
173 "setenv get_cmd dhcp; " \
174 "else " \
175 "setenv get_cmd tftp; " \
176 "fi; " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200177 "${get_cmd} ${image}; " \
Otavio Salvador8ae269d2013-12-16 20:44:03 -0200178 "nand write ${loadaddr} kernel ${filesize}\0" \
179 "update_nand_fdt=" /* Update fdt */ \
180 "mtdparts default; " \
181 "nand erase.part fdt; " \
182 "if test ${ip_dyn} = yes; then " \
183 "setenv get_cmd dhcp; " \
184 "else " \
185 "setenv get_cmd tftp; " \
186 "fi; " \
187 "${get_cmd} ${fdt_file}; " \
188 "nand write ${loadaddr} fdt ${filesize}\0" \
189 "update_nand_filesystem=" /* Update filesystem */ \
190 "mtdparts default; " \
191 "nand erase.part filesystem; " \
192 "if test ${ip_dyn} = yes; then " \
193 "setenv get_cmd dhcp; " \
194 "else " \
195 "setenv get_cmd tftp; " \
196 "fi; " \
197 "${get_cmd} ${ubifs_file}; " \
198 "ubi part filesystem; " \
199 "ubi create filesystem; " \
200 "ubi write ${loadaddr} filesystem ${filesize}\0" \
Otavio Salvador09308e82013-12-16 20:44:02 -0200201 "nandargs=setenv bootargs console=${console_mainline},${baudrate} " \
202 "rootfstype=ubifs ubi.mtd=6 root=ubi0_0 ${mtdparts}\0" \
203 "nandboot=" /* Boot from NAND */ \
204 "mtdparts default; " \
205 "run nandargs; " \
206 "nand read ${loadaddr} kernel 0x00400000; " \
207 "if test ${boot_fdt} = yes; then " \
208 "nand read ${fdt_addr} fdt 0x00080000; " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200209 "bootz ${loadaddr} - ${fdt_addr}; " \
Otavio Salvador09308e82013-12-16 20:44:02 -0200210 "else " \
211 "if test ${boot_fdt} = no; then " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200212 "bootz; " \
Otavio Salvador09308e82013-12-16 20:44:02 -0200213 "else " \
214 "echo \"ERROR: Set boot_fdt to yes or no.\"; " \
215 "fi; " \
216 "fi\0" \
217 "update_sd_firmware_filename=u-boot.sd\0" \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000218 "update_sd_firmware=" /* Update the SD firmware partition */ \
219 "if mmc rescan ; then " \
220 "if tftp ${update_sd_firmware_filename} ; then " \
221 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
222 "setexpr fw_sz ${fw_sz} + 1 ; " \
223 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
224 "fi ; " \
225 "fi\0" \
226 "script=boot.scr\0" \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200227 "image=zImage\0" \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000228 "console_fsl=ttyAM0\0" \
229 "console_mainline=ttyAMA0\0" \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000230 "fdt_file=imx28-evk.dtb\0" \
231 "fdt_addr=0x41000000\0" \
232 "boot_fdt=try\0" \
233 "ip_dyn=yes\0" \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000234 "mmcdev=0\0" \
235 "mmcpart=2\0" \
Otavio Salvador3c41e902013-01-10 09:45:05 +0000236 "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000237 "mmcargs=setenv bootargs console=${console_mainline},${baudrate} " \
Otavio Salvador3c41e902013-01-10 09:45:05 +0000238 "root=${mmcroot}\0" \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000239 "loadbootscript=" \
240 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
241 "bootscript=echo Running bootscript from mmc ...; " \
242 "source\0" \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200243 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000244 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000245 "mmcboot=echo Booting from mmc ...; " \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000246 "run mmcargs; " \
247 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
248 "if run loadfdt; then " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200249 "bootz ${loadaddr} - ${fdt_addr}; " \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000250 "else " \
251 "if test ${boot_fdt} = try; then " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200252 "bootz; " \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000253 "else " \
254 "echo WARN: Cannot load the DT; " \
255 "fi; " \
256 "fi; " \
257 "else " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200258 "bootz; " \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000259 "fi;\0" \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000260 "netargs=setenv bootargs console=${console_mainline},${baudrate} " \
Fabio Estevam29f75a52011-12-20 05:46:34 +0000261 "root=/dev/nfs " \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000262 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
263 "netboot=echo Booting from net ...; " \
264 "run netargs; " \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000265 "if test ${ip_dyn} = yes; then " \
266 "setenv get_cmd dhcp; " \
267 "else " \
268 "setenv get_cmd tftp; " \
269 "fi; " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200270 "${get_cmd} ${image}; " \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000271 "if test ${boot_fdt} = yes; then " \
272 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200273 "bootz ${loadaddr} - ${fdt_addr}; " \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000274 "else " \
275 "if test ${boot_fdt} = try; then " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200276 "bootz; " \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000277 "else " \
278 "echo WARN: Cannot load the DT; " \
279 "fi;" \
280 "fi; " \
281 "else " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200282 "bootz; " \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000283 "fi;\0"
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000284
285#define CONFIG_BOOTCOMMAND \
Andrew Bradford66968112012-10-01 05:06:52 +0000286 "mmc dev ${mmcdev}; if mmc rescan; then " \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000287 "if run loadbootscript; then " \
288 "run bootscript; " \
289 "else " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200290 "if run loadimage; then " \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000291 "run mmcboot; " \
292 "else run netboot; " \
293 "fi; " \
294 "fi; " \
295 "else run netboot; fi"
Fabio Estevam29f75a52011-12-20 05:46:34 +0000296
Marek Vasut5434caf2013-06-16 15:39:02 +0200297/* The rest of the configuration is shared */
298#include <configs/mxs.h>
299
300#endif /* __CONFIGS_MX28EVK_H__ */