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