blob: 28955233449f3e6ecf4d8892892f2353f557d490 [file] [log] [blame]
Fabio Estevamf22d7592014-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>
Alexey Brodkin267d8e22014-02-26 17:47:58 +040017#include <linux/sizes.h>
Fabio Estevamf22d7592014-01-03 15:55:58 -020018
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" \
Otavio Salvador70aa1032014-01-16 19:57:57 -020095 "image=zImage\0" \
Fabio Estevamf22d7592014-01-03 15:55:58 -020096 "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" \
Otavio Salvador70aa1032014-01-16 19:57:57 -0200127 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
Fabio Estevamf22d7592014-01-03 15:55:58 -0200128 "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 " \
Otavio Salvador70aa1032014-01-16 19:57:57 -0200133 "bootz ${loadaddr} - ${fdt_addr}; " \
Fabio Estevamf22d7592014-01-03 15:55:58 -0200134 "else " \
135 "if test ${boot_fdt} = try; then " \
Otavio Salvador70aa1032014-01-16 19:57:57 -0200136 "bootz; " \
Fabio Estevamf22d7592014-01-03 15:55:58 -0200137 "else " \
138 "echo WARN: Cannot load the DT; " \
139 "fi; " \
140 "fi; " \
141 "else " \
Otavio Salvador70aa1032014-01-16 19:57:57 -0200142 "bootz; " \
Fabio Estevamf22d7592014-01-03 15:55:58 -0200143 "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; " \
Otavio Salvador70aa1032014-01-16 19:57:57 -0200154 "${get_cmd} ${image}; " \
Fabio Estevamf22d7592014-01-03 15:55:58 -0200155 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
156 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
Otavio Salvador70aa1032014-01-16 19:57:57 -0200157 "bootz ${loadaddr} - ${fdt_addr}; " \
Fabio Estevamf22d7592014-01-03 15:55:58 -0200158 "else " \
159 "if test ${boot_fdt} = try; then " \
Otavio Salvador70aa1032014-01-16 19:57:57 -0200160 "bootz; " \
Fabio Estevamf22d7592014-01-03 15:55:58 -0200161 "else " \
162 "echo WARN: Cannot load the DT; " \
163 "fi; " \
164 "fi; " \
165 "else " \
Otavio Salvador70aa1032014-01-16 19:57:57 -0200166 "bootz; " \
Fabio Estevamf22d7592014-01-03 15:55:58 -0200167 "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 " \
Otavio Salvador70aa1032014-01-16 19:57:57 -0200174 "if run loadimage; then " \
Fabio Estevamf22d7592014-01-03 15:55:58 -0200175 "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
Fabio Estevamf22d7592014-01-03 15:55:58 -0200193
194#define CONFIG_CMDLINE_EDITING
195
196/* Physical Memory Map */
197#define CONFIG_NR_DRAM_BANKS 1
198#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
199
200#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
201#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
202#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
203
204#define CONFIG_SYS_INIT_SP_OFFSET \
205 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
206#define CONFIG_SYS_INIT_SP_ADDR \
207 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
208
209/* FLASH and environment organization */
210#define CONFIG_SYS_NO_FLASH
211
212#define CONFIG_ENV_SIZE (8 * 1024)
213
214#define CONFIG_ENV_IS_IN_MMC
215#define CONFIG_ENV_OFFSET (6 * 64 * 1024)
216#define CONFIG_SYS_MMC_ENV_DEV 0
217
218#define CONFIG_OF_LIBFDT
219#define CONFIG_CMD_BOOTZ
220
221#ifndef CONFIG_SYS_DCACHE_OFF
222#define CONFIG_CMD_CACHE
223#endif
224
225#endif /* __CONFIG_H * */