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 /* Memory configuration */
14 #define PHYS_SDRAM_1 0x40000000 /* Base address */
15 #define PHYS_SDRAM_1_SIZE 0x40000000 /* Max 1 GB RAM */
16 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
18 /* UBI and NAND partitioning */
21 #ifdef CONFIG_CMD_DATE
22 #define CONFIG_RTC_MXS
27 /* Framebuffer support */
28 #ifdef CONFIG_DM_VIDEO
29 #define CONFIG_VIDEO_LOGO_MAX_SIZE (512 << 10)
32 /* Extra Environment */
33 #define CONFIG_EXTRA_ENV_SETTINGS \
34 "ubifs_file=filesystem.ubifs\0" \
35 "update_nand_full_filename=u-boot.nand\0" \
36 "update_nand_firmware_filename=u-boot.sb\0" \
37 "update_nand_firmware_maxsz=0x100000\0" \
38 "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \
39 "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \
40 "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \
43 "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
44 "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
45 "update_nand_firmware_full=" /* Update FCB, DBBT and FW */ \
46 "if tftp ${update_nand_full_filename} ; then " \
47 "run update_nand_get_fcb_size ; " \
48 "nand scrub -y 0x0 ${filesize} ; " \
49 "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
50 "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
51 "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
52 "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
54 "update_nand_firmware=" /* Update only firmware */ \
55 "if tftp ${update_nand_firmware_filename} ; then " \
56 "run update_nand_get_fcb_size ; " \
57 "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \
58 "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \
59 "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \
60 "nand erase ${fcb_sz} ${fw_sz} ; " \
61 "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
62 "nand write ${loadaddr} ${fw_off} ${filesize} ; " \
64 "update_nand_kernel=" /* Update kernel */ \
65 "mtdparts default; " \
66 "nand erase.part kernel; " \
67 "if test ${ip_dyn} = yes; then " \
68 "setenv get_cmd dhcp; " \
70 "setenv get_cmd tftp; " \
72 "${get_cmd} ${image}; " \
73 "nand write ${loadaddr} kernel ${filesize}\0" \
74 "update_nand_fdt=" /* Update fdt */ \
75 "mtdparts default; " \
76 "nand erase.part fdt; " \
77 "if test ${ip_dyn} = yes; then " \
78 "setenv get_cmd dhcp; " \
80 "setenv get_cmd tftp; " \
82 "${get_cmd} ${fdt_file}; " \
83 "nand write ${loadaddr} fdt ${filesize}\0" \
84 "update_nand_filesystem=" /* Update filesystem */ \
85 "mtdparts default; " \
86 "nand erase.part filesystem; " \
87 "if test ${ip_dyn} = yes; then " \
88 "setenv get_cmd dhcp; " \
90 "setenv get_cmd tftp; " \
92 "${get_cmd} ${ubifs_file}; " \
93 "ubi part filesystem; " \
94 "ubi create filesystem; " \
95 "ubi write ${loadaddr} filesystem ${filesize}\0" \
96 "nandargs=setenv bootargs console=${console_mainline},${baudrate} " \
97 "rootfstype=ubifs ubi.mtd=6 root=ubi0_0 ${mtdparts}\0" \
98 "nandboot=" /* Boot from NAND */ \
99 "mtdparts default; " \
101 "nand read ${loadaddr} kernel 0x00400000; " \
102 "if test ${boot_fdt} = yes; then " \
103 "nand read ${fdt_addr} fdt 0x00080000; " \
104 "bootz ${loadaddr} - ${fdt_addr}; " \
106 "if test ${boot_fdt} = no; then " \
109 "echo \"ERROR: Set boot_fdt to yes or no.\"; " \
112 "update_sd_firmware_filename=u-boot.sd\0" \
113 "update_sd_firmware=" /* Update the SD firmware partition */ \
114 "if mmc rescan ; then " \
115 "if tftp ${update_sd_firmware_filename} ; then " \
116 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
117 "setexpr fw_sz ${fw_sz} + 1 ; " \
118 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
121 "script=boot.scr\0" \
123 "console_fsl=ttyAM0\0" \
124 "console_mainline=ttyAMA0\0" \
125 "fdt_file=imx28-evk.dtb\0" \
126 "fdt_addr=0x41000000\0" \
131 "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
132 "mmcargs=setenv bootargs console=${console_mainline},${baudrate} " \
133 "root=${mmcroot}\0" \
135 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
136 "bootscript=echo Running bootscript from mmc ...; " \
138 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
139 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
140 "mmcboot=echo Booting from mmc ...; " \
142 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
143 "if run loadfdt; then " \
144 "bootz ${loadaddr} - ${fdt_addr}; " \
146 "if test ${boot_fdt} = try; then " \
149 "echo WARN: Cannot load the DT; " \
155 "netargs=setenv bootargs console=${console_mainline},${baudrate} " \
157 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
158 "netboot=echo Booting from net ...; " \
160 "if test ${ip_dyn} = yes; then " \
161 "setenv get_cmd dhcp; " \
163 "setenv get_cmd tftp; " \
165 "${get_cmd} ${image}; " \
166 "if test ${boot_fdt} = yes; then " \
167 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
168 "bootz ${loadaddr} - ${fdt_addr}; " \
170 "if test ${boot_fdt} = try; then " \
173 "echo WARN: Cannot load the DT; " \
180 /* The rest of the configuration is shared */
181 #include <configs/mxs.h>
183 #endif /* __CONFIGS_MX28EVK_H__ */