sunxi: emac: port to phylib
[platform/kernel/u-boot.git] / include / configs / m28evk.h
1 /*
2  * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
3  * on behalf of DENX Software Engineering GmbH
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7 #ifndef __CONFIGS_M28EVK_H__
8 #define __CONFIGS_M28EVK_H__
9
10 /* System configurations */
11 #define CONFIG_MX28                             /* i.MX28 SoC */
12 #define MACH_TYPE_M28EVK        3613
13 #define CONFIG_MACH_TYPE        MACH_TYPE_M28EVK
14
15 #define CONFIG_FIT
16
17 #define CONFIG_TIMESTAMP                /* Print image info with timestamp */
18
19 /* U-Boot Commands */
20 #define CONFIG_SYS_NO_FLASH
21 #include <config_cmd_default.h>
22 #define CONFIG_DISPLAY_CPUINFO
23 #define CONFIG_DOS_PARTITION
24 #define CONFIG_FAT_WRITE
25
26 #define CONFIG_CMD_ASKENV
27 #define CONFIG_CMD_BMP
28 #define CONFIG_CMD_CACHE
29 #define CONFIG_CMD_DATE
30 #define CONFIG_CMD_DHCP
31 #define CONFIG_CMD_EEPROM
32 #define CONFIG_CMD_EXT4
33 #define CONFIG_CMD_EXT4_WRITE
34 #define CONFIG_CMD_FAT
35 #define CONFIG_CMD_FS_GENERIC
36 #define CONFIG_CMD_GPIO
37 #define CONFIG_CMD_GREPENV
38 #define CONFIG_CMD_I2C
39 #define CONFIG_CMD_MII
40 #define CONFIG_CMD_MMC
41 #define CONFIG_CMD_NAND
42 #define CONFIG_CMD_NAND_TRIMFFS
43 #define CONFIG_CMD_NET
44 #define CONFIG_CMD_NFS
45 #define CONFIG_CMD_PING
46 #define CONFIG_CMD_SETEXPR
47 #define CONFIG_CMD_SF
48 #define CONFIG_CMD_SPI
49 #define CONFIG_CMD_USB
50 #define CONFIG_VIDEO
51
52 #define CONFIG_REGEX                    /* Enable regular expression support */
53
54 /* Memory configuration */
55 #define CONFIG_NR_DRAM_BANKS            1               /* 1 bank of DRAM */
56 #define PHYS_SDRAM_1                    0x40000000      /* Base address */
57 #define PHYS_SDRAM_1_SIZE               0x20000000      /* Max 512 MB RAM */
58 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM_1
59
60 /* Environment */
61 #define CONFIG_ENV_SIZE                 (16 * 1024)
62 #define CONFIG_ENV_IS_IN_NAND
63
64 /* Environment is in NAND */
65 #if defined(CONFIG_CMD_NAND) && defined(CONFIG_ENV_IS_IN_NAND)
66 #define CONFIG_ENV_SIZE_REDUND          CONFIG_ENV_SIZE
67 #define CONFIG_ENV_SECT_SIZE            (128 * 1024)
68 #define CONFIG_ENV_RANGE                (4 * CONFIG_ENV_SECT_SIZE)
69 #define CONFIG_ENV_OFFSET               (24 * CONFIG_ENV_SECT_SIZE) /* 3 MiB */
70 #define CONFIG_ENV_OFFSET_REDUND        \
71                 (CONFIG_ENV_OFFSET + CONFIG_ENV_RANGE)
72
73 #define CONFIG_CMD_UBI
74 #define CONFIG_CMD_UBIFS
75 #define CONFIG_CMD_MTDPARTS
76 #define CONFIG_RBTREE
77 #define CONFIG_LZO
78 #define CONFIG_MTD_DEVICE
79 #define CONFIG_MTD_PARTITIONS
80 #define MTDIDS_DEFAULT                  "nand0=gpmi-nand"
81 #define MTDPARTS_DEFAULT                        \
82         "mtdparts=gpmi-nand:"                   \
83                 "3m(u-boot),"                   \
84                 "512k(env1),"                   \
85                 "512k(env2),"                   \
86                 "14m(boot),"                    \
87                 "238m(data),"                   \
88                 "-@4096k(UBI)"
89 #else
90 #define CONFIG_ENV_IS_NOWHERE
91 #endif
92
93 /* FEC Ethernet on SoC */
94 #ifdef CONFIG_CMD_NET
95 #define CONFIG_FEC_MXC
96 #endif
97
98 /* EEPROM */
99 #ifdef CONFIG_CMD_EEPROM
100 #define CONFIG_SYS_I2C_MULTI_EEPROMS
101 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN  2
102 #endif
103
104 /* RTC */
105 #ifdef CONFIG_CMD_DATE
106 /* Use the internal RTC in the MXS chip */
107 #define CONFIG_RTC_INTERNAL
108 #ifdef CONFIG_RTC_INTERNAL
109 #define CONFIG_RTC_MXS
110 #else
111 #define CONFIG_RTC_M41T62
112 #define CONFIG_SYS_I2C_RTC_ADDR         0x68
113 #define CONFIG_SYS_M41T11_BASE_YEAR     2000
114 #endif
115 #endif
116
117 /* USB */
118 #ifdef CONFIG_CMD_USB
119 #define CONFIG_EHCI_MXS_PORT0
120 #define CONFIG_EHCI_MXS_PORT1
121 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
122 #define CONFIG_USB_STORAGE
123 #endif
124
125 /* SPI */
126 #ifdef CONFIG_CMD_SPI
127 #define CONFIG_DEFAULT_SPI_BUS          2
128 #define CONFIG_DEFAULT_SPI_CS           0
129 #define CONFIG_DEFAULT_SPI_MODE         SPI_MODE_0
130
131 /* SPI FLASH */
132 #ifdef CONFIG_CMD_SF
133 #define CONFIG_SPI_FLASH
134 #define CONFIG_SPI_FLASH_STMICRO
135 #define CONFIG_SF_DEFAULT_BUS           2
136 #define CONFIG_SF_DEFAULT_CS            0
137 #define CONFIG_SF_DEFAULT_SPEED         40000000
138 #define CONFIG_SF_DEFAULT_MODE          SPI_MODE_0
139
140 #define CONFIG_ENV_SPI_BUS              2
141 #define CONFIG_ENV_SPI_CS               0
142 #define CONFIG_ENV_SPI_MAX_HZ           40000000
143 #define CONFIG_ENV_SPI_MODE             SPI_MODE_0
144 #endif
145
146 #endif
147
148 /* LCD */
149 #ifdef CONFIG_VIDEO
150 #define CONFIG_VIDEO_LOGO
151 #define CONFIG_SPLASH_SCREEN
152 #define CONFIG_CMD_BMP
153 #define CONFIG_BMP_16BPP
154 #define CONFIG_VIDEO_BMP_RLE8
155 #define CONFIG_VIDEO_BMP_GZIP
156 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE  (2 << 20)
157 #endif
158
159 /* Booting Linux */
160 #define CONFIG_BOOTDELAY        3
161 #define CONFIG_BOOTFILE         "fitImage"
162 #define CONFIG_BOOTARGS         "console=ttyAMA0,115200n8 "
163 #define CONFIG_BOOTCOMMAND      "run mmc_mmc"
164 #define CONFIG_LOADADDR         0x42000000
165 #define CONFIG_SYS_LOAD_ADDR    CONFIG_LOADADDR
166
167 /* Extra Environment */
168 #define CONFIG_PREBOOT          "run try_bootscript"
169 #define CONFIG_HOSTNAME         m28evk
170
171 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
172         "consdev=ttyAMA0\0"                                             \
173         "baudrate=115200\0"                                             \
174         "bootscript=boot.scr\0"                                         \
175         "bootdev=/dev/mmcblk0p2\0"                                      \
176         "rootdev=/dev/mmcblk0p3\0"                                      \
177         "netdev=eth0\0"                                                 \
178         "hostname=m28evk\0"                                             \
179         "rootpath=/opt/eldk-5.5/armv5te/rootfs-qte-sdk\0"               \
180         "kernel_addr_r=0x42000000\0"                                    \
181         "videomode=video=ctfb:x:800,y:480,depth:18,mode:0,pclk:30066,"  \
182                 "le:0,ri:256,up:0,lo:45,hs:1,vs:1,sync:100663296,"      \
183                 "vmode:0\0"                                             \
184         "update_nand_full_filename=u-boot.nand\0"                       \
185         "update_nand_firmware_filename=u-boot.sb\0"                     \
186         "update_sd_firmware_filename=u-boot.sd\0"                       \
187         "update_nand_firmware_maxsz=0x100000\0"                         \
188         "update_nand_stride=0x40\0"     /* MX28 datasheet ch. 12.12 */  \
189         "update_nand_count=0x4\0"       /* MX28 datasheet ch. 12.12 */  \
190         "update_nand_get_fcb_size="     /* Get size of FCB blocks */    \
191                 "nand device 0 ; "                                      \
192                 "nand info ; "                                          \
193                 "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \
194                 "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \
195         "update_nand_full="             /* Update FCB, DBBT and FW */   \
196                 "if tftp ${update_nand_full_filename} ; then "          \
197                 "run update_nand_get_fcb_size ; "                       \
198                 "nand scrub -y 0x0 ${filesize} ; "                      \
199                 "nand write.raw ${loadaddr} 0x0 ${fcb_sz} ; "           \
200                 "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \
201                 "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \
202                 "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \
203                 "fi\0"                                                  \
204         "update_nand_firmware="         /* Update only firmware */      \
205                 "if tftp ${update_nand_firmware_filename} ; then "      \
206                 "run update_nand_get_fcb_size ; "                       \
207                 "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \
208                 "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; "    \
209                 "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \
210                 "nand erase ${fcb_sz} ${fw_sz} ; "                      \
211                 "nand write ${loadaddr} ${fcb_sz} ${filesize} ; "       \
212                 "nand write ${loadaddr} ${fw_off} ${filesize} ; "       \
213                 "fi\0"                                                  \
214         "update_sd_firmware="           /* Update the SD firmware partition */ \
215                 "if mmc rescan ; then "                                 \
216                 "if tftp ${update_sd_firmware_filename} ; then "        \
217                 "setexpr fw_sz ${filesize} / 0x200 ; "  /* SD block size */ \
218                 "setexpr fw_sz ${fw_sz} + 1 ; "                         \
219                 "mmc write ${loadaddr} 0x800 ${fw_sz} ; "               \
220                 "fi ; "                                                 \
221                 "fi\0"                                                  \
222         "addcons="                                                      \
223                 "setenv bootargs ${bootargs} "                          \
224                 "console=${consdev},${baudrate}\0"                      \
225         "addip="                                                        \
226                 "setenv bootargs ${bootargs} "                          \
227                 "ip=${ipaddr}:${serverip}:${gatewayip}:"                \
228                         "${netmask}:${hostname}:${netdev}:off\0"        \
229         "addmisc="                                                      \
230                 "setenv bootargs ${bootargs} ${miscargs}\0"             \
231         "adddfltmtd="                                                   \
232                 "if test \"x${mtdparts}\" == \"x\" ; then "             \
233                         "mtdparts default ; "                           \
234                 "fi\0"                                                  \
235         "addmtd="                                                       \
236                 "run adddfltmtd ; "                                     \
237                 "setenv bootargs ${bootargs} ${mtdparts}\0"             \
238         "addargs=run addcons addmtd addmisc\0"                          \
239         "mmcload="                                                      \
240                 "mmc rescan ; "                                         \
241                 "load mmc 0:2 ${kernel_addr_r} ${bootfile}\0"           \
242         "ubiload="                                                      \
243                 "ubi part UBI ; ubifsmount ubi0:rootfs ; "              \
244                 "ubifsload ${kernel_addr_r} /boot/${bootfile}\0"        \
245         "netload="                                                      \
246                 "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0"       \
247         "miscargs=nohlt panic=1\0"                                      \
248         "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0"         \
249         "ubiargs="                                                      \
250                 "setenv bootargs ubi.mtd=5 "                            \
251                 "root=ubi0:rootfs rootfstype=ubifs\0"                   \
252         "nfsargs="                                                      \
253                 "setenv bootargs root=/dev/nfs rw "                     \
254                         "nfsroot=${serverip}:${rootpath},v3,tcp\0"      \
255         "mmc_mmc="                                                      \
256                 "run mmcload mmcargs addargs ; "                        \
257                 "bootm ${kernel_addr_r}\0"                              \
258         "mmc_ubi="                                                      \
259                 "run mmcload ubiargs addargs ; "                        \
260                 "bootm ${kernel_addr_r}\0"                              \
261         "mmc_nfs="                                                      \
262                 "run mmcload nfsargs addip addargs ; "                  \
263                 "bootm ${kernel_addr_r}\0"                              \
264         "ubi_mmc="                                                      \
265                 "run ubiload mmcargs addargs ; "                        \
266                 "bootm ${kernel_addr_r}\0"                              \
267         "ubi_ubi="                                                      \
268                 "run ubiload ubiargs addargs ; "                        \
269                 "bootm ${kernel_addr_r}\0"                              \
270         "ubi_nfs="                                                      \
271                 "run ubiload nfsargs addip addargs ; "                  \
272                 "bootm ${kernel_addr_r}\0"                              \
273         "net_mmc="                                                      \
274                 "run netload mmcargs addargs ; "                        \
275                 "bootm ${kernel_addr_r}\0"                              \
276         "net_ubi="                                                      \
277                 "run netload ubiargs addargs ; "                        \
278                 "bootm ${kernel_addr_r}\0"                              \
279         "net_nfs="                                                      \
280                 "run netload nfsargs addip addargs ; "                  \
281                 "bootm ${kernel_addr_r}\0"                              \
282         "try_bootscript="                                               \
283                 "mmc rescan;"                                           \
284                 "if test -e mmc 0:2 ${bootscript} ; then "              \
285                 "if load mmc 0:2 ${kernel_addr_r} ${bootscript};"       \
286                 "then ; "                                               \
287                         "echo Running bootscript... ; "                 \
288                         "source ${kernel_addr_r} ; "                    \
289                 "fi ; "                                                 \
290                 "fi\0"
291
292 /* The rest of the configuration is shared */
293 #include <configs/mxs.h>
294
295 #endif /* __CONFIGS_M28EVK_H__ */