sunxi: Add support for using MII phy-s with the GMAC nic
[oweals/u-boot.git] / include / configs / nitrogen6x.h
1 /*
2  * Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
3  *
4  * Configuration settings for the Boundary Devices Nitrogen6X
5  * and Freescale i.MX6Q Sabre Lite boards.
6  *
7  * SPDX-License-Identifier:     GPL-2.0+
8  */
9
10 #ifndef __CONFIG_H
11 #define __CONFIG_H
12
13 #include "mx6_common.h"
14 #define CONFIG_MX6
15 #define CONFIG_DISPLAY_CPUINFO
16 #define CONFIG_DISPLAY_BOARDINFO
17
18 #define CONFIG_MACH_TYPE        3769
19
20 #include <asm/arch/imx-regs.h>
21 #include <asm/imx-common/gpio.h>
22
23 #define CONFIG_CMDLINE_TAG
24 #define CONFIG_SETUP_MEMORY_TAGS
25 #define CONFIG_INITRD_TAG
26 #define CONFIG_REVISION_TAG
27 #define CONFIG_SYS_GENERIC_BOARD
28
29 /* Size of malloc() pool */
30 #define CONFIG_SYS_MALLOC_LEN           (10 * 1024 * 1024)
31
32 #define CONFIG_BOARD_EARLY_INIT_F
33 #define CONFIG_MISC_INIT_R
34 #define CONFIG_MXC_GPIO
35 #define CONFIG_CI_UDC
36 #define CONFIG_USBD_HS
37 #define CONFIG_USB_GADGET_DUALSPEED
38 #define CONFIG_USB_ETHER
39 #define CONFIG_USB_ETH_CDC
40 #define CONFIG_NETCONSOLE
41
42 #define CONFIG_CMD_FUSE
43 #ifdef CONFIG_CMD_FUSE
44 #define CONFIG_MXC_OCOTP
45 #endif
46
47 #define CONFIG_MXC_UART
48 #define CONFIG_MXC_UART_BASE           UART2_BASE
49
50 #define CONFIG_CMD_SF
51 #ifdef CONFIG_CMD_SF
52 #define CONFIG_SPI_FLASH
53 #define CONFIG_SPI_FLASH_SST
54 #define CONFIG_MXC_SPI
55 #define CONFIG_SF_DEFAULT_BUS  0
56 #define CONFIG_SF_DEFAULT_CS   (0|(IMX_GPIO_NR(3, 19)<<8))
57 #define CONFIG_SF_DEFAULT_SPEED 25000000
58 #define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0)
59 #endif
60
61 /* I2C Configs */
62 #define CONFIG_CMD_I2C
63 #define CONFIG_SYS_I2C
64 #define CONFIG_SYS_I2C_MXC
65 #define CONFIG_SYS_I2C_SPEED            100000
66
67 /* MMC Configs */
68 #define CONFIG_FSL_ESDHC
69 #define CONFIG_FSL_USDHC
70 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
71 #define CONFIG_SYS_FSL_USDHC_NUM       2
72
73 #define CONFIG_MMC
74 #define CONFIG_CMD_MMC
75 #define CONFIG_GENERIC_MMC
76 #define CONFIG_BOUNCE_BUFFER
77 #define CONFIG_CMD_EXT2
78 #define CONFIG_CMD_FAT
79 #define CONFIG_DOS_PARTITION
80
81 #ifdef CONFIG_MX6Q
82 #define CONFIG_CMD_SATA
83 #endif
84
85 /*
86  * SATA Configs
87  */
88 #ifdef CONFIG_CMD_SATA
89 #define CONFIG_DWC_AHSATA
90 #define CONFIG_SYS_SATA_MAX_DEVICE      1
91 #define CONFIG_DWC_AHSATA_PORT_ID       0
92 #define CONFIG_DWC_AHSATA_BASE_ADDR     SATA_ARB_BASE_ADDR
93 #define CONFIG_LBA48
94 #define CONFIG_LIBATA
95 #endif
96
97 #define CONFIG_CMD_PING
98 #define CONFIG_CMD_DHCP
99 #define CONFIG_CMD_MII
100 #define CONFIG_CMD_NET
101 #define CONFIG_FEC_MXC
102 #define CONFIG_MII
103 #define IMX_FEC_BASE                    ENET_BASE_ADDR
104 #define CONFIG_FEC_XCV_TYPE             RGMII
105 #define CONFIG_ETHPRIME                 "FEC"
106 #define CONFIG_FEC_MXC_PHYADDR          6
107 #define CONFIG_PHYLIB
108 #define CONFIG_PHY_MICREL
109 #define CONFIG_PHY_MICREL_KSZ9021
110
111 /* USB Configs */
112 #define CONFIG_CMD_USB
113 #define CONFIG_CMD_FAT
114 #define CONFIG_USB_EHCI
115 #define CONFIG_USB_EHCI_MX6
116 #define CONFIG_USB_STORAGE
117 #define CONFIG_USB_HOST_ETHER
118 #define CONFIG_USB_ETHER_ASIX
119 #define CONFIG_USB_ETHER_MCS7830
120 #define CONFIG_USB_ETHER_SMSC95XX
121 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
122 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET        /* For OTG port */
123 #define CONFIG_MXC_USB_PORTSC   (PORT_PTS_UTMI | PORT_PTS_PTW)
124 #define CONFIG_MXC_USB_FLAGS    0
125
126 /* Miscellaneous commands */
127 #define CONFIG_CMD_BMODE
128 #define CONFIG_CMD_SETEXPR
129
130 /* Framebuffer and LCD */
131 #define CONFIG_VIDEO
132 #define CONFIG_VIDEO_IPUV3
133 #define CONFIG_CFB_CONSOLE
134 #define CONFIG_VGA_AS_SINGLE_DEVICE
135 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
136 #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
137 #define CONFIG_VIDEO_BMP_RLE8
138 #define CONFIG_SPLASH_SCREEN
139 #define CONFIG_BMP_16BPP
140 #define CONFIG_VIDEO_LOGO
141 #define CONFIG_IPUV3_CLK 260000000
142 #define CONFIG_CMD_HDMIDETECT
143 #define CONFIG_CONSOLE_MUX
144 #define CONFIG_IMX_HDMI
145 #define CONFIG_IMX_VIDEO_SKIP
146
147 /* allow to overwrite serial and ethaddr */
148 #define CONFIG_ENV_OVERWRITE
149 #define CONFIG_CONS_INDEX              1
150 #define CONFIG_BAUDRATE                        115200
151
152 /* Command definition */
153 #include <config_cmd_default.h>
154
155 #undef CONFIG_CMD_IMLS
156
157 #define CONFIG_BOOTDELAY               1
158
159 #define CONFIG_PREBOOT                 ""
160
161 #define CONFIG_LOADADDR                        0x12000000
162 #define CONFIG_SYS_TEXT_BASE           0x17800000
163
164 #ifdef CONFIG_CMD_SATA
165 #define CONFIG_DRIVE_SATA "sata "
166 #else
167 #define CONFIG_DRIVE_SATA
168 #endif
169
170 #ifdef CONFIG_CMD_MMC
171 #define CONFIG_DRIVE_MMC "mmc "
172 #else
173 #define CONFIG_DRIVE_MMC
174 #endif
175
176 #define CONFIG_DRIVE_TYPES CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
177
178 #if defined(CONFIG_SABRELITE)
179 #define CONFIG_EXTRA_ENV_SETTINGS \
180         "script=boot.scr\0" \
181         "uimage=uImage\0" \
182         "console=ttymxc1\0" \
183         "fdt_high=0xffffffff\0" \
184         "initrd_high=0xffffffff\0" \
185         "fdt_file=imx6q-sabrelite.dtb\0" \
186         "fdt_addr=0x18000000\0" \
187         "boot_fdt=try\0" \
188         "ip_dyn=yes\0" \
189         "mmcdev=0\0" \
190         "mmcpart=1\0" \
191         "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
192         "mmcargs=setenv bootargs console=${console},${baudrate} " \
193                 "root=${mmcroot}\0" \
194         "loadbootscript=" \
195                 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
196         "bootscript=echo Running bootscript from mmc ...; " \
197                 "source\0" \
198         "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
199         "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
200         "mmcboot=echo Booting from mmc ...; " \
201                 "run mmcargs; " \
202                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
203                         "if run loadfdt; then " \
204                                 "bootm ${loadaddr} - ${fdt_addr}; " \
205                         "else " \
206                                 "if test ${boot_fdt} = try; then " \
207                                         "bootm; " \
208                                 "else " \
209                                         "echo WARN: Cannot load the DT; " \
210                                 "fi; " \
211                         "fi; " \
212                 "else " \
213                         "bootm; " \
214                 "fi;\0" \
215         "netargs=setenv bootargs console=${console},${baudrate} " \
216                 "root=/dev/nfs " \
217         "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
218                 "netboot=echo Booting from net ...; " \
219                 "run netargs; " \
220                 "if test ${ip_dyn} = yes; then " \
221                         "setenv get_cmd dhcp; " \
222                 "else " \
223                         "setenv get_cmd tftp; " \
224                 "fi; " \
225                 "${get_cmd} ${uimage}; " \
226                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
227                         "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
228                                 "bootm ${loadaddr} - ${fdt_addr}; " \
229                         "else " \
230                                 "if test ${boot_fdt} = try; then " \
231                                         "bootm; " \
232                                 "else " \
233                                         "echo WARN: Cannot load the DT; " \
234                                 "fi; " \
235                         "fi; " \
236                 "else " \
237                         "bootm; " \
238                 "fi;\0"
239
240 #define CONFIG_BOOTCOMMAND \
241            "mmc dev ${mmcdev}; if mmc rescan; then " \
242                    "if run loadbootscript; then " \
243                            "run bootscript; " \
244                    "else " \
245                            "if run loaduimage; then " \
246                                    "run mmcboot; " \
247                            "else run netboot; " \
248                            "fi; " \
249                    "fi; " \
250            "else run netboot; fi"
251 #else
252 #define CONFIG_EXTRA_ENV_SETTINGS \
253         "console=ttymxc1\0" \
254         "clearenv=if sf probe || sf probe || sf probe 1 ; then " \
255                 "sf erase 0xc0000 0x2000 && " \
256                 "echo restored environment to factory default ; fi\0" \
257         "bootcmd=for dtype in " CONFIG_DRIVE_TYPES \
258                 "; do " \
259                         "for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
260                                 "for fs in fat ext2 ; do " \
261                                         "${fs}load " \
262                                                 "${dtype} ${disk}:1 " \
263                                                 "10008000 " \
264                                                 "/6x_bootscript" \
265                                                 "&& source 10008000 ; " \
266                                 "done ; " \
267                         "done ; " \
268                 "done; " \
269                 "setenv stdout serial,vga ; " \
270                 "echo ; echo 6x_bootscript not found ; " \
271                 "echo ; echo serial console at 115200, 8N1 ; echo ; " \
272                 "echo details at http://boundarydevices.com/6q_bootscript ; " \
273                 "setenv stdout serial\0" \
274         "upgradeu=for dtype in " CONFIG_DRIVE_TYPES \
275                 "; do " \
276                 "for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
277                      "for fs in fat ext2 ; do " \
278                                 "${fs}load ${dtype} ${disk}:1 10008000 " \
279                                         "/6x_upgrade " \
280                                         "&& source 10008000 ; " \
281                         "done ; " \
282                 "done ; " \
283         "done\0" \
284
285 #endif
286 /* Miscellaneous configurable options */
287 #define CONFIG_SYS_LONGHELP
288 #define CONFIG_SYS_HUSH_PARSER
289 #define CONFIG_SYS_PROMPT              "U-Boot > "
290 #define CONFIG_AUTO_COMPLETE
291 #define CONFIG_SYS_CBSIZE              1024
292
293 /* Print Buffer Size */
294 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
295 #define CONFIG_SYS_MAXARGS             16
296 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
297
298 #define CONFIG_SYS_MEMTEST_START       0x10000000
299 #define CONFIG_SYS_MEMTEST_END         0x10010000
300 #define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
301
302 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
303
304 #define CONFIG_CMDLINE_EDITING
305
306 /* Physical Memory Map */
307 #define CONFIG_NR_DRAM_BANKS           1
308 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
309
310 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
311 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
312 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
313
314 #define CONFIG_SYS_INIT_SP_OFFSET \
315         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
316 #define CONFIG_SYS_INIT_SP_ADDR \
317         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
318
319 /* FLASH and environment organization */
320 #define CONFIG_SYS_NO_FLASH
321
322 #define CONFIG_ENV_SIZE                 (8 * 1024)
323
324 #if defined(CONFIG_SABRELITE)
325 #define CONFIG_ENV_IS_IN_MMC
326 #else
327 #define CONFIG_ENV_IS_IN_SPI_FLASH
328 #endif
329
330 #if defined(CONFIG_ENV_IS_IN_MMC)
331 #define CONFIG_ENV_OFFSET               (6 * 64 * 1024)
332 #define CONFIG_SYS_MMC_ENV_DEV          0
333 #elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
334 #define CONFIG_ENV_OFFSET               (768 * 1024)
335 #define CONFIG_ENV_SECT_SIZE            (8 * 1024)
336 #define CONFIG_ENV_SPI_BUS              CONFIG_SF_DEFAULT_BUS
337 #define CONFIG_ENV_SPI_CS               CONFIG_SF_DEFAULT_CS
338 #define CONFIG_ENV_SPI_MODE             CONFIG_SF_DEFAULT_MODE
339 #define CONFIG_ENV_SPI_MAX_HZ           CONFIG_SF_DEFAULT_SPEED
340 #endif
341
342 #define CONFIG_OF_LIBFDT
343 #define CONFIG_CMD_BOOTZ
344
345 #ifndef CONFIG_SYS_DCACHE_OFF
346 #define CONFIG_CMD_CACHE
347 #endif
348
349 #define CONFIG_CMD_BMP
350
351 #define CONFIG_CMD_TIME
352 #define CONFIG_SYS_ALT_MEMTEST
353
354 #define CONFIG_CMD_BOOTZ
355 #define CONFIG_SUPPORT_RAW_INITRD
356 #define CONFIG_CMD_FS_GENERIC
357
358 /*
359  * PCI express
360  */
361 #ifdef CONFIG_CMD_PCI
362 #define CONFIG_PCI
363 #define CONFIG_PCI_PNP
364 #define CONFIG_PCI_SCAN_SHOW
365 #define CONFIG_PCIE_IMX
366 #endif
367
368 #endif         /* __CONFIG_H */