2 * (C) Copyright 2011 Freescale Semiconductor, Inc.
3 * Author: Fabio Estevam <fabio.estevam@freescale.com>
6 * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
7 * on behalf of DENX Software Engineering GmbH
9 * SPDX-License-Identifier: GPL-2.0+
11 #ifndef __CONFIGS_MX28EVK_H__
12 #define __CONFIGS_MX28EVK_H__
14 /* System configurations */
15 #define CONFIG_MX28 /* i.MX28 SoC */
16 #define CONFIG_MACH_TYPE MACH_TYPE_MX28EVK
20 #define CONFIG_CMD_NAND
21 #define CONFIG_CMD_NAND_TRIMFFS
23 /* Memory configuration */
24 #define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
25 #define PHYS_SDRAM_1 0x40000000 /* Base address */
26 #define PHYS_SDRAM_1_SIZE 0x40000000 /* Max 1 GB RAM */
27 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
30 #ifndef CONFIG_ENV_IS_IN_SPI_FLASH
31 #define CONFIG_ENV_SIZE (16 * 1024)
33 #define CONFIG_ENV_SIZE (4 * 1024)
35 #define CONFIG_ENV_OVERWRITE
37 /* Environment is in MMC */
38 #if defined(CONFIG_CMD_MMC) && defined(CONFIG_ENV_IS_IN_MMC)
39 #define CONFIG_ENV_OFFSET (256 * 1024)
40 #define CONFIG_SYS_MMC_ENV_DEV 0
43 /* Environment is in NAND */
44 #if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND)
45 #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
46 #define CONFIG_ENV_SECT_SIZE (128 * 1024)
47 #define CONFIG_ENV_RANGE (512 * 1024)
48 #define CONFIG_ENV_OFFSET 0x300000
49 #define CONFIG_ENV_OFFSET_REDUND \
50 (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
53 /* Environemnt is in SPI flash */
54 #if defined(CONFIG_CMD_SF) && defined(CONFIG_ENV_IS_IN_SPI_FLASH)
55 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
56 #define CONFIG_ENV_OFFSET 0x40000 /* 256K */
57 #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
58 #define CONFIG_ENV_SECT_SIZE 0x1000
59 #define CONFIG_ENV_SPI_CS 0
60 #define CONFIG_ENV_SPI_BUS 2
61 #define CONFIG_ENV_SPI_MAX_HZ 24000000
62 #define CONFIG_ENV_SPI_MODE SPI_MODE_0
65 /* UBI and NAND partitioning */
66 #ifdef CONFIG_CMD_NAND
67 #define CONFIG_CMD_UBIFS
68 #define CONFIG_CMD_MTDPARTS
71 #define CONFIG_MTD_DEVICE
72 #define CONFIG_MTD_PARTITIONS
73 #define MTDIDS_DEFAULT "nand0=gpmi-nand"
74 #define MTDPARTS_DEFAULT \
75 "mtdparts=gpmi-nand:" \
77 "512k(environment)," \
78 "512k(redundant-environment)," \
85 /* FEC Ethernet on SoC */
87 #define CONFIG_FEC_MXC
88 #define CONFIG_MX28_FEC_MAC_IN_OCOTP
92 #ifdef CONFIG_CMD_DATE
93 #define CONFIG_RTC_MXS
98 #define CONFIG_EHCI_MXS_PORT1
99 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
100 #define CONFIG_USB_HOST_ETHER
101 #define CONFIG_USB_ETHER_ASIX
102 #define CONFIG_USB_ETHER_SMSC95XX
106 #ifdef CONFIG_CMD_SPI
107 #define CONFIG_DEFAULT_SPI_BUS 2
108 #define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
112 #define CONFIG_SF_DEFAULT_BUS 2
113 #define CONFIG_SF_DEFAULT_CS 0
114 /* this may vary and depends on the installed chip */
115 #define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
116 #define CONFIG_SF_DEFAULT_SPEED 24000000
121 /* Framebuffer support */
123 #define CONFIG_VIDEO_LOGO
124 #define CONFIG_SPLASH_SCREEN
125 #define CONFIG_BMP_16BPP
126 #define CONFIG_VIDEO_BMP_RLE8
127 #define CONFIG_VIDEO_BMP_GZIP
128 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (512 << 10)
132 #define CONFIG_BOOTFILE "uImage"
133 #define CONFIG_LOADADDR 0x42000000
134 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
136 /* Extra Environment */
137 #define CONFIG_EXTRA_ENV_SETTINGS \
138 "ubifs_file=filesystem.ubifs\0" \
139 "update_nand_full_filename=u-boot.nand\0" \
140 "update_nand_firmware_filename=u-boot.sb\0" \
141 "update_nand_firmware_maxsz=0x100000\0" \
142 "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \
143 "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \
144 "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \
147 "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
148 "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
149 "update_nand_firmware_full=" /* Update FCB, DBBT and FW */ \
150 "if tftp ${update_nand_full_filename} ; then " \
151 "run update_nand_get_fcb_size ; " \
152 "nand scrub -y 0x0 ${filesize} ; " \
153 "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
154 "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
155 "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
156 "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
158 "update_nand_firmware=" /* Update only firmware */ \
159 "if tftp ${update_nand_firmware_filename} ; then " \
160 "run update_nand_get_fcb_size ; " \
161 "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \
162 "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \
163 "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \
164 "nand erase ${fcb_sz} ${fw_sz} ; " \
165 "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
166 "nand write ${loadaddr} ${fw_off} ${filesize} ; " \
168 "update_nand_kernel=" /* Update kernel */ \
169 "mtdparts default; " \
170 "nand erase.part kernel; " \
171 "if test ${ip_dyn} = yes; then " \
172 "setenv get_cmd dhcp; " \
174 "setenv get_cmd tftp; " \
176 "${get_cmd} ${image}; " \
177 "nand write ${loadaddr} kernel ${filesize}\0" \
178 "update_nand_fdt=" /* Update fdt */ \
179 "mtdparts default; " \
180 "nand erase.part fdt; " \
181 "if test ${ip_dyn} = yes; then " \
182 "setenv get_cmd dhcp; " \
184 "setenv get_cmd tftp; " \
186 "${get_cmd} ${fdt_file}; " \
187 "nand write ${loadaddr} fdt ${filesize}\0" \
188 "update_nand_filesystem=" /* Update filesystem */ \
189 "mtdparts default; " \
190 "nand erase.part filesystem; " \
191 "if test ${ip_dyn} = yes; then " \
192 "setenv get_cmd dhcp; " \
194 "setenv get_cmd tftp; " \
196 "${get_cmd} ${ubifs_file}; " \
197 "ubi part filesystem; " \
198 "ubi create filesystem; " \
199 "ubi write ${loadaddr} filesystem ${filesize}\0" \
200 "nandargs=setenv bootargs console=${console_mainline},${baudrate} " \
201 "rootfstype=ubifs ubi.mtd=6 root=ubi0_0 ${mtdparts}\0" \
202 "nandboot=" /* Boot from NAND */ \
203 "mtdparts default; " \
205 "nand read ${loadaddr} kernel 0x00400000; " \
206 "if test ${boot_fdt} = yes; then " \
207 "nand read ${fdt_addr} fdt 0x00080000; " \
208 "bootz ${loadaddr} - ${fdt_addr}; " \
210 "if test ${boot_fdt} = no; then " \
213 "echo \"ERROR: Set boot_fdt to yes or no.\"; " \
216 "update_sd_firmware_filename=u-boot.sd\0" \
217 "update_sd_firmware=" /* Update the SD firmware partition */ \
218 "if mmc rescan ; then " \
219 "if tftp ${update_sd_firmware_filename} ; then " \
220 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
221 "setexpr fw_sz ${fw_sz} + 1 ; " \
222 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
225 "script=boot.scr\0" \
227 "console_fsl=ttyAM0\0" \
228 "console_mainline=ttyAMA0\0" \
229 "fdt_file=imx28-evk.dtb\0" \
230 "fdt_addr=0x41000000\0" \
235 "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
236 "mmcargs=setenv bootargs console=${console_mainline},${baudrate} " \
237 "root=${mmcroot}\0" \
239 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
240 "bootscript=echo Running bootscript from mmc ...; " \
242 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
243 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
244 "mmcboot=echo Booting from mmc ...; " \
246 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
247 "if run loadfdt; then " \
248 "bootz ${loadaddr} - ${fdt_addr}; " \
250 "if test ${boot_fdt} = try; then " \
253 "echo WARN: Cannot load the DT; " \
259 "netargs=setenv bootargs console=${console_mainline},${baudrate} " \
261 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
262 "netboot=echo Booting from net ...; " \
264 "if test ${ip_dyn} = yes; then " \
265 "setenv get_cmd dhcp; " \
267 "setenv get_cmd tftp; " \
269 "${get_cmd} ${image}; " \
270 "if test ${boot_fdt} = yes; then " \
271 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
272 "bootz ${loadaddr} - ${fdt_addr}; " \
274 "if test ${boot_fdt} = try; then " \
277 "echo WARN: Cannot load the DT; " \
284 #define CONFIG_BOOTCOMMAND \
285 "mmc dev ${mmcdev}; if mmc rescan; then " \
286 "if run loadbootscript; then " \
289 "if run loadimage; then " \
291 "else run netboot; " \
294 "else run netboot; fi"
296 /* The rest of the configuration is shared */
297 #include <configs/mxs.h>
299 #endif /* __CONFIGS_MX28EVK_H__ */