blob: 634a09f34928fd8e7e33233a223b9d139f484ec5 [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
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030023
24/* MMC Configs */
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030025#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC2_BASE_ADDR
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030026
27/* Ethernet Configuration */
28#define CONFIG_FEC_MXC
29#define CONFIG_CMD_PING
30#define CONFIG_CMD_DHCP
31#define CONFIG_CMD_MII
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030032#define CONFIG_MII
33#define IMX_FEC_BASE ENET_BASE_ADDR
34#define CONFIG_FEC_XCV_TYPE RGMII
35#define CONFIG_FEC_MXC_PHYADDR 0
36#define CONFIG_PHYLIB
37#define CONFIG_PHY_ATHEROS
38
Fabio Estevamf68a9c62015-04-29 22:28:09 -030039/* Framebuffer */
40#define CONFIG_VIDEO
41#define CONFIG_VIDEO_IPUV3
42#define CONFIG_IPUV3_CLK 260000000
43#define CONFIG_CFB_CONSOLE
44#define CONFIG_VGA_AS_SINGLE_DEVICE
45#define CONFIG_SYS_CONSOLE_IS_IN_ENV
46#define CONFIG_VIDEO_BMP_RLE8
47#define CONFIG_SPLASH_SCREEN
48#define CONFIG_SPLASH_SCREEN_ALIGN
49#define CONFIG_BMP_16BPP
50#define CONFIG_VIDEO_LOGO
51#define CONFIG_VIDEO_BMP_LOGO
52#define CONFIG_IMX_HDMI
Fabio Estevam0e1f9912015-05-04 14:09:23 -030053#define CONFIG_CMD_HDMIDETECT
Fabio Estevamf68a9c62015-04-29 22:28:09 -030054#define CONFIG_IMX_VIDEO_SKIP
Fabio Estevamc49cfdc2015-04-29 22:28:11 -030055#define CONFIG_CONSOLE_MUX
Fabio Estevamf68a9c62015-04-29 22:28:09 -030056
Fabio Estevame1d74372015-04-29 22:28:10 -030057/* USB */
58#define CONFIG_CMD_USB
59#define CONFIG_USB_EHCI
60#define CONFIG_USB_EHCI_MX6
61#define CONFIG_USB_STORAGE
62#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
63#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
64#define CONFIG_MXC_USB_FLAGS 0
65#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
Fabio Estevamc49cfdc2015-04-29 22:28:11 -030066#define CONFIG_USB_KEYBOARD
67#define CONFIG_SYS_USB_EVENT_POLL
Fabio Estevam0e1f9912015-05-04 14:09:23 -030068#define CONFIG_PREBOOT \
69 "if hdmidet; then " \
70 "usb start; " \
71 "setenv stdin serial,usbkbd; "\
72 "setenv stdout serial,vga; " \
73 "setenv stderr serial,vga; " \
74 "else " \
75 "setenv stdin serial; " \
76 "setenv stdout serial; " \
77 "setenv stderr serial; " \
78 "fi;"
Fabio Estevame1d74372015-04-29 22:28:10 -030079
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030080/* Command definition */
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030081
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030082#define CONFIG_MXC_UART_BASE UART1_BASE
83#define CONFIG_CONSOLE_DEV "ttymxc0"
84#define CONFIG_MMCROOT "/dev/mmcblk0p2"
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030085#define CONFIG_SYS_FSL_USDHC_NUM 1
86#define CONFIG_SYS_MMC_ENV_DEV 0 /* SDHC2 */
87
Fabio Estevam205d5862015-04-25 18:47:21 -030088#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030089#define CONFIG_EXTRA_ENV_SETTINGS \
90 "script=boot.scr\0" \
91 "image=zImage\0" \
Fabio Estevam205d5862015-04-25 18:47:21 -030092 "fdtfile=undefined\0" \
Fabio Estevam6a305f22015-04-25 18:47:20 -030093 "fdt_addr_r=0x18000000\0" \
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -030094 "boot_fdt=try\0" \
95 "ip_dyn=yes\0" \
96 "console=" CONFIG_CONSOLE_DEV "\0" \
97 "bootm_size=0x10000000\0" \
98 "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
99 "mmcpart=1\0" \
100 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
101 "update_sd_firmware=" \
102 "if test ${ip_dyn} = yes; then " \
103 "setenv get_cmd dhcp; " \
104 "else " \
105 "setenv get_cmd tftp; " \
106 "fi; " \
107 "if mmc dev ${mmcdev}; then " \
108 "if ${get_cmd} ${update_sd_firmware_filename}; then " \
109 "setexpr fw_sz ${filesize} / 0x200; " \
110 "setexpr fw_sz ${fw_sz} + 1; " \
111 "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
112 "fi; " \
113 "fi\0" \
114 "mmcargs=setenv bootargs console=${console},${baudrate} " \
115 "root=${mmcroot}\0" \
116 "loadbootscript=" \
117 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
118 "bootscript=echo Running bootscript from mmc ...; " \
119 "source\0" \
120 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
Fabio Estevam6a305f22015-04-25 18:47:20 -0300121 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile}\0" \
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -0300122 "mmcboot=echo Booting from mmc ...; " \
123 "run mmcargs; " \
124 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
125 "if run loadfdt; then " \
Fabio Estevam6a305f22015-04-25 18:47:20 -0300126 "bootz ${loadaddr} - ${fdt_addr_r}; " \
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -0300127 "else " \
128 "if test ${boot_fdt} = try; then " \
129 "bootz; " \
130 "else " \
131 "echo WARN: Cannot load the DT; " \
132 "fi; " \
133 "fi; " \
134 "else " \
135 "bootz; " \
136 "fi;\0" \
137 "netargs=setenv bootargs console=${console},${baudrate} " \
138 "root=/dev/nfs " \
139 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
140 "netboot=echo Booting from net ...; " \
141 "run netargs; " \
142 "if test ${ip_dyn} = yes; then " \
143 "setenv get_cmd dhcp; " \
144 "else " \
145 "setenv get_cmd tftp; " \
146 "fi; " \
147 "${get_cmd} ${image}; " \
148 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
Fabio Estevam6a305f22015-04-25 18:47:20 -0300149 "if ${get_cmd} ${fdt_addr_r} ${fdtfile}; then " \
150 "bootz ${loadaddr} - ${fdt_addr_r}; " \
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -0300151 "else " \
152 "if test ${boot_fdt} = try; then " \
153 "bootz; " \
154 "else " \
155 "echo WARN: Cannot load the DT; " \
156 "fi; " \
157 "fi; " \
158 "else " \
159 "bootz; " \
Fabio Estevam205d5862015-04-25 18:47:21 -0300160 "fi;\0" \
161 "findfdt="\
162 "if test $board_name = HUMMINGBOARD && test $board_rev = MX6Q ; then " \
163 "setenv fdtfile imx6q-hummingboard.dtb; fi; " \
164 "if test $board_name = HUMMINGBOARD && test $board_rev = MX6DL ; then " \
165 "setenv fdtfile imx6dl-hummingboard.dtb; fi; " \
166 "if test $board_name = CUBOXI && test $board_rev = MX6Q ; then " \
167 "setenv fdtfile imx6q-cubox-i.dtb; fi; " \
168 "if test $board_name = CUBOXI && test $board_rev = MX6DL ; then " \
169 "setenv fdtfile imx6dl-cubox-i.dtb; fi; " \
170 "if test $fdtfile = undefined; then " \
171 "echo WARNING: Could not determine dtb to use; fi; \0" \
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -0300172
173#define CONFIG_BOOTCOMMAND \
Fabio Estevam205d5862015-04-25 18:47:21 -0300174 "run findfdt; " \
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -0300175 "mmc dev ${mmcdev};" \
176 "if mmc rescan; then " \
177 "if run loadbootscript; then " \
178 "run bootscript; " \
179 "else " \
180 "if run loadimage; then " \
181 "run mmcboot; " \
182 "else run netboot; " \
183 "fi; " \
184 "fi; " \
185 "else run netboot; fi"
186
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -0300187/* Physical Memory Map */
188#define CONFIG_NR_DRAM_BANKS 1
189#define CONFIG_SYS_SDRAM_BASE MMDC0_ARB_BASE_ADDR
190#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
191#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
192
193#define CONFIG_SYS_INIT_SP_OFFSET \
194 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
195#define CONFIG_SYS_INIT_SP_ADDR \
196 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
197
198/* Environment organization */
199#define CONFIG_ENV_SIZE (8 * 1024)
200#define CONFIG_ENV_IS_IN_MMC
201#define CONFIG_ENV_OFFSET (8 * 64 * 1024)
202
Fabio Estevamb8ce6fe2015-04-20 14:48:57 -0300203#endif /* __MX6CUBOXI_CONFIG_H */