]>
Commit | Line | Data |
---|---|---|
29f75a5c FE |
1 | /* |
2 | * (C) Copyright 2011 Freescale Semiconductor, Inc. | |
3 | * Author: Fabio Estevam <[email protected]> | |
4 | * | |
5 | * Based on m28evk.h: | |
6 | * Copyright (C) 2011 Marek Vasut <[email protected]> | |
7 | * on behalf of DENX Software Engineering GmbH | |
8 | * | |
1a459660 | 9 | * SPDX-License-Identifier: GPL-2.0+ |
29f75a5c | 10 | */ |
5434caf5 MV |
11 | #ifndef __CONFIGS_MX28EVK_H__ |
12 | #define __CONFIGS_MX28EVK_H__ | |
29f75a5c | 13 | |
5434caf5 | 14 | /* System configurations */ |
29f75a5c | 15 | #define CONFIG_MX28 /* i.MX28 SoC */ |
29f75a5c | 16 | #define CONFIG_MACH_TYPE MACH_TYPE_MX28EVK |
29f75a5c | 17 | |
40f1daa0 | 18 | /* U-Boot Commands */ |
5434caf5 | 19 | #define CONFIG_SYS_NO_FLASH |
29f75a5c FE |
20 | #define CONFIG_DISPLAY_CPUINFO |
21 | #define CONFIG_DOS_PARTITION | |
29f75a5c | 22 | |
9588d942 | 23 | #define CONFIG_CMD_DATE |
ab461be6 | 24 | #define CONFIG_CMD_NAND |
8b360c06 | 25 | #define CONFIG_CMD_NAND_TRIMFFS |
68661db2 | 26 | #define CONFIG_VIDEO |
29f75a5c | 27 | |
5434caf5 | 28 | /* Memory configuration */ |
29f75a5c FE |
29 | #define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */ |
30 | #define PHYS_SDRAM_1 0x40000000 /* Base address */ | |
31 | #define PHYS_SDRAM_1_SIZE 0x40000000 /* Max 1 GB RAM */ | |
29f75a5c | 32 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 |
29f75a5c | 33 | |
5434caf5 | 34 | /* Environment */ |
3aa89052 | 35 | #ifndef CONFIG_ENV_IS_IN_SPI_FLASH |
5434caf5 | 36 | #define CONFIG_ENV_SIZE (16 * 1024) |
3aa89052 FE |
37 | #else |
38 | #define CONFIG_ENV_SIZE (4 * 1024) | |
39 | #endif | |
29f75a5c | 40 | #define CONFIG_ENV_OVERWRITE |
29f75a5c | 41 | |
5434caf5 MV |
42 | /* Environment is in MMC */ |
43 | #if defined(CONFIG_CMD_MMC) && defined(CONFIG_ENV_IS_IN_MMC) | |
44 | #define CONFIG_ENV_OFFSET (256 * 1024) | |
45 | #define CONFIG_SYS_MMC_ENV_DEV 0 | |
29f75a5c FE |
46 | #endif |
47 | ||
ab461be6 | 48 | /* Environment is in NAND */ |
5434caf5 | 49 | #if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND) |
ab461be6 FE |
50 | #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE |
51 | #define CONFIG_ENV_SECT_SIZE (128 * 1024) | |
52 | #define CONFIG_ENV_RANGE (512 * 1024) | |
ab461be6 | 53 | #define CONFIG_ENV_OFFSET 0x300000 |
ab461be6 FE |
54 | #define CONFIG_ENV_OFFSET_REDUND \ |
55 | (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE) | |
da85c9c8 | 56 | #endif |
ab461be6 | 57 | |
5434caf5 MV |
58 | /* Environemnt is in SPI flash */ |
59 | #if defined(CONFIG_CMD_SF) && defined(CONFIG_ENV_IS_IN_SPI_FLASH) | |
60 | #define CONFIG_SYS_REDUNDAND_ENVIRONMENT | |
5434caf5 MV |
61 | #define CONFIG_ENV_OFFSET 0x40000 /* 256K */ |
62 | #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) | |
63 | #define CONFIG_ENV_SECT_SIZE 0x1000 | |
64 | #define CONFIG_ENV_SPI_CS 0 | |
65 | #define CONFIG_ENV_SPI_BUS 2 | |
66 | #define CONFIG_ENV_SPI_MAX_HZ 24000000 | |
67 | #define CONFIG_ENV_SPI_MODE SPI_MODE_0 | |
68 | #endif | |
69 | ||
70 | /* UBI and NAND partitioning */ | |
71 | #ifdef CONFIG_CMD_NAND | |
ab461be6 FE |
72 | #define CONFIG_CMD_UBIFS |
73 | #define CONFIG_CMD_MTDPARTS | |
74 | #define CONFIG_RBTREE | |
75 | #define CONFIG_LZO | |
76 | #define CONFIG_MTD_DEVICE | |
77 | #define CONFIG_MTD_PARTITIONS | |
78 | #define MTDIDS_DEFAULT "nand0=gpmi-nand" | |
79 | #define MTDPARTS_DEFAULT \ | |
80 | "mtdparts=gpmi-nand:" \ | |
81 | "3m(bootloader)ro," \ | |
82 | "512k(environment)," \ | |
83 | "512k(redundant-environment)," \ | |
84 | "4m(kernel)," \ | |
4d64050b | 85 | "512k(fdt)," \ |
ab461be6 FE |
86 | "8m(ramdisk)," \ |
87 | "-(filesystem)" | |
ecb7be29 LH |
88 | #endif |
89 | ||
5434caf5 | 90 | /* FEC Ethernet on SoC */ |
29f75a5c | 91 | #ifdef CONFIG_CMD_NET |
29f75a5c | 92 | #define CONFIG_FEC_MXC |
29f75a5c FE |
93 | #define CONFIG_MX28_FEC_MAC_IN_OCOTP |
94 | #endif | |
95 | ||
40f1daa0 | 96 | /* RTC */ |
9588d942 MF |
97 | #ifdef CONFIG_CMD_DATE |
98 | #define CONFIG_RTC_MXS | |
99 | #endif | |
100 | ||
40f1daa0 | 101 | /* USB */ |
598aa2bb | 102 | #ifdef CONFIG_CMD_USB |
afa87210 MV |
103 | #define CONFIG_EHCI_MXS_PORT1 |
104 | #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 | |
91dd7ca6 FE |
105 | #define CONFIG_USB_HOST_ETHER |
106 | #define CONFIG_USB_ETHER_ASIX | |
107 | #define CONFIG_USB_ETHER_SMSC95XX | |
598aa2bb MF |
108 | #endif |
109 | ||
40f1daa0 | 110 | /* SPI */ |
ed97abed | 111 | #ifdef CONFIG_CMD_SPI |
ed97abed MF |
112 | #define CONFIG_DEFAULT_SPI_BUS 2 |
113 | #define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0 | |
114 | ||
115 | /* SPI Flash */ | |
116 | #ifdef CONFIG_CMD_SF | |
5434caf5 MV |
117 | #define CONFIG_SF_DEFAULT_BUS 2 |
118 | #define CONFIG_SF_DEFAULT_CS 0 | |
ed97abed | 119 | /* this may vary and depends on the installed chip */ |
ed97abed MF |
120 | #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0 |
121 | #define CONFIG_SF_DEFAULT_SPEED 24000000 | |
ed97abed | 122 | #endif |
5434caf5 | 123 | |
ed97abed MF |
124 | #endif |
125 | ||
68661db2 FE |
126 | /* Framebuffer support */ |
127 | #ifdef CONFIG_VIDEO | |
68661db2 | 128 | #define CONFIG_VIDEO_LOGO |
68661db2 FE |
129 | #define CONFIG_SPLASH_SCREEN |
130 | #define CONFIG_CMD_BMP | |
131 | #define CONFIG_BMP_16BPP | |
132 | #define CONFIG_VIDEO_BMP_RLE8 | |
133 | #define CONFIG_VIDEO_BMP_GZIP | |
134 | #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (512 << 10) | |
135 | #endif | |
136 | ||
40f1daa0 | 137 | /* Boot Linux */ |
5434caf5 MV |
138 | #define CONFIG_BOOTFILE "uImage" |
139 | #define CONFIG_LOADADDR 0x42000000 | |
29f75a5c FE |
140 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |
141 | ||
5434caf5 | 142 | /* Extra Environment */ |
29f75a5c | 143 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
8ae269d4 | 144 | "ubifs_file=filesystem.ubifs\0" \ |
f994dc5e OS |
145 | "update_nand_full_filename=u-boot.nand\0" \ |
146 | "update_nand_firmware_filename=u-boot.sb\0" \ | |
f994dc5e OS |
147 | "update_nand_firmware_maxsz=0x100000\0" \ |
148 | "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \ | |
149 | "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \ | |
150 | "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \ | |
151 | "nand device 0 ; " \ | |
152 | "nand info ; " \ | |
153 | "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \ | |
154 | "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \ | |
8ae269d4 | 155 | "update_nand_firmware_full=" /* Update FCB, DBBT and FW */ \ |
f994dc5e OS |
156 | "if tftp ${update_nand_full_filename} ; then " \ |
157 | "run update_nand_get_fcb_size ; " \ | |
158 | "nand scrub -y 0x0 ${filesize} ; " \ | |
71779d5b | 159 | "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \ |
f994dc5e OS |
160 | "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \ |
161 | "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \ | |
162 | "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \ | |
163 | "fi\0" \ | |
164 | "update_nand_firmware=" /* Update only firmware */ \ | |
165 | "if tftp ${update_nand_firmware_filename} ; then " \ | |
166 | "run update_nand_get_fcb_size ; " \ | |
167 | "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \ | |
168 | "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \ | |
169 | "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \ | |
170 | "nand erase ${fcb_sz} ${fw_sz} ; " \ | |
171 | "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \ | |
172 | "nand write ${loadaddr} ${fw_off} ${filesize} ; " \ | |
173 | "fi\0" \ | |
8ae269d4 OS |
174 | "update_nand_kernel=" /* Update kernel */ \ |
175 | "mtdparts default; " \ | |
176 | "nand erase.part kernel; " \ | |
177 | "if test ${ip_dyn} = yes; then " \ | |
178 | "setenv get_cmd dhcp; " \ | |
179 | "else " \ | |
180 | "setenv get_cmd tftp; " \ | |
181 | "fi; " \ | |
fb3f9170 | 182 | "${get_cmd} ${image}; " \ |
8ae269d4 OS |
183 | "nand write ${loadaddr} kernel ${filesize}\0" \ |
184 | "update_nand_fdt=" /* Update fdt */ \ | |
185 | "mtdparts default; " \ | |
186 | "nand erase.part fdt; " \ | |
187 | "if test ${ip_dyn} = yes; then " \ | |
188 | "setenv get_cmd dhcp; " \ | |
189 | "else " \ | |
190 | "setenv get_cmd tftp; " \ | |
191 | "fi; " \ | |
192 | "${get_cmd} ${fdt_file}; " \ | |
193 | "nand write ${loadaddr} fdt ${filesize}\0" \ | |
194 | "update_nand_filesystem=" /* Update filesystem */ \ | |
195 | "mtdparts default; " \ | |
196 | "nand erase.part filesystem; " \ | |
197 | "if test ${ip_dyn} = yes; then " \ | |
198 | "setenv get_cmd dhcp; " \ | |
199 | "else " \ | |
200 | "setenv get_cmd tftp; " \ | |
201 | "fi; " \ | |
202 | "${get_cmd} ${ubifs_file}; " \ | |
203 | "ubi part filesystem; " \ | |
204 | "ubi create filesystem; " \ | |
205 | "ubi write ${loadaddr} filesystem ${filesize}\0" \ | |
09308e8e OS |
206 | "nandargs=setenv bootargs console=${console_mainline},${baudrate} " \ |
207 | "rootfstype=ubifs ubi.mtd=6 root=ubi0_0 ${mtdparts}\0" \ | |
208 | "nandboot=" /* Boot from NAND */ \ | |
209 | "mtdparts default; " \ | |
210 | "run nandargs; " \ | |
211 | "nand read ${loadaddr} kernel 0x00400000; " \ | |
212 | "if test ${boot_fdt} = yes; then " \ | |
213 | "nand read ${fdt_addr} fdt 0x00080000; " \ | |
fb3f9170 | 214 | "bootz ${loadaddr} - ${fdt_addr}; " \ |
09308e8e OS |
215 | "else " \ |
216 | "if test ${boot_fdt} = no; then " \ | |
fb3f9170 | 217 | "bootz; " \ |
09308e8e OS |
218 | "else " \ |
219 | "echo \"ERROR: Set boot_fdt to yes or no.\"; " \ | |
220 | "fi; " \ | |
221 | "fi\0" \ | |
222 | "update_sd_firmware_filename=u-boot.sd\0" \ | |
f994dc5e OS |
223 | "update_sd_firmware=" /* Update the SD firmware partition */ \ |
224 | "if mmc rescan ; then " \ | |
225 | "if tftp ${update_sd_firmware_filename} ; then " \ | |
226 | "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \ | |
227 | "setexpr fw_sz ${fw_sz} + 1 ; " \ | |
228 | "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \ | |
229 | "fi ; " \ | |
230 | "fi\0" \ | |
231 | "script=boot.scr\0" \ | |
fb3f9170 | 232 | "image=zImage\0" \ |
f994dc5e OS |
233 | "console_fsl=ttyAM0\0" \ |
234 | "console_mainline=ttyAMA0\0" \ | |
4c6b2350 OS |
235 | "fdt_file=imx28-evk.dtb\0" \ |
236 | "fdt_addr=0x41000000\0" \ | |
237 | "boot_fdt=try\0" \ | |
238 | "ip_dyn=yes\0" \ | |
f994dc5e OS |
239 | "mmcdev=0\0" \ |
240 | "mmcpart=2\0" \ | |
3c41e901 | 241 | "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \ |
f994dc5e | 242 | "mmcargs=setenv bootargs console=${console_mainline},${baudrate} " \ |
3c41e901 | 243 | "root=${mmcroot}\0" \ |
f994dc5e OS |
244 | "loadbootscript=" \ |
245 | "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ | |
246 | "bootscript=echo Running bootscript from mmc ...; " \ | |
247 | "source\0" \ | |
fb3f9170 | 248 | "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ |
4c6b2350 | 249 | "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ |
f994dc5e | 250 | "mmcboot=echo Booting from mmc ...; " \ |
4c6b2350 OS |
251 | "run mmcargs; " \ |
252 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ | |
253 | "if run loadfdt; then " \ | |
fb3f9170 | 254 | "bootz ${loadaddr} - ${fdt_addr}; " \ |
4c6b2350 OS |
255 | "else " \ |
256 | "if test ${boot_fdt} = try; then " \ | |
fb3f9170 | 257 | "bootz; " \ |
4c6b2350 OS |
258 | "else " \ |
259 | "echo WARN: Cannot load the DT; " \ | |
260 | "fi; " \ | |
261 | "fi; " \ | |
262 | "else " \ | |
fb3f9170 | 263 | "bootz; " \ |
4c6b2350 | 264 | "fi;\0" \ |
f994dc5e | 265 | "netargs=setenv bootargs console=${console_mainline},${baudrate} " \ |
29f75a5c | 266 | "root=/dev/nfs " \ |
f994dc5e OS |
267 | "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ |
268 | "netboot=echo Booting from net ...; " \ | |
269 | "run netargs; " \ | |
4c6b2350 OS |
270 | "if test ${ip_dyn} = yes; then " \ |
271 | "setenv get_cmd dhcp; " \ | |
272 | "else " \ | |
273 | "setenv get_cmd tftp; " \ | |
274 | "fi; " \ | |
fb3f9170 | 275 | "${get_cmd} ${image}; " \ |
4c6b2350 OS |
276 | "if test ${boot_fdt} = yes; then " \ |
277 | "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ | |
fb3f9170 | 278 | "bootz ${loadaddr} - ${fdt_addr}; " \ |
4c6b2350 OS |
279 | "else " \ |
280 | "if test ${boot_fdt} = try; then " \ | |
fb3f9170 | 281 | "bootz; " \ |
4c6b2350 OS |
282 | "else " \ |
283 | "echo WARN: Cannot load the DT; " \ | |
284 | "fi;" \ | |
285 | "fi; " \ | |
286 | "else " \ | |
fb3f9170 | 287 | "bootz; " \ |
4c6b2350 | 288 | "fi;\0" |
f994dc5e OS |
289 | |
290 | #define CONFIG_BOOTCOMMAND \ | |
66968110 | 291 | "mmc dev ${mmcdev}; if mmc rescan; then " \ |
f994dc5e OS |
292 | "if run loadbootscript; then " \ |
293 | "run bootscript; " \ | |
294 | "else " \ | |
fb3f9170 | 295 | "if run loadimage; then " \ |
f994dc5e OS |
296 | "run mmcboot; " \ |
297 | "else run netboot; " \ | |
298 | "fi; " \ | |
299 | "fi; " \ | |
300 | "else run netboot; fi" | |
29f75a5c | 301 | |
5434caf5 MV |
302 | /* The rest of the configuration is shared */ |
303 | #include <configs/mxs.h> | |
304 | ||
305 | #endif /* __CONFIGS_MX28EVK_H__ */ |