blob: f6fa599e6bfd39d69f8e3d9747ab2a596658f849 [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 CONFIG_MACH_TYPE MACH_TYPE_M28EVK
Marek Vasut78687b72011-11-08 23:18:20 +000013
Marek Vasuteb0c7012014-06-26 11:01:27 +020014#define CONFIG_TIMESTAMP /* Print image info with timestamp */
15
Marek Vasutb51f8ae2013-06-16 15:39:02 +020016/* U-Boot Commands */
Marek Vasuteb0c7012014-06-26 11:01:27 +020017#define CONFIG_FAT_WRITE
Marek Vasut78687b72011-11-08 23:18:20 +000018
Wolfgang Denkbed617d2013-03-23 23:50:35 +000019#define CONFIG_CMD_EEPROM
Wolfgang Denkbed617d2013-03-23 23:50:35 +000020#define CONFIG_CMD_NAND
Marek Vasute154c712013-07-07 20:20:26 +020021#define CONFIG_CMD_NAND_TRIMFFS
Marek Vasut78687b72011-11-08 23:18:20 +000022
Marek Vasutb51f8ae2013-06-16 15:39:02 +020023/* Memory configuration */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000024#define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
25#define PHYS_SDRAM_1 0x40000000 /* Base address */
26#define PHYS_SDRAM_1_SIZE 0x20000000 /* Max 512 MB RAM */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000027#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
Marek Vasut78687b72011-11-08 23:18:20 +000028
Marek Vasutb51f8ae2013-06-16 15:39:02 +020029/* Environment */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000030#define CONFIG_ENV_SIZE (16 * 1024)
Marek Vasutb51f8ae2013-06-16 15:39:02 +020031#define CONFIG_ENV_IS_IN_NAND
Marek Vasut78687b72011-11-08 23:18:20 +000032
33/* Environment is in NAND */
Marek Vasutb51f8ae2013-06-16 15:39:02 +020034#if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND)
Wolfgang Denkbed617d2013-03-23 23:50:35 +000035#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
36#define CONFIG_ENV_SECT_SIZE (128 * 1024)
Marek Vasut72d2dee2014-06-26 11:01:28 +020037#define CONFIG_ENV_RANGE (4 * CONFIG_ENV_SECT_SIZE)
38#define CONFIG_ENV_OFFSET (24 * CONFIG_ENV_SECT_SIZE) /* 3 MiB */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000039#define CONFIG_ENV_OFFSET_REDUND \
Marek Vasut78687b72011-11-08 23:18:20 +000040 (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
41
Wolfgang Denkbed617d2013-03-23 23:50:35 +000042#define CONFIG_CMD_UBIFS
43#define CONFIG_CMD_MTDPARTS
44#define CONFIG_RBTREE
45#define CONFIG_LZO
46#define CONFIG_MTD_DEVICE
47#define CONFIG_MTD_PARTITIONS
48#define MTDIDS_DEFAULT "nand0=gpmi-nand"
49#define MTDPARTS_DEFAULT \
Marek Vasut94be3652012-08-28 15:12:48 +000050 "mtdparts=gpmi-nand:" \
Marek Vasut72d2dee2014-06-26 11:01:28 +020051 "3m(u-boot)," \
52 "512k(env1)," \
53 "512k(env2)," \
54 "14m(boot)," \
55 "238m(data)," \
56 "-@4096k(UBI)"
Marek Vasut173825c2011-12-31 18:28:22 +000057#else
Wolfgang Denkbed617d2013-03-23 23:50:35 +000058#define CONFIG_ENV_IS_NOWHERE
Marek Vasut78687b72011-11-08 23:18:20 +000059#endif
60
Marek Vasutb51f8ae2013-06-16 15:39:02 +020061/* FEC Ethernet on SoC */
62#ifdef CONFIG_CMD_NET
Wolfgang Denkbed617d2013-03-23 23:50:35 +000063#define CONFIG_FEC_MXC
Marek Vasut78687b72011-11-08 23:18:20 +000064#endif
65
Marek Vasutb51f8ae2013-06-16 15:39:02 +020066/* EEPROM */
67#ifdef CONFIG_CMD_EEPROM
Wolfgang Denkbed617d2013-03-23 23:50:35 +000068#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
Marek Vasut78687b72011-11-08 23:18:20 +000069#endif
70
Marek Vasutb51f8ae2013-06-16 15:39:02 +020071/* RTC */
72#ifdef CONFIG_CMD_DATE
Marek Vasut78687b72011-11-08 23:18:20 +000073/* Use the internal RTC in the MXS chip */
Wolfgang Denkbed617d2013-03-23 23:50:35 +000074#define CONFIG_RTC_INTERNAL
Marek Vasutb51f8ae2013-06-16 15:39:02 +020075#ifdef CONFIG_RTC_INTERNAL
Wolfgang Denkbed617d2013-03-23 23:50:35 +000076#define CONFIG_RTC_MXS
Marek Vasut78687b72011-11-08 23:18:20 +000077#else
Wolfgang Denkbed617d2013-03-23 23:50:35 +000078#define CONFIG_RTC_M41T62
79#define CONFIG_SYS_I2C_RTC_ADDR 0x68
80#define CONFIG_SYS_M41T11_BASE_YEAR 2000
Marek Vasut78687b72011-11-08 23:18:20 +000081#endif
82#endif
83
Marek Vasutb51f8ae2013-06-16 15:39:02 +020084/* USB */
85#ifdef CONFIG_CMD_USB
Marek Vasut191a2ce2013-02-23 02:43:02 +000086#define CONFIG_EHCI_MXS_PORT0
87#define CONFIG_EHCI_MXS_PORT1
88#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
Marek Vasutbf4362f2011-11-08 23:18:27 +000089#endif
90
Marek Vasutb51f8ae2013-06-16 15:39:02 +020091/* SPI */
92#ifdef CONFIG_CMD_SPI
Wolfgang Denkbed617d2013-03-23 23:50:35 +000093#define CONFIG_DEFAULT_SPI_BUS 2
94#define CONFIG_DEFAULT_SPI_CS 0
95#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
Marek Vasut78687b72011-11-08 23:18:20 +000096
97/* SPI FLASH */
Marek Vasutb51f8ae2013-06-16 15:39:02 +020098#ifdef CONFIG_CMD_SF
Wolfgang Denkbed617d2013-03-23 23:50:35 +000099#define CONFIG_SF_DEFAULT_BUS 2
100#define CONFIG_SF_DEFAULT_CS 0
101#define CONFIG_SF_DEFAULT_SPEED 40000000
102#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
Marek Vasut78687b72011-11-08 23:18:20 +0000103
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000104#define CONFIG_ENV_SPI_BUS 2
105#define CONFIG_ENV_SPI_CS 0
106#define CONFIG_ENV_SPI_MAX_HZ 40000000
107#define CONFIG_ENV_SPI_MODE SPI_MODE_0
Marek Vasut78687b72011-11-08 23:18:20 +0000108#endif
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200109
Marek Vasut78687b72011-11-08 23:18:20 +0000110#endif
111
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200112/* LCD */
113#ifdef CONFIG_VIDEO
Marek Vasut34ce0e12013-04-28 09:20:04 +0000114#define CONFIG_VIDEO_LOGO
Marek Vasut34ce0e12013-04-28 09:20:04 +0000115#define CONFIG_SPLASH_SCREEN
Marek Vasut34ce0e12013-04-28 09:20:04 +0000116#define CONFIG_BMP_16BPP
117#define CONFIG_VIDEO_BMP_RLE8
118#define CONFIG_VIDEO_BMP_GZIP
Marek Vasuteb0c7012014-06-26 11:01:27 +0200119#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (2 << 20)
Marek Vasut34ce0e12013-04-28 09:20:04 +0000120#endif
121
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200122/* Booting Linux */
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200123#define CONFIG_BOOTFILE "fitImage"
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000124#define CONFIG_BOOTARGS "console=ttyAMA0,115200n8 "
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200125#define CONFIG_BOOTCOMMAND "run mmc_mmc"
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000126#define CONFIG_LOADADDR 0x42000000
127#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
Marek Vasut78687b72011-11-08 23:18:20 +0000128
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200129/* Extra Environment */
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200130#define CONFIG_PREBOOT "run try_bootscript"
131#define CONFIG_HOSTNAME m28evk
132
Wolfgang Denkbed617d2013-03-23 23:50:35 +0000133#define CONFIG_EXTRA_ENV_SETTINGS \
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200134 "consdev=ttyAMA0\0" \
135 "baudrate=115200\0" \
Marek Vasut04457b72014-10-12 00:00:50 +0200136 "bootscript=boot.scr\0" \
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200137 "bootdev=/dev/mmcblk0p2\0" \
138 "rootdev=/dev/mmcblk0p3\0" \
139 "netdev=eth0\0" \
140 "hostname=m28evk\0" \
141 "rootpath=/opt/eldk-5.5/armv5te/rootfs-qte-sdk\0" \
142 "kernel_addr_r=0x42000000\0" \
143 "videomode=video=ctfb:x:800,y:480,depth:18,mode:0,pclk:30066," \
144 "le:0,ri:256,up:0,lo:45,hs:1,vs:1,sync:100663296," \
145 "vmode:0\0" \
Marek Vasut78687b72011-11-08 23:18:20 +0000146 "update_nand_full_filename=u-boot.nand\0" \
147 "update_nand_firmware_filename=u-boot.sb\0" \
Marek Vasutf5013862012-05-01 11:09:43 +0000148 "update_sd_firmware_filename=u-boot.sd\0" \
Marek Vasut78687b72011-11-08 23:18:20 +0000149 "update_nand_firmware_maxsz=0x100000\0" \
150 "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \
151 "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \
152 "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \
153 "nand device 0 ; " \
154 "nand info ; " \
155 "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
156 "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
157 "update_nand_full=" /* Update FCB, DBBT and FW */ \
158 "if tftp ${update_nand_full_filename} ; then " \
159 "run update_nand_get_fcb_size ; " \
160 "nand scrub -y 0x0 ${filesize} ; " \
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200161 "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
Marek Vasut78687b72011-11-08 23:18:20 +0000162 "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
163 "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
164 "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
165 "fi\0" \
166 "update_nand_firmware=" /* Update only firmware */ \
167 "if tftp ${update_nand_firmware_filename} ; then " \
168 "run update_nand_get_fcb_size ; " \
169 "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \
170 "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \
171 "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \
172 "nand erase ${fcb_sz} ${fw_sz} ; " \
173 "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
174 "nand write ${loadaddr} ${fw_off} ${filesize} ; " \
Marek Vasutf5013862012-05-01 11:09:43 +0000175 "fi\0" \
176 "update_sd_firmware=" /* Update the SD firmware partition */ \
177 "if mmc rescan ; then " \
178 "if tftp ${update_sd_firmware_filename} ; then " \
179 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
180 "setexpr fw_sz ${fw_sz} + 1 ; " \
181 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
182 "fi ; " \
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200183 "fi\0" \
184 "addcons=" \
185 "setenv bootargs ${bootargs} " \
186 "console=${consdev},${baudrate}\0" \
187 "addip=" \
188 "setenv bootargs ${bootargs} " \
189 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
190 "${netmask}:${hostname}:${netdev}:off\0" \
191 "addmisc=" \
192 "setenv bootargs ${bootargs} ${miscargs}\0" \
193 "adddfltmtd=" \
194 "if test \"x${mtdparts}\" == \"x\" ; then " \
195 "mtdparts default ; " \
196 "fi\0" \
197 "addmtd=" \
198 "run adddfltmtd ; " \
199 "setenv bootargs ${bootargs} ${mtdparts}\0" \
200 "addargs=run addcons addmtd addmisc\0" \
201 "mmcload=" \
202 "mmc rescan ; " \
Marek Vasutbfbeff22014-09-23 13:18:20 +0200203 "load mmc 0:2 ${kernel_addr_r} ${bootfile}\0" \
Lothar Rubusch65af06e2014-06-26 11:01:29 +0200204 "ubiload=" \
205 "ubi part UBI ; ubifsmount ubi0:rootfs ; " \
206 "ubifsload ${kernel_addr_r} /boot/${bootfile}\0" \
207 "netload=" \
208 "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \
209 "miscargs=nohlt panic=1\0" \
210 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
211 "ubiargs=" \
212 "setenv bootargs ubi.mtd=5 " \
213 "root=ubi0:rootfs rootfstype=ubifs\0" \
214 "nfsargs=" \
215 "setenv bootargs root=/dev/nfs rw " \
216 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
217 "mmc_mmc=" \
218 "run mmcload mmcargs addargs ; " \
219 "bootm ${kernel_addr_r}\0" \
220 "mmc_ubi=" \
221 "run mmcload ubiargs addargs ; " \
222 "bootm ${kernel_addr_r}\0" \
223 "mmc_nfs=" \
224 "run mmcload nfsargs addip addargs ; " \
225 "bootm ${kernel_addr_r}\0" \
226 "ubi_mmc=" \
227 "run ubiload mmcargs addargs ; " \
228 "bootm ${kernel_addr_r}\0" \
229 "ubi_ubi=" \
230 "run ubiload ubiargs addargs ; " \
231 "bootm ${kernel_addr_r}\0" \
232 "ubi_nfs=" \
233 "run ubiload nfsargs addip addargs ; " \
234 "bootm ${kernel_addr_r}\0" \
235 "net_mmc=" \
236 "run netload mmcargs addargs ; " \
237 "bootm ${kernel_addr_r}\0" \
238 "net_ubi=" \
239 "run netload ubiargs addargs ; " \
240 "bootm ${kernel_addr_r}\0" \
241 "net_nfs=" \
242 "run netload nfsargs addip addargs ; " \
243 "bootm ${kernel_addr_r}\0" \
244 "try_bootscript=" \
245 "mmc rescan;" \
Marek Vasuteab2cb62014-09-23 13:18:18 +0200246 "if test -e mmc 0:2 ${bootscript} ; then " \
Marek Vasutbfbeff22014-09-23 13:18:20 +0200247 "if load mmc 0:2 ${kernel_addr_r} ${bootscript};" \
Marek Vasuta977f482014-09-25 21:14:16 +0200248 "then ; " \
249 "echo Running bootscript... ; " \
250 "source ${kernel_addr_r} ; " \
Marek Vasuteab2cb62014-09-23 13:18:18 +0200251 "fi ; " \
Marek Vasut78687b72011-11-08 23:18:20 +0000252 "fi\0"
253
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200254/* The rest of the configuration is shared */
255#include <configs/mxs.h>
256
257#endif /* __CONFIGS_M28EVK_H__ */