1
2
3
4
5
6
7
8#ifndef __MA5D4EVK_CONFIG_H__
9#define __MA5D4EVK_CONFIG_H__
10
11#define CONFIG_TIMESTAMP
12
13#include "at91-sama5_common.h"
14#define CONFIG_SYS_USE_SERIALFLASH 1
15#define CONFIG_BOARD_LATE_INIT
16
17
18#define CONFIG_SYS_TIMER_COUNTER 0xfc06863c
19
20
21
22
23#define CONFIG_NR_DRAM_BANKS 1
24#define CONFIG_SYS_SDRAM_BASE 0x20000000
25#define CONFIG_SYS_SDRAM_SIZE 0x10000000
26
27#ifdef CONFIG_SPL_BUILD
28#define CONFIG_SYS_INIT_SP_ADDR 0x210000
29#else
30#define CONFIG_SYS_INIT_SP_ADDR \
31 (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE)
32#endif
33
34
35
36
37#define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
38#define CONFIG_SYS_CONSOLE_ENV_OVERWRITE
39#define CONFIG_ENV_SIZE 0x4000
40#define CONFIG_SYS_MMC_ENV_DEV 0
41#define CONFIG_ENV_OFFSET 512
42
43
44
45
46
47
48
49
50#define CONFIG_ATMEL_USART
51#define CONFIG_USART_BASE 0xf802c000
52#define CONFIG_USART_ID 6
53
54
55
56
57#ifdef CONFIG_CMD_NET
58#define CONFIG_MACB
59#define CONFIG_RMII
60#define CONFIG_NET_RETRY_COUNT 20
61#define CONFIG_MACB_SEARCH_PHY
62#define CONFIG_ARP_TIMEOUT 200UL
63#define CONFIG_IP_DEFRAG
64#endif
65
66
67
68
69#ifdef CONFIG_LCD
70#define CONFIG_BMP_16BPP
71#define CONFIG_BMP_24BPP
72#define CONFIG_BMP_32BPP
73#define LCD_BPP LCD_COLOR16
74#define LCD_OUTPUT_BPP 24
75#define CONFIG_ATMEL_HLCD
76#endif
77
78
79
80
81#ifdef CONFIG_CMD_MMC
82#define CONFIG_GENERIC_ATMEL_MCI
83#endif
84
85
86
87
88#ifdef CONFIG_CMD_SF
89#define CONFIG_ATMEL_SPI
90#define CONFIG_ATMEL_SPI0
91#define CONFIG_SPI_FLASH_ATMEL
92#define CONFIG_SF_DEFAULT_BUS 0
93#define CONFIG_SF_DEFAULT_CS 0
94#define CONFIG_SF_DEFAULT_SPEED 30000000
95#endif
96
97
98
99
100#ifdef CONFIG_CMD_USB
101
102
103#define CONFIG_SYS_DFU_DATA_BUF_SIZE (1 * 1024 * 1024)
104#define DFU_DEFAULT_POLL_TIMEOUT 300
105#endif
106
107
108
109
110#define CONFIG_CMDLINE_TAG
111#define CONFIG_INITRD_TAG
112#define CONFIG_SETUP_MEMORY_TAGS
113#define CONFIG_BOOTFILE "fitImage"
114#define CONFIG_LOADADDR 0x20800000
115#define CONFIG_BOOTCOMMAND "run mmc_mmc"
116#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
117
118
119
120
121#define CONFIG_PREBOOT "run try_bootscript"
122#define CONFIG_HOSTNAME ma5d4evk
123
124#define CONFIG_EXTRA_ENV_SETTINGS \
125 "consdev=ttyS3\0" \
126 "baudrate=115200\0" \
127 "bootscript=boot.scr\0" \
128 "bootdev=/dev/mmcblk0p1\0" \
129 "bootpart=0:1\0" \
130 "rootdev=/dev/mmcblk0p2\0" \
131 "netdev=eth0\0" \
132 "dfu_alt_info=mmc raw 0 3867148288\0" \
133 "kernel_addr_r=0x22000000\0" \
134 "update_spi_firmware_spl_addr=0x21000000\0" \
135 "update_spi_firmware_spl_filename=boot.bin\0" \
136 "update_spi_firmware_addr=0x22000000\0" \
137 "update_spi_firmware_filename=u-boot.img\0" \
138 "update_spi_firmware=" \
139 "if sf probe ; then " \
140 "if tftp ${update_spi_firmware_spl_addr} " \
141 "${update_spi_firmware_spl_filename} ; then " \
142 "setenv update_spi_firmware_spl_filesize ${filesize} ; "\
143 "if tftp ${update_spi_firmware_addr} " \
144 "${update_spi_firmware_filename} ; then " \
145 "setenv update_spi_firmware_filesize ${filesize} ; " \
146 "sf update ${update_spi_firmware_spl_addr} 0x0 " \
147 "${update_spi_firmware_spl_filesize} ; " \
148 "sf update ${update_spi_firmware_addr} 0x10000 " \
149 "${update_spi_firmware_filesize} ; " \
150 "fi ; " \
151 "fi ; " \
152 "fi\0" \
153 "addcons=" \
154 "setenv bootargs ${bootargs} " \
155 "console=${consdev},${baudrate}\0" \
156 "addip=" \
157 "setenv bootargs ${bootargs} " \
158 "ip=${ipaddr}:${serverip}:${gatewayip}:" \
159 "${netmask}:${hostname}:${netdev}:off\0" \
160 "addmisc=" \
161 "setenv bootargs ${bootargs} ${miscargs}\0" \
162 "addargs=run addcons addmisc\0" \
163 "mmcload=" \
164 "mmc rescan ; " \
165 "load mmc ${bootpart} ${kernel_addr_r} ${bootfile}\0" \
166 "netload=" \
167 "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \
168 "miscargs=nohlt panic=1\0" \
169 "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
170 "nfsargs=" \
171 "setenv bootargs root=/dev/nfs rw " \
172 "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
173 "fdtimg=if test ${bootmode} = \"sf\" ; then " \
174 "setenv kernel_fdt 1 ; " \
175 "else ; " \
176 "setenv kernel_fdt 2 ; " \
177 "fi\0" \
178 "mmc_mmc=" \
179 "run fdtimg mmcload mmcargs addargs ; " \
180 "bootm ${kernel_addr_r}:kernel@1 - ${kernel_addr_r}:fdt@${kernel_fdt}\0" \
181 "mmc_nfs=" \
182 "run fdtimg mmcload nfsargs addip addargs ; " \
183 "bootm ${kernel_addr_r}:kernel@1 - ${kernel_addr_r}:fdt@${kernel_fdt}\0" \
184 "net_mmc=" \
185 "run fdtimg netload mmcargs addargs ; " \
186 "bootm ${kernel_addr_r}:kernel@1 - ${kernel_addr_r}:fdt@${kernel_fdt}\0" \
187 "net_nfs=" \
188 "run fdtimg netload nfsargs addip addargs ; " \
189 "bootm ${kernel_addr_r}:kernel@1 - ${kernel_addr_r}:fdt@${kernel_fdt}\0" \
190 "try_bootscript=" \
191 "mmc rescan;" \
192 "if test -e mmc 1:1 ${bootscript} ; then " \
193 "if load mmc 1:1 ${kernel_addr_r} ${bootscript};" \
194 "then ; " \
195 "echo Running bootscript... ; " \
196 "source ${kernel_addr_r} ; " \
197 "fi ; " \
198 "fi\0"
199
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
207#define CONFIG_SYS_MONITOR_LEN (512 << 10)
208
209#define CONFIG_SPL_SPI_LOAD
210#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x10000
211
212#define CONFIG_SYS_USE_MMC
213#define CONFIG_SPL_MMC_SUPPORT
214#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200
215#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
216#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
217#define CONFIG_SPL_FAT_SUPPORT
218#define CONFIG_SPL_LIBDISK_SUPPORT
219
220#endif
221