1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * (C) Copyright 2011 Freescale Semiconductor, Inc.
4 * Author: Fabio Estevam <fabio.estevam@freescale.com>
7 * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
8 * on behalf of DENX Software Engineering GmbH
10 #ifndef __CONFIGS_MX28EVK_H__
11 #define __CONFIGS_MX28EVK_H__
13 /* System configurations */
14 #define CONFIG_MACH_TYPE MACH_TYPE_MX28EVK
16 /* Memory configuration */
17 #define PHYS_SDRAM_1 0x40000000 /* Base address */
18 #define PHYS_SDRAM_1_SIZE 0x40000000 /* Max 1 GB RAM */
19 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
22 #ifndef CONFIG_ENV_IS_IN_SPI_FLASH
23 #define CONFIG_ENV_SIZE (16 * 1024)
25 #define CONFIG_ENV_SIZE (4 * 1024)
27 #define CONFIG_ENV_OVERWRITE
29 /* Environment is in MMC */
30 #if defined(CONFIG_CMD_MMC) && defined(CONFIG_ENV_IS_IN_MMC)
31 #define CONFIG_ENV_OFFSET (256 * 1024)
32 #define CONFIG_SYS_MMC_ENV_DEV 0
35 /* Environment is in NAND */
36 #if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND)
37 #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
38 #define CONFIG_ENV_SECT_SIZE (128 * 1024)
39 #define CONFIG_ENV_RANGE (512 * 1024)
40 #define CONFIG_ENV_OFFSET 0x300000
41 #define CONFIG_ENV_OFFSET_REDUND \
42 (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
45 /* Environment is in SPI flash */
46 #if defined(CONFIG_CMD_SF) && defined(CONFIG_ENV_IS_IN_SPI_FLASH)
47 #define CONFIG_ENV_OFFSET 0x40000 /* 256K */
48 #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
49 #define CONFIG_ENV_SECT_SIZE 0x1000
52 /* UBI and NAND partitioning */
54 /* FEC Ethernet on SoC */
56 #define CONFIG_FEC_MXC
57 #define CONFIG_FEC_MXC_MDIO_BASE MXS_ENET0_BASE
58 #define CONFIG_MX28_FEC_MAC_IN_OCOTP
62 #ifdef CONFIG_CMD_DATE
63 #define CONFIG_RTC_MXS
68 #define CONFIG_EHCI_MXS_PORT1
69 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
72 /* Framebuffer support */
74 #define CONFIG_VIDEO_LOGO
75 #define CONFIG_SPLASH_SCREEN
76 #define CONFIG_BMP_16BPP
77 #define CONFIG_VIDEO_BMP_RLE8
78 #define CONFIG_VIDEO_BMP_GZIP
79 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (512 << 10)
83 #define CONFIG_BOOTFILE "uImage"
84 #define CONFIG_LOADADDR 0x42000000
85 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
87 /* Extra Environment */
88 #define CONFIG_EXTRA_ENV_SETTINGS \
89 "ubifs_file=filesystem.ubifs\0" \
90 "update_nand_full_filename=u-boot.nand\0" \
91 "update_nand_firmware_filename=u-boot.sb\0" \
92 "update_nand_firmware_maxsz=0x100000\0" \
93 "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \
94 "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \
95 "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \
98 "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
99 "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
100 "update_nand_firmware_full=" /* Update FCB, DBBT and FW */ \
101 "if tftp ${update_nand_full_filename} ; then " \
102 "run update_nand_get_fcb_size ; " \
103 "nand scrub -y 0x0 ${filesize} ; " \
104 "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
105 "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
106 "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
107 "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
109 "update_nand_firmware=" /* Update only firmware */ \
110 "if tftp ${update_nand_firmware_filename} ; then " \
111 "run update_nand_get_fcb_size ; " \
112 "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \
113 "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \
114 "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \
115 "nand erase ${fcb_sz} ${fw_sz} ; " \
116 "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
117 "nand write ${loadaddr} ${fw_off} ${filesize} ; " \
119 "update_nand_kernel=" /* Update kernel */ \
120 "mtdparts default; " \
121 "nand erase.part kernel; " \
122 "if test ${ip_dyn} = yes; then " \
123 "setenv get_cmd dhcp; " \
125 "setenv get_cmd tftp; " \
127 "${get_cmd} ${image}; " \
128 "nand write ${loadaddr} kernel ${filesize}\0" \
129 "update_nand_fdt=" /* Update fdt */ \
130 "mtdparts default; " \
131 "nand erase.part fdt; " \
132 "if test ${ip_dyn} = yes; then " \
133 "setenv get_cmd dhcp; " \
135 "setenv get_cmd tftp; " \
137 "${get_cmd} ${fdt_file}; " \
138 "nand write ${loadaddr} fdt ${filesize}\0" \
139 "update_nand_filesystem=" /* Update filesystem */ \
140 "mtdparts default; " \
141 "nand erase.part filesystem; " \
142 "if test ${ip_dyn} = yes; then " \
143 "setenv get_cmd dhcp; " \
145 "setenv get_cmd tftp; " \
147 "${get_cmd} ${ubifs_file}; " \
148 "ubi part filesystem; " \
149 "ubi create filesystem; " \
150 "ubi write ${loadaddr} filesystem ${filesize}\0" \
151 "nandargs=setenv bootargs console=${console_mainline},${baudrate} " \
152 "rootfstype=ubifs ubi.mtd=6 root=ubi0_0 ${mtdparts}\0" \
153 "nandboot=" /* Boot from NAND */ \
154 "mtdparts default; " \
156 "nand read ${loadaddr} kernel 0x00400000; " \
157 "if test ${boot_fdt} = yes; then " \
158 "nand read ${fdt_addr} fdt 0x00080000; " \
159 "bootz ${loadaddr} - ${fdt_addr}; " \
161 "if test ${boot_fdt} = no; then " \
164 "echo \"ERROR: Set boot_fdt to yes or no.\"; " \
167 "update_sd_firmware_filename=u-boot.sd\0" \
168 "update_sd_firmware=" /* Update the SD firmware partition */ \
169 "if mmc rescan ; then " \
170 "if tftp ${update_sd_firmware_filename} ; then " \
171 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
172 "setexpr fw_sz ${fw_sz} + 1 ; " \
173 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
176 "script=boot.scr\0" \
178 "console_fsl=ttyAM0\0" \
179 "console_mainline=ttyAMA0\0" \
180 "fdt_file=imx28-evk.dtb\0" \
181 "fdt_addr=0x41000000\0" \
186 "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
187 "mmcargs=setenv bootargs console=${console_mainline},${baudrate} " \
188 "root=${mmcroot}\0" \
190 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
191 "bootscript=echo Running bootscript from mmc ...; " \
193 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
194 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
195 "mmcboot=echo Booting from mmc ...; " \
197 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
198 "if run loadfdt; then " \
199 "bootz ${loadaddr} - ${fdt_addr}; " \
201 "if test ${boot_fdt} = try; then " \
204 "echo WARN: Cannot load the DT; " \
210 "netargs=setenv bootargs console=${console_mainline},${baudrate} " \
212 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
213 "netboot=echo Booting from net ...; " \
215 "if test ${ip_dyn} = yes; then " \
216 "setenv get_cmd dhcp; " \
218 "setenv get_cmd tftp; " \
220 "${get_cmd} ${image}; " \
221 "if test ${boot_fdt} = yes; then " \
222 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
223 "bootz ${loadaddr} - ${fdt_addr}; " \
225 "if test ${boot_fdt} = try; then " \
228 "echo WARN: Cannot load the DT; " \
235 #define CONFIG_BOOTCOMMAND \
236 "mmc dev ${mmcdev}; if mmc rescan; then " \
237 "if run loadbootscript; then " \
240 "if run loadimage; then " \
242 "else run netboot; " \
245 "else run netboot; fi"
247 /* The rest of the configuration is shared */
248 #include <configs/mxs.h>
250 #endif /* __CONFIGS_MX28EVK_H__ */