blob: 973f2c5d073afa5d1f4fc2dcd730c9b6c1994ef0 [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>
Alexey Brodkin1ace4022014-02-26 17:47:58 +040017#include <linux/sizes.h>
Fabio Estevam3a217732014-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
Fabio Estevam518d2252014-04-22 15:35:00 -030030#define CONFIG_SYS_GENERIC_BOARD
31
Fabio Estevam3a217732014-01-03 15:55:58 -020032/* Size of malloc() pool */
33#define CONFIG_SYS_MALLOC_LEN (2 * SZ_1M)
34
35#define CONFIG_BOARD_EARLY_INIT_F
36#define CONFIG_MXC_GPIO
37
38#define CONFIG_MXC_UART
39#define CONFIG_MXC_UART_BASE UART1_BASE
40
41/* allow to overwrite serial and ethaddr */
42#define CONFIG_ENV_OVERWRITE
43#define CONFIG_CONS_INDEX 1
44#define CONFIG_BAUDRATE 115200
45
46/* Command definition */
47#include <config_cmd_default.h>
48
49#undef CONFIG_CMD_IMLS
50#undef CONFIG_CMD_I2C
51
52#define CONFIG_CMD_BMODE
53#define CONFIG_CMD_SETEXPR
54#define CONFIG_CMD_MEMTEST
55#define CONFIG_BOOTDELAY 3
56
57#define CONFIG_SYS_MEMTEST_START 0x10000000
58#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 500 * SZ_1M)
59#define CONFIG_LOADADDR 0x12000000
60#define CONFIG_SYS_TEXT_BASE 0x17800000
61
62/* MMC Configuration */
63#define CONFIG_FSL_ESDHC
64#define CONFIG_FSL_USDHC
65#define CONFIG_SYS_FSL_USDHC_NUM 1
66#define CONFIG_SYS_FSL_ESDHC_ADDR 0
67
68#define CONFIG_MMC
69#define CONFIG_CMD_MMC
70#define CONFIG_GENERIC_MMC
71#define CONFIG_BOUNCE_BUFFER
72#define CONFIG_CMD_EXT2
73#define CONFIG_CMD_FAT
74#define CONFIG_DOS_PARTITION
75
76/* Ethernet Configuration */
77#define CONFIG_FEC_MXC
78#ifdef CONFIG_FEC_MXC
79#define CONFIG_CMD_PING
80#define CONFIG_CMD_DHCP
81#define CONFIG_CMD_MII
82#define CONFIG_CMD_NET
83#define CONFIG_MII
84#define IMX_FEC_BASE ENET_BASE_ADDR
85#define CONFIG_FEC_XCV_TYPE RGMII
86#define CONFIG_FEC_MXC_PHYADDR 0
87#define CONFIG_PHYLIB
88#define CONFIG_PHY_ATHEROS
89#endif
90
91#if defined(CONFIG_MX6S)
92#define CONFIG_DEFAULT_FDT_FILE "imx6dl-hummingboard.dtb"
93#endif
94
95#define CONFIG_EXTRA_ENV_SETTINGS \
96 "script=boot.scr\0" \
Otavio Salvador1e373df2014-01-16 19:57:57 -020097 "image=zImage\0" \
Fabio Estevam3a217732014-01-03 15:55:58 -020098 "console=ttymxc0\0" \
99 "splashpos=m,m\0" \
100 "fdt_high=0xffffffff\0" \
101 "initrd_high=0xffffffff\0" \
102 "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
103 "fdt_addr=0x18000000\0" \
104 "boot_fdt=try\0" \
105 "ip_dyn=yes\0" \
106 "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
107 "mmcpart=1\0" \
108 "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
109 "update_sd_firmware_filename=u-boot.imx\0" \
110 "update_sd_firmware=" \
111 "if test ${ip_dyn} = yes; then " \
112 "setenv get_cmd dhcp; " \
113 "else " \
114 "setenv get_cmd tftp; " \
115 "fi; " \
116 "if mmc dev ${mmcdev}; then " \
117 "if ${get_cmd} ${update_sd_firmware_filename}; then " \
118 "setexpr fw_sz ${filesize} / 0x200; " \
119 "setexpr fw_sz ${fw_sz} + 1; " \
120 "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
121 "fi; " \
122 "fi\0" \
123 "mmcargs=setenv bootargs console=${console},${baudrate} " \
124 "root=${mmcroot}\0" \
125 "loadbootscript=" \
126 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
127 "bootscript=echo Running bootscript from mmc ...; " \
128 "source\0" \
Otavio Salvador1e373df2014-01-16 19:57:57 -0200129 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
Fabio Estevam3a217732014-01-03 15:55:58 -0200130 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
131 "mmcboot=echo Booting from mmc ...; " \
132 "run mmcargs; " \
133 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
134 "if run loadfdt; then " \
Otavio Salvador1e373df2014-01-16 19:57:57 -0200135 "bootz ${loadaddr} - ${fdt_addr}; " \
Fabio Estevam3a217732014-01-03 15:55:58 -0200136 "else " \
137 "if test ${boot_fdt} = try; then " \
Otavio Salvador1e373df2014-01-16 19:57:57 -0200138 "bootz; " \
Fabio Estevam3a217732014-01-03 15:55:58 -0200139 "else " \
140 "echo WARN: Cannot load the DT; " \
141 "fi; " \
142 "fi; " \
143 "else " \
Otavio Salvador1e373df2014-01-16 19:57:57 -0200144 "bootz; " \
Fabio Estevam3a217732014-01-03 15:55:58 -0200145 "fi;\0" \
146 "netargs=setenv bootargs console=${console},${baudrate} " \
147 "root=/dev/nfs " \
148 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
149 "netboot=echo Booting from net ...; " \
150 "run netargs; " \
151 "if test ${ip_dyn} = yes; then " \
152 "setenv get_cmd dhcp; " \
153 "else " \
154 "setenv get_cmd tftp; " \
155 "fi; " \
Otavio Salvador1e373df2014-01-16 19:57:57 -0200156 "${get_cmd} ${image}; " \
Fabio Estevam3a217732014-01-03 15:55:58 -0200157 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
158 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
Otavio Salvador1e373df2014-01-16 19:57:57 -0200159 "bootz ${loadaddr} - ${fdt_addr}; " \
Fabio Estevam3a217732014-01-03 15:55:58 -0200160 "else " \
161 "if test ${boot_fdt} = try; then " \
Otavio Salvador1e373df2014-01-16 19:57:57 -0200162 "bootz; " \
Fabio Estevam3a217732014-01-03 15:55:58 -0200163 "else " \
164 "echo WARN: Cannot load the DT; " \
165 "fi; " \
166 "fi; " \
167 "else " \
Otavio Salvador1e373df2014-01-16 19:57:57 -0200168 "bootz; " \
Fabio Estevam3a217732014-01-03 15:55:58 -0200169 "fi;\0"
170
171#define CONFIG_BOOTCOMMAND \
172 "mmc dev ${mmcdev}; if mmc rescan; then " \
173 "if run loadbootscript; then " \
174 "run bootscript; " \
175 "else " \
Otavio Salvador1e373df2014-01-16 19:57:57 -0200176 "if run loadimage; then " \
Fabio Estevam3a217732014-01-03 15:55:58 -0200177 "run mmcboot; " \
178 "else run netboot; " \
179 "fi; " \
180 "fi; " \
181 "else run netboot; fi"
182
183/* Miscellaneous configurable options */
184#define CONFIG_SYS_LONGHELP
185#define CONFIG_SYS_HUSH_PARSER
186#define CONFIG_AUTO_COMPLETE
187#define CONFIG_SYS_CBSIZE 1024
Fabio Estevam3a217732014-01-03 15:55:58 -0200188#define CONFIG_SYS_MAXARGS 16
189#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
190
191#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
Fabio Estevam3a217732014-01-03 15:55:58 -0200192
193#define CONFIG_CMDLINE_EDITING
194
195/* Physical Memory Map */
196#define CONFIG_NR_DRAM_BANKS 1
197#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
198
199#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
200#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
201#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
202
203#define CONFIG_SYS_INIT_SP_OFFSET \
204 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
205#define CONFIG_SYS_INIT_SP_ADDR \
206 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
207
208/* FLASH and environment organization */
209#define CONFIG_SYS_NO_FLASH
210
211#define CONFIG_ENV_SIZE (8 * 1024)
212
213#define CONFIG_ENV_IS_IN_MMC
214#define CONFIG_ENV_OFFSET (6 * 64 * 1024)
215#define CONFIG_SYS_MMC_ENV_DEV 0
216
217#define CONFIG_OF_LIBFDT
218#define CONFIG_CMD_BOOTZ
219
220#ifndef CONFIG_SYS_DCACHE_OFF
221#define CONFIG_CMD_CACHE
222#endif
223
224#endif /* __CONFIG_H * */