blob: 9f3ac48b70a2be95ac7c4db6062e12f24100bdec [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Fabio Estevam29f75a52011-12-20 05:46:34 +00002/*
3 * (C) Copyright 2011 Freescale Semiconductor, Inc.
4 * Author: Fabio Estevam <fabio.estevam@freescale.com>
5 *
6 * Based on m28evk.h:
7 * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
8 * on behalf of DENX Software Engineering GmbH
Fabio Estevam29f75a52011-12-20 05:46:34 +00009 */
Marek Vasut5434caf2013-06-16 15:39:02 +020010#ifndef __CONFIGS_MX28EVK_H__
11#define __CONFIGS_MX28EVK_H__
Fabio Estevam29f75a52011-12-20 05:46:34 +000012
Marek Vasut5434caf2013-06-16 15:39:02 +020013/* Memory configuration */
Fabio Estevam29f75a52011-12-20 05:46:34 +000014#define PHYS_SDRAM_1 0x40000000 /* Base address */
15#define PHYS_SDRAM_1_SIZE 0x40000000 /* Max 1 GB RAM */
Fabio Estevam29f75a52011-12-20 05:46:34 +000016#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
Fabio Estevam29f75a52011-12-20 05:46:34 +000017
Marek Vasut5434caf2013-06-16 15:39:02 +020018/* UBI and NAND partitioning */
Lauri Hintsalaecb7be22012-04-17 00:35:46 +000019
Fabio Estevam40f1daa2013-01-27 05:52:05 +000020/* RTC */
Matthias Fuchs9588d942012-01-18 01:33:07 +000021#ifdef CONFIG_CMD_DATE
22#define CONFIG_RTC_MXS
23#endif
24
Fabio Estevam40f1daa2013-01-27 05:52:05 +000025/* USB */
Matthias Fuchs598aa2b2012-01-18 01:33:08 +000026
Fabio Estevam68661db2013-05-10 09:14:09 +000027/* Framebuffer support */
Anatolij Gustschin79c05332021-10-04 17:33:12 +020028#ifdef CONFIG_DM_VIDEO
Fabio Estevam68661db2013-05-10 09:14:09 +000029#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (512 << 10)
30#endif
31
Marek Vasut5434caf2013-06-16 15:39:02 +020032/* Extra Environment */
Fabio Estevam29f75a52011-12-20 05:46:34 +000033#define CONFIG_EXTRA_ENV_SETTINGS \
Otavio Salvador8ae269d2013-12-16 20:44:03 -020034 "ubifs_file=filesystem.ubifs\0" \
Otavio Salvadorf994dc52012-09-15 08:26:17 +000035 "update_nand_full_filename=u-boot.nand\0" \
36 "update_nand_firmware_filename=u-boot.sb\0" \
Otavio Salvadorf994dc52012-09-15 08:26:17 +000037 "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 */ \
41 "nand device 0 ; " \
42 "nand info ; " \
43 "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
44 "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
Otavio Salvador8ae269d2013-12-16 20:44:03 -020045 "update_nand_firmware_full=" /* Update FCB, DBBT and FW */ \
Otavio Salvadorf994dc52012-09-15 08:26:17 +000046 "if tftp ${update_nand_full_filename} ; then " \
47 "run update_nand_get_fcb_size ; " \
48 "nand scrub -y 0x0 ${filesize} ; " \
Eric Benard71779d52012-12-11 11:36:21 +000049 "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
Otavio Salvadorf994dc52012-09-15 08:26:17 +000050 "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} ; " \
53 "fi\0" \
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} ; " \
63 "fi\0" \
Otavio Salvador8ae269d2013-12-16 20:44:03 -020064 "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; " \
69 "else " \
70 "setenv get_cmd tftp; " \
71 "fi; " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -020072 "${get_cmd} ${image}; " \
Otavio Salvador8ae269d2013-12-16 20:44:03 -020073 "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; " \
79 "else " \
80 "setenv get_cmd tftp; " \
81 "fi; " \
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; " \
89 "else " \
90 "setenv get_cmd tftp; " \
91 "fi; " \
92 "${get_cmd} ${ubifs_file}; " \
93 "ubi part filesystem; " \
94 "ubi create filesystem; " \
95 "ubi write ${loadaddr} filesystem ${filesize}\0" \
Otavio Salvador09308e82013-12-16 20:44:02 -020096 "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; " \
100 "run nandargs; " \
101 "nand read ${loadaddr} kernel 0x00400000; " \
102 "if test ${boot_fdt} = yes; then " \
103 "nand read ${fdt_addr} fdt 0x00080000; " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200104 "bootz ${loadaddr} - ${fdt_addr}; " \
Otavio Salvador09308e82013-12-16 20:44:02 -0200105 "else " \
106 "if test ${boot_fdt} = no; then " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200107 "bootz; " \
Otavio Salvador09308e82013-12-16 20:44:02 -0200108 "else " \
109 "echo \"ERROR: Set boot_fdt to yes or no.\"; " \
110 "fi; " \
111 "fi\0" \
112 "update_sd_firmware_filename=u-boot.sd\0" \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000113 "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} ; " \
119 "fi ; " \
120 "fi\0" \
121 "script=boot.scr\0" \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200122 "image=zImage\0" \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000123 "console_fsl=ttyAM0\0" \
124 "console_mainline=ttyAMA0\0" \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000125 "fdt_file=imx28-evk.dtb\0" \
126 "fdt_addr=0x41000000\0" \
127 "boot_fdt=try\0" \
128 "ip_dyn=yes\0" \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000129 "mmcdev=0\0" \
130 "mmcpart=2\0" \
Otavio Salvador3c41e902013-01-10 09:45:05 +0000131 "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000132 "mmcargs=setenv bootargs console=${console_mainline},${baudrate} " \
Otavio Salvador3c41e902013-01-10 09:45:05 +0000133 "root=${mmcroot}\0" \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000134 "loadbootscript=" \
135 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
136 "bootscript=echo Running bootscript from mmc ...; " \
137 "source\0" \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200138 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000139 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000140 "mmcboot=echo Booting from mmc ...; " \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000141 "run mmcargs; " \
142 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
143 "if run loadfdt; then " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200144 "bootz ${loadaddr} - ${fdt_addr}; " \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000145 "else " \
146 "if test ${boot_fdt} = try; then " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200147 "bootz; " \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000148 "else " \
149 "echo WARN: Cannot load the DT; " \
150 "fi; " \
151 "fi; " \
152 "else " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200153 "bootz; " \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000154 "fi;\0" \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000155 "netargs=setenv bootargs console=${console_mainline},${baudrate} " \
Fabio Estevam29f75a52011-12-20 05:46:34 +0000156 "root=/dev/nfs " \
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000157 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
158 "netboot=echo Booting from net ...; " \
159 "run netargs; " \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000160 "if test ${ip_dyn} = yes; then " \
161 "setenv get_cmd dhcp; " \
162 "else " \
163 "setenv get_cmd tftp; " \
164 "fi; " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200165 "${get_cmd} ${image}; " \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000166 "if test ${boot_fdt} = yes; then " \
167 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200168 "bootz ${loadaddr} - ${fdt_addr}; " \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000169 "else " \
170 "if test ${boot_fdt} = try; then " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200171 "bootz; " \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000172 "else " \
173 "echo WARN: Cannot load the DT; " \
174 "fi;" \
175 "fi; " \
176 "else " \
Otavio Salvadorfb3f9172014-01-16 19:57:59 -0200177 "bootz; " \
Otavio Salvador4c6b2352013-01-10 09:45:06 +0000178 "fi;\0"
Otavio Salvadorf994dc52012-09-15 08:26:17 +0000179
Marek Vasut5434caf2013-06-16 15:39:02 +0200180/* The rest of the configuration is shared */
181#include <configs/mxs.h>
182
183#endif /* __CONFIGS_MX28EVK_H__ */