blob: 5d58b16420068d98ecc5c324079c6459132ca52f [file] [log] [blame]
Fabio Estevam1d97a592015-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
11#include <linux/sizes.h>
12#include <asm/arch/imx-regs.h>
13#include <asm/imx-common/gpio.h>
14#include "mx6_common.h"
15
16#define CONFIG_MX6
17#define CONFIG_SPL_LIBCOMMON_SUPPORT
18#define CONFIG_SPL_MMC_SUPPORT
19#include "imx6_spl.h"
20
21#define CONFIG_DISPLAY_CPUINFO
22#define CONFIG_DISPLAY_BOARDINFO
23#define CONFIG_CMDLINE_TAG
24#define CONFIG_SETUP_MEMORY_TAGS
25#define CONFIG_INITRD_TAG
26#define CONFIG_REVISION_TAG
27#define CONFIG_IMX6_THERMAL
28#define CONFIG_SYS_GENERIC_BOARD
29
30#define CONFIG_SYS_MALLOC_LEN (2 * SZ_1M)
31#define CONFIG_BOARD_EARLY_INIT_F
32#define CONFIG_MXC_GPIO
33#define CONFIG_MXC_UART
34#define CONFIG_CMD_FUSE
35#define CONFIG_MXC_OCOTP
36
37/* MMC Configs */
38#define CONFIG_FSL_ESDHC
39#define CONFIG_FSL_USDHC
40#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC2_BASE_ADDR
41#define CONFIG_MMC
42#define CONFIG_CMD_MMC
43#define CONFIG_GENERIC_MMC
44#define CONFIG_BOUNCE_BUFFER
45#define CONFIG_CMD_EXT4
46#define CONFIG_CMD_EXT4_WRITE
47#define CONFIG_CMD_FAT
48#define CONFIG_DOS_PARTITION
49
50/* Ethernet Configuration */
51#define CONFIG_FEC_MXC
52#define CONFIG_CMD_PING
53#define CONFIG_CMD_DHCP
54#define CONFIG_CMD_MII
55#define CONFIG_CMD_NET
56#define CONFIG_MII
57#define IMX_FEC_BASE ENET_BASE_ADDR
58#define CONFIG_FEC_XCV_TYPE RGMII
59#define CONFIG_FEC_MXC_PHYADDR 0
60#define CONFIG_PHYLIB
61#define CONFIG_PHY_ATHEROS
62
63/* allow to overwrite serial and ethaddr */
64#define CONFIG_ENV_OVERWRITE
65#define CONFIG_CONS_INDEX 1
66#define CONFIG_BAUDRATE 115200
67
68#define CONFIG_SYS_NO_FLASH
69
70/* Command definition */
71#include <config_cmd_default.h>
72
73#define CONFIG_CMD_BOOTZ
74#define CONFIG_CMD_SETEXPR
75
76#define CONFIG_BOOTDELAY 1
77
78#define CONFIG_LOADADDR 0x12000000
79#define CONFIG_SYS_TEXT_BASE 0x17800000
80
81#define CONFIG_MXC_UART_BASE UART1_BASE
82#define CONFIG_CONSOLE_DEV "ttymxc0"
83#define CONFIG_MMCROOT "/dev/mmcblk0p2"
84#define CONFIG_DEFAULT_FDT_FILE "imx6q-hummingboard.dtb"
85#define CONFIG_SYS_FSL_USDHC_NUM 1
86#define CONFIG_SYS_MMC_ENV_DEV 0 /* SDHC2 */
87
88#define CONFIG_EXTRA_ENV_SETTINGS \
89 "script=boot.scr\0" \
90 "image=zImage\0" \
91 "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
92 "fdt_addr=0x18000000\0" \
93 "boot_fdt=try\0" \
94 "ip_dyn=yes\0" \
95 "console=" CONFIG_CONSOLE_DEV "\0" \
96 "bootm_size=0x10000000\0" \
97 "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
98 "mmcpart=1\0" \
99 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
100 "update_sd_firmware=" \
101 "if test ${ip_dyn} = yes; then " \
102 "setenv get_cmd dhcp; " \
103 "else " \
104 "setenv get_cmd tftp; " \
105 "fi; " \
106 "if mmc dev ${mmcdev}; then " \
107 "if ${get_cmd} ${update_sd_firmware_filename}; then " \
108 "setexpr fw_sz ${filesize} / 0x200; " \
109 "setexpr fw_sz ${fw_sz} + 1; " \
110 "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
111 "fi; " \
112 "fi\0" \
113 "mmcargs=setenv bootargs console=${console},${baudrate} " \
114 "root=${mmcroot}\0" \
115 "loadbootscript=" \
116 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
117 "bootscript=echo Running bootscript from mmc ...; " \
118 "source\0" \
119 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
120 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
121 "mmcboot=echo Booting from mmc ...; " \
122 "run mmcargs; " \
123 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
124 "if run loadfdt; then " \
125 "bootz ${loadaddr} - ${fdt_addr}; " \
126 "else " \
127 "if test ${boot_fdt} = try; then " \
128 "bootz; " \
129 "else " \
130 "echo WARN: Cannot load the DT; " \
131 "fi; " \
132 "fi; " \
133 "else " \
134 "bootz; " \
135 "fi;\0" \
136 "netargs=setenv bootargs console=${console},${baudrate} " \
137 "root=/dev/nfs " \
138 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
139 "netboot=echo Booting from net ...; " \
140 "run netargs; " \
141 "if test ${ip_dyn} = yes; then " \
142 "setenv get_cmd dhcp; " \
143 "else " \
144 "setenv get_cmd tftp; " \
145 "fi; " \
146 "${get_cmd} ${image}; " \
147 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
148 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
149 "bootz ${loadaddr} - ${fdt_addr}; " \
150 "else " \
151 "if test ${boot_fdt} = try; then " \
152 "bootz; " \
153 "else " \
154 "echo WARN: Cannot load the DT; " \
155 "fi; " \
156 "fi; " \
157 "else " \
158 "bootz; " \
159 "fi;\0"
160
161#define CONFIG_BOOTCOMMAND \
162 "mmc dev ${mmcdev};" \
163 "if mmc rescan; then " \
164 "if run loadbootscript; then " \
165 "run bootscript; " \
166 "else " \
167 "if run loadimage; then " \
168 "run mmcboot; " \
169 "else run netboot; " \
170 "fi; " \
171 "fi; " \
172 "else run netboot; fi"
173
174/* Miscellaneous configurable options */
175#define CONFIG_SYS_LONGHELP
176#define CONFIG_SYS_HUSH_PARSER
177#define CONFIG_AUTO_COMPLETE
178#define CONFIG_SYS_CBSIZE 256
179#define CONFIG_SYS_MAXARGS 16
180#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
181
182#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
183
184#define CONFIG_CMDLINE_EDITING
185
186/* Physical Memory Map */
187#define CONFIG_NR_DRAM_BANKS 1
188#define CONFIG_SYS_SDRAM_BASE MMDC0_ARB_BASE_ADDR
189#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
190#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
191
192#define CONFIG_SYS_INIT_SP_OFFSET \
193 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
194#define CONFIG_SYS_INIT_SP_ADDR \
195 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
196
197/* Environment organization */
198#define CONFIG_ENV_SIZE (8 * 1024)
199#define CONFIG_ENV_IS_IN_MMC
200#define CONFIG_ENV_OFFSET (8 * 64 * 1024)
201
202#define CONFIG_OF_LIBFDT
203#define CONFIG_CMD_CACHE
204
205#endif /* __MX6CUBOXI_CONFIG_H */