Kconfig: Move CONFIG_BOOTSTAGE to Kconfig
[platform/kernel/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_CMD_GPIO
36 #define CONFIG_CI_UDC
37 #define CONFIG_USBD_HS
38 #define CONFIG_USB_GADGET_DUALSPEED
39 #define CONFIG_USB_ETHER
40 #define CONFIG_USB_ETH_CDC
41 #define CONFIG_NETCONSOLE
42
43 #define CONFIG_CMD_FUSE
44 #ifdef CONFIG_CMD_FUSE
45 #define CONFIG_MXC_OCOTP
46 #endif
47
48 #define CONFIG_MXC_UART
49 #define CONFIG_MXC_UART_BASE           UART2_BASE
50
51 #define CONFIG_CMD_SF
52 #ifdef CONFIG_CMD_SF
53 #define CONFIG_SPI_FLASH
54 #define CONFIG_SPI_FLASH_SST
55 #define CONFIG_MXC_SPI
56 #define CONFIG_SF_DEFAULT_BUS  0
57 #define CONFIG_SF_DEFAULT_CS   0
58 #define CONFIG_SF_DEFAULT_SPEED 25000000
59 #define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0)
60 #endif
61
62 /* I2C Configs */
63 #define CONFIG_CMD_I2C
64 #define CONFIG_SYS_I2C
65 #define CONFIG_SYS_I2C_MXC
66 #define CONFIG_SYS_I2C_SPEED            100000
67 #define CONFIG_I2C_EDID
68
69 /* MMC Configs */
70 #define CONFIG_FSL_ESDHC
71 #define CONFIG_FSL_USDHC
72 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
73 #define CONFIG_SYS_FSL_USDHC_NUM       2
74
75 #define CONFIG_MMC
76 #define CONFIG_CMD_MMC
77 #define CONFIG_GENERIC_MMC
78 #define CONFIG_BOUNCE_BUFFER
79 #define CONFIG_CMD_EXT2
80 #define CONFIG_CMD_EXT4
81 #define CONFIG_CMD_EXT4_WRITE
82 #define CONFIG_CMD_FAT
83 #define CONFIG_DOS_PARTITION
84
85 #ifdef CONFIG_MX6Q
86 #define CONFIG_CMD_SATA
87 #endif
88
89 /*
90  * SATA Configs
91  */
92 #ifdef CONFIG_CMD_SATA
93 #define CONFIG_DWC_AHSATA
94 #define CONFIG_SYS_SATA_MAX_DEVICE      1
95 #define CONFIG_DWC_AHSATA_PORT_ID       0
96 #define CONFIG_DWC_AHSATA_BASE_ADDR     SATA_ARB_BASE_ADDR
97 #define CONFIG_LBA48
98 #define CONFIG_LIBATA
99 #endif
100
101 #define CONFIG_CMD_PING
102 #define CONFIG_CMD_DHCP
103 #define CONFIG_CMD_MII
104 #define CONFIG_CMD_NET
105 #define CONFIG_FEC_MXC
106 #define CONFIG_MII
107 #define IMX_FEC_BASE                    ENET_BASE_ADDR
108 #define CONFIG_FEC_XCV_TYPE             RGMII
109 #define CONFIG_ETHPRIME                 "FEC"
110 #define CONFIG_FEC_MXC_PHYADDR          6
111 #define CONFIG_PHYLIB
112 #define CONFIG_PHY_MICREL
113 #define CONFIG_PHY_MICREL_KSZ9021
114
115 /* USB Configs */
116 #define CONFIG_CMD_USB
117 #define CONFIG_CMD_FAT
118 #define CONFIG_USB_EHCI
119 #define CONFIG_USB_EHCI_MX6
120 #define CONFIG_USB_STORAGE
121 #define CONFIG_USB_HOST_ETHER
122 #define CONFIG_USB_ETHER_ASIX
123 #define CONFIG_USB_ETHER_MCS7830
124 #define CONFIG_USB_ETHER_SMSC95XX
125 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
126 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET        /* For OTG port */
127 #define CONFIG_MXC_USB_PORTSC   (PORT_PTS_UTMI | PORT_PTS_PTW)
128 #define CONFIG_MXC_USB_FLAGS    0
129 #define CONFIG_USB_KEYBOARD
130 #define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
131
132 /* Miscellaneous commands */
133 #define CONFIG_CMD_BMODE
134 #define CONFIG_CMD_SETEXPR
135
136 /* Framebuffer and LCD */
137 #define CONFIG_VIDEO
138 #define CONFIG_VIDEO_IPUV3
139 #define CONFIG_CFB_CONSOLE
140 #define CONFIG_VGA_AS_SINGLE_DEVICE
141 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
142 #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
143 #define CONFIG_VIDEO_BMP_RLE8
144 #define CONFIG_SPLASH_SCREEN
145 #define CONFIG_BMP_16BPP
146 #define CONFIG_IPUV3_CLK 260000000
147 #define CONFIG_CMD_HDMIDETECT
148 #define CONFIG_CONSOLE_MUX
149 #define CONFIG_IMX_HDMI
150 #define CONFIG_IMX_VIDEO_SKIP
151
152 /* allow to overwrite serial and ethaddr */
153 #define CONFIG_ENV_OVERWRITE
154 #define CONFIG_CONS_INDEX              1
155 #define CONFIG_BAUDRATE                        115200
156
157 /* Command definition */
158 #include <config_cmd_default.h>
159
160 #undef CONFIG_CMD_IMLS
161
162 #define CONFIG_BOOTDELAY               1
163
164 #define CONFIG_PREBOOT                 ""
165
166 #define CONFIG_LOADADDR                        0x12000000
167 #define CONFIG_SYS_TEXT_BASE           0x17800000
168
169 #ifdef CONFIG_CMD_SATA
170 #define CONFIG_DRIVE_SATA "sata "
171 #else
172 #define CONFIG_DRIVE_SATA
173 #endif
174
175 #ifdef CONFIG_CMD_MMC
176 #define CONFIG_DRIVE_MMC "mmc "
177 #else
178 #define CONFIG_DRIVE_MMC
179 #endif
180
181 #ifdef CONFIG_USB_STORAGE
182 #define CONFIG_DRIVE_USB "usb "
183 #else
184 #define CONFIG_DRIVE_USB
185 #endif
186
187 #define CONFIG_DRIVE_TYPES CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC CONFIG_DRIVE_USB
188 #define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
189
190 #if defined(CONFIG_SABRELITE)
191 #define CONFIG_EXTRA_ENV_SETTINGS \
192         "script=boot.scr\0" \
193         "uimage=uImage\0" \
194         "console=ttymxc1\0" \
195         "fdt_high=0xffffffff\0" \
196         "initrd_high=0xffffffff\0" \
197         "fdt_file=imx6q-sabrelite.dtb\0" \
198         "fdt_addr=0x18000000\0" \
199         "boot_fdt=try\0" \
200         "ip_dyn=yes\0" \
201         "mmcdevs=0 1\0" \
202         "mmcpart=1\0" \
203         "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
204         "mmcargs=setenv bootargs console=${console},${baudrate} " \
205                 "root=${mmcroot}\0" \
206         "loadbootscript=" \
207                 "load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
208         "bootscript=echo Running bootscript from mmc ...; " \
209                 "source\0" \
210         "loaduimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
211         "loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
212         "mmcboot=echo Booting from mmc ...; " \
213                 "run mmcargs; " \
214                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
215                         "if run loadfdt; then " \
216                                 "bootm ${loadaddr} - ${fdt_addr}; " \
217                         "else " \
218                                 "if test ${boot_fdt} = try; then " \
219                                         "bootm; " \
220                                 "else " \
221                                         "echo WARN: Cannot load the DT; " \
222                                 "fi; " \
223                         "fi; " \
224                 "else " \
225                         "bootm; " \
226                 "fi;\0" \
227         "netargs=setenv bootargs console=${console},${baudrate} " \
228                 "root=/dev/nfs " \
229         "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
230                 "netboot=echo Booting from net ...; " \
231                 "run netargs; " \
232                 "if test ${ip_dyn} = yes; then " \
233                         "setenv get_cmd dhcp; " \
234                 "else " \
235                         "setenv get_cmd tftp; " \
236                 "fi; " \
237                 "${get_cmd} ${uimage}; " \
238                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
239                         "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
240                                 "bootm ${loadaddr} - ${fdt_addr}; " \
241                         "else " \
242                                 "if test ${boot_fdt} = try; then " \
243                                         "bootm; " \
244                                 "else " \
245                                         "echo WARN: Cannot load the DT; " \
246                                 "fi; " \
247                         "fi; " \
248                 "else " \
249                         "bootm; " \
250                 "fi;\0"
251
252 #define CONFIG_BOOTCOMMAND \
253         "for mmcdev in ${mmcdevs}; do " \
254                 "mmc dev ${mmcdev}; " \
255                 "if mmc rescan; then " \
256                         "if run loadbootscript; then " \
257                                 "run bootscript; " \
258                         "else " \
259                                 "if run loaduimage; then " \
260                                         "run mmcboot; " \
261                                 "fi; " \
262                         "fi; " \
263                 "fi; " \
264         "done; " \
265         "run netboot; "
266 #else
267 #define CONFIG_EXTRA_ENV_SETTINGS \
268         "bootdevs=" CONFIG_DRIVE_TYPES "\0" \
269         "umsdevs=" CONFIG_UMSDEVS "\0" \
270         "console=ttymxc1\0" \
271         "clearenv=if sf probe || sf probe || sf probe 1 ; then " \
272                 "sf erase 0xc0000 0x2000 && " \
273                 "echo restored environment to factory default ; fi\0" \
274         "bootcmd=for dtype in ${bootdevs}" \
275                 "; do " \
276                         "if itest.s \"xusb\" == \"x${dtype}\" ; then " \
277                                 "usb start ;" \
278                         "fi; " \
279                         "for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
280                                 "load " \
281                                         "${dtype} ${disk}:1 " \
282                                         "10008000 " \
283                                         "/6x_bootscript" \
284                                         "&& source 10008000 ; " \
285                         "done ; " \
286                 "done; " \
287                 "setenv stdout serial,vga ; " \
288                 "echo ; echo 6x_bootscript not found ; " \
289                 "echo ; echo serial console at 115200, 8N1 ; echo ; " \
290                 "echo details at http://boundarydevices.com/6q_bootscript ; " \
291                 "setenv stdout serial;" \
292                 "setenv stdin serial,usbkbd;" \
293                 "for dtype in ${umsdevs} ; do " \
294                         "if itest.s sata == ${dtype}; then " \
295                                 "initcmd='sata init' ;" \
296                         "else " \
297                                 "initcmd='mmc rescan' ;" \
298                         "fi; " \
299                         "for disk in 0 1 ; do " \
300                                 "if $initcmd && $dtype dev $disk ; then " \
301                                         "setenv stdout serial,vga; " \
302                                         "echo expose ${dtype} ${disk} " \
303                                                 "over USB; " \
304                                         "ums 0 $dtype $disk ;" \
305                                 "fi; " \
306                 "       done; " \
307                 "done ;" \
308                 "setenv stdout serial,vga; " \
309                 "echo no block devices found;" \
310                 "\0" \
311         "initrd_high=0xffffffff\0" \
312         "upgradeu=for dtype in ${bootdevs}" \
313                 "; do " \
314                 "for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
315                         "load ${dtype} ${disk}:1 10008000 " \
316                                 "/6x_upgrade " \
317                                 "&& source 10008000 ; " \
318                 "done ; " \
319         "done\0" \
320
321 #endif
322 /* Miscellaneous configurable options */
323 #define CONFIG_SYS_LONGHELP
324 #define CONFIG_SYS_HUSH_PARSER
325 #define CONFIG_SYS_PROMPT              "U-Boot > "
326 #define CONFIG_AUTO_COMPLETE
327 #define CONFIG_SYS_CBSIZE              1024
328 #define CONFIG_SYS_MAXARGS             48
329 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
330
331 #define CONFIG_SYS_MEMTEST_START       0x10000000
332 #define CONFIG_SYS_MEMTEST_END         0x10010000
333 #define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
334
335 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
336
337 #define CONFIG_CMDLINE_EDITING
338
339 /* Physical Memory Map */
340 #define CONFIG_NR_DRAM_BANKS           1
341 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
342
343 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
344 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
345 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
346
347 #define CONFIG_SYS_INIT_SP_OFFSET \
348         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
349 #define CONFIG_SYS_INIT_SP_ADDR \
350         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
351
352 /* FLASH and environment organization */
353 #define CONFIG_SYS_NO_FLASH
354
355 #define CONFIG_ENV_SIZE                 (8 * 1024)
356
357 #if defined(CONFIG_SABRELITE)
358 #define CONFIG_ENV_IS_IN_MMC
359 #else
360 #define CONFIG_ENV_IS_IN_SPI_FLASH
361 #endif
362
363 #if defined(CONFIG_ENV_IS_IN_MMC)
364 #define CONFIG_ENV_OFFSET               (6 * 64 * 1024)
365 #define CONFIG_SYS_MMC_ENV_DEV          0
366 #elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
367 #define CONFIG_ENV_OFFSET               (768 * 1024)
368 #define CONFIG_ENV_SECT_SIZE            (8 * 1024)
369 #define CONFIG_ENV_SPI_BUS              CONFIG_SF_DEFAULT_BUS
370 #define CONFIG_ENV_SPI_CS               CONFIG_SF_DEFAULT_CS
371 #define CONFIG_ENV_SPI_MODE             CONFIG_SF_DEFAULT_MODE
372 #define CONFIG_ENV_SPI_MAX_HZ           CONFIG_SF_DEFAULT_SPEED
373 #endif
374
375 #define CONFIG_OF_LIBFDT
376 #define CONFIG_CMD_BOOTZ
377
378 #ifndef CONFIG_SYS_DCACHE_OFF
379 #define CONFIG_CMD_CACHE
380 #endif
381
382 #define CONFIG_CMD_BMP
383
384 #define CONFIG_CMD_TIME
385 #define CONFIG_CMD_MEMTEST
386 #define CONFIG_SYS_ALT_MEMTEST
387
388 #define CONFIG_CMD_BOOTZ
389 #define CONFIG_SUPPORT_RAW_INITRD
390 #define CONFIG_CMD_FS_GENERIC
391
392 /*
393  * PCI express
394  */
395 #ifdef CONFIG_CMD_PCI
396 #define CONFIG_PCI
397 #define CONFIG_PCI_PNP
398 #define CONFIG_PCI_SCAN_SHOW
399 #define CONFIG_PCIE_IMX
400 #endif
401
402 #define CONFIG_CMD_ELF
403
404 #define CONFIG_USB_GADGET
405 #define CONFIG_CMD_USB_MASS_STORAGE
406 #define CONFIG_USB_GADGET_MASS_STORAGE
407 #define CONFIG_USBDOWNLOAD_GADGET
408 #define CONFIG_USB_GADGET_VBUS_DRAW     2
409
410 /* Netchip IDs */
411 #define CONFIG_G_DNL_VENDOR_NUM 0x0525
412 #define CONFIG_G_DNL_PRODUCT_NUM 0xa4a5
413 #define CONFIG_G_DNL_MANUFACTURER "Boundary"
414
415 #define CONFIG_CMD_FASTBOOT
416 #define CONFIG_ANDROID_BOOT_IMAGE
417 #define CONFIG_USB_FASTBOOT_BUF_ADDR   CONFIG_SYS_LOAD_ADDR
418 #define CONFIG_USB_FASTBOOT_BUF_SIZE   0x07000000
419
420 #endif         /* __CONFIG_H */