blob: bb1fa44d80dc780658a7204ce9ca084d44440a1c [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
11/* System configurations */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000012#define CONFIG_MX28 /* i.MX28 SoC */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000013#define MACH_TYPE_M28EVK 3613
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000014#define CONFIG_MACH_TYPE MACH_TYPE_M28EVK
Marek Vasutfc102722011-11-08 23:18:20 +000015
Marek Vasut5434caf2013-06-16 15:39:02 +020016/* U-Boot Commands */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000017#define CONFIG_SYS_NO_FLASH
Marek Vasutfc102722011-11-08 23:18:20 +000018#include <config_cmd_default.h>
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000019#define CONFIG_DISPLAY_CPUINFO
20#define CONFIG_DOS_PARTITION
Marek Vasutfc102722011-11-08 23:18:20 +000021
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000022#define CONFIG_CMD_CACHE
23#define CONFIG_CMD_DATE
24#define CONFIG_CMD_DHCP
25#define CONFIG_CMD_EEPROM
26#define CONFIG_CMD_EXT2
27#define CONFIG_CMD_FAT
28#define CONFIG_CMD_GPIO
Wolfgang Denkee747a22013-03-23 23:50:36 +000029#define CONFIG_CMD_GREPENV
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000030#define CONFIG_CMD_I2C
31#define CONFIG_CMD_MII
32#define CONFIG_CMD_MMC
33#define CONFIG_CMD_NAND
Marek Vasut32cc24d2013-07-07 20:20:26 +020034#define CONFIG_CMD_NAND_TRIMFFS
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000035#define CONFIG_CMD_NET
36#define CONFIG_CMD_NFS
37#define CONFIG_CMD_PING
38#define CONFIG_CMD_SETEXPR
39#define CONFIG_CMD_SF
40#define CONFIG_CMD_SPI
41#define CONFIG_CMD_USB
Marek Vasutd782c1f2013-04-28 09:20:04 +000042#define CONFIG_VIDEO
Marek Vasutfc102722011-11-08 23:18:20 +000043
Wolfgang Denkee747a22013-03-23 23:50:36 +000044#define CONFIG_REGEX /* Enable regular expression support */
45
Marek Vasut5434caf2013-06-16 15:39:02 +020046/* Memory configuration */
Wolfgang Denk5f71bca2013-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 Denk5f71bca2013-03-23 23:50:35 +000050#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
Fabio Estevam1084606c2011-12-29 03:35:38 +000051
Marek Vasut5434caf2013-06-16 15:39:02 +020052/* Environment */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000053#define CONFIG_ENV_SIZE (16 * 1024)
Marek Vasut5434caf2013-06-16 15:39:02 +020054#define CONFIG_ENV_IS_IN_NAND
Marek Vasutfc102722011-11-08 23:18:20 +000055
56/* Environment is in NAND */
Marek Vasut5434caf2013-06-16 15:39:02 +020057#if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND)
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000058#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
59#define CONFIG_ENV_SECT_SIZE (128 * 1024)
60#define CONFIG_ENV_RANGE (512 * 1024)
61#define CONFIG_ENV_OFFSET 0x300000
62#define CONFIG_ENV_OFFSET_REDUND \
Marek Vasutfc102722011-11-08 23:18:20 +000063 (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
64
Wolfgang Denk5f71bca2013-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 Vasutc16ecb02012-08-28 15:12:48 +000074 "mtdparts=gpmi-nand:" \
Marek Vasutfc102722011-11-08 23:18:20 +000075 "3m(bootloader)ro," \
76 "512k(environment)," \
77 "512k(redundant-environment)," \
78 "4m(kernel)," \
Marek Vasut1f75b542012-12-25 15:08:40 +000079 "128k(fdt)," \
80 "8m(ramdisk)," \
Marek Vasutfc102722011-11-08 23:18:20 +000081 "-(filesystem)"
Marek Vasutc660a542011-12-31 18:28:22 +000082#else
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000083#define CONFIG_ENV_IS_NOWHERE
Marek Vasutfc102722011-11-08 23:18:20 +000084#endif
85
Marek Vasut5434caf2013-06-16 15:39:02 +020086/* FEC Ethernet on SoC */
87#ifdef CONFIG_CMD_NET
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000088#define CONFIG_FEC_MXC
Marek Vasutfc102722011-11-08 23:18:20 +000089#endif
90
Marek Vasut5434caf2013-06-16 15:39:02 +020091/* EEPROM */
92#ifdef CONFIG_CMD_EEPROM
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000093#define CONFIG_SYS_I2C_MULTI_EEPROMS
94#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
Marek Vasutfc102722011-11-08 23:18:20 +000095#endif
96
Marek Vasut5434caf2013-06-16 15:39:02 +020097/* RTC */
98#ifdef CONFIG_CMD_DATE
Marek Vasutfc102722011-11-08 23:18:20 +000099/* Use the internal RTC in the MXS chip */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000100#define CONFIG_RTC_INTERNAL
Marek Vasut5434caf2013-06-16 15:39:02 +0200101#ifdef CONFIG_RTC_INTERNAL
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000102#define CONFIG_RTC_MXS
Marek Vasutfc102722011-11-08 23:18:20 +0000103#else
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000104#define CONFIG_RTC_M41T62
105#define CONFIG_SYS_I2C_RTC_ADDR 0x68
106#define CONFIG_SYS_M41T11_BASE_YEAR 2000
Marek Vasutfc102722011-11-08 23:18:20 +0000107#endif
108#endif
109
Marek Vasut5434caf2013-06-16 15:39:02 +0200110/* USB */
111#ifdef CONFIG_CMD_USB
Marek Vasutafa87212013-02-23 02:43:02 +0000112#define CONFIG_EHCI_MXS_PORT0
113#define CONFIG_EHCI_MXS_PORT1
114#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000115#define CONFIG_USB_STORAGE
Marek Vasut8f59bc12011-11-08 23:18:27 +0000116#endif
117
Marek Vasut5434caf2013-06-16 15:39:02 +0200118/* SPI */
119#ifdef CONFIG_CMD_SPI
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000120#define CONFIG_DEFAULT_SPI_BUS 2
121#define CONFIG_DEFAULT_SPI_CS 0
122#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
Marek Vasutfc102722011-11-08 23:18:20 +0000123
124/* SPI FLASH */
Marek Vasut5434caf2013-06-16 15:39:02 +0200125#ifdef CONFIG_CMD_SF
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000126#define CONFIG_SPI_FLASH
127#define CONFIG_SPI_FLASH_STMICRO
128#define CONFIG_SF_DEFAULT_BUS 2
129#define CONFIG_SF_DEFAULT_CS 0
130#define CONFIG_SF_DEFAULT_SPEED 40000000
131#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
Marek Vasutfc102722011-11-08 23:18:20 +0000132
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000133#define CONFIG_ENV_SPI_BUS 2
134#define CONFIG_ENV_SPI_CS 0
135#define CONFIG_ENV_SPI_MAX_HZ 40000000
136#define CONFIG_ENV_SPI_MODE SPI_MODE_0
Marek Vasutfc102722011-11-08 23:18:20 +0000137#endif
Marek Vasut5434caf2013-06-16 15:39:02 +0200138
Marek Vasutfc102722011-11-08 23:18:20 +0000139#endif
140
Marek Vasut5434caf2013-06-16 15:39:02 +0200141/* LCD */
142#ifdef CONFIG_VIDEO
Marek Vasutd782c1f2013-04-28 09:20:04 +0000143#define CONFIG_VIDEO_LOGO
Marek Vasutd782c1f2013-04-28 09:20:04 +0000144#define CONFIG_SPLASH_SCREEN
145#define CONFIG_CMD_BMP
146#define CONFIG_BMP_16BPP
147#define CONFIG_VIDEO_BMP_RLE8
148#define CONFIG_VIDEO_BMP_GZIP
149#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (512 << 10)
150#endif
151
Marek Vasut5434caf2013-06-16 15:39:02 +0200152/* Booting Linux */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000153#define CONFIG_BOOTDELAY 3
154#define CONFIG_BOOTFILE "uImage"
155#define CONFIG_BOOTARGS "console=ttyAMA0,115200n8 "
156#define CONFIG_BOOTCOMMAND "run bootcmd_net"
157#define CONFIG_LOADADDR 0x42000000
158#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
Marek Vasutfc102722011-11-08 23:18:20 +0000159
Marek Vasut5434caf2013-06-16 15:39:02 +0200160/* Extra Environment */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000161#define CONFIG_EXTRA_ENV_SETTINGS \
Marek Vasutfc102722011-11-08 23:18:20 +0000162 "update_nand_full_filename=u-boot.nand\0" \
163 "update_nand_firmware_filename=u-boot.sb\0" \
Marek Vasut9a0f98d2012-05-01 11:09:43 +0000164 "update_sd_firmware_filename=u-boot.sd\0" \
Marek Vasutfc102722011-11-08 23:18:20 +0000165 "update_nand_firmware_maxsz=0x100000\0" \
166 "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \
167 "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \
168 "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \
169 "nand device 0 ; " \
170 "nand info ; " \
171 "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
172 "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
173 "update_nand_full=" /* Update FCB, DBBT and FW */ \
174 "if tftp ${update_nand_full_filename} ; then " \
175 "run update_nand_get_fcb_size ; " \
176 "nand scrub -y 0x0 ${filesize} ; " \
Eric Benard71779d52012-12-11 11:36:21 +0000177 "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
Marek Vasutfc102722011-11-08 23:18:20 +0000178 "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
179 "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
180 "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
181 "fi\0" \
182 "update_nand_firmware=" /* Update only firmware */ \
183 "if tftp ${update_nand_firmware_filename} ; then " \
184 "run update_nand_get_fcb_size ; " \
185 "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \
186 "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \
187 "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \
188 "nand erase ${fcb_sz} ${fw_sz} ; " \
189 "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
190 "nand write ${loadaddr} ${fw_off} ${filesize} ; " \
Marek Vasut9a0f98d2012-05-01 11:09:43 +0000191 "fi\0" \
192 "update_sd_firmware=" /* Update the SD firmware partition */ \
193 "if mmc rescan ; then " \
194 "if tftp ${update_sd_firmware_filename} ; then " \
195 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
196 "setexpr fw_sz ${fw_sz} + 1 ; " \
197 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
198 "fi ; " \
Marek Vasutfc102722011-11-08 23:18:20 +0000199 "fi\0"
200
Marek Vasut5434caf2013-06-16 15:39:02 +0200201/* The rest of the configuration is shared */
202#include <configs/mxs.h>
203
204#endif /* __CONFIGS_M28EVK_H__ */