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