9898f55d6c2782049e901949918ef44ab682f5c2
[platform/kernel/u-boot.git] / include / configs / wandboard.h
1 /*
2  * Copyright (C) 2013 Freescale Semiconductor, Inc.
3  *
4  * Configuration settings for the Wandboard.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  */
11
12 #ifndef __CONFIG_H
13 #define __CONFIG_H
14
15 #include <asm/arch/imx-regs.h>
16 #include <asm/imx-common/gpio.h>
17 #include <asm/sizes.h>
18
19 #define CONFIG_MX6
20 #define CONFIG_DISPLAY_CPUINFO
21 #define CONFIG_DISPLAY_BOARDINFO
22
23 #define MACH_TYPE_WANDBOARD             4412
24 #define CONFIG_MACH_TYPE                MACH_TYPE_WANDBOARD
25
26 #define CONFIG_CMDLINE_TAG
27 #define CONFIG_SETUP_MEMORY_TAGS
28 #define CONFIG_INITRD_TAG
29 #define CONFIG_REVISION_TAG
30
31 /* Size of malloc() pool */
32 #define CONFIG_SYS_MALLOC_LEN           (3 * SZ_1M)
33
34 #define CONFIG_BOARD_EARLY_INIT_F
35 #define CONFIG_MXC_GPIO
36
37 #define CONFIG_MXC_UART
38 #define CONFIG_MXC_UART_BASE            UART1_BASE
39
40 /* allow to overwrite serial and ethaddr */
41 #define CONFIG_ENV_OVERWRITE
42 #define CONFIG_CONS_INDEX               1
43 #define CONFIG_BAUDRATE                 115200
44
45 /* Command definition */
46 #include <config_cmd_default.h>
47
48 #undef CONFIG_CMD_IMLS
49
50 #define CONFIG_CMD_SETEXPR
51
52 #define CONFIG_BOOTDELAY                5
53
54 #define CONFIG_SYS_MEMTEST_START        0x10000000
55 #define CONFIG_SYS_MEMTEST_END          (CONFIG_SYS_MEMTEST_START + 500 * SZ_1M)
56 #define CONFIG_LOADADDR                 0x12000000
57 #define CONFIG_SYS_TEXT_BASE            0x17800000
58
59 /* MMC Configuration */
60 #define CONFIG_FSL_ESDHC
61 #define CONFIG_FSL_USDHC
62 #define CONFIG_SYS_FSL_USDHC_NUM        2
63 #define CONFIG_SYS_FSL_ESDHC_ADDR       0
64
65 #define CONFIG_MMC
66 #define CONFIG_CMD_MMC
67 #define CONFIG_GENERIC_MMC
68 #define CONFIG_BOUNCE_BUFFER
69 #define CONFIG_CMD_EXT2
70 #define CONFIG_CMD_FAT
71 #define CONFIG_DOS_PARTITION
72
73 /* Ethernet Configuration */
74 #define CONFIG_CMD_PING
75 #define CONFIG_CMD_DHCP
76 #define CONFIG_CMD_MII
77 #define CONFIG_CMD_NET
78 #define CONFIG_FEC_MXC
79 #define CONFIG_MII
80 #define IMX_FEC_BASE                    ENET_BASE_ADDR
81 #define CONFIG_FEC_XCV_TYPE             RGMII
82 #define CONFIG_ETHPRIME                 "FEC"
83 #define CONFIG_FEC_MXC_PHYADDR          1
84 #define CONFIG_PHYLIB
85 #define CONFIG_PHY_ATHEROS
86
87 #if defined(CONFIG_MX6DL)
88 #define CONFIG_DEFAULT_FDT_FILE         "imx6dl-wandboard.dtb"
89 #elif defined(CONFIG_MX6S)
90 #define CONFIG_DEFAULT_FDT_FILE         "imx6s-wandboard.dtb"
91 #endif
92
93 #define CONFIG_EXTRA_ENV_SETTINGS \
94         "script=boot.scr\0" \
95         "uimage=uImage\0" \
96         "console=ttymxc0\0" \
97         "fdt_high=0xffffffff\0" \
98         "initrd_high=0xffffffff\0" \
99         "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
100         "fdt_addr=0x11000000\0" \
101         "boot_fdt=try\0" \
102         "ip_dyn=yes\0" \
103         "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
104         "mmcpart=" __stringify(CONFIG_SYS_MMC_ENV_PART) "\0" \
105         "mmcroot=/dev/mmcblk0p3 rootwait rw\0" \
106         "update_sd_firmware_filename=u-boot.imx\0" \
107         "update_sd_firmware=" \
108                 "if test ${ip_dyn} = yes; then " \
109                         "setenv get_cmd dhcp; " \
110                 "else " \
111                         "setenv get_cmd tftp; " \
112                 "fi; " \
113                 "if mmc dev ${mmcdev}; then "   \
114                         "if ${get_cmd} ${update_sd_firmware_filename}; then " \
115                                 "setexpr fw_sz ${filesize} / 0x200; " \
116                                 "setexpr fw_sz ${fw_sz} + 1; "  \
117                                 "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
118                         "fi; "  \
119                 "fi\0" \
120         "mmcargs=setenv bootargs console=${console},${baudrate} " \
121                 "root=${mmcroot}\0" \
122         "loadbootscript=" \
123                 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
124         "bootscript=echo Running bootscript from mmc ...; " \
125                 "source\0" \
126         "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
127         "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
128         "mmcboot=echo Booting from mmc ...; " \
129                 "run mmcargs; " \
130                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
131                         "if run loadfdt; then " \
132                                 "bootm ${loadaddr} - ${fdt_addr}; " \
133                         "else " \
134                                 "if test ${boot_fdt} = try; then " \
135                                         "bootm; " \
136                                 "else " \
137                                         "echo WARN: Cannot load the DT; " \
138                                 "fi; " \
139                         "fi; " \
140                 "else " \
141                         "bootm; " \
142                 "fi;\0" \
143         "netargs=setenv bootargs console=${console},${baudrate} " \
144                 "root=/dev/nfs " \
145         "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
146                 "netboot=echo Booting from net ...; " \
147                 "run netargs; " \
148                 "if test ${ip_dyn} = yes; then " \
149                         "setenv get_cmd dhcp; " \
150                 "else " \
151                         "setenv get_cmd tftp; " \
152                 "fi; " \
153                 "${get_cmd} ${uimage}; " \
154                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
155                         "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
156                                 "bootm ${loadaddr} - ${fdt_addr}; " \
157                         "else " \
158                                 "if test ${boot_fdt} = try; then " \
159                                         "bootm; " \
160                                 "else " \
161                                         "echo WARN: Cannot load the DT; " \
162                                 "fi; " \
163                         "fi; " \
164                 "else " \
165                         "bootm; " \
166                 "fi;\0"
167
168 #define CONFIG_BOOTCOMMAND \
169            "mmc dev ${mmcdev}; if mmc rescan; then " \
170                    "if run loadbootscript; then " \
171                            "run bootscript; " \
172                    "else " \
173                            "if run loaduimage; then " \
174                                    "run mmcboot; " \
175                            "else run netboot; " \
176                            "fi; " \
177                    "fi; " \
178            "else run netboot; fi"
179
180 /* Miscellaneous configurable options */
181 #define CONFIG_SYS_LONGHELP
182 #define CONFIG_SYS_HUSH_PARSER
183 #define CONFIG_SYS_PROMPT              "=> "
184 #define CONFIG_AUTO_COMPLETE
185 #define CONFIG_SYS_CBSIZE               256
186
187 /* Print Buffer Size */
188 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
189 #define CONFIG_SYS_MAXARGS             16
190 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
191
192 #define CONFIG_SYS_LOAD_ADDR            CONFIG_LOADADDR
193 #define CONFIG_SYS_HZ                   1000
194
195 #define CONFIG_CMDLINE_EDITING
196
197 /* Physical Memory Map */
198 #define CONFIG_NR_DRAM_BANKS            1
199 #define PHYS_SDRAM                      MMDC0_ARB_BASE_ADDR
200
201 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM
202 #define CONFIG_SYS_INIT_RAM_ADDR        IRAM_BASE_ADDR
203 #define CONFIG_SYS_INIT_RAM_SIZE        IRAM_SIZE
204
205 #define CONFIG_SYS_INIT_SP_OFFSET \
206         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
207 #define CONFIG_SYS_INIT_SP_ADDR \
208         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
209
210 /* FLASH and environment organization */
211 #define CONFIG_SYS_NO_FLASH
212
213 #define CONFIG_ENV_SIZE                 (8 * 1024)
214
215 #define CONFIG_ENV_IS_IN_MMC
216 #define CONFIG_ENV_OFFSET               (6 * 64 * 1024)
217 #define CONFIG_SYS_MMC_ENV_DEV          0
218 #define CONFIG_SYS_MMC_ENV_PART         2
219
220 #define CONFIG_OF_LIBFDT
221 #define CONFIG_CMD_BOOTZ
222
223 #ifndef CONFIG_SYS_DCACHE_OFF
224 #define CONFIG_CMD_CACHE
225 #endif
226
227 #endif                         /* __CONFIG_H * */