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