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