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