2 * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
3 * on behalf of DENX Software Engineering GmbH
5 * SPDX-License-Identifier: GPL-2.0+
7 #ifndef __CONFIGS_M28EVK_H__
8 #define __CONFIGS_M28EVK_H__
10 /* System configurations */
11 #define CONFIG_MX28 /* i.MX28 SoC */
12 #define MACH_TYPE_M28EVK 3613
13 #define CONFIG_MACH_TYPE MACH_TYPE_M28EVK
15 #define CONFIG_TIMESTAMP /* Print image info with timestamp */
18 #define CONFIG_SYS_NO_FLASH
19 #define CONFIG_DOS_PARTITION
20 #define CONFIG_FAT_WRITE
22 #define CONFIG_CMD_BMP
23 #define CONFIG_CMD_DATE
24 #define CONFIG_CMD_EEPROM
25 #define CONFIG_CMD_NAND
26 #define CONFIG_CMD_NAND_TRIMFFS
29 /* Memory configuration */
30 #define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
31 #define PHYS_SDRAM_1 0x40000000 /* Base address */
32 #define PHYS_SDRAM_1_SIZE 0x20000000 /* Max 512 MB RAM */
33 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
36 #define CONFIG_ENV_SIZE (16 * 1024)
37 #define CONFIG_ENV_IS_IN_NAND
39 /* Environment is in NAND */
40 #if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND)
41 #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
42 #define CONFIG_ENV_SECT_SIZE (128 * 1024)
43 #define CONFIG_ENV_RANGE (4 * CONFIG_ENV_SECT_SIZE)
44 #define CONFIG_ENV_OFFSET (24 * CONFIG_ENV_SECT_SIZE) /* 3 MiB */
45 #define CONFIG_ENV_OFFSET_REDUND \
46 (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
48 #define CONFIG_CMD_UBIFS
49 #define CONFIG_CMD_MTDPARTS
52 #define CONFIG_MTD_DEVICE
53 #define CONFIG_MTD_PARTITIONS
54 #define MTDIDS_DEFAULT "nand0=gpmi-nand"
55 #define MTDPARTS_DEFAULT \
56 "mtdparts=gpmi-nand:" \
64 #define CONFIG_ENV_IS_NOWHERE
67 /* FEC Ethernet on SoC */
69 #define CONFIG_FEC_MXC
73 #ifdef CONFIG_CMD_EEPROM
74 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
78 #ifdef CONFIG_CMD_DATE
79 /* Use the internal RTC in the MXS chip */
80 #define CONFIG_RTC_INTERNAL
81 #ifdef CONFIG_RTC_INTERNAL
82 #define CONFIG_RTC_MXS
84 #define CONFIG_RTC_M41T62
85 #define CONFIG_SYS_I2C_RTC_ADDR 0x68
86 #define CONFIG_SYS_M41T11_BASE_YEAR 2000
92 #define CONFIG_EHCI_MXS_PORT0
93 #define CONFIG_EHCI_MXS_PORT1
94 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
99 #define CONFIG_DEFAULT_SPI_BUS 2
100 #define CONFIG_DEFAULT_SPI_CS 0
101 #define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
105 #define CONFIG_SF_DEFAULT_BUS 2
106 #define CONFIG_SF_DEFAULT_CS 0
107 #define CONFIG_SF_DEFAULT_SPEED 40000000
108 #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
110 #define CONFIG_ENV_SPI_BUS 2
111 #define CONFIG_ENV_SPI_CS 0
112 #define CONFIG_ENV_SPI_MAX_HZ 40000000
113 #define CONFIG_ENV_SPI_MODE SPI_MODE_0
120 #define CONFIG_VIDEO_LOGO
121 #define CONFIG_SPLASH_SCREEN
122 #define CONFIG_CMD_BMP
123 #define CONFIG_BMP_16BPP
124 #define CONFIG_VIDEO_BMP_RLE8
125 #define CONFIG_VIDEO_BMP_GZIP
126 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (2 << 20)
130 #define CONFIG_BOOTFILE "fitImage"
131 #define CONFIG_BOOTARGS "console=ttyAMA0,115200n8 "
132 #define CONFIG_BOOTCOMMAND "run mmc_mmc"
133 #define CONFIG_LOADADDR 0x42000000
134 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
136 /* Extra Environment */
137 #define CONFIG_PREBOOT "run try_bootscript"
138 #define CONFIG_HOSTNAME m28evk
140 #define CONFIG_EXTRA_ENV_SETTINGS \
141 "consdev=ttyAMA0\0" \
142 "baudrate=115200\0" \
143 "bootscript=boot.scr\0" \
144 "bootdev=/dev/mmcblk0p2\0" \
145 "rootdev=/dev/mmcblk0p3\0" \
147 "hostname=m28evk\0" \
148 "rootpath=/opt/eldk-5.5/armv5te/rootfs-qte-sdk\0" \
149 "kernel_addr_r=0x42000000\0" \
150 "videomode=video=ctfb:x:800,y:480,depth:18,mode:0,pclk:30066," \
151 "le:0,ri:256,up:0,lo:45,hs:1,vs:1,sync:100663296," \
153 "update_nand_full_filename=u-boot.nand\0" \
154 "update_nand_firmware_filename=u-boot.sb\0" \
155 "update_sd_firmware_filename=u-boot.sd\0" \
156 "update_nand_firmware_maxsz=0x100000\0" \
157 "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \
158 "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \
159 "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \
162 "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
163 "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
164 "update_nand_full=" /* Update FCB, DBBT and FW */ \
165 "if tftp ${update_nand_full_filename} ; then " \
166 "run update_nand_get_fcb_size ; " \
167 "nand scrub -y 0x0 ${filesize} ; " \
168 "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
169 "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
170 "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
171 "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
173 "update_nand_firmware=" /* Update only firmware */ \
174 "if tftp ${update_nand_firmware_filename} ; then " \
175 "run update_nand_get_fcb_size ; " \
176 "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \
177 "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \
178 "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \
179 "nand erase ${fcb_sz} ${fw_sz} ; " \
180 "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
181 "nand write ${loadaddr} ${fw_off} ${filesize} ; " \
183 "update_sd_firmware=" /* Update the SD firmware partition */ \
184 "if mmc rescan ; then " \
185 "if tftp ${update_sd_firmware_filename} ; then " \
186 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
187 "setexpr fw_sz ${fw_sz} + 1 ; " \
188 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
192 "setenv bootargs ${bootargs} " \
193 "console=${consdev},${baudrate}\0" \
195 "setenv bootargs ${bootargs} " \
196 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
197 "${netmask}:${hostname}:${netdev}:off\0" \
199 "setenv bootargs ${bootargs} ${miscargs}\0" \
201 "if test \"x${mtdparts}\" == \"x\" ; then " \
202 "mtdparts default ; " \
205 "run adddfltmtd ; " \
206 "setenv bootargs ${bootargs} ${mtdparts}\0" \
207 "addargs=run addcons addmtd addmisc\0" \
210 "load mmc 0:2 ${kernel_addr_r} ${bootfile}\0" \
212 "ubi part UBI ; ubifsmount ubi0:rootfs ; " \
213 "ubifsload ${kernel_addr_r} /boot/${bootfile}\0" \
215 "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \
216 "miscargs=nohlt panic=1\0" \
217 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
219 "setenv bootargs ubi.mtd=5 " \
220 "root=ubi0:rootfs rootfstype=ubifs\0" \
222 "setenv bootargs root=/dev/nfs rw " \
223 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
225 "run mmcload mmcargs addargs ; " \
226 "bootm ${kernel_addr_r}\0" \
228 "run mmcload ubiargs addargs ; " \
229 "bootm ${kernel_addr_r}\0" \
231 "run mmcload nfsargs addip addargs ; " \
232 "bootm ${kernel_addr_r}\0" \
234 "run ubiload mmcargs addargs ; " \
235 "bootm ${kernel_addr_r}\0" \
237 "run ubiload ubiargs addargs ; " \
238 "bootm ${kernel_addr_r}\0" \
240 "run ubiload nfsargs addip addargs ; " \
241 "bootm ${kernel_addr_r}\0" \
243 "run netload mmcargs addargs ; " \
244 "bootm ${kernel_addr_r}\0" \
246 "run netload ubiargs addargs ; " \
247 "bootm ${kernel_addr_r}\0" \
249 "run netload nfsargs addip addargs ; " \
250 "bootm ${kernel_addr_r}\0" \
253 "if test -e mmc 0:2 ${bootscript} ; then " \
254 "if load mmc 0:2 ${kernel_addr_r} ${bootscript};" \
256 "echo Running bootscript... ; " \
257 "source ${kernel_addr_r} ; " \
261 /* The rest of the configuration is shared */
262 #include <configs/mxs.h>
264 #endif /* __CONFIGS_M28EVK_H__ */