blob: e061a101aee6299fc371e334e61f5bd4958b16a3 [file] [log] [blame]
Marek Vasutc21c28b2016-02-11 14:13:38 +01001/*
2 * DENX MA5D4 configuration
3 * Copyright (C) 2015 Marek Vasut <marex@denx.de>
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8#ifndef __MA5D4EVK_CONFIG_H__
9#define __MA5D4EVK_CONFIG_H__
10
11#define CONFIG_SYS_NO_FLASH
12
Marek Vasutc21c28b2016-02-11 14:13:38 +010013#define CONFIG_TIMESTAMP /* Print image info with timestamp */
14
15#include "at91-sama5_common.h"
16#undef CONFIG_BOOTARGS
17#define CONFIG_SYS_USE_SERIALFLASH 1
18
19/*
20 * U-Boot Commands
21 */
22#define CONFIG_DOS_PARTITION
23#define CONFIG_FAT_WRITE
24/*#define CONFIG_LCD*/
25
26#define CONFIG_CMD_ASKENV
27#define CONFIG_CMD_CACHE
28#define CONFIG_CMD_DHCP
29#define CONFIG_CMD_EXT4
30#define CONFIG_CMD_EXT4_WRITE
31#define CONFIG_CMD_FAT
32#define CONFIG_CMD_FS_GENERIC
33#define CONFIG_CMD_GREPENV
34#define CONFIG_CMD_MII
35#define CONFIG_CMD_MMC
36#define CONFIG_CMD_PING
37#define CONFIG_CMD_SF
38#define CONFIG_CMD_USB
39
40/*
41 * Memory configurations
42 */
43#define CONFIG_NR_DRAM_BANKS 1
44#define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_DDRCS
45#define CONFIG_SYS_SDRAM_SIZE 0x10000000
46
47#ifdef CONFIG_SPL_BUILD
48#define CONFIG_SYS_INIT_SP_ADDR 0x210000
49#else
50#define CONFIG_SYS_INIT_SP_ADDR \
51 (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE)
52#endif
53
54/*
55 * Environment
56 */
57#define CONFIG_ENV_IS_IN_SPI_FLASH
58#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
59#define CONFIG_ENV_OFFSET 0x8000
60#define CONFIG_ENV_SIZE 0x4000
61#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
62#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
63#define CONFIG_ENV_SECT_SIZE 0x1000
64
65/*
66 * U-Boot general configurations
67 */
68#define CONFIG_VERSION_VARIABLE /* U-BOOT version */
69
70/*
71 * Serial Driver
72 */
73#define CONFIG_ATMEL_USART
74#define CONFIG_USART_BASE ATMEL_BASE_USART0
75#define CONFIG_USART_ID ATMEL_ID_USART0
76
77/*
78 * Ethernet
79 */
80#ifdef CONFIG_CMD_NET
81#define CONFIG_MACB
82#define CONFIG_RMII
83#define CONFIG_NET_RETRY_COUNT 20
84#define CONFIG_MACB_SEARCH_PHY
85#define CONFIG_ARP_TIMEOUT 200UL
86#define CONFIG_IP_DEFRAG
87#endif
88
89/*
90 * LCD
91 */
92#ifdef CONFIG_LCD
93#define CONFIG_CMD_BMP
94#define CONFIG_BMP_16BPP
95#define CONFIG_BMP_24BPP
96#define CONFIG_BMP_32BPP
97#define LCD_BPP LCD_COLOR16
98#define LCD_OUTPUT_BPP 24
99#define CONFIG_ATMEL_HLCD
100#define CONFIG_SYS_CONSOLE_IS_IN_ENV
101#endif
102
103/*
104 * SD/MMC
105 */
106#ifdef CONFIG_CMD_MMC
107#define CONFIG_MMC
108#define CONFIG_GENERIC_MMC
109#define CONFIG_GENERIC_ATMEL_MCI
110#endif
111
112/*
113 * SPI NOR (boot memory)
114 */
115#ifdef CONFIG_CMD_SF
116#define CONFIG_ATMEL_SPI
117#define CONFIG_ATMEL_SPI0
118#define CONFIG_SPI_FLASH_ATMEL
119#define CONFIG_SF_DEFAULT_BUS 0
120#define CONFIG_SF_DEFAULT_CS 0
121#define CONFIG_SF_DEFAULT_SPEED 30000000
122#endif
123
124/*
125 * USB
126 */
127#ifdef CONFIG_CMD_USB
128#define CONFIG_USB_EHCI
129#define CONFIG_USB_EHCI_ATMEL
130#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
131#define CONFIG_USB_STORAGE
132
133/* USB device */
Marek Vasutc21c28b2016-02-11 14:13:38 +0100134#define CONFIG_USB_GADGET_DUALSPEED
135#define CONFIG_USB_GADGET_ATMEL_USBA
136#define CONFIG_USB_ETHER
137#define CONFIG_USB_ETH_RNDIS
138#define CONFIG_USBNET_MANUFACTURER "DENX"
139#endif
140
141/*
142 * Boot Linux
143 */
144#define CONFIG_CMDLINE_TAG
145#define CONFIG_INITRD_TAG
146#define CONFIG_SETUP_MEMORY_TAGS
147#define CONFIG_BOOTDELAY 3
148#define CONFIG_BOOTFILE "fitImage"
149#define CONFIG_BOOTARGS "console=ttyS3,115200"
150#define CONFIG_LOADADDR 0x20800000
151#define CONFIG_BOOTCOMMAND "run mmc_mmc"
152#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
153#define CONFIG_OF_LIBFDT
154
155/*
156 * Extra Environments
157 */
158#define CONFIG_PREBOOT "run try_bootscript"
159#define CONFIG_HOSTNAME ma5d4evk
160
161#define CONFIG_EXTRA_ENV_SETTINGS \
162 "consdev=ttyS3\0" \
163 "baudrate=115200\0" \
164 "bootscript=boot.scr\0" \
165 "bootdev=/dev/mmcblk1p1\0" \
166 "bootpart=1:1\0" \
167 "rootdev=/dev/mmcblk1p2\0" \
168 "netdev=eth0\0" \
169 "kernel_addr_r=0x22000000\0" \
170 "update_spi_firmware_spl_addr=0x21000000\0" \
171 "update_spi_firmware_spl_filename=boot.bin\0" \
172 "update_spi_firmware_addr=0x22000000\0" \
173 "update_spi_firmware_filename=u-boot.img\0" \
174 "update_spi_firmware=" /* Update the SPI flash firmware */ \
175 "if sf probe ; then " \
176 "if tftp ${update_spi_firmware_spl_addr} " \
177 "${update_spi_firmware_spl_filename} ; then " \
178 "setenv update_spi_firmware_spl_filesize ${filesize} ; "\
179 "if tftp ${update_spi_firmware_addr} " \
180 "${update_spi_firmware_filename} ; then " \
181 "setenv update_spi_firmware_filesize ${filesize} ; " \
182 "sf update ${update_spi_firmware_spl_addr} 0x0 " \
183 "${update_spi_firmware_spl_filesize} ; " \
184 "sf update ${update_spi_firmware_addr} 0x10000 " \
185 "${update_spi_firmware_filesize} ; " \
186 "fi ; " \
187 "fi ; " \
188 "fi\0" \
189 "addcons=" \
190 "setenv bootargs ${bootargs} " \
191 "console=${consdev},${baudrate}\0" \
192 "addip=" \
193 "setenv bootargs ${bootargs} " \
194 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
195 "${netmask}:${hostname}:${netdev}:off\0" \
196 "addmisc=" \
197 "setenv bootargs ${bootargs} ${miscargs}\0" \
198 "addargs=run addcons addmisc\0" \
199 "mmcload=" \
200 "mmc rescan ; " \
201 "load mmc ${bootpart} ${kernel_addr_r} ${bootfile}\0" \
202 "netload=" \
203 "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \
204 "miscargs=nohlt panic=1\0" \
205 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
206 "nfsargs=" \
207 "setenv bootargs root=/dev/nfs rw " \
208 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
209 "mmc_mmc=" \
210 "run mmcload mmcargs addargs ; " \
211 "bootm ${kernel_addr_r}\0" \
212 "mmc_nfs=" \
213 "run mmcload nfsargs addip addargs ; " \
214 "bootm ${kernel_addr_r}\0" \
215 "net_mmc=" \
216 "run netload mmcargs addargs ; " \
217 "bootm ${kernel_addr_r}\0" \
218 "net_nfs=" \
219 "run netload nfsargs addip addargs ; " \
220 "bootm ${kernel_addr_r}\0" \
221 "try_bootscript=" \
222 "mmc rescan;" \
223 "if test -e mmc ${bootpart} ${bootscript} ; then " \
224 "if load mmc ${bootpart} ${kernel_addr_r} ${bootscript};"\
225 "then ; " \
226 "echo Running bootscript... ; " \
227 "source ${kernel_addr_r} ; " \
228 "fi ; " \
229 "fi\0"
230/* SPL */
231#define CONFIG_SPL_FRAMEWORK
232#define CONFIG_SPL_TEXT_BASE 0x200000
233#define CONFIG_SPL_MAX_SIZE 0x10000
234#define CONFIG_SPL_BSS_START_ADDR 0x20000000
235#define CONFIG_SPL_BSS_MAX_SIZE 0x80000
236#define CONFIG_SYS_SPL_MALLOC_START 0x20080000
237#define CONFIG_SYS_SPL_MALLOC_SIZE 0x80000
238
239#define CONFIG_SPL_LIBCOMMON_SUPPORT
240#define CONFIG_SPL_LIBGENERIC_SUPPORT
241#define CONFIG_SPL_GPIO_SUPPORT
242#define CONFIG_SPL_SERIAL_SUPPORT
243
244#define CONFIG_SPL_BOARD_INIT
245#define CONFIG_SYS_MONITOR_LEN (512 << 10)
246
247#define CONFIG_SPL_SPI_SUPPORT
248#define CONFIG_SPL_SPI_FLASH_SUPPORT
249#define CONFIG_SPL_SPI_LOAD
250#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x10000
251
252#endif /* __MA5D4EVK_CONFIG_H__ */