blob: c2f918214d1c8250c0c1ada60206848a8632f576 [file] [log] [blame]
Marek Vasutc21c28b2016-02-11 14:13:38 +01001/*
Marek Vasutf1d56df2017-05-02 20:27:40 +02002 * Aries MA5D4 configuration
Marek Vasutc21c28b2016-02-11 14:13:38 +01003 * 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
Marek Vasutc21c28b2016-02-11 14:13:38 +010011#define CONFIG_TIMESTAMP /* Print image info with timestamp */
12
13#include "at91-sama5_common.h"
14#undef CONFIG_BOOTARGS
15#define CONFIG_SYS_USE_SERIALFLASH 1
16
17/*
Marek Vasutc21c28b2016-02-11 14:13:38 +010018 * Memory configurations
19 */
20#define CONFIG_NR_DRAM_BANKS 1
21#define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_DDRCS
22#define CONFIG_SYS_SDRAM_SIZE 0x10000000
23
24#ifdef CONFIG_SPL_BUILD
25#define CONFIG_SYS_INIT_SP_ADDR 0x210000
26#else
27#define CONFIG_SYS_INIT_SP_ADDR \
28 (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE)
29#endif
30
31/*
32 * Environment
33 */
Marek Vasutcc6f9de2017-05-02 20:27:48 +020034#define CONFIG_ENV_IS_IN_MMC
35#define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
36#define CONFIG_SYS_CONSOLE_ENV_OVERWRITE
Marek Vasutc21c28b2016-02-11 14:13:38 +010037#define CONFIG_ENV_SIZE 0x4000
Marek Vasutcc6f9de2017-05-02 20:27:48 +020038#define CONFIG_SYS_MMC_ENV_DEV 0 /* eMMC */
39#define CONFIG_ENV_OFFSET 512 /* just after the MBR */
Marek Vasutc21c28b2016-02-11 14:13:38 +010040
41/*
42 * U-Boot general configurations
43 */
Marek Vasutc21c28b2016-02-11 14:13:38 +010044
45/*
46 * Serial Driver
47 */
48#define CONFIG_ATMEL_USART
49#define CONFIG_USART_BASE ATMEL_BASE_USART0
50#define CONFIG_USART_ID ATMEL_ID_USART0
51
52/*
53 * Ethernet
54 */
55#ifdef CONFIG_CMD_NET
56#define CONFIG_MACB
57#define CONFIG_RMII
58#define CONFIG_NET_RETRY_COUNT 20
59#define CONFIG_MACB_SEARCH_PHY
60#define CONFIG_ARP_TIMEOUT 200UL
61#define CONFIG_IP_DEFRAG
62#endif
63
64/*
65 * LCD
66 */
67#ifdef CONFIG_LCD
Marek Vasutc21c28b2016-02-11 14:13:38 +010068#define CONFIG_BMP_16BPP
69#define CONFIG_BMP_24BPP
70#define CONFIG_BMP_32BPP
71#define LCD_BPP LCD_COLOR16
72#define LCD_OUTPUT_BPP 24
73#define CONFIG_ATMEL_HLCD
Marek Vasutc21c28b2016-02-11 14:13:38 +010074#endif
75
76/*
77 * SD/MMC
78 */
79#ifdef CONFIG_CMD_MMC
Marek Vasutc21c28b2016-02-11 14:13:38 +010080#define CONFIG_GENERIC_ATMEL_MCI
81#endif
82
83/*
84 * SPI NOR (boot memory)
85 */
86#ifdef CONFIG_CMD_SF
87#define CONFIG_ATMEL_SPI
88#define CONFIG_ATMEL_SPI0
89#define CONFIG_SPI_FLASH_ATMEL
90#define CONFIG_SF_DEFAULT_BUS 0
91#define CONFIG_SF_DEFAULT_CS 0
92#define CONFIG_SF_DEFAULT_SPEED 30000000
93#endif
94
95/*
96 * USB
97 */
98#ifdef CONFIG_CMD_USB
Marek Vasutc21c28b2016-02-11 14:13:38 +010099#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
Marek Vasutc21c28b2016-02-11 14:13:38 +0100100
101/* USB device */
Marek Vasutc21c28b2016-02-11 14:13:38 +0100102#define CONFIG_USB_ETHER
103#define CONFIG_USB_ETH_RNDIS
Marek Vasutf1d56df2017-05-02 20:27:40 +0200104#define CONFIG_USBNET_MANUFACTURER "AriesEmbedded"
Marek Vasutcdc12ee2017-05-02 20:27:43 +0200105#define CONFIG_USB_FUNCTION_MASS_STORAGE
106#define CONFIG_SYS_DFU_DATA_BUF_SIZE (1 * 1024 * 1024)
107#define DFU_DEFAULT_POLL_TIMEOUT 300
Marek Vasutc21c28b2016-02-11 14:13:38 +0100108#endif
109
110/*
111 * Boot Linux
112 */
113#define CONFIG_CMDLINE_TAG
114#define CONFIG_INITRD_TAG
115#define CONFIG_SETUP_MEMORY_TAGS
Marek Vasutc21c28b2016-02-11 14:13:38 +0100116#define CONFIG_BOOTFILE "fitImage"
117#define CONFIG_BOOTARGS "console=ttyS3,115200"
118#define CONFIG_LOADADDR 0x20800000
119#define CONFIG_BOOTCOMMAND "run mmc_mmc"
120#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
Marek Vasutc21c28b2016-02-11 14:13:38 +0100121
122/*
123 * Extra Environments
124 */
125#define CONFIG_PREBOOT "run try_bootscript"
126#define CONFIG_HOSTNAME ma5d4evk
127
128#define CONFIG_EXTRA_ENV_SETTINGS \
129 "consdev=ttyS3\0" \
130 "baudrate=115200\0" \
131 "bootscript=boot.scr\0" \
Marek Vasut4425be32017-05-02 20:27:45 +0200132 "bootdev=/dev/mmcblk0p1\0" \
133 "bootpart=0:1\0" \
134 "rootdev=/dev/mmcblk0p2\0" \
Marek Vasutc21c28b2016-02-11 14:13:38 +0100135 "netdev=eth0\0" \
Marek Vasutcdc12ee2017-05-02 20:27:43 +0200136 "dfu_alt_info=mmc raw 0 3867148288\0" \
Marek Vasutc21c28b2016-02-11 14:13:38 +0100137 "kernel_addr_r=0x22000000\0" \
138 "update_spi_firmware_spl_addr=0x21000000\0" \
139 "update_spi_firmware_spl_filename=boot.bin\0" \
140 "update_spi_firmware_addr=0x22000000\0" \
141 "update_spi_firmware_filename=u-boot.img\0" \
142 "update_spi_firmware=" /* Update the SPI flash firmware */ \
143 "if sf probe ; then " \
144 "if tftp ${update_spi_firmware_spl_addr} " \
145 "${update_spi_firmware_spl_filename} ; then " \
146 "setenv update_spi_firmware_spl_filesize ${filesize} ; "\
147 "if tftp ${update_spi_firmware_addr} " \
148 "${update_spi_firmware_filename} ; then " \
149 "setenv update_spi_firmware_filesize ${filesize} ; " \
150 "sf update ${update_spi_firmware_spl_addr} 0x0 " \
151 "${update_spi_firmware_spl_filesize} ; " \
152 "sf update ${update_spi_firmware_addr} 0x10000 " \
153 "${update_spi_firmware_filesize} ; " \
154 "fi ; " \
155 "fi ; " \
156 "fi\0" \
157 "addcons=" \
158 "setenv bootargs ${bootargs} " \
159 "console=${consdev},${baudrate}\0" \
160 "addip=" \
161 "setenv bootargs ${bootargs} " \
162 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
163 "${netmask}:${hostname}:${netdev}:off\0" \
164 "addmisc=" \
165 "setenv bootargs ${bootargs} ${miscargs}\0" \
166 "addargs=run addcons addmisc\0" \
167 "mmcload=" \
168 "mmc rescan ; " \
169 "load mmc ${bootpart} ${kernel_addr_r} ${bootfile}\0" \
170 "netload=" \
171 "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \
172 "miscargs=nohlt panic=1\0" \
173 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
174 "nfsargs=" \
175 "setenv bootargs root=/dev/nfs rw " \
176 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
177 "mmc_mmc=" \
178 "run mmcload mmcargs addargs ; " \
179 "bootm ${kernel_addr_r}\0" \
180 "mmc_nfs=" \
181 "run mmcload nfsargs addip addargs ; " \
182 "bootm ${kernel_addr_r}\0" \
183 "net_mmc=" \
184 "run netload mmcargs addargs ; " \
185 "bootm ${kernel_addr_r}\0" \
186 "net_nfs=" \
187 "run netload nfsargs addip addargs ; " \
188 "bootm ${kernel_addr_r}\0" \
189 "try_bootscript=" \
190 "mmc rescan;" \
Marek Vasut4425be32017-05-02 20:27:45 +0200191 "if test -e mmc 1:1 ${bootscript} ; then " \
192 "if load mmc 1:1 ${kernel_addr_r} ${bootscript};" \
Marek Vasutc21c28b2016-02-11 14:13:38 +0100193 "then ; " \
194 "echo Running bootscript... ; " \
195 "source ${kernel_addr_r} ; " \
196 "fi ; " \
197 "fi\0"
198/* SPL */
199#define CONFIG_SPL_FRAMEWORK
200#define CONFIG_SPL_TEXT_BASE 0x200000
201#define CONFIG_SPL_MAX_SIZE 0x10000
202#define CONFIG_SPL_BSS_START_ADDR 0x20000000
203#define CONFIG_SPL_BSS_MAX_SIZE 0x80000
204#define CONFIG_SYS_SPL_MALLOC_START 0x20080000
205#define CONFIG_SYS_SPL_MALLOC_SIZE 0x80000
206
Marek Vasutc21c28b2016-02-11 14:13:38 +0100207#define CONFIG_SYS_MONITOR_LEN (512 << 10)
208
Marek Vasutc21c28b2016-02-11 14:13:38 +0100209#define CONFIG_SPL_SPI_LOAD
210#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x10000
211
Marek Vasut4e843832017-05-02 20:27:46 +0200212#define CONFIG_SYS_USE_MMC
213#define CONFIG_SPL_LDSCRIPT arch/arm/mach-at91/armv7/u-boot-spl.lds
214#define CONFIG_SPL_MMC_SUPPORT
215#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
216#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
217#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
218#define CONFIG_SPL_FAT_SUPPORT
219#define CONFIG_SPL_LIBDISK_SUPPORT
220
Marek Vasutc21c28b2016-02-11 14:13:38 +0100221#endif /* __MA5D4EVK_CONFIG_H__ */