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