blob: 09ab4d7f256b514ad33ee8c6b6d433a0a52a3423 [file] [log] [blame]
Bo Shen927b9012014-11-10 15:24:02 +08001/*
2 * Configuration settings for the SAMA5D4EK 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 Shencd5ca302014-12-03 18:02:21 +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 Shen927b9012014-11-10 15:24:02 +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#define LCD_BPP LCD_COLOR16
146#define LCD_OUTPUT_BPP 18
147#define CONFIG_LCD_LOGO
148#define CONFIG_LCD_INFO
149#define CONFIG_LCD_INFO_BELOW_LOGO
150#define CONFIG_SYS_WHITE_ON_BLACK
151#define CONFIG_ATMEL_HLCD
152#define CONFIG_ATMEL_LCD_RGB565
153#define CONFIG_SYS_CONSOLE_IS_IN_ENV
154
155#ifdef CONFIG_SYS_USE_SERIALFLASH
156/* bootstrap + u-boot + env + linux in serial flash */
157#define CONFIG_ENV_IS_IN_SPI_FLASH
158#define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS
159#define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS
160#define CONFIG_ENV_OFFSET 0x10000
161#define CONFIG_ENV_SIZE 0x10000
162#define CONFIG_ENV_SECT_SIZE 0x1000
163#define CONFIG_BOOTCOMMAND "sf probe 0; " \
164 "sf read 0x21000000 0xa0000 0x60000; " \
165 "sf read 0x22000000 0x100000 0x300000; " \
166 "bootz 0x22000000 - 0x21000000"
167#elif CONFIG_SYS_USE_NANDFLASH
168/* bootstrap + u-boot + env in nandflash */
169#define CONFIG_ENV_IS_IN_NAND
170#define CONFIG_ENV_OFFSET 0xc0000
171#define CONFIG_ENV_OFFSET_REDUND 0x100000
172#define CONFIG_ENV_SIZE 0x20000
173#define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \
174 "nand read 0x22000000 0x200000 0x600000;" \
175 "bootz 0x22000000 - 0x21000000"
176#elif CONFIG_SYS_USE_MMC
177/* bootstrap + u-boot + env in sd card */
178#define CONFIG_ENV_IS_IN_FAT
179#define CONFIG_FAT_WRITE
180#define FAT_ENV_INTERFACE "mmc"
181/*
182 * We don't specify the part number, if device 0 has partition table, it means
183 * the first partition; it no partition table, then take whole device as a
184 * FAT file system.
185 */
186#define FAT_ENV_DEVICE_AND_PART "0"
187#define FAT_ENV_FILE "uboot.env"
188#define CONFIG_ENV_SIZE 0x4000
189#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 sama5d4ek.dtb; " \
190 "fatload mmc 0:1 0x22000000 zImage; " \
191 "bootz 0x22000000 - 0x21000000"
192#endif
193
194#ifdef CONFIG_SYS_USE_MMC
195#define CONFIG_BOOTARGS \
196 "console=ttyS0,115200 earlyprintk " \
197 "root=/dev/mmcblk0p2 rw rootwait"
198#else
199#define CONFIG_BOOTARGS \
200 "console=ttyS0,115200 earlyprintk " \
201 "mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro," \
202 "256K(env),256k(evn_redundent),256k(spare)," \
203 "512k(dtb),6M(kernel)ro,-(rootfs) " \
204 "rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs"
205#endif
206
207#define CONFIG_BAUDRATE 115200
208
209#define CONFIG_SYS_PROMPT "U-Boot> "
210#define CONFIG_SYS_CBSIZE 256
211#define CONFIG_SYS_MAXARGS 16
212#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
213 sizeof(CONFIG_SYS_PROMPT) + 16)
214#define CONFIG_SYS_LONGHELP
215#define CONFIG_CMDLINE_EDITING
216#define CONFIG_AUTO_COMPLETE
217#define CONFIG_SYS_HUSH_PARSER
218
219/* Size of malloc() pool */
220#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
221
222#endif