blob: c740d85332748cf4a2386738452e694cc4b0bddc [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Fabio Estevam5ffd3c52011-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 Estevam5ffd3c52011-12-20 05:46:34 +00009 */
Marek Vasutb51f8ae2013-06-16 15:39:02 +020010#ifndef __CONFIGS_MX28EVK_H__
11#define __CONFIGS_MX28EVK_H__
Fabio Estevam5ffd3c52011-12-20 05:46:34 +000012
Marek Vasutb51f8ae2013-06-16 15:39:02 +020013/* Memory configuration */
Fabio Estevam5ffd3c52011-12-20 05:46:34 +000014#define PHYS_SDRAM_1 0x40000000 /* Base address */
15#define PHYS_SDRAM_1_SIZE 0x40000000 /* Max 1 GB RAM */
Tom Rinibb4dd962022-11-16 13:10:37 -050016#define CFG_SYS_SDRAM_BASE PHYS_SDRAM_1
Fabio Estevam5ffd3c52011-12-20 05:46:34 +000017
Marek Vasutb51f8ae2013-06-16 15:39:02 +020018/* UBI and NAND partitioning */
Lauri Hintsala6f515f72012-04-17 00:35:46 +000019
Marek Vasutb51f8ae2013-06-16 15:39:02 +020020/* Extra Environment */
Fabio Estevam5ffd3c52011-12-20 05:46:34 +000021#define CONFIG_EXTRA_ENV_SETTINGS \
Otavio Salvadorc1f9a4d2013-12-16 20:44:03 -020022 "ubifs_file=filesystem.ubifs\0" \
Otavio Salvadore8301fc2012-09-15 08:26:17 +000023 "update_nand_full_filename=u-boot.nand\0" \
24 "update_nand_firmware_filename=u-boot.sb\0" \
Otavio Salvadore8301fc2012-09-15 08:26:17 +000025 "update_nand_firmware_maxsz=0x100000\0" \
26 "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \
27 "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \
28 "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \
29 "nand device 0 ; " \
30 "nand info ; " \
31 "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
32 "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
Otavio Salvadorc1f9a4d2013-12-16 20:44:03 -020033 "update_nand_firmware_full=" /* Update FCB, DBBT and FW */ \
Otavio Salvadore8301fc2012-09-15 08:26:17 +000034 "if tftp ${update_nand_full_filename} ; then " \
35 "run update_nand_get_fcb_size ; " \
36 "nand scrub -y 0x0 ${filesize} ; " \
Eric Benard1a068192012-12-11 11:36:21 +000037 "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
Otavio Salvadore8301fc2012-09-15 08:26:17 +000038 "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
39 "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
40 "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
41 "fi\0" \
42 "update_nand_firmware=" /* Update only firmware */ \
43 "if tftp ${update_nand_firmware_filename} ; then " \
44 "run update_nand_get_fcb_size ; " \
45 "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \
46 "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \
47 "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \
48 "nand erase ${fcb_sz} ${fw_sz} ; " \
49 "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
50 "nand write ${loadaddr} ${fw_off} ${filesize} ; " \
51 "fi\0" \
Otavio Salvadorc1f9a4d2013-12-16 20:44:03 -020052 "update_nand_kernel=" /* Update kernel */ \
53 "mtdparts default; " \
54 "nand erase.part kernel; " \
55 "if test ${ip_dyn} = yes; then " \
56 "setenv get_cmd dhcp; " \
57 "else " \
58 "setenv get_cmd tftp; " \
59 "fi; " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -020060 "${get_cmd} ${image}; " \
Otavio Salvadorc1f9a4d2013-12-16 20:44:03 -020061 "nand write ${loadaddr} kernel ${filesize}\0" \
62 "update_nand_fdt=" /* Update fdt */ \
63 "mtdparts default; " \
64 "nand erase.part fdt; " \
65 "if test ${ip_dyn} = yes; then " \
66 "setenv get_cmd dhcp; " \
67 "else " \
68 "setenv get_cmd tftp; " \
69 "fi; " \
70 "${get_cmd} ${fdt_file}; " \
71 "nand write ${loadaddr} fdt ${filesize}\0" \
72 "update_nand_filesystem=" /* Update filesystem */ \
73 "mtdparts default; " \
74 "nand erase.part filesystem; " \
75 "if test ${ip_dyn} = yes; then " \
76 "setenv get_cmd dhcp; " \
77 "else " \
78 "setenv get_cmd tftp; " \
79 "fi; " \
80 "${get_cmd} ${ubifs_file}; " \
81 "ubi part filesystem; " \
82 "ubi create filesystem; " \
83 "ubi write ${loadaddr} filesystem ${filesize}\0" \
Otavio Salvadora81ab702013-12-16 20:44:02 -020084 "nandargs=setenv bootargs console=${console_mainline},${baudrate} " \
85 "rootfstype=ubifs ubi.mtd=6 root=ubi0_0 ${mtdparts}\0" \
86 "nandboot=" /* Boot from NAND */ \
87 "mtdparts default; " \
88 "run nandargs; " \
89 "nand read ${loadaddr} kernel 0x00400000; " \
90 "if test ${boot_fdt} = yes; then " \
91 "nand read ${fdt_addr} fdt 0x00080000; " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -020092 "bootz ${loadaddr} - ${fdt_addr}; " \
Otavio Salvadora81ab702013-12-16 20:44:02 -020093 "else " \
94 "if test ${boot_fdt} = no; then " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -020095 "bootz; " \
Otavio Salvadora81ab702013-12-16 20:44:02 -020096 "else " \
97 "echo \"ERROR: Set boot_fdt to yes or no.\"; " \
98 "fi; " \
99 "fi\0" \
100 "update_sd_firmware_filename=u-boot.sd\0" \
Otavio Salvadore8301fc2012-09-15 08:26:17 +0000101 "update_sd_firmware=" /* Update the SD firmware partition */ \
102 "if mmc rescan ; then " \
103 "if tftp ${update_sd_firmware_filename} ; then " \
104 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
105 "setexpr fw_sz ${fw_sz} + 1 ; " \
106 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
107 "fi ; " \
108 "fi\0" \
109 "script=boot.scr\0" \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -0200110 "image=zImage\0" \
Otavio Salvadore8301fc2012-09-15 08:26:17 +0000111 "console_fsl=ttyAM0\0" \
112 "console_mainline=ttyAMA0\0" \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000113 "fdt_file=imx28-evk.dtb\0" \
114 "fdt_addr=0x41000000\0" \
115 "boot_fdt=try\0" \
116 "ip_dyn=yes\0" \
Otavio Salvadore8301fc2012-09-15 08:26:17 +0000117 "mmcdev=0\0" \
118 "mmcpart=2\0" \
Otavio Salvadorac46d562013-01-10 09:45:05 +0000119 "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
Otavio Salvadore8301fc2012-09-15 08:26:17 +0000120 "mmcargs=setenv bootargs console=${console_mainline},${baudrate} " \
Otavio Salvadorac46d562013-01-10 09:45:05 +0000121 "root=${mmcroot}\0" \
Otavio Salvadore8301fc2012-09-15 08:26:17 +0000122 "loadbootscript=" \
123 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
124 "bootscript=echo Running bootscript from mmc ...; " \
125 "source\0" \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -0200126 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000127 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
Otavio Salvadore8301fc2012-09-15 08:26:17 +0000128 "mmcboot=echo Booting from mmc ...; " \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000129 "run mmcargs; " \
130 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
131 "if run loadfdt; then " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -0200132 "bootz ${loadaddr} - ${fdt_addr}; " \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000133 "else " \
134 "if test ${boot_fdt} = try; then " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -0200135 "bootz; " \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000136 "else " \
137 "echo WARN: Cannot load the DT; " \
138 "fi; " \
139 "fi; " \
140 "else " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -0200141 "bootz; " \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000142 "fi;\0" \
Otavio Salvadore8301fc2012-09-15 08:26:17 +0000143 "netargs=setenv bootargs console=${console_mainline},${baudrate} " \
Fabio Estevam5ffd3c52011-12-20 05:46:34 +0000144 "root=/dev/nfs " \
Otavio Salvadore8301fc2012-09-15 08:26:17 +0000145 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
146 "netboot=echo Booting from net ...; " \
147 "run netargs; " \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000148 "if test ${ip_dyn} = yes; then " \
149 "setenv get_cmd dhcp; " \
150 "else " \
151 "setenv get_cmd tftp; " \
152 "fi; " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -0200153 "${get_cmd} ${image}; " \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000154 "if test ${boot_fdt} = yes; then " \
155 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -0200156 "bootz ${loadaddr} - ${fdt_addr}; " \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000157 "else " \
158 "if test ${boot_fdt} = try; then " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -0200159 "bootz; " \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000160 "else " \
161 "echo WARN: Cannot load the DT; " \
162 "fi;" \
163 "fi; " \
164 "else " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -0200165 "bootz; " \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000166 "fi;\0"
Otavio Salvadore8301fc2012-09-15 08:26:17 +0000167
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200168/* The rest of the configuration is shared */
169#include <configs/mxs.h>
170
171#endif /* __CONFIGS_MX28EVK_H__ */