blob: 82aee1513218245106b3dca6f443c72bdcfe2ea4 [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
Marek Vasute3f40722017-05-02 20:27:50 +020016#define CONFIG_BOARD_LATE_INIT
Marek Vasutc21c28b2016-02-11 14:13:38 +010017
18/*
Marek Vasutc21c28b2016-02-11 14:13:38 +010019 * Memory configurations
20 */
21#define CONFIG_NR_DRAM_BANKS 1
22#define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_DDRCS
23#define CONFIG_SYS_SDRAM_SIZE 0x10000000
24
25#ifdef CONFIG_SPL_BUILD
26#define CONFIG_SYS_INIT_SP_ADDR 0x210000
27#else
28#define CONFIG_SYS_INIT_SP_ADDR \
29 (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE)
30#endif
31
32/*
33 * Environment
34 */
Marek Vasutcc6f9de2017-05-02 20:27:48 +020035#define CONFIG_ENV_IS_IN_MMC
36#define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
37#define CONFIG_SYS_CONSOLE_ENV_OVERWRITE
Marek Vasutc21c28b2016-02-11 14:13:38 +010038#define CONFIG_ENV_SIZE 0x4000
Marek Vasutcc6f9de2017-05-02 20:27:48 +020039#define CONFIG_SYS_MMC_ENV_DEV 0 /* eMMC */
40#define CONFIG_ENV_OFFSET 512 /* just after the MBR */
Marek Vasutc21c28b2016-02-11 14:13:38 +010041
42/*
43 * U-Boot general configurations
44 */
Marek Vasutc21c28b2016-02-11 14:13:38 +010045
46/*
47 * Serial Driver
48 */
49#define CONFIG_ATMEL_USART
50#define CONFIG_USART_BASE ATMEL_BASE_USART0
51#define CONFIG_USART_ID ATMEL_ID_USART0
52
53/*
54 * Ethernet
55 */
56#ifdef CONFIG_CMD_NET
57#define CONFIG_MACB
58#define CONFIG_RMII
59#define CONFIG_NET_RETRY_COUNT 20
60#define CONFIG_MACB_SEARCH_PHY
61#define CONFIG_ARP_TIMEOUT 200UL
62#define CONFIG_IP_DEFRAG
63#endif
64
65/*
66 * LCD
67 */
68#ifdef CONFIG_LCD
Marek Vasutc21c28b2016-02-11 14:13:38 +010069#define CONFIG_BMP_16BPP
70#define CONFIG_BMP_24BPP
71#define CONFIG_BMP_32BPP
72#define LCD_BPP LCD_COLOR16
73#define LCD_OUTPUT_BPP 24
74#define CONFIG_ATMEL_HLCD
Marek Vasutc21c28b2016-02-11 14:13:38 +010075#endif
76
77/*
78 * SD/MMC
79 */
80#ifdef CONFIG_CMD_MMC
Marek Vasutc21c28b2016-02-11 14:13:38 +010081#define CONFIG_GENERIC_ATMEL_MCI
82#endif
83
84/*
85 * SPI NOR (boot memory)
86 */
87#ifdef CONFIG_CMD_SF
88#define CONFIG_ATMEL_SPI
89#define CONFIG_ATMEL_SPI0
90#define CONFIG_SPI_FLASH_ATMEL
91#define CONFIG_SF_DEFAULT_BUS 0
92#define CONFIG_SF_DEFAULT_CS 0
93#define CONFIG_SF_DEFAULT_SPEED 30000000
94#endif
95
96/*
97 * USB
98 */
99#ifdef CONFIG_CMD_USB
Marek Vasutc21c28b2016-02-11 14:13:38 +0100100#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
Marek Vasutc21c28b2016-02-11 14:13:38 +0100101
102/* USB device */
Marek Vasutc21c28b2016-02-11 14:13:38 +0100103#define CONFIG_USB_ETHER
104#define CONFIG_USB_ETH_RNDIS
Marek Vasutf1d56df2017-05-02 20:27:40 +0200105#define CONFIG_USBNET_MANUFACTURER "AriesEmbedded"
Marek Vasutcdc12ee2017-05-02 20:27:43 +0200106#define CONFIG_USB_FUNCTION_MASS_STORAGE
107#define CONFIG_SYS_DFU_DATA_BUF_SIZE (1 * 1024 * 1024)
108#define DFU_DEFAULT_POLL_TIMEOUT 300
Marek Vasutc21c28b2016-02-11 14:13:38 +0100109#endif
110
111/*
112 * Boot Linux
113 */
114#define CONFIG_CMDLINE_TAG
115#define CONFIG_INITRD_TAG
116#define CONFIG_SETUP_MEMORY_TAGS
Marek Vasutc21c28b2016-02-11 14:13:38 +0100117#define CONFIG_BOOTFILE "fitImage"
118#define CONFIG_BOOTARGS "console=ttyS3,115200"
119#define CONFIG_LOADADDR 0x20800000
120#define CONFIG_BOOTCOMMAND "run mmc_mmc"
121#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
Marek Vasutc21c28b2016-02-11 14:13:38 +0100122
123/*
124 * Extra Environments
125 */
126#define CONFIG_PREBOOT "run try_bootscript"
127#define CONFIG_HOSTNAME ma5d4evk
128
129#define CONFIG_EXTRA_ENV_SETTINGS \
130 "consdev=ttyS3\0" \
131 "baudrate=115200\0" \
132 "bootscript=boot.scr\0" \
Marek Vasut4425be32017-05-02 20:27:45 +0200133 "bootdev=/dev/mmcblk0p1\0" \
134 "bootpart=0:1\0" \
135 "rootdev=/dev/mmcblk0p2\0" \
Marek Vasutc21c28b2016-02-11 14:13:38 +0100136 "netdev=eth0\0" \
Marek Vasutcdc12ee2017-05-02 20:27:43 +0200137 "dfu_alt_info=mmc raw 0 3867148288\0" \
Marek Vasutc21c28b2016-02-11 14:13:38 +0100138 "kernel_addr_r=0x22000000\0" \
139 "update_spi_firmware_spl_addr=0x21000000\0" \
140 "update_spi_firmware_spl_filename=boot.bin\0" \
141 "update_spi_firmware_addr=0x22000000\0" \
142 "update_spi_firmware_filename=u-boot.img\0" \
143 "update_spi_firmware=" /* Update the SPI flash firmware */ \
144 "if sf probe ; then " \
145 "if tftp ${update_spi_firmware_spl_addr} " \
146 "${update_spi_firmware_spl_filename} ; then " \
147 "setenv update_spi_firmware_spl_filesize ${filesize} ; "\
148 "if tftp ${update_spi_firmware_addr} " \
149 "${update_spi_firmware_filename} ; then " \
150 "setenv update_spi_firmware_filesize ${filesize} ; " \
151 "sf update ${update_spi_firmware_spl_addr} 0x0 " \
152 "${update_spi_firmware_spl_filesize} ; " \
153 "sf update ${update_spi_firmware_addr} 0x10000 " \
154 "${update_spi_firmware_filesize} ; " \
155 "fi ; " \
156 "fi ; " \
157 "fi\0" \
158 "addcons=" \
159 "setenv bootargs ${bootargs} " \
160 "console=${consdev},${baudrate}\0" \
161 "addip=" \
162 "setenv bootargs ${bootargs} " \
163 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
164 "${netmask}:${hostname}:${netdev}:off\0" \
165 "addmisc=" \
166 "setenv bootargs ${bootargs} ${miscargs}\0" \
167 "addargs=run addcons addmisc\0" \
168 "mmcload=" \
169 "mmc rescan ; " \
170 "load mmc ${bootpart} ${kernel_addr_r} ${bootfile}\0" \
171 "netload=" \
172 "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \
173 "miscargs=nohlt panic=1\0" \
174 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
175 "nfsargs=" \
176 "setenv bootargs root=/dev/nfs rw " \
177 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
Marek Vasute3f40722017-05-02 20:27:50 +0200178 "fdtimg=if test ${bootmode} = \"sf\" ; then " \
179 "setenv kernel_fdt 1 ; " \
180 "else ; " \
181 "setenv kernel_fdt 2 ; " \
182 "fi\0" \
Marek Vasutc21c28b2016-02-11 14:13:38 +0100183 "mmc_mmc=" \
Marek Vasute3f40722017-05-02 20:27:50 +0200184 "run fdtimg mmcload mmcargs addargs ; " \
185 "bootm ${kernel_addr_r}:kernel@1 - ${kernel_addr_r}:fdt@${kernel_fdt}\0" \
Marek Vasutc21c28b2016-02-11 14:13:38 +0100186 "mmc_nfs=" \
Marek Vasute3f40722017-05-02 20:27:50 +0200187 "run fdtimg mmcload nfsargs addip addargs ; " \
188 "bootm ${kernel_addr_r}:kernel@1 - ${kernel_addr_r}:fdt@${kernel_fdt}\0" \
Marek Vasutc21c28b2016-02-11 14:13:38 +0100189 "net_mmc=" \
Marek Vasute3f40722017-05-02 20:27:50 +0200190 "run fdtimg netload mmcargs addargs ; " \
191 "bootm ${kernel_addr_r}:kernel@1 - ${kernel_addr_r}:fdt@${kernel_fdt}\0" \
Marek Vasutc21c28b2016-02-11 14:13:38 +0100192 "net_nfs=" \
Marek Vasute3f40722017-05-02 20:27:50 +0200193 "run fdtimg netload nfsargs addip addargs ; " \
194 "bootm ${kernel_addr_r}:kernel@1 - ${kernel_addr_r}:fdt@${kernel_fdt}\0" \
Marek Vasutc21c28b2016-02-11 14:13:38 +0100195 "try_bootscript=" \
196 "mmc rescan;" \
Marek Vasut4425be32017-05-02 20:27:45 +0200197 "if test -e mmc 1:1 ${bootscript} ; then " \
198 "if load mmc 1:1 ${kernel_addr_r} ${bootscript};" \
Marek Vasutc21c28b2016-02-11 14:13:38 +0100199 "then ; " \
200 "echo Running bootscript... ; " \
201 "source ${kernel_addr_r} ; " \
202 "fi ; " \
203 "fi\0"
204/* SPL */
205#define CONFIG_SPL_FRAMEWORK
206#define CONFIG_SPL_TEXT_BASE 0x200000
207#define CONFIG_SPL_MAX_SIZE 0x10000
208#define CONFIG_SPL_BSS_START_ADDR 0x20000000
209#define CONFIG_SPL_BSS_MAX_SIZE 0x80000
210#define CONFIG_SYS_SPL_MALLOC_START 0x20080000
211#define CONFIG_SYS_SPL_MALLOC_SIZE 0x80000
212
Marek Vasutc21c28b2016-02-11 14:13:38 +0100213#define CONFIG_SYS_MONITOR_LEN (512 << 10)
214
Marek Vasutc21c28b2016-02-11 14:13:38 +0100215#define CONFIG_SPL_SPI_LOAD
216#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x10000
217
Marek Vasut4e843832017-05-02 20:27:46 +0200218#define CONFIG_SYS_USE_MMC
219#define CONFIG_SPL_LDSCRIPT arch/arm/mach-at91/armv7/u-boot-spl.lds
220#define CONFIG_SPL_MMC_SUPPORT
221#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
222#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
223#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
224#define CONFIG_SPL_FAT_SUPPORT
225#define CONFIG_SPL_LIBDISK_SUPPORT
226
Marek Vasutc21c28b2016-02-11 14:13:38 +0100227#endif /* __MA5D4EVK_CONFIG_H__ */