blob: 140f5e98c52158a12351b5372d5bbce43ac7b8d7 [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 */
Fabio Estevam5ffd3c52011-12-20 05:46:34 +000016#define CONFIG_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
Fabio Estevam49ac1972013-01-27 05:52:05 +000020/* RTC */
Matthias Fuchs5c4b3432012-01-18 01:33:07 +000021#ifdef CONFIG_CMD_DATE
22#define CONFIG_RTC_MXS
23#endif
24
Marek Vasutb51f8ae2013-06-16 15:39:02 +020025/* Extra Environment */
Fabio Estevam5ffd3c52011-12-20 05:46:34 +000026#define CONFIG_EXTRA_ENV_SETTINGS \
Otavio Salvadorc1f9a4d2013-12-16 20:44:03 -020027 "ubifs_file=filesystem.ubifs\0" \
Otavio Salvadore8301fc2012-09-15 08:26:17 +000028 "update_nand_full_filename=u-boot.nand\0" \
29 "update_nand_firmware_filename=u-boot.sb\0" \
Otavio Salvadore8301fc2012-09-15 08:26:17 +000030 "update_nand_firmware_maxsz=0x100000\0" \
31 "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \
32 "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \
33 "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \
34 "nand device 0 ; " \
35 "nand info ; " \
36 "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
37 "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
Otavio Salvadorc1f9a4d2013-12-16 20:44:03 -020038 "update_nand_firmware_full=" /* Update FCB, DBBT and FW */ \
Otavio Salvadore8301fc2012-09-15 08:26:17 +000039 "if tftp ${update_nand_full_filename} ; then " \
40 "run update_nand_get_fcb_size ; " \
41 "nand scrub -y 0x0 ${filesize} ; " \
Eric Benard1a068192012-12-11 11:36:21 +000042 "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; " \
Otavio Salvadore8301fc2012-09-15 08:26:17 +000043 "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
44 "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
45 "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
46 "fi\0" \
47 "update_nand_firmware=" /* Update only firmware */ \
48 "if tftp ${update_nand_firmware_filename} ; then " \
49 "run update_nand_get_fcb_size ; " \
50 "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \
51 "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \
52 "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \
53 "nand erase ${fcb_sz} ${fw_sz} ; " \
54 "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \
55 "nand write ${loadaddr} ${fw_off} ${filesize} ; " \
56 "fi\0" \
Otavio Salvadorc1f9a4d2013-12-16 20:44:03 -020057 "update_nand_kernel=" /* Update kernel */ \
58 "mtdparts default; " \
59 "nand erase.part kernel; " \
60 "if test ${ip_dyn} = yes; then " \
61 "setenv get_cmd dhcp; " \
62 "else " \
63 "setenv get_cmd tftp; " \
64 "fi; " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -020065 "${get_cmd} ${image}; " \
Otavio Salvadorc1f9a4d2013-12-16 20:44:03 -020066 "nand write ${loadaddr} kernel ${filesize}\0" \
67 "update_nand_fdt=" /* Update fdt */ \
68 "mtdparts default; " \
69 "nand erase.part fdt; " \
70 "if test ${ip_dyn} = yes; then " \
71 "setenv get_cmd dhcp; " \
72 "else " \
73 "setenv get_cmd tftp; " \
74 "fi; " \
75 "${get_cmd} ${fdt_file}; " \
76 "nand write ${loadaddr} fdt ${filesize}\0" \
77 "update_nand_filesystem=" /* Update filesystem */ \
78 "mtdparts default; " \
79 "nand erase.part filesystem; " \
80 "if test ${ip_dyn} = yes; then " \
81 "setenv get_cmd dhcp; " \
82 "else " \
83 "setenv get_cmd tftp; " \
84 "fi; " \
85 "${get_cmd} ${ubifs_file}; " \
86 "ubi part filesystem; " \
87 "ubi create filesystem; " \
88 "ubi write ${loadaddr} filesystem ${filesize}\0" \
Otavio Salvadora81ab702013-12-16 20:44:02 -020089 "nandargs=setenv bootargs console=${console_mainline},${baudrate} " \
90 "rootfstype=ubifs ubi.mtd=6 root=ubi0_0 ${mtdparts}\0" \
91 "nandboot=" /* Boot from NAND */ \
92 "mtdparts default; " \
93 "run nandargs; " \
94 "nand read ${loadaddr} kernel 0x00400000; " \
95 "if test ${boot_fdt} = yes; then " \
96 "nand read ${fdt_addr} fdt 0x00080000; " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -020097 "bootz ${loadaddr} - ${fdt_addr}; " \
Otavio Salvadora81ab702013-12-16 20:44:02 -020098 "else " \
99 "if test ${boot_fdt} = no; then " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -0200100 "bootz; " \
Otavio Salvadora81ab702013-12-16 20:44:02 -0200101 "else " \
102 "echo \"ERROR: Set boot_fdt to yes or no.\"; " \
103 "fi; " \
104 "fi\0" \
105 "update_sd_firmware_filename=u-boot.sd\0" \
Otavio Salvadore8301fc2012-09-15 08:26:17 +0000106 "update_sd_firmware=" /* Update the SD firmware partition */ \
107 "if mmc rescan ; then " \
108 "if tftp ${update_sd_firmware_filename} ; then " \
109 "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
110 "setexpr fw_sz ${fw_sz} + 1 ; " \
111 "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \
112 "fi ; " \
113 "fi\0" \
114 "script=boot.scr\0" \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -0200115 "image=zImage\0" \
Otavio Salvadore8301fc2012-09-15 08:26:17 +0000116 "console_fsl=ttyAM0\0" \
117 "console_mainline=ttyAMA0\0" \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000118 "fdt_file=imx28-evk.dtb\0" \
119 "fdt_addr=0x41000000\0" \
120 "boot_fdt=try\0" \
121 "ip_dyn=yes\0" \
Otavio Salvadore8301fc2012-09-15 08:26:17 +0000122 "mmcdev=0\0" \
123 "mmcpart=2\0" \
Otavio Salvadorac46d562013-01-10 09:45:05 +0000124 "mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
Otavio Salvadore8301fc2012-09-15 08:26:17 +0000125 "mmcargs=setenv bootargs console=${console_mainline},${baudrate} " \
Otavio Salvadorac46d562013-01-10 09:45:05 +0000126 "root=${mmcroot}\0" \
Otavio Salvadore8301fc2012-09-15 08:26:17 +0000127 "loadbootscript=" \
128 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
129 "bootscript=echo Running bootscript from mmc ...; " \
130 "source\0" \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -0200131 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000132 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
Otavio Salvadore8301fc2012-09-15 08:26:17 +0000133 "mmcboot=echo Booting from mmc ...; " \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000134 "run mmcargs; " \
135 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
136 "if run loadfdt; then " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -0200137 "bootz ${loadaddr} - ${fdt_addr}; " \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000138 "else " \
139 "if test ${boot_fdt} = try; then " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -0200140 "bootz; " \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000141 "else " \
142 "echo WARN: Cannot load the DT; " \
143 "fi; " \
144 "fi; " \
145 "else " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -0200146 "bootz; " \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000147 "fi;\0" \
Otavio Salvadore8301fc2012-09-15 08:26:17 +0000148 "netargs=setenv bootargs console=${console_mainline},${baudrate} " \
Fabio Estevam5ffd3c52011-12-20 05:46:34 +0000149 "root=/dev/nfs " \
Otavio Salvadore8301fc2012-09-15 08:26:17 +0000150 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
151 "netboot=echo Booting from net ...; " \
152 "run netargs; " \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000153 "if test ${ip_dyn} = yes; then " \
154 "setenv get_cmd dhcp; " \
155 "else " \
156 "setenv get_cmd tftp; " \
157 "fi; " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -0200158 "${get_cmd} ${image}; " \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000159 "if test ${boot_fdt} = yes; then " \
160 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -0200161 "bootz ${loadaddr} - ${fdt_addr}; " \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000162 "else " \
163 "if test ${boot_fdt} = try; then " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -0200164 "bootz; " \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000165 "else " \
166 "echo WARN: Cannot load the DT; " \
167 "fi;" \
168 "fi; " \
169 "else " \
Otavio Salvadorc0c94a22014-01-16 19:57:59 -0200170 "bootz; " \
Otavio Salvador016bb5f2013-01-10 09:45:06 +0000171 "fi;\0"
Otavio Salvadore8301fc2012-09-15 08:26:17 +0000172
Marek Vasutb51f8ae2013-06-16 15:39:02 +0200173/* The rest of the configuration is shared */
174#include <configs/mxs.h>
175
176#endif /* __CONFIGS_MX28EVK_H__ */