]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/configs/nitrogen6x.h
mx6: Factor out common HDMI setup code
[karo-tx-uboot.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  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20  * MA 02111-1307 USA
21  */
22
23 #ifndef __CONFIG_H
24 #define __CONFIG_H
25
26 #define CONFIG_MX6
27 #define CONFIG_DISPLAY_CPUINFO
28 #define CONFIG_DISPLAY_BOARDINFO
29
30 #define CONFIG_MACH_TYPE        3769
31
32 #include <asm/arch/imx-regs.h>
33 #include <asm/imx-common/gpio.h>
34
35 #define CONFIG_CMDLINE_TAG
36 #define CONFIG_SETUP_MEMORY_TAGS
37 #define CONFIG_INITRD_TAG
38 #define CONFIG_REVISION_TAG
39
40 /* Size of malloc() pool */
41 #define CONFIG_SYS_MALLOC_LEN           (10 * 1024 * 1024)
42
43 #define CONFIG_BOARD_EARLY_INIT_F
44 #define CONFIG_MISC_INIT_R
45 #define CONFIG_MXC_GPIO
46
47 #define CONFIG_CMD_FUSE
48 #ifdef CONFIG_CMD_FUSE
49 #define CONFIG_MXC_OCOTP
50 #endif
51
52 #define CONFIG_MXC_UART
53 #define CONFIG_MXC_UART_BASE           UART2_BASE
54
55 #define CONFIG_CMD_SF
56 #ifdef CONFIG_CMD_SF
57 #define CONFIG_SPI_FLASH
58 #define CONFIG_SPI_FLASH_SST
59 #define CONFIG_MXC_SPI
60 #define CONFIG_SF_DEFAULT_BUS  0
61 #define CONFIG_SF_DEFAULT_CS   (0|(IMX_GPIO_NR(3, 19)<<8))
62 #define CONFIG_SF_DEFAULT_SPEED 25000000
63 #define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0)
64 #endif
65
66 /* I2C Configs */
67 #define CONFIG_CMD_I2C
68 #define CONFIG_I2C_MULTI_BUS
69 #define CONFIG_I2C_MXC
70 #define CONFIG_SYS_I2C_SPEED            100000
71
72 /* OCOTP Configs */
73 #define CONFIG_CMD_IMXOTP
74 #ifdef CONFIG_CMD_IMXOTP
75 #define CONFIG_IMX_OTP
76 #define IMX_OTP_BASE                    OCOTP_BASE_ADDR
77 #define IMX_OTP_ADDR_MAX                0x7F
78 #define IMX_OTP_DATA_ERROR_VAL          0xBADABADA
79 #define IMX_OTPWRITE_ENABLED
80 #endif
81
82 /* MMC Configs */
83 #define CONFIG_FSL_ESDHC
84 #define CONFIG_FSL_USDHC
85 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
86 #define CONFIG_SYS_FSL_USDHC_NUM       2
87
88 #define CONFIG_MMC
89 #define CONFIG_CMD_MMC
90 #define CONFIG_GENERIC_MMC
91 #define CONFIG_BOUNCE_BUFFER
92 #define CONFIG_CMD_EXT2
93 #define CONFIG_CMD_FAT
94 #define CONFIG_DOS_PARTITION
95
96 #ifdef CONFIG_MX6Q
97 #define CONFIG_CMD_SATA
98 #endif
99
100 /*
101  * SATA Configs
102  */
103 #ifdef CONFIG_CMD_SATA
104 #define CONFIG_DWC_AHSATA
105 #define CONFIG_SYS_SATA_MAX_DEVICE      1
106 #define CONFIG_DWC_AHSATA_PORT_ID       0
107 #define CONFIG_DWC_AHSATA_BASE_ADDR     SATA_ARB_BASE_ADDR
108 #define CONFIG_LBA48
109 #define CONFIG_LIBATA
110 #endif
111
112 #define CONFIG_CMD_PING
113 #define CONFIG_CMD_DHCP
114 #define CONFIG_CMD_MII
115 #define CONFIG_CMD_NET
116 #define CONFIG_FEC_MXC
117 #define CONFIG_MII
118 #define IMX_FEC_BASE                    ENET_BASE_ADDR
119 #define CONFIG_FEC_XCV_TYPE             RGMII
120 #define CONFIG_ETHPRIME                 "FEC"
121 #define CONFIG_FEC_MXC_PHYADDR          6
122 #define CONFIG_PHYLIB
123 #define CONFIG_PHY_MICREL
124 #define CONFIG_PHY_MICREL_KSZ9021
125
126 /* USB Configs */
127 #define CONFIG_CMD_USB
128 #define CONFIG_CMD_FAT
129 #define CONFIG_USB_EHCI
130 #define CONFIG_USB_EHCI_MX6
131 #define CONFIG_USB_STORAGE
132 #define CONFIG_USB_HOST_ETHER
133 #define CONFIG_USB_ETHER_ASIX
134 #define CONFIG_USB_ETHER_SMSC95XX
135 #define CONFIG_MXC_USB_PORT     1
136 #define CONFIG_MXC_USB_PORTSC   (PORT_PTS_UTMI | PORT_PTS_PTW)
137 #define CONFIG_MXC_USB_FLAGS    0
138
139 /* Miscellaneous commands */
140 #define CONFIG_CMD_BMODE
141 #define CONFIG_CMD_SETEXPR
142
143 /* Framebuffer and LCD */
144 #define CONFIG_VIDEO
145 #define CONFIG_VIDEO_IPUV3
146 #define CONFIG_CFB_CONSOLE
147 #define CONFIG_VGA_AS_SINGLE_DEVICE
148 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
149 #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
150 #define CONFIG_VIDEO_BMP_RLE8
151 #define CONFIG_SPLASH_SCREEN
152 #define CONFIG_BMP_16BPP
153 #define CONFIG_VIDEO_LOGO
154 #define CONFIG_IPUV3_CLK 260000000
155 #define CONFIG_CMD_HDMIDETECT
156 #define CONFIG_CONSOLE_MUX
157 #define CONFIG_IMX_HDMI
158
159 /* allow to overwrite serial and ethaddr */
160 #define CONFIG_ENV_OVERWRITE
161 #define CONFIG_CONS_INDEX              1
162 #define CONFIG_BAUDRATE                        115200
163
164 /* Command definition */
165 #include <config_cmd_default.h>
166
167 #undef CONFIG_CMD_IMLS
168
169 #define CONFIG_BOOTDELAY               1
170
171 #define CONFIG_PREBOOT                 ""
172
173 #define CONFIG_LOADADDR                        0x12000000
174 #define CONFIG_SYS_TEXT_BASE           0x17800000
175
176 #ifdef CONFIG_CMD_SATA
177 #define CONFIG_DRIVE_SATA "sata "
178 #else
179 #define CONFIG_DRIVE_SATA
180 #endif
181
182 #ifdef CONFIG_CMD_MMC
183 #define CONFIG_DRIVE_MMC "mmc "
184 #else
185 #define CONFIG_DRIVE_MMC
186 #endif
187
188 #define CONFIG_DRIVE_TYPES 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=0x11000000\0" \
199         "boot_fdt=try\0" \
200         "ip_dyn=yes\0" \
201         "mmcdev=0\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                 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
208         "bootscript=echo Running bootscript from mmc ...; " \
209                 "source\0" \
210         "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
211         "loadfdt=fatload 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            "mmc dev ${mmcdev}; if mmc rescan; then " \
254                    "if run loadbootscript; then " \
255                            "run bootscript; " \
256                    "else " \
257                            "if run loaduimage; then " \
258                                    "run mmcboot; " \
259                            "else run netboot; " \
260                            "fi; " \
261                    "fi; " \
262            "else run netboot; fi"
263 #else
264 #define CONFIG_EXTRA_ENV_SETTINGS \
265         "console=ttymxc1\0" \
266         "clearenv=if sf probe || sf probe || sf probe 1 ; then " \
267                 "sf erase 0xc0000 0x2000 && " \
268                 "echo restored environment to factory default ; fi\0" \
269         "bootcmd=for dtype in " CONFIG_DRIVE_TYPES \
270                 "; do " \
271                         "for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
272                                 "for fs in fat ext2 ; do " \
273                                         "${fs}load " \
274                                                 "${dtype} ${disk}:1 " \
275                                                 "10008000 " \
276                                                 "/6x_bootscript" \
277                                                 "&& source 10008000 ; " \
278                                 "done ; " \
279                         "done ; " \
280                 "done; " \
281                 "setenv stdout serial,vga ; " \
282                 "echo ; echo 6x_bootscript not found ; " \
283                 "echo ; echo serial console at 115200, 8N1 ; echo ; " \
284                 "echo details at http://boundarydevices.com/6q_bootscript ; " \
285                 "setenv stdout serial\0" \
286         "upgradeu=for dtype in " CONFIG_DRIVE_TYPES \
287                 "; do " \
288                 "for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
289                      "for fs in fat ext2 ; do " \
290                                 "${fs}load ${dtype} ${disk}:1 10008000 " \
291                                         "/6x_upgrade " \
292                                         "&& source 10008000 ; " \
293                         "done ; " \
294                 "done ; " \
295         "done\0" \
296
297 #endif
298 /* Miscellaneous configurable options */
299 #define CONFIG_SYS_LONGHELP
300 #define CONFIG_SYS_HUSH_PARSER
301 #define CONFIG_SYS_PROMPT              "U-Boot > "
302 #define CONFIG_AUTO_COMPLETE
303 #define CONFIG_SYS_CBSIZE              1024
304
305 /* Print Buffer Size */
306 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
307 #define CONFIG_SYS_MAXARGS             16
308 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
309
310 #define CONFIG_SYS_MEMTEST_START       0x10000000
311 #define CONFIG_SYS_MEMTEST_END         0x10010000
312 #define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
313
314 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
315 #define CONFIG_SYS_HZ                  1000
316
317 #define CONFIG_CMDLINE_EDITING
318
319 /* Physical Memory Map */
320 #define CONFIG_NR_DRAM_BANKS           1
321 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
322
323 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
324 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
325 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
326
327 #define CONFIG_SYS_INIT_SP_OFFSET \
328         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
329 #define CONFIG_SYS_INIT_SP_ADDR \
330         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
331
332 /* FLASH and environment organization */
333 #define CONFIG_SYS_NO_FLASH
334
335 #define CONFIG_ENV_SIZE                 (8 * 1024)
336
337 #if defined(CONFIG_SABRELITE)
338 #define CONFIG_ENV_IS_IN_MMC
339 #else
340 #define CONFIG_ENV_IS_IN_SPI_FLASH
341 #endif
342
343 #if defined(CONFIG_ENV_IS_IN_MMC)
344 #define CONFIG_ENV_OFFSET               (6 * 64 * 1024)
345 #define CONFIG_SYS_MMC_ENV_DEV          0
346 #elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
347 #define CONFIG_ENV_OFFSET               (768 * 1024)
348 #define CONFIG_ENV_SECT_SIZE            (8 * 1024)
349 #define CONFIG_ENV_SPI_BUS              CONFIG_SF_DEFAULT_BUS
350 #define CONFIG_ENV_SPI_CS               CONFIG_SF_DEFAULT_CS
351 #define CONFIG_ENV_SPI_MODE             CONFIG_SF_DEFAULT_MODE
352 #define CONFIG_ENV_SPI_MAX_HZ           CONFIG_SF_DEFAULT_SPEED
353 #endif
354
355 #define CONFIG_OF_LIBFDT
356 #define CONFIG_CMD_BOOTZ
357
358 #ifndef CONFIG_SYS_DCACHE_OFF
359 #define CONFIG_CMD_CACHE
360 #endif
361
362 #define CONFIG_CMD_BMP
363
364 #define CONFIG_CMD_TIME
365 #define CONFIG_SYS_ALT_MEMTEST
366
367 #define CONFIG_CMD_BOOTZ
368 #define CONFIG_SUPPORT_RAW_INITRD
369 #define CONFIG_CMD_FS_GENERIC
370
371 #endif         /* __CONFIG_H */