1 /*
2  * Configuration file for the SAMA5D2 Xplained Board.
3  *
4  * Copyright (C) 2015 Atmel Corporation
5  *		      Wenyou Yang <wenyou.yang@atmel.com>
6  *
7  * SPDX-License-Identifier:	GPL-2.0+
8  */
9 
10 #ifndef __CONFIG_H
11 #define __CONFIG_H
12 
13 /* No NOR flash, this definition should put before common header */
14 #define CONFIG_SYS_NO_FLASH
15 
16 #include "at91-sama5_common.h"
17 
18 /* serial console */
19 #define CONFIG_ATMEL_USART
20 #define CONFIG_USART_BASE		ATMEL_BASE_UART1
21 #define CONFIG_USART_ID			ATMEL_ID_UART1
22 
23 /* SDRAM */
24 #define CONFIG_NR_DRAM_BANKS		1
25 #define CONFIG_SYS_SDRAM_BASE           ATMEL_BASE_DDRCS
26 #define CONFIG_SYS_SDRAM_SIZE		0x20000000
27 
28 #define CONFIG_SYS_INIT_SP_ADDR \
29 	(CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE)
30 
31 #define CONFIG_SYS_LOAD_ADDR		0x22000000 /* load address */
32 
33 #undef CONFIG_AT91_GPIO
34 #define CONFIG_ATMEL_PIO4
35 
36 /* SerialFlash */
37 #ifdef CONFIG_CMD_SF
38 #define CONFIG_ATMEL_SPI
39 #define CONFIG_ATMEL_SPI0
40 #define CONFIG_SPI_FLASH_ATMEL
41 #define CONFIG_SF_DEFAULT_BUS		0
42 #define CONFIG_SF_DEFAULT_CS		0
43 #define CONFIG_SF_DEFAULT_SPEED		30000000
44 #endif
45 
46 /* NAND flash */
47 #undef CONFIG_CMD_NAND
48 
49 /* MMC */
50 #define CONFIG_CMD_MMC
51 
52 #ifdef CONFIG_CMD_MMC
53 #define CONFIG_MMC
54 #define CONFIG_GENERIC_MMC
55 #define CONFIG_SDHCI
56 #define CONFIG_ATMEL_SDHCI
57 #define CONFIG_ATMEL_SDHCI0
58 #define CONFIG_ATMEL_SDHCI1
59 #define CONFIG_SUPPORT_EMMC_BOOT
60 #endif
61 
62 /* USB */
63 #define CONFIG_CMD_USB
64 
65 #ifdef CONFIG_CMD_USB
66 #define CONFIG_USB_EHCI
67 #define CONFIG_USB_EHCI_ATMEL
68 #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS	3
69 #define CONFIG_USB_STORAGE
70 #endif
71 
72 /* USB device */
73 #define CONFIG_USB_GADGET
74 #define CONFIG_USB_GADGET_DUALSPEED
75 #define CONFIG_USB_GADGET_ATMEL_USBA
76 #define CONFIG_USB_ETHER
77 #define CONFIG_USB_ETH_RNDIS
78 #define CONFIG_USBNET_MANUFACTURER      "Atmel SAMA5D2 XPlained"
79 
80 #if defined(CONFIG_CMD_USB) || defined(CONFIG_CMD_MMC)
81 #define CONFIG_CMD_FAT
82 #define CONFIG_DOS_PARTITION
83 #endif
84 
85 /* Ethernet Hardware */
86 #define CONFIG_MACB
87 #define CONFIG_RMII
88 #define CONFIG_NET_RETRY_COUNT		20
89 #define CONFIG_MACB_SEARCH_PHY
90 
91 /* LCD */
92 /* #define CONFIG_LCD */
93 
94 #ifdef CONFIG_LCD
95 #define LCD_BPP				LCD_COLOR16
96 #define LCD_OUTPUT_BPP                  24
97 #define CONFIG_LCD_LOGO
98 #define CONFIG_LCD_INFO
99 #define CONFIG_LCD_INFO_BELOW_LOGO
100 #define CONFIG_SYS_WHITE_ON_BLACK
101 #define CONFIG_ATMEL_HLCD
102 #define CONFIG_ATMEL_LCD_RGB565
103 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
104 #endif
105 
106 #ifdef CONFIG_SYS_USE_MMC
107 
108 /* bootstrap + u-boot + env in sd card */
109 #undef FAT_ENV_DEVICE_AND_PART
110 #undef CONFIG_BOOTCOMMAND
111 
112 #define FAT_ENV_DEVICE_AND_PART	"1"
113 #define CONFIG_BOOTCOMMAND	"fatload mmc 1:1 0x21000000 at91-sama5d2_xplained.dtb; " \
114 				"fatload mmc 1:1 0x22000000 zImage; " \
115 				"bootz 0x22000000 - 0x21000000"
116 #undef CONFIG_BOOTARGS
117 #define CONFIG_BOOTARGS \
118 	"console=ttyS0,115200 earlyprintk root=/dev/mmcblk1p2 rw rootwait"
119 
120 #endif
121 
122 #endif
123