blob: 4055af55bf5aa70e223162324b40b8d48e79ffc0 [file] [log] [blame]
Fabio Estevam3a217732014-01-03 15:55:58 -02001/*
2 * Copyright (C) 2013 Freescale Semiconductor, Inc.
3 * Copyright (C) 2013 SolidRun ltd.
4 * Copyright (C) 2013 Jon Nettleton <jon.nettleton@gmail.com>
5 *
6 * Configuration settings for the SolidRun Hummingboard.
7 *
8 * SPDX-License-Identifier: GPL-2.0+
9 */
10
11#ifndef __CONFIG_H
12#define __CONFIG_H
13
14#include "mx6_common.h"
15#include <asm/arch/imx-regs.h>
16#include <asm/imx-common/gpio.h>
17#include <asm/sizes.h>
18
19#define CONFIG_MX6
20#define CONFIG_DISPLAY_CPUINFO
21#define CONFIG_DISPLAY_BOARDINFO
22
23#define CONFIG_MACH_TYPE 4773
24
25#define CONFIG_CMDLINE_TAG
26#define CONFIG_SETUP_MEMORY_TAGS
27#define CONFIG_INITRD_TAG
28#define CONFIG_REVISION_TAG
29
30/* Size of malloc() pool */
31#define CONFIG_SYS_MALLOC_LEN (2 * SZ_1M)
32
33#define CONFIG_BOARD_EARLY_INIT_F
34#define CONFIG_MXC_GPIO
35
36#define CONFIG_MXC_UART
37#define CONFIG_MXC_UART_BASE UART1_BASE
38
39/* allow to overwrite serial and ethaddr */
40#define CONFIG_ENV_OVERWRITE
41#define CONFIG_CONS_INDEX 1
42#define CONFIG_BAUDRATE 115200
43
44/* Command definition */
45#include <config_cmd_default.h>
46
47#undef CONFIG_CMD_IMLS
48#undef CONFIG_CMD_I2C
49
50#define CONFIG_CMD_BMODE
51#define CONFIG_CMD_SETEXPR
52#define CONFIG_CMD_MEMTEST
53#define CONFIG_BOOTDELAY 3
54
55#define CONFIG_SYS_MEMTEST_START 0x10000000
56#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 500 * SZ_1M)
57#define CONFIG_LOADADDR 0x12000000
58#define CONFIG_SYS_TEXT_BASE 0x17800000
59
60/* MMC Configuration */
61#define CONFIG_FSL_ESDHC
62#define CONFIG_FSL_USDHC
63#define CONFIG_SYS_FSL_USDHC_NUM 1
64#define CONFIG_SYS_FSL_ESDHC_ADDR 0
65
66#define CONFIG_MMC
67#define CONFIG_CMD_MMC
68#define CONFIG_GENERIC_MMC
69#define CONFIG_BOUNCE_BUFFER
70#define CONFIG_CMD_EXT2
71#define CONFIG_CMD_FAT
72#define CONFIG_DOS_PARTITION
73
74/* Ethernet Configuration */
75#define CONFIG_FEC_MXC
76#ifdef CONFIG_FEC_MXC
77#define CONFIG_CMD_PING
78#define CONFIG_CMD_DHCP
79#define CONFIG_CMD_MII
80#define CONFIG_CMD_NET
81#define CONFIG_MII
82#define IMX_FEC_BASE ENET_BASE_ADDR
83#define CONFIG_FEC_XCV_TYPE RGMII
84#define CONFIG_FEC_MXC_PHYADDR 0
85#define CONFIG_PHYLIB
86#define CONFIG_PHY_ATHEROS
87#endif
88
89#if defined(CONFIG_MX6S)
90#define CONFIG_DEFAULT_FDT_FILE "imx6dl-hummingboard.dtb"
91#endif
92
93#define CONFIG_EXTRA_ENV_SETTINGS \
94 "script=boot.scr\0" \
95 "uimage=uImage\0" \
96 "console=ttymxc0\0" \
97 "splashpos=m,m\0" \
98 "fdt_high=0xffffffff\0" \
99 "initrd_high=0xffffffff\0" \
100 "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
101 "fdt_addr=0x18000000\0" \
102 "boot_fdt=try\0" \
103 "ip_dyn=yes\0" \
104 "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
105 "mmcpart=1\0" \
106 "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
107 "update_sd_firmware_filename=u-boot.imx\0" \
108 "update_sd_firmware=" \
109 "if test ${ip_dyn} = yes; then " \
110 "setenv get_cmd dhcp; " \
111 "else " \
112 "setenv get_cmd tftp; " \
113 "fi; " \
114 "if mmc dev ${mmcdev}; then " \
115 "if ${get_cmd} ${update_sd_firmware_filename}; then " \
116 "setexpr fw_sz ${filesize} / 0x200; " \
117 "setexpr fw_sz ${fw_sz} + 1; " \
118 "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
119 "fi; " \
120 "fi\0" \
121 "mmcargs=setenv bootargs console=${console},${baudrate} " \
122 "root=${mmcroot}\0" \
123 "loadbootscript=" \
124 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
125 "bootscript=echo Running bootscript from mmc ...; " \
126 "source\0" \
127 "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
128 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
129 "mmcboot=echo Booting from mmc ...; " \
130 "run mmcargs; " \
131 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
132 "if run loadfdt; then " \
133 "bootm ${loadaddr} - ${fdt_addr}; " \
134 "else " \
135 "if test ${boot_fdt} = try; then " \
136 "bootm; " \
137 "else " \
138 "echo WARN: Cannot load the DT; " \
139 "fi; " \
140 "fi; " \
141 "else " \
142 "bootm; " \
143 "fi;\0" \
144 "netargs=setenv bootargs console=${console},${baudrate} " \
145 "root=/dev/nfs " \
146 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
147 "netboot=echo Booting from net ...; " \
148 "run netargs; " \
149 "if test ${ip_dyn} = yes; then " \
150 "setenv get_cmd dhcp; " \
151 "else " \
152 "setenv get_cmd tftp; " \
153 "fi; " \
154 "${get_cmd} ${uimage}; " \
155 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
156 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
157 "bootm ${loadaddr} - ${fdt_addr}; " \
158 "else " \
159 "if test ${boot_fdt} = try; then " \
160 "bootm; " \
161 "else " \
162 "echo WARN: Cannot load the DT; " \
163 "fi; " \
164 "fi; " \
165 "else " \
166 "bootm; " \
167 "fi;\0"
168
169#define CONFIG_BOOTCOMMAND \
170 "mmc dev ${mmcdev}; if mmc rescan; then " \
171 "if run loadbootscript; then " \
172 "run bootscript; " \
173 "else " \
174 "if run loaduimage; then " \
175 "run mmcboot; " \
176 "else run netboot; " \
177 "fi; " \
178 "fi; " \
179 "else run netboot; fi"
180
181/* Miscellaneous configurable options */
182#define CONFIG_SYS_LONGHELP
183#define CONFIG_SYS_HUSH_PARSER
184#define CONFIG_AUTO_COMPLETE
185#define CONFIG_SYS_CBSIZE 1024
186
187/* Print Buffer Size */
188#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
189#define CONFIG_SYS_MAXARGS 16
190#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
191
192#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
193#define CONFIG_SYS_HZ 1000
194
195#define CONFIG_CMDLINE_EDITING
196
197/* Physical Memory Map */
198#define CONFIG_NR_DRAM_BANKS 1
199#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
200
201#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
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/* FLASH and environment organization */
211#define CONFIG_SYS_NO_FLASH
212
213#define CONFIG_ENV_SIZE (8 * 1024)
214
215#define CONFIG_ENV_IS_IN_MMC
216#define CONFIG_ENV_OFFSET (6 * 64 * 1024)
217#define CONFIG_SYS_MMC_ENV_DEV 0
218
219#define CONFIG_OF_LIBFDT
220#define CONFIG_CMD_BOOTZ
221
222#ifndef CONFIG_SYS_DCACHE_OFF
223#define CONFIG_CMD_CACHE
224#endif
225
226#endif /* __CONFIG_H * */