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