blob: 21c3f960aef391f9604f803dad73ad8d4468fedc [file] [log] [blame]
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -03001/*
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
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030011#include "mx6_common.h"
12
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030013#define CONFIG_SPL_LIBCOMMON_SUPPORT
14#define CONFIG_SPL_MMC_SUPPORT
15#include "imx6_spl.h"
16
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030017#define CONFIG_IMX6_THERMAL
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030018
Fabio Estevamf68a9c62015-04-29 22:28:09 -030019#define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M)
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030020#define CONFIG_BOARD_EARLY_INIT_F
Fabio Estevam205d5862015-04-25 18:47:21 -030021#define CONFIG_BOARD_LATE_INIT
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030022#define CONFIG_MXC_UART
23#define CONFIG_CMD_FUSE
24#define CONFIG_MXC_OCOTP
25
26/* MMC Configs */
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030027#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC2_BASE_ADDR
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030028
29/* Ethernet Configuration */
30#define CONFIG_FEC_MXC
31#define CONFIG_CMD_PING
32#define CONFIG_CMD_DHCP
33#define CONFIG_CMD_MII
34#define CONFIG_CMD_NET
35#define CONFIG_MII
36#define IMX_FEC_BASE ENET_BASE_ADDR
37#define CONFIG_FEC_XCV_TYPE RGMII
38#define CONFIG_FEC_MXC_PHYADDR 0
39#define CONFIG_PHYLIB
40#define CONFIG_PHY_ATHEROS
41
Fabio Estevamf68a9c62015-04-29 22:28:09 -030042/* Framebuffer */
43#define CONFIG_VIDEO
44#define CONFIG_VIDEO_IPUV3
45#define CONFIG_IPUV3_CLK 260000000
46#define CONFIG_CFB_CONSOLE
47#define CONFIG_VGA_AS_SINGLE_DEVICE
48#define CONFIG_SYS_CONSOLE_IS_IN_ENV
49#define CONFIG_VIDEO_BMP_RLE8
50#define CONFIG_SPLASH_SCREEN
51#define CONFIG_SPLASH_SCREEN_ALIGN
52#define CONFIG_BMP_16BPP
53#define CONFIG_VIDEO_LOGO
54#define CONFIG_VIDEO_BMP_LOGO
55#define CONFIG_IMX_HDMI
Fabio Estevam0e1f9912015-05-04 14:09:23 -030056#define CONFIG_CMD_HDMIDETECT
Fabio Estevamf68a9c62015-04-29 22:28:09 -030057#define CONFIG_IMX_VIDEO_SKIP
Fabio Estevamc49cfdc2015-04-29 22:28:11 -030058#define CONFIG_CONSOLE_MUX
Fabio Estevamf68a9c62015-04-29 22:28:09 -030059
Fabio Estevame1d74372015-04-29 22:28:10 -030060/* USB */
61#define CONFIG_CMD_USB
62#define CONFIG_USB_EHCI
63#define CONFIG_USB_EHCI_MX6
64#define CONFIG_USB_STORAGE
65#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
66#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
67#define CONFIG_MXC_USB_FLAGS 0
68#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
Fabio Estevamc49cfdc2015-04-29 22:28:11 -030069#define CONFIG_USB_KEYBOARD
70#define CONFIG_SYS_USB_EVENT_POLL
Fabio Estevam0e1f9912015-05-04 14:09:23 -030071#define CONFIG_PREBOOT \
72 "if hdmidet; then " \
73 "usb start; " \
74 "setenv stdin serial,usbkbd; "\
75 "setenv stdout serial,vga; " \
76 "setenv stderr serial,vga; " \
77 "else " \
78 "setenv stdin serial; " \
79 "setenv stdout serial; " \
80 "setenv stderr serial; " \
81 "fi;"
Fabio Estevame1d74372015-04-29 22:28:10 -030082
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030083/* Command definition */
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030084#define CONFIG_CMD_SETEXPR
85
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030086#define CONFIG_MXC_UART_BASE UART1_BASE
87#define CONFIG_CONSOLE_DEV "ttymxc0"
88#define CONFIG_MMCROOT "/dev/mmcblk0p2"
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030089#define CONFIG_SYS_FSL_USDHC_NUM 1
90#define CONFIG_SYS_MMC_ENV_DEV 0 /* SDHC2 */
91
Fabio Estevam205d5862015-04-25 18:47:21 -030092#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030093#define CONFIG_EXTRA_ENV_SETTINGS \
94 "script=boot.scr\0" \
95 "image=zImage\0" \
Fabio Estevam205d5862015-04-25 18:47:21 -030096 "fdtfile=undefined\0" \
Fabio Estevam6a305f22015-04-25 18:47:20 -030097 "fdt_addr_r=0x18000000\0" \
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030098 "boot_fdt=try\0" \
99 "ip_dyn=yes\0" \
100 "console=" CONFIG_CONSOLE_DEV "\0" \
101 "bootm_size=0x10000000\0" \
102 "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
103 "mmcpart=1\0" \
104 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
105 "update_sd_firmware=" \
106 "if test ${ip_dyn} = yes; then " \
107 "setenv get_cmd dhcp; " \
108 "else " \
109 "setenv get_cmd tftp; " \
110 "fi; " \
111 "if mmc dev ${mmcdev}; then " \
112 "if ${get_cmd} ${update_sd_firmware_filename}; then " \
113 "setexpr fw_sz ${filesize} / 0x200; " \
114 "setexpr fw_sz ${fw_sz} + 1; " \
115 "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
116 "fi; " \
117 "fi\0" \
118 "mmcargs=setenv bootargs console=${console},${baudrate} " \
119 "root=${mmcroot}\0" \
120 "loadbootscript=" \
121 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
122 "bootscript=echo Running bootscript from mmc ...; " \
123 "source\0" \
124 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
Fabio Estevam6a305f22015-04-25 18:47:20 -0300125 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile}\0" \
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -0300126 "mmcboot=echo Booting from mmc ...; " \
127 "run mmcargs; " \
128 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
129 "if run loadfdt; then " \
Fabio Estevam6a305f22015-04-25 18:47:20 -0300130 "bootz ${loadaddr} - ${fdt_addr_r}; " \
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -0300131 "else " \
132 "if test ${boot_fdt} = try; then " \
133 "bootz; " \
134 "else " \
135 "echo WARN: Cannot load the DT; " \
136 "fi; " \
137 "fi; " \
138 "else " \
139 "bootz; " \
140 "fi;\0" \
141 "netargs=setenv bootargs console=${console},${baudrate} " \
142 "root=/dev/nfs " \
143 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
144 "netboot=echo Booting from net ...; " \
145 "run netargs; " \
146 "if test ${ip_dyn} = yes; then " \
147 "setenv get_cmd dhcp; " \
148 "else " \
149 "setenv get_cmd tftp; " \
150 "fi; " \
151 "${get_cmd} ${image}; " \
152 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
Fabio Estevam6a305f22015-04-25 18:47:20 -0300153 "if ${get_cmd} ${fdt_addr_r} ${fdtfile}; then " \
154 "bootz ${loadaddr} - ${fdt_addr_r}; " \
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -0300155 "else " \
156 "if test ${boot_fdt} = try; then " \
157 "bootz; " \
158 "else " \
159 "echo WARN: Cannot load the DT; " \
160 "fi; " \
161 "fi; " \
162 "else " \
163 "bootz; " \
Fabio Estevam205d5862015-04-25 18:47:21 -0300164 "fi;\0" \
165 "findfdt="\
166 "if test $board_name = HUMMINGBOARD && test $board_rev = MX6Q ; then " \
167 "setenv fdtfile imx6q-hummingboard.dtb; fi; " \
168 "if test $board_name = HUMMINGBOARD && test $board_rev = MX6DL ; then " \
169 "setenv fdtfile imx6dl-hummingboard.dtb; fi; " \
170 "if test $board_name = CUBOXI && test $board_rev = MX6Q ; then " \
171 "setenv fdtfile imx6q-cubox-i.dtb; fi; " \
172 "if test $board_name = CUBOXI && test $board_rev = MX6DL ; then " \
173 "setenv fdtfile imx6dl-cubox-i.dtb; fi; " \
174 "if test $fdtfile = undefined; then " \
175 "echo WARNING: Could not determine dtb to use; fi; \0" \
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -0300176
177#define CONFIG_BOOTCOMMAND \
Fabio Estevam205d5862015-04-25 18:47:21 -0300178 "run findfdt; " \
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -0300179 "mmc dev ${mmcdev};" \
180 "if mmc rescan; then " \
181 "if run loadbootscript; then " \
182 "run bootscript; " \
183 "else " \
184 "if run loadimage; then " \
185 "run mmcboot; " \
186 "else run netboot; " \
187 "fi; " \
188 "fi; " \
189 "else run netboot; fi"
190
191/* Miscellaneous configurable options */
192#define CONFIG_SYS_LONGHELP
193#define CONFIG_SYS_HUSH_PARSER
194#define CONFIG_AUTO_COMPLETE
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -0300195#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
196
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -0300197#define CONFIG_CMDLINE_EDITING
198
199/* Physical Memory Map */
200#define CONFIG_NR_DRAM_BANKS 1
201#define CONFIG_SYS_SDRAM_BASE MMDC0_ARB_BASE_ADDR
202#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
203#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
204
205#define CONFIG_SYS_INIT_SP_OFFSET \
206 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
207#define CONFIG_SYS_INIT_SP_ADDR \
208 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
209
210/* Environment organization */
211#define CONFIG_ENV_SIZE (8 * 1024)
212#define CONFIG_ENV_IS_IN_MMC
213#define CONFIG_ENV_OFFSET (8 * 64 * 1024)
214
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -0300215#endif /* __MX6CUBOXI_CONFIG_H */