blob: 996973d99b6cb236f848c7d12ad63f61069878f5 [file] [log] [blame]
Bo Shenf1960442014-11-10 15:46:22 +08001/*
2 * Configuration settings for the SAMA5D4 Xplained ultra board.
3 *
4 * Copyright (C) 2014 Atmel
5 * Bo Shen <voice.shen@atmel.com>
6 *
7 * SPDX-License-Identifier: GPL-2.0+
8 */
9
10#ifndef __CONFIG_H
11#define __CONFIG_H
12
13#include <asm/hardware.h>
14
15#define CONFIG_SYS_TEXT_BASE 0x26f00000
16
17/* ARM asynchronous clock */
18#define CONFIG_SYS_AT91_SLOW_CLOCK 32768
19#define CONFIG_SYS_AT91_MAIN_CLOCK 12000000 /* from 12 MHz crystal */
20
21#define CONFIG_ARCH_CPU_INIT
22
23#define CONFIG_SKIP_LOWLEVEL_INIT
24#define CONFIG_BOARD_EARLY_INIT_F
25#define CONFIG_DISPLAY_CPUINFO
26
27#define CONFIG_CMD_BOOTZ
28#define CONFIG_OF_LIBFDT /* Device Tree support */
29
30#define CONFIG_SYS_GENERIC_BOARD
31
32/* general purpose I/O */
33#define CONFIG_AT91_GPIO
34
35/* serial console */
36#define CONFIG_ATMEL_USART
37#define CONFIG_USART_BASE ATMEL_BASE_USART3
38#define CONFIG_USART_ID ATMEL_ID_USART3
39
40#define CONFIG_BOOTDELAY 3
41
42/*
43 * BOOTP options
44 */
45#define CONFIG_BOOTP_BOOTFILESIZE
46#define CONFIG_BOOTP_BOOTPATH
47#define CONFIG_BOOTP_GATEWAY
48#define CONFIG_BOOTP_HOSTNAME
49
50/* No NOR flash */
51#define CONFIG_SYS_NO_FLASH
52
53/*
54 * Command line configuration.
55 */
56#include <config_cmd_default.h>
57#undef CONFIG_CMD_FPGA
58#undef CONFIG_CMD_IMI
59#undef CONFIG_CMD_LOADS
60#define CONFIG_CMD_PING
61#define CONFIG_CMD_DHCP
62#define CONFIG_CMD_SETEXPR
63
64/* SDRAM */
65#define CONFIG_NR_DRAM_BANKS 1
66#define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_DDRCS
67#define CONFIG_SYS_SDRAM_SIZE 0x20000000
68
69#define CONFIG_SYS_INIT_SP_ADDR \
70 (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE)
71
72#define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */
73
74/* SerialFlash */
75#define CONFIG_CMD_SF
76
77#ifdef CONFIG_CMD_SF
78#define CONFIG_ATMEL_SPI
79#define CONFIG_ATMEL_SPI0
80#define CONFIG_SPI_FLASH
81#define CONFIG_SPI_FLASH_ATMEL
82#define CONFIG_SF_DEFAULT_BUS 0
83#define CONFIG_SF_DEFAULT_CS 0
84#define CONFIG_SF_DEFAULT_SPEED 30000000
85#endif
86
87/* NAND flash */
88#define CONFIG_CMD_NAND
89
90#ifdef CONFIG_CMD_NAND
91#define CONFIG_NAND_ATMEL
92#define CONFIG_SYS_MAX_NAND_DEVICE 1
93#define CONFIG_SYS_NAND_BASE ATMEL_BASE_CS3
94/* our ALE is AD21 */
95#define CONFIG_SYS_NAND_MASK_ALE (1 << 21)
96/* our CLE is AD22 */
97#define CONFIG_SYS_NAND_MASK_CLE (1 << 22)
98#define CONFIG_SYS_NAND_ONFI_DETECTION
99/* PMECC & PMERRLOC */
100#define CONFIG_ATMEL_NAND_HWECC
101#define CONFIG_ATMEL_NAND_HW_PMECC
102#endif
103
104/* MMC */
105#define CONFIG_CMD_MMC
106
107#ifdef CONFIG_CMD_MMC
108#define CONFIG_MMC
109#define CONFIG_GENERIC_MMC
110#define CONFIG_GENERIC_ATMEL_MCI
111#define ATMEL_BASE_MMCI ATMEL_BASE_MCI1
112#endif
113
114/* USB */
115#define CONFIG_CMD_USB
116
117#ifdef CONFIG_CMD_USB
118#define CONFIG_USB_EHCI
119#define CONFIG_USB_EHCI_ATMEL
120#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
121#define CONFIG_USB_STORAGE
122#endif
123
Bo Shen52305a82014-12-03 18:02:23 +0800124/* USB device */
125#define CONFIG_USB_GADGET
126#define CONFIG_USB_GADGET_DUALSPEED
127#define CONFIG_USB_GADGET_ATMEL_USBA
128#define CONFIG_USB_ETHER
129#define CONFIG_USB_ETH_RNDIS
130#define CONFIG_USBNET_MANUFACTURER "Atmel SAMA5D4EK"
131
Bo Shenf1960442014-11-10 15:46:22 +0800132#if defined(CONFIG_CMD_USB) || defined(CONFIG_CMD_MMC)
133#define CONFIG_CMD_FAT
134#define CONFIG_DOS_PARTITION
135#endif
136
137/* Ethernet Hardware */
138#define CONFIG_MACB
139#define CONFIG_RMII
140#define CONFIG_NET_RETRY_COUNT 20
141#define CONFIG_MACB_SEARCH_PHY
142
143/* LCD */
144/* #define CONFIG_LCD */
145#ifdef CONFIG_LCD
146#define LCD_BPP LCD_COLOR16
147#define LCD_OUTPUT_BPP 24
148#define CONFIG_LCD_LOGO
149#define CONFIG_LCD_INFO
150#define CONFIG_LCD_INFO_BELOW_LOGO
151#define CONFIG_SYS_WHITE_ON_BLACK
152#define CONFIG_ATMEL_HLCD
153#define CONFIG_ATMEL_LCD_RGB565
154#define CONFIG_SYS_CONSOLE_IS_IN_ENV
155#endif
156
157#ifdef CONFIG_SYS_USE_SERIALFLASH
158/* bootstrap + u-boot + env + linux in serial flash */
159#define CONFIG_ENV_IS_IN_SPI_FLASH
160#define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS
161#define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS
162#define CONFIG_ENV_OFFSET 0x10000
163#define CONFIG_ENV_SIZE 0x10000
164#define CONFIG_ENV_SECT_SIZE 0x1000
165#define CONFIG_BOOTCOMMAND "sf probe 0; " \
166 "sf read 0x21000000 0xa0000 0x60000; " \
167 "sf read 0x22000000 0x100000 0x300000; " \
168 "bootz 0x22000000 - 0x21000000"
169#elif CONFIG_SYS_USE_NANDFLASH
170/* bootstrap + u-boot + env in nandflash */
171#define CONFIG_ENV_IS_IN_NAND
172#define CONFIG_ENV_OFFSET 0xc0000
173#define CONFIG_ENV_OFFSET_REDUND 0x100000
174#define CONFIG_ENV_SIZE 0x20000
175#define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \
176 "nand read 0x22000000 0x200000 0x600000;" \
177 "bootz 0x22000000 - 0x21000000"
178#elif CONFIG_SYS_USE_MMC
179/* bootstrap + u-boot + env in sd card */
180#define CONFIG_ENV_IS_IN_FAT
181#define CONFIG_FAT_WRITE
182#define FAT_ENV_INTERFACE "mmc"
183/*
184 * We don't specify the part number, if device 0 has partition table, it means
185 * the first partition; it no partition table, then take whole device as a
186 * FAT file system.
187 */
188#define FAT_ENV_DEVICE_AND_PART "0"
189#define FAT_ENV_FILE "uboot.env"
190#define CONFIG_ENV_SIZE 0x4000
191#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 at91-sama5d4_xplained.dtb; " \
192 "fatload mmc 0:1 0x22000000 zImage; " \
193 "bootz 0x22000000 - 0x21000000"
194#endif
195
196#ifdef CONFIG_SYS_USE_MMC
197#define CONFIG_BOOTARGS \
198 "console=ttyS0,115200 earlyprintk " \
199 "root=/dev/mmcblk0p2 rw rootwait"
200#else
201#define CONFIG_BOOTARGS \
202 "console=ttyS0,115200 earlyprintk " \
203 "mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro," \
204 "256K(env),256k(evn_redundent),256k(spare)," \
205 "512k(dtb),6M(kernel)ro,-(rootfs) " \
206 "rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs"
207#endif
208
209#define CONFIG_BAUDRATE 115200
210
211#define CONFIG_SYS_PROMPT "U-Boot> "
212#define CONFIG_SYS_CBSIZE 256
213#define CONFIG_SYS_MAXARGS 16
214#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
215 sizeof(CONFIG_SYS_PROMPT) + 16)
216#define CONFIG_SYS_LONGHELP
217#define CONFIG_CMDLINE_EDITING
218#define CONFIG_AUTO_COMPLETE
219#define CONFIG_SYS_HUSH_PARSER
220
221/* Size of malloc() pool */
222#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
223
224#endif