blob: 5e3d6e80a87b1ca0e9444ab1a4ed3d6ecf6646eb [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Marek Vasutc21c28b2016-02-11 14:13:38 +01002/*
Marek Vasutf1d56df2017-05-02 20:27:40 +02003 * Aries MA5D4 configuration
Marek Vasutc21c28b2016-02-11 14:13:38 +01004 * Copyright (C) 2015 Marek Vasut <marex@denx.de>
Marek Vasutc21c28b2016-02-11 14:13:38 +01005 */
6
7#ifndef __MA5D4EVK_CONFIG_H__
8#define __MA5D4EVK_CONFIG_H__
9
Marek Vasutc21c28b2016-02-11 14:13:38 +010010#define CONFIG_TIMESTAMP /* Print image info with timestamp */
11
12#include "at91-sama5_common.h"
Marek Vasutc21c28b2016-02-11 14:13:38 +010013#define CONFIG_SYS_USE_SERIALFLASH 1
Marek Vasute3f40722017-05-02 20:27:50 +020014#define CONFIG_BOARD_LATE_INIT
Marek Vasutc21c28b2016-02-11 14:13:38 +010015
Wenyou Yange61ed482017-09-14 11:07:42 +080016/* Timer */
17#define CONFIG_SYS_TIMER_COUNTER 0xfc06863c
18
Marek Vasutc21c28b2016-02-11 14:13:38 +010019/*
Marek Vasutc21c28b2016-02-11 14:13:38 +010020 * Memory configurations
21 */
22#define CONFIG_NR_DRAM_BANKS 1
Wenyou Yange61ed482017-09-14 11:07:42 +080023#define CONFIG_SYS_SDRAM_BASE 0x20000000
Marek Vasutc21c28b2016-02-11 14:13:38 +010024#define CONFIG_SYS_SDRAM_SIZE 0x10000000
25
26#ifdef CONFIG_SPL_BUILD
27#define CONFIG_SYS_INIT_SP_ADDR 0x210000
28#else
29#define CONFIG_SYS_INIT_SP_ADDR \
30 (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE)
31#endif
32
33/*
34 * Environment
35 */
Marek Vasutcc6f9de2017-05-02 20:27:48 +020036#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
Wenyou Yange61ed482017-09-14 11:07:42 +080050#define CONFIG_USART_BASE 0xf802c000
51#define CONFIG_USART_ID 6
Marek Vasutc21c28b2016-02-11 14:13:38 +010052
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
Tom Rinie80fa2c2018-04-07 09:15:50 -040088#define CONFIG_ATMEL_SPI0
Marek Vasutc21c28b2016-02-11 14:13:38 +010089#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
100/* USB device */
Marek Vasutcdc12ee2017-05-02 20:27:43 +0200101#define CONFIG_SYS_DFU_DATA_BUF_SIZE (1 * 1024 * 1024)
102#define DFU_DEFAULT_POLL_TIMEOUT 300
Marek Vasutc21c28b2016-02-11 14:13:38 +0100103#endif
104
105/*
106 * Boot Linux
107 */
108#define CONFIG_CMDLINE_TAG
109#define CONFIG_INITRD_TAG
110#define CONFIG_SETUP_MEMORY_TAGS
Marek Vasutc21c28b2016-02-11 14:13:38 +0100111#define CONFIG_BOOTFILE "fitImage"
Marek Vasutc21c28b2016-02-11 14:13:38 +0100112#define CONFIG_LOADADDR 0x20800000
113#define CONFIG_BOOTCOMMAND "run mmc_mmc"
114#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
Marek Vasutc21c28b2016-02-11 14:13:38 +0100115
116/*
117 * Extra Environments
118 */
119#define CONFIG_PREBOOT "run try_bootscript"
Mario Six5bc05432018-03-28 14:38:20 +0200120#define CONFIG_HOSTNAME "ma5d4evk"
Marek Vasutc21c28b2016-02-11 14:13:38 +0100121
122#define CONFIG_EXTRA_ENV_SETTINGS \
123 "consdev=ttyS3\0" \
124 "baudrate=115200\0" \
125 "bootscript=boot.scr\0" \
Marek Vasut4425be32017-05-02 20:27:45 +0200126 "bootdev=/dev/mmcblk0p1\0" \
127 "bootpart=0:1\0" \
128 "rootdev=/dev/mmcblk0p2\0" \
Marek Vasutc21c28b2016-02-11 14:13:38 +0100129 "netdev=eth0\0" \
Marek Vasutcdc12ee2017-05-02 20:27:43 +0200130 "dfu_alt_info=mmc raw 0 3867148288\0" \
Marek Vasutc21c28b2016-02-11 14:13:38 +0100131 "kernel_addr_r=0x22000000\0" \
132 "update_spi_firmware_spl_addr=0x21000000\0" \
133 "update_spi_firmware_spl_filename=boot.bin\0" \
134 "update_spi_firmware_addr=0x22000000\0" \
135 "update_spi_firmware_filename=u-boot.img\0" \
136 "update_spi_firmware=" /* Update the SPI flash firmware */ \
137 "if sf probe ; then " \
138 "if tftp ${update_spi_firmware_spl_addr} " \
139 "${update_spi_firmware_spl_filename} ; then " \
140 "setenv update_spi_firmware_spl_filesize ${filesize} ; "\
141 "if tftp ${update_spi_firmware_addr} " \
142 "${update_spi_firmware_filename} ; then " \
143 "setenv update_spi_firmware_filesize ${filesize} ; " \
144 "sf update ${update_spi_firmware_spl_addr} 0x0 " \
145 "${update_spi_firmware_spl_filesize} ; " \
146 "sf update ${update_spi_firmware_addr} 0x10000 " \
147 "${update_spi_firmware_filesize} ; " \
148 "fi ; " \
149 "fi ; " \
150 "fi\0" \
151 "addcons=" \
152 "setenv bootargs ${bootargs} " \
153 "console=${consdev},${baudrate}\0" \
154 "addip=" \
155 "setenv bootargs ${bootargs} " \
156 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
157 "${netmask}:${hostname}:${netdev}:off\0" \
158 "addmisc=" \
159 "setenv bootargs ${bootargs} ${miscargs}\0" \
160 "addargs=run addcons addmisc\0" \
161 "mmcload=" \
162 "mmc rescan ; " \
163 "load mmc ${bootpart} ${kernel_addr_r} ${bootfile}\0" \
164 "netload=" \
165 "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \
166 "miscargs=nohlt panic=1\0" \
167 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
168 "nfsargs=" \
169 "setenv bootargs root=/dev/nfs rw " \
170 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
Marek Vasute3f40722017-05-02 20:27:50 +0200171 "fdtimg=if test ${bootmode} = \"sf\" ; then " \
172 "setenv kernel_fdt 1 ; " \
173 "else ; " \
174 "setenv kernel_fdt 2 ; " \
175 "fi\0" \
Marek Vasutc21c28b2016-02-11 14:13:38 +0100176 "mmc_mmc=" \
Marek Vasute3f40722017-05-02 20:27:50 +0200177 "run fdtimg mmcload mmcargs addargs ; " \
178 "bootm ${kernel_addr_r}:kernel@1 - ${kernel_addr_r}:fdt@${kernel_fdt}\0" \
Marek Vasutc21c28b2016-02-11 14:13:38 +0100179 "mmc_nfs=" \
Marek Vasute3f40722017-05-02 20:27:50 +0200180 "run fdtimg mmcload nfsargs addip addargs ; " \
181 "bootm ${kernel_addr_r}:kernel@1 - ${kernel_addr_r}:fdt@${kernel_fdt}\0" \
Marek Vasutc21c28b2016-02-11 14:13:38 +0100182 "net_mmc=" \
Marek Vasute3f40722017-05-02 20:27:50 +0200183 "run fdtimg netload mmcargs addargs ; " \
184 "bootm ${kernel_addr_r}:kernel@1 - ${kernel_addr_r}:fdt@${kernel_fdt}\0" \
Marek Vasutc21c28b2016-02-11 14:13:38 +0100185 "net_nfs=" \
Marek Vasute3f40722017-05-02 20:27:50 +0200186 "run fdtimg netload nfsargs addip addargs ; " \
187 "bootm ${kernel_addr_r}:kernel@1 - ${kernel_addr_r}:fdt@${kernel_fdt}\0" \
Marek Vasutc21c28b2016-02-11 14:13:38 +0100188 "try_bootscript=" \
189 "mmc rescan;" \
Marek Vasut4425be32017-05-02 20:27:45 +0200190 "if test -e mmc 1:1 ${bootscript} ; then " \
191 "if load mmc 1:1 ${kernel_addr_r} ${bootscript};" \
Marek Vasutc21c28b2016-02-11 14:13:38 +0100192 "then ; " \
193 "echo Running bootscript... ; " \
194 "source ${kernel_addr_r} ; " \
195 "fi ; " \
196 "fi\0"
197/* SPL */
Marek Vasutc21c28b2016-02-11 14:13:38 +0100198#define CONFIG_SPL_TEXT_BASE 0x200000
199#define CONFIG_SPL_MAX_SIZE 0x10000
200#define CONFIG_SPL_BSS_START_ADDR 0x20000000
201#define CONFIG_SPL_BSS_MAX_SIZE 0x80000
202#define CONFIG_SYS_SPL_MALLOC_START 0x20080000
203#define CONFIG_SYS_SPL_MALLOC_SIZE 0x80000
204
Marek Vasutc21c28b2016-02-11 14:13:38 +0100205#define CONFIG_SYS_MONITOR_LEN (512 << 10)
206
Marek Vasutc21c28b2016-02-11 14:13:38 +0100207#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x10000
208
Marek Vasut4e843832017-05-02 20:27:46 +0200209#define CONFIG_SYS_USE_MMC
Marek Vasut4e843832017-05-02 20:27:46 +0200210#define CONFIG_SPL_MMC_SUPPORT
211#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
212#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
213#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
214#define CONFIG_SPL_FAT_SUPPORT
215#define CONFIG_SPL_LIBDISK_SUPPORT
216
Marek Vasutc21c28b2016-02-11 14:13:38 +0100217#endif /* __MA5D4EVK_CONFIG_H__ */