blob: 327a866ea56558edfead3b1877ba9fe980f4d890 [file] [log] [blame]
Stefano Babic53b603c2012-02-22 00:24:40 +00001/*
2 * (C) Copyright 2012, Stefano Babic <sbabic@denx.de>
3 *
4 * Copyright (C) 2010 Freescale Semiconductor, Inc.
5 *
6 * Configuration settings for the MX53-EVK Freescale board.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc.
21 */
22
23#ifndef __CONFIG_H
24#define __CONFIG_H
25
26/* SOC type must be included before imx-regs.h */
27#define CONFIG_MX53
28#include <asm/arch/imx-regs.h>
Stefano Babic53b603c2012-02-22 00:24:40 +000029
Stefano Babic53b603c2012-02-22 00:24:40 +000030#define CONFIG_DISPLAY_CPUINFO
31#define CONFIG_DISPLAY_BOARDINFO
32
33#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
34#define CONFIG_SETUP_MEMORY_TAGS
35#define CONFIG_INITRD_TAG
36
37#define CONFIG_OF_LIBFDT
38
39/* Size of malloc() pool */
40#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
41
42#define CONFIG_BOARD_EARLY_INIT_F
43
44/* Enable GPIOs */
45#define CONFIG_MXC_GPIO
46
47/* UART */
48#define CONFIG_MXC_UART
49#define CONFIG_MXC_UART_BASE UART4_BASE_ADDR
50
51/* MMC */
52#define CONFIG_FSL_ESDHC
53#define CONFIG_SYS_FSL_ESDHC_ADDR 0
54#define CONFIG_SYS_FSL_ESDHC_NUM 1
55
56#define CONFIG_MMC
57#define CONFIG_GENERIC_MMC
58#define CONFIG_DOS_PARTITION
59
60/* Ethernet on FEC */
61#define CONFIG_NET_MULTI
62#define CONFIG_MII
Stefano Babic53b603c2012-02-22 00:24:40 +000063
64#define CONFIG_FEC_MXC
65#define IMX_FEC_BASE FEC_BASE_ADDR
66#define CONFIG_FEC_MXC_PHYADDR 0x01
67#define CONFIG_PHY_ADDR CONFIG_FEC_MXC_PHYADDR
68#define CONFIG_RESET_PHY_R
69#define CONFIG_FEC_MXC_NO_ANEG
Ashok Kumar Reddyf0afa1a2012-09-05 22:09:37 +053070#define CONFIG_ETHPRIME "FEC0"
Stefano Babic53b603c2012-02-22 00:24:40 +000071
72/* SPI */
73#define CONFIG_HARD_SPI
74#define CONFIG_MXC_SPI
75#define CONFIG_DEFAULT_SPI_BUS 1
76#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0
77
78/* SPI FLASH - not used for environment */
79#define CONFIG_SPI_FLASH
80#define CONFIG_SPI_FLASH_STMICRO
Stefano Babic53b603c2012-02-22 00:24:40 +000081#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
82#define CONFIG_SF_DEFAULT_SPEED 25000000
83
84/* allow to overwrite serial and ethaddr */
85#define CONFIG_ENV_OVERWRITE
86#define CONFIG_CONS_INDEX 1
87#define CONFIG_BAUDRATE 115200
Stefano Babic53b603c2012-02-22 00:24:40 +000088
89/* Command definition */
90#include <config_cmd_default.h>
91#define CONFIG_CMD_PING
92#define CONFIG_CMD_DHCP
93#define CONFIG_CMD_MII
94#define CONFIG_CMD_MMC
95#define CONFIG_CMD_FAT
96#define CONFIG_CMD_EXT2
97#define CONFIG_CMD_MTDPARTS
98#define CONFIG_CMD_SPI
99#define CONFIG_CMD_SF
100#define CONFIG_CMD_GPIO
101
102#define CONFIG_BOOTDELAY 3
103
104#define CONFIG_LOADADDR 0x70800000 /* loadaddr env var */
105#define CONFIG_SYS_TEXT_BASE 0xf0001400 /* uboot in nor flash */
106
107#define CONFIG_ARP_TIMEOUT 200UL
108
109/* Miscellaneous configurable options */
110#define CONFIG_SYS_LONGHELP /* undef to save memory */
111#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
Stefano Babic53b603c2012-02-22 00:24:40 +0000112#define CONFIG_SYS_PROMPT "IMA3 MX53 U-Boot > "
113#define CONFIG_AUTO_COMPLETE
114#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
115
116/* Print Buffer Size */
117#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
118#define CONFIG_SYS_MAXARGS 16 /* max number of command args */
119#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
120
121#define CONFIG_SYS_MEMTEST_START 0x70000000
122#define CONFIG_SYS_MEMTEST_END 0x10000
123
124#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
125
126#define CONFIG_SYS_HZ 1000
127#define CONFIG_CMDLINE_EDITING
128
Stefano Babic53b603c2012-02-22 00:24:40 +0000129/* Physical Memory Map */
130#define CONFIG_NR_DRAM_BANKS 1
131#define PHYS_SDRAM_1 CSD0_BASE_ADDR
132#define PHYS_SDRAM_1_SIZE (1024 * 1024 * 1024)
133
134#define CONFIG_SYS_SDRAM_BASE (PHYS_SDRAM_1)
135#define CONFIG_SYS_INIT_RAM_ADDR (IRAM_BASE_ADDR)
136#define CONFIG_SYS_INIT_RAM_SIZE (IRAM_SIZE)
137
138#define CONFIG_SYS_INIT_SP_OFFSET \
139 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
140#define CONFIG_SYS_INIT_SP_ADDR \
141 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
142
143#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
144#define MTDIDS_DEFAULT "nor0=f0000000.flash"
145
146/* FLASH and environment organization */
147
148#define CONFIG_SYS_FLASH_BASE 0xF0000000
149#define CONFIG_SYS_FLASH_CFI /* Flash is CFI conformant */
150#define CONFIG_FLASH_CFI_DRIVER /* Use the common driver */
151#define CONFIG_FLASH_CFI_MTD /* with MTD support */
152#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE }
153#define CONFIG_SYS_MAX_FLASH_BANKS 1
154#define CONFIG_SYS_MAX_FLASH_SECT 1024
155
156#define CONFIG_SYS_FLASH_EMPTY_INFO
157#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
158
159#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
160#define CONFIG_SYS_MONITOR_LEN (512 * 1024)
161
162#define CONFIG_ENV_SIZE (8 * 1024)
163#define CONFIG_ENV_IS_IN_FLASH
164#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + \
165 CONFIG_SYS_MONITOR_LEN)
166#define CONFIG_ENV_SECT_SIZE 0x20000
167#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
168 CONFIG_ENV_SECT_SIZE)
169#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
170
171/*
172 * Default environment and default scripts
173 * to update uboot and load kernel
174 */
175
176#define HOSTNAME ima3-mx53
Stefano Babic53b603c2012-02-22 00:24:40 +0000177
178#define CONFIG_HOSTNAME ima3-mx53
179#define CONFIG_EXTRA_ENV_SETTINGS \
180 "netdev=eth0\0" \
181 "nfsargs=setenv bootargs root=/dev/nfs rw " \
182 "nfsroot=${serverip}:${rootpath}\0" \
183 "ramargs=setenv bootargs root=/dev/ram0 rw\0" \
184 "addip_sta=setenv bootargs ${bootargs} " \
185 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
186 ":${hostname}:${netdev}:off panic=1\0" \
187 "addip_dyn=setenv bootargs ${bootargs} ip=dhcp\0" \
188 "addip=if test -n ${ipdyn};then run addip_dyn;" \
189 "else run addip_sta;fi\0" \
190 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
191 "addtty=setenv bootargs ${bootargs}" \
192 " console=${console},${baudrate}\0" \
193 "addmisc=setenv bootargs ${bootargs} ${misc}\0" \
194 "console=ttymxc3\0" \
195 "loadaddr=70800000\0" \
196 "kernel_addr_r=70800000\0" \
197 "ramdisk_addr_r=71000000\0" \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200198 "hostname=" __stringify(CONFIG_HOSTNAME) "\0" \
199 "bootfile=" __stringify(CONFIG_HOSTNAME) "/uImage\0" \
200 "ramdisk_file=" __stringify(CONFIG_HOSTNAME) "/uRamdisk\0" \
Stefano Babic53b603c2012-02-22 00:24:40 +0000201 "mmcargs=setenv bootargs root=${mmcroot} " \
202 "rootfstype=${mmcrootfstype}\0" \
203 "mmcroot=/dev/mmcblk0p3 rw\0" \
204 "mmcboot=echo Booting from mmc ...; " \
205 "run mmcargs addip addtty addmtd addmisc mmcload;" \
206 "bootm\0" \
207 "mmcload=fatload mmc ${mmcdev}:${mmcpart} " \
208 "${loadaddr} ${uimage}\0" \
209 "mmcrootfstype=ext3 rootwait\0" \
210 "flash_self=run ramargs addip addtty addmtd addmisc;" \
211 "bootm ${kernel_addr} ${ramdisk_addr}\0" \
212 "flash_nfs=run nfsargs addip addtty addmtd addmisc;" \
213 "bootm ${kernel_addr}\0" \
214 "net_nfs=tftp ${kernel_addr_r} ${bootfile}; " \
215 "run nfsargs addip addtty addmtd addmisc;" \
216 "bootm ${kernel_addr_r}\0" \
217 "net_self_load=tftp ${ramdisk_addr_r} ${ramdisk_file};" \
218 "tftp ${kernel_addr_r} ${bootfile}\0" \
219 "net_self=if run net_self_load;then " \
220 "run ramargs addip addtty addmtd addmisc;" \
221 "bootm ${kernel_addr_r} ${ramdisk_addr_r};" \
222 "else echo Images not loades;fi\0" \
223 "satargs=setenv bootargs root=/dev/sda1\0" \
224 "satafile=boot/uImage\0" \
225 "ssdboot=echo Booting from ssd ...; " \
226 "run satargs addip addtty addmtd addmisc;" \
227 "sata init;ext2load sata 0:1 ${kernel_addr_r} " \
228 "${satafile};bootm\0" \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200229 "u-boot=" __stringify(CONFIG_HOSTNAME) "/u-boot.imx\0" \
Stefano Babic53b603c2012-02-22 00:24:40 +0000230 "uimage=uImage\0" \
231 "load=tftp ${loadaddr} ${u-boot}\0" \
232 "uboot_addr=0xf0001000\0" \
233 "update=protect off 0xf0000000 +60000;" \
234 "erase ${uboot_addr} +60000;" \
235 "cp.b ${loadaddr} ${uboot_addr} ${filesize}\0" \
236 "upd=if run load;then echo Updating u-boot;if run update;" \
237 "then echo U-Boot updated;" \
238 "else echo Error updating u-boot !;" \
239 "echo Board without bootloader !!;" \
240 "fi;" \
241 "else echo U-Boot not downloaded..exiting;fi\0" \
242 "bootcmd=run net_nfs\0"
243
244
245#define CONFIG_CMD_SATA
246#ifdef CONFIG_CMD_SATA
247 #define CONFIG_DWC_AHSATA
248 #define CONFIG_SYS_SATA_MAX_DEVICE 1
249 #define CONFIG_DWC_AHSATA_PORT_ID 0
250 #define CONFIG_DWC_AHSATA_BASE_ADDR SATA_BASE_ADDR
251 #define CONFIG_LBA48
252 #define CONFIG_LIBATA
253#endif
254
255#endif /* __CONFIG_H */