imx6: move standard ATAG configs to mx6_common.h
[oweals/u-boot.git] / include / configs / mx6cuboxi.h
1 /*
2  * Copyright (C) 2015 Freescale Semiconductor, Inc.
3  *
4  * Configuration settings for the SolidRun mx6 based boards
5  *
6  * SPDX-License-Identifier:     GPL-2.0+
7  */
8 #ifndef __MX6CUBOXI_CONFIG_H
9 #define __MX6CUBOXI_CONFIG_H
10
11 #include "mx6_common.h"
12
13 #define CONFIG_SPL_LIBCOMMON_SUPPORT
14 #define CONFIG_SPL_MMC_SUPPORT
15 #include "imx6_spl.h"
16
17 #define CONFIG_IMX6_THERMAL
18
19 #define CONFIG_SYS_MALLOC_LEN           (10 * SZ_1M)
20 #define CONFIG_BOARD_EARLY_INIT_F
21 #define CONFIG_BOARD_LATE_INIT
22 #define CONFIG_MXC_GPIO
23 #define CONFIG_MXC_UART
24 #define CONFIG_CMD_FUSE
25 #define CONFIG_MXC_OCOTP
26
27 /* MMC Configs */
28 #define CONFIG_FSL_ESDHC
29 #define CONFIG_FSL_USDHC
30 #define CONFIG_SYS_FSL_ESDHC_ADDR       USDHC2_BASE_ADDR
31 #define CONFIG_MMC
32 #define CONFIG_CMD_MMC
33 #define CONFIG_GENERIC_MMC
34 #define CONFIG_BOUNCE_BUFFER
35 #define CONFIG_CMD_EXT4
36 #define CONFIG_CMD_EXT4_WRITE
37 #define CONFIG_CMD_FAT
38 #define CONFIG_DOS_PARTITION
39
40 /* Ethernet Configuration */
41 #define CONFIG_FEC_MXC
42 #define CONFIG_CMD_PING
43 #define CONFIG_CMD_DHCP
44 #define CONFIG_CMD_MII
45 #define CONFIG_CMD_NET
46 #define CONFIG_MII
47 #define IMX_FEC_BASE                    ENET_BASE_ADDR
48 #define CONFIG_FEC_XCV_TYPE             RGMII
49 #define CONFIG_FEC_MXC_PHYADDR          0
50 #define CONFIG_PHYLIB
51 #define CONFIG_PHY_ATHEROS
52
53 /* allow to overwrite serial and ethaddr */
54 #define CONFIG_ENV_OVERWRITE
55 #define CONFIG_CONS_INDEX               1
56 #define CONFIG_BAUDRATE                 115200
57
58 /* Framebuffer */
59 #define CONFIG_VIDEO
60 #define CONFIG_VIDEO_IPUV3
61 #define CONFIG_IPUV3_CLK                260000000
62 #define CONFIG_CFB_CONSOLE
63 #define CONFIG_VGA_AS_SINGLE_DEVICE
64 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
65 #define CONFIG_VIDEO_BMP_RLE8
66 #define CONFIG_SPLASH_SCREEN
67 #define CONFIG_SPLASH_SCREEN_ALIGN
68 #define CONFIG_BMP_16BPP
69 #define CONFIG_VIDEO_LOGO
70 #define CONFIG_VIDEO_BMP_LOGO
71 #define CONFIG_IMX_HDMI
72 #define CONFIG_CMD_HDMIDETECT
73 #define CONFIG_IMX_VIDEO_SKIP
74 #define CONFIG_CONSOLE_MUX
75
76 /* USB */
77 #define CONFIG_CMD_USB
78 #define CONFIG_USB_EHCI
79 #define CONFIG_USB_EHCI_MX6
80 #define CONFIG_USB_STORAGE
81 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
82 #define CONFIG_MXC_USB_PORTSC           (PORT_PTS_UTMI | PORT_PTS_PTW)
83 #define CONFIG_MXC_USB_FLAGS            0
84 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
85 #define CONFIG_USB_KEYBOARD
86 #define CONFIG_SYS_USB_EVENT_POLL
87 #define CONFIG_PREBOOT \
88         "if hdmidet; then " \
89                 "usb start; "                  \
90                 "setenv stdin  serial,usbkbd; "\
91                 "setenv stdout serial,vga; "   \
92                 "setenv stderr serial,vga; "   \
93         "else " \
94                 "setenv stdin  serial; " \
95                 "setenv stdout serial; " \
96                 "setenv stderr serial; " \
97         "fi;"
98
99 /* Command definition */
100 #define CONFIG_CMD_BOOTZ
101 #define CONFIG_CMD_SETEXPR
102
103 #define CONFIG_BOOTDELAY                1
104
105 #define CONFIG_LOADADDR                 0x12000000
106 #define CONFIG_SYS_TEXT_BASE            0x17800000
107
108 #define CONFIG_MXC_UART_BASE    UART1_BASE
109 #define CONFIG_CONSOLE_DEV      "ttymxc0"
110 #define CONFIG_MMCROOT          "/dev/mmcblk0p2"
111 #define CONFIG_SYS_FSL_USDHC_NUM        1
112 #define CONFIG_SYS_MMC_ENV_DEV          0       /* SDHC2 */
113
114 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
115 #define CONFIG_EXTRA_ENV_SETTINGS \
116         "script=boot.scr\0" \
117         "image=zImage\0" \
118         "fdtfile=undefined\0" \
119         "fdt_addr_r=0x18000000\0" \
120         "boot_fdt=try\0" \
121         "ip_dyn=yes\0" \
122         "console=" CONFIG_CONSOLE_DEV "\0" \
123         "bootm_size=0x10000000\0" \
124         "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
125         "mmcpart=1\0" \
126         "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
127         "update_sd_firmware=" \
128                 "if test ${ip_dyn} = yes; then " \
129                         "setenv get_cmd dhcp; " \
130                 "else " \
131                         "setenv get_cmd tftp; " \
132                 "fi; " \
133                 "if mmc dev ${mmcdev}; then "   \
134                         "if ${get_cmd} ${update_sd_firmware_filename}; then " \
135                                 "setexpr fw_sz ${filesize} / 0x200; " \
136                                 "setexpr fw_sz ${fw_sz} + 1; "  \
137                                 "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
138                         "fi; "  \
139                 "fi\0" \
140         "mmcargs=setenv bootargs console=${console},${baudrate} " \
141                 "root=${mmcroot}\0" \
142         "loadbootscript=" \
143                 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
144         "bootscript=echo Running bootscript from mmc ...; " \
145                 "source\0" \
146         "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
147         "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile}\0" \
148         "mmcboot=echo Booting from mmc ...; " \
149                 "run mmcargs; " \
150                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
151                         "if run loadfdt; then " \
152                                 "bootz ${loadaddr} - ${fdt_addr_r}; " \
153                         "else " \
154                                 "if test ${boot_fdt} = try; then " \
155                                         "bootz; " \
156                                 "else " \
157                                         "echo WARN: Cannot load the DT; " \
158                                 "fi; " \
159                         "fi; " \
160                 "else " \
161                         "bootz; " \
162                 "fi;\0" \
163         "netargs=setenv bootargs console=${console},${baudrate} " \
164                 "root=/dev/nfs " \
165                 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
166         "netboot=echo Booting from net ...; " \
167                 "run netargs; " \
168                 "if test ${ip_dyn} = yes; then " \
169                         "setenv get_cmd dhcp; " \
170                 "else " \
171                         "setenv get_cmd tftp; " \
172                 "fi; " \
173                 "${get_cmd} ${image}; " \
174                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
175                         "if ${get_cmd} ${fdt_addr_r} ${fdtfile}; then " \
176                                 "bootz ${loadaddr} - ${fdt_addr_r}; " \
177                         "else " \
178                                 "if test ${boot_fdt} = try; then " \
179                                         "bootz; " \
180                                 "else " \
181                                         "echo WARN: Cannot load the DT; " \
182                                 "fi; " \
183                         "fi; " \
184                 "else " \
185                         "bootz; " \
186                 "fi;\0" \
187         "findfdt="\
188                 "if test $board_name = HUMMINGBOARD && test $board_rev = MX6Q ; then " \
189                         "setenv fdtfile imx6q-hummingboard.dtb; fi; " \
190                 "if test $board_name = HUMMINGBOARD && test $board_rev = MX6DL ; then " \
191                         "setenv fdtfile imx6dl-hummingboard.dtb; fi; " \
192                 "if test $board_name = CUBOXI && test $board_rev = MX6Q ; then " \
193                         "setenv fdtfile imx6q-cubox-i.dtb; fi; " \
194                 "if test $board_name = CUBOXI && test $board_rev = MX6DL ; then " \
195                         "setenv fdtfile imx6dl-cubox-i.dtb; fi; " \
196                 "if test $fdtfile = undefined; then " \
197                         "echo WARNING: Could not determine dtb to use; fi; \0" \
198
199 #define CONFIG_BOOTCOMMAND \
200         "run findfdt; " \
201         "mmc dev ${mmcdev};" \
202         "if mmc rescan; then " \
203                 "if run loadbootscript; then " \
204                 "run bootscript; " \
205                 "else " \
206                         "if run loadimage; then " \
207                                 "run mmcboot; " \
208                         "else run netboot; " \
209                         "fi; " \
210                 "fi; " \
211         "else run netboot; fi"
212
213 /* Miscellaneous configurable options */
214 #define CONFIG_SYS_LONGHELP
215 #define CONFIG_SYS_HUSH_PARSER
216 #define CONFIG_AUTO_COMPLETE
217 #define CONFIG_SYS_CBSIZE              256
218 #define CONFIG_SYS_MAXARGS             16
219 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
220
221 #define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
222
223 #define CONFIG_CMDLINE_EDITING
224
225 /* Physical Memory Map */
226 #define CONFIG_NR_DRAM_BANKS           1
227 #define CONFIG_SYS_SDRAM_BASE          MMDC0_ARB_BASE_ADDR
228 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
229 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
230
231 #define CONFIG_SYS_INIT_SP_OFFSET \
232         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
233 #define CONFIG_SYS_INIT_SP_ADDR \
234         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
235
236 /* Environment organization */
237 #define CONFIG_ENV_SIZE                 (8 * 1024)
238 #define CONFIG_ENV_IS_IN_MMC
239 #define CONFIG_ENV_OFFSET               (8 * 64 * 1024)
240
241 #define CONFIG_OF_LIBFDT
242 #define CONFIG_CMD_CACHE
243
244 #endif                         /* __MX6CUBOXI_CONFIG_H */