blob: 14874a5ebc4005c2df95d4401600cd33715f3b94 [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 CONFIG_MACH_TYPE MACH_TYPE_M28EVK
Marek Vasutfc102722011-11-08 23:18:20 +000013
Marek Vasut31b57a52014-06-26 11:01:27 +020014#define CONFIG_TIMESTAMP /* Print image info with timestamp */
15
Marek Vasut5434caf2013-06-16 15:39:02 +020016/* U-Boot Commands */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000017#define CONFIG_CMD_NAND
Marek Vasut32cc24d2013-07-07 20:20:26 +020018#define CONFIG_CMD_NAND_TRIMFFS
Marek Vasutfc102722011-11-08 23:18:20 +000019
Marek Vasut5434caf2013-06-16 15:39:02 +020020/* Memory configuration */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000021#define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
22#define PHYS_SDRAM_1 0x40000000 /* Base address */
23#define PHYS_SDRAM_1_SIZE 0x20000000 /* Max 512 MB RAM */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000024#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
Fabio Estevam10846062011-12-29 03:35:38 +000025
Marek Vasut5434caf2013-06-16 15:39:02 +020026/* Environment */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000027#define CONFIG_ENV_SIZE (16 * 1024)
Marek Vasutfc102722011-11-08 23:18:20 +000028
29/* Environment is in NAND */
Marek Vasut5434caf2013-06-16 15:39:02 +020030#if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND)
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000031#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
32#define CONFIG_ENV_SECT_SIZE (128 * 1024)
Marek Vasut76582f92014-06-26 11:01:28 +020033#define CONFIG_ENV_RANGE (4 * CONFIG_ENV_SECT_SIZE)
34#define CONFIG_ENV_OFFSET (24 * CONFIG_ENV_SECT_SIZE) /* 3 MiB */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000035#define CONFIG_ENV_OFFSET_REDUND \
Marek Vasutfc102722011-11-08 23:18:20 +000036 (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
37
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000038#define CONFIG_MTD_DEVICE
39#define CONFIG_MTD_PARTITIONS
40#define MTDIDS_DEFAULT "nand0=gpmi-nand"
41#define MTDPARTS_DEFAULT \
Marek Vasutc16ecb02012-08-28 15:12:48 +000042 "mtdparts=gpmi-nand:" \
Marek Vasut76582f92014-06-26 11:01:28 +020043 "3m(u-boot)," \
44 "512k(env1)," \
45 "512k(env2)," \
46 "14m(boot)," \
47 "238m(data)," \
48 "-@4096k(UBI)"
Marek Vasutfc102722011-11-08 23:18:20 +000049#endif
50
Marek Vasut5434caf2013-06-16 15:39:02 +020051/* FEC Ethernet on SoC */
52#ifdef CONFIG_CMD_NET
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000053#define CONFIG_FEC_MXC
Marek Vasutfc102722011-11-08 23:18:20 +000054#endif
55
Marek Vasut5434caf2013-06-16 15:39:02 +020056/* RTC */
57#ifdef CONFIG_CMD_DATE
Marek Vasutfc102722011-11-08 23:18:20 +000058/* Use the internal RTC in the MXS chip */
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000059#define CONFIG_RTC_INTERNAL
Marek Vasut5434caf2013-06-16 15:39:02 +020060#ifdef CONFIG_RTC_INTERNAL
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000061#define CONFIG_RTC_MXS
Marek Vasutfc102722011-11-08 23:18:20 +000062#else
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000063#define CONFIG_RTC_M41T62
64#define CONFIG_SYS_I2C_RTC_ADDR 0x68
65#define CONFIG_SYS_M41T11_BASE_YEAR 2000
Marek Vasutfc102722011-11-08 23:18:20 +000066#endif
67#endif
68
Marek Vasut5434caf2013-06-16 15:39:02 +020069/* USB */
70#ifdef CONFIG_CMD_USB
Marek Vasutafa87212013-02-23 02:43:02 +000071#define CONFIG_EHCI_MXS_PORT0
72#define CONFIG_EHCI_MXS_PORT1
73#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
Marek Vasut8f59bc12011-11-08 23:18:27 +000074#endif
75
Marek Vasut5434caf2013-06-16 15:39:02 +020076/* SPI */
77#ifdef CONFIG_CMD_SPI
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000078#define CONFIG_DEFAULT_SPI_BUS 2
79#define CONFIG_DEFAULT_SPI_CS 0
80#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
Marek Vasutfc102722011-11-08 23:18:20 +000081
82/* SPI FLASH */
Marek Vasut5434caf2013-06-16 15:39:02 +020083#ifdef CONFIG_CMD_SF
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000084#define CONFIG_SF_DEFAULT_BUS 2
85#define CONFIG_SF_DEFAULT_CS 0
86#define CONFIG_SF_DEFAULT_SPEED 40000000
87#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
Marek Vasutfc102722011-11-08 23:18:20 +000088
Wolfgang Denk5f71bca2013-03-23 23:50:35 +000089#define CONFIG_ENV_SPI_BUS 2
90#define CONFIG_ENV_SPI_CS 0
91#define CONFIG_ENV_SPI_MAX_HZ 40000000
92#define CONFIG_ENV_SPI_MODE SPI_MODE_0
Marek Vasutfc102722011-11-08 23:18:20 +000093#endif
Marek Vasut5434caf2013-06-16 15:39:02 +020094
Marek Vasutfc102722011-11-08 23:18:20 +000095#endif
96
Marek Vasut5434caf2013-06-16 15:39:02 +020097/* LCD */
98#ifdef CONFIG_VIDEO
Marek Vasutd782c1f2013-04-28 09:20:04 +000099#define CONFIG_VIDEO_LOGO
Marek Vasutd782c1f2013-04-28 09:20:04 +0000100#define CONFIG_SPLASH_SCREEN
Marek Vasutd782c1f2013-04-28 09:20:04 +0000101#define CONFIG_BMP_16BPP
102#define CONFIG_VIDEO_BMP_RLE8
103#define CONFIG_VIDEO_BMP_GZIP
Marek Vasut31b57a52014-06-26 11:01:27 +0200104#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (2 << 20)
Marek Vasutd782c1f2013-04-28 09:20:04 +0000105#endif
106
Marek Vasut5434caf2013-06-16 15:39:02 +0200107/* Booting Linux */
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200108#define CONFIG_BOOTFILE "fitImage"
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000109#define CONFIG_BOOTARGS "console=ttyAMA0,115200n8 "
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200110#define CONFIG_BOOTCOMMAND "run mmc_mmc"
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000111#define CONFIG_LOADADDR 0x42000000
112#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
Marek Vasutfc102722011-11-08 23:18:20 +0000113
Marek Vasut5434caf2013-06-16 15:39:02 +0200114/* Extra Environment */
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200115#define CONFIG_PREBOOT "run try_bootscript"
116#define CONFIG_HOSTNAME m28evk
117
Wolfgang Denk5f71bca2013-03-23 23:50:35 +0000118#define CONFIG_EXTRA_ENV_SETTINGS \
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200119 "consdev=ttyAMA0\0" \
120 "baudrate=115200\0" \
Marek Vasutd12159b2014-10-12 00:00:50 +0200121 "bootscript=boot.scr\0" \
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200122 "bootdev=/dev/mmcblk0p2\0" \
123 "rootdev=/dev/mmcblk0p3\0" \
124 "netdev=eth0\0" \
125 "hostname=m28evk\0" \
126 "rootpath=/opt/eldk-5.5/armv5te/rootfs-qte-sdk\0" \
127 "kernel_addr_r=0x42000000\0" \
128 "videomode=video=ctfb:x:800,y:480,depth:18,mode:0,pclk:30066," \
129 "le:0,ri:256,up:0,lo:45,hs:1,vs:1,sync:100663296," \
130 "vmode:0\0" \
Marek Vasutfc102722011-11-08 23:18:20 +0000131 "update_nand_full_filename=u-boot.nand\0" \
132 "update_nand_firmware_filename=u-boot.sb\0" \
Marek Vasut9a0f98d2012-05-01 11:09:43 +0000133 "update_sd_firmware_filename=u-boot.sd\0" \
Marek Vasutfc102722011-11-08 23:18:20 +0000134 "update_nand_firmware_maxsz=0x100000\0" \
135 "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \
136 "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \
137 "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \
138 "nand device 0 ; " \
139 "nand info ; " \
140 "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
141 "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
142 "update_nand_full=" /* Update FCB, DBBT and FW */ \
143 "if tftp ${update_nand_full_filename} ; then " \
144 "run update_nand_get_fcb_size ; " \
145 "nand scrub -y 0x0 ${filesize} ; " \
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200146 "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
Marek Vasutfc102722011-11-08 23:18:20 +0000147 "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
148 "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
149 "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
150 "fi\0" \
151 "update_nand_firmware=" /* Update only firmware */ \
152 "if tftp ${update_nand_firmware_filename} ; then " \
153 "run update_nand_get_fcb_size ; " \
154 "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \
155 "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \
156 "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \
157 "nand erase ${fcb_sz} ${fw_sz} ; " \
158 "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
159 "nand write ${loadaddr} ${fw_off} ${filesize} ; " \
Marek Vasut9a0f98d2012-05-01 11:09:43 +0000160 "fi\0" \
161 "update_sd_firmware=" /* Update the SD firmware partition */ \
162 "if mmc rescan ; then " \
163 "if tftp ${update_sd_firmware_filename} ; then " \
164 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
165 "setexpr fw_sz ${fw_sz} + 1 ; " \
166 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
167 "fi ; " \
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200168 "fi\0" \
169 "addcons=" \
170 "setenv bootargs ${bootargs} " \
171 "console=${consdev},${baudrate}\0" \
172 "addip=" \
173 "setenv bootargs ${bootargs} " \
174 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
175 "${netmask}:${hostname}:${netdev}:off\0" \
176 "addmisc=" \
177 "setenv bootargs ${bootargs} ${miscargs}\0" \
178 "adddfltmtd=" \
179 "if test \"x${mtdparts}\" == \"x\" ; then " \
180 "mtdparts default ; " \
181 "fi\0" \
182 "addmtd=" \
183 "run adddfltmtd ; " \
184 "setenv bootargs ${bootargs} ${mtdparts}\0" \
185 "addargs=run addcons addmtd addmisc\0" \
186 "mmcload=" \
187 "mmc rescan ; " \
Marek Vasutfc532a92014-09-23 13:18:20 +0200188 "load mmc 0:2 ${kernel_addr_r} ${bootfile}\0" \
Lothar Rubuscha428ac92014-06-26 11:01:29 +0200189 "ubiload=" \
190 "ubi part UBI ; ubifsmount ubi0:rootfs ; " \
191 "ubifsload ${kernel_addr_r} /boot/${bootfile}\0" \
192 "netload=" \
193 "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \
194 "miscargs=nohlt panic=1\0" \
195 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
196 "ubiargs=" \
197 "setenv bootargs ubi.mtd=5 " \
198 "root=ubi0:rootfs rootfstype=ubifs\0" \
199 "nfsargs=" \
200 "setenv bootargs root=/dev/nfs rw " \
201 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
202 "mmc_mmc=" \
203 "run mmcload mmcargs addargs ; " \
204 "bootm ${kernel_addr_r}\0" \
205 "mmc_ubi=" \
206 "run mmcload ubiargs addargs ; " \
207 "bootm ${kernel_addr_r}\0" \
208 "mmc_nfs=" \
209 "run mmcload nfsargs addip addargs ; " \
210 "bootm ${kernel_addr_r}\0" \
211 "ubi_mmc=" \
212 "run ubiload mmcargs addargs ; " \
213 "bootm ${kernel_addr_r}\0" \
214 "ubi_ubi=" \
215 "run ubiload ubiargs addargs ; " \
216 "bootm ${kernel_addr_r}\0" \
217 "ubi_nfs=" \
218 "run ubiload nfsargs addip addargs ; " \
219 "bootm ${kernel_addr_r}\0" \
220 "net_mmc=" \
221 "run netload mmcargs addargs ; " \
222 "bootm ${kernel_addr_r}\0" \
223 "net_ubi=" \
224 "run netload ubiargs addargs ; " \
225 "bootm ${kernel_addr_r}\0" \
226 "net_nfs=" \
227 "run netload nfsargs addip addargs ; " \
228 "bootm ${kernel_addr_r}\0" \
229 "try_bootscript=" \
230 "mmc rescan;" \
Marek Vasut4ba9b1c2014-09-23 13:18:18 +0200231 "if test -e mmc 0:2 ${bootscript} ; then " \
Marek Vasutfc532a92014-09-23 13:18:20 +0200232 "if load mmc 0:2 ${kernel_addr_r} ${bootscript};" \
Marek Vasut46f8a4b2014-09-25 21:14:16 +0200233 "then ; " \
234 "echo Running bootscript... ; " \
235 "source ${kernel_addr_r} ; " \
Marek Vasut4ba9b1c2014-09-23 13:18:18 +0200236 "fi ; " \
Marek Vasutfc102722011-11-08 23:18:20 +0000237 "fi\0"
238
Marek Vasut5434caf2013-06-16 15:39:02 +0200239/* The rest of the configuration is shared */
240#include <configs/mxs.h>
241
242#endif /* __CONFIGS_M28EVK_H__ */