Bo Shen | 927b901 | 2014-11-10 15:24:02 +0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 124 | #if defined(CONFIG_CMD_USB) || defined(CONFIG_CMD_MMC) |
| 125 | #define CONFIG_CMD_FAT |
| 126 | #define CONFIG_DOS_PARTITION |
| 127 | #endif |
| 128 | |
| 129 | /* Ethernet Hardware */ |
| 130 | #define CONFIG_MACB |
| 131 | #define CONFIG_RMII |
| 132 | #define CONFIG_NET_RETRY_COUNT 20 |
| 133 | #define CONFIG_MACB_SEARCH_PHY |
| 134 | |
| 135 | /* LCD */ |
| 136 | #define CONFIG_LCD |
| 137 | #define LCD_BPP LCD_COLOR16 |
| 138 | #define LCD_OUTPUT_BPP 18 |
| 139 | #define CONFIG_LCD_LOGO |
| 140 | #define CONFIG_LCD_INFO |
| 141 | #define CONFIG_LCD_INFO_BELOW_LOGO |
| 142 | #define CONFIG_SYS_WHITE_ON_BLACK |
| 143 | #define CONFIG_ATMEL_HLCD |
| 144 | #define CONFIG_ATMEL_LCD_RGB565 |
| 145 | #define CONFIG_SYS_CONSOLE_IS_IN_ENV |
| 146 | |
| 147 | #ifdef CONFIG_SYS_USE_SERIALFLASH |
| 148 | /* bootstrap + u-boot + env + linux in serial flash */ |
| 149 | #define CONFIG_ENV_IS_IN_SPI_FLASH |
| 150 | #define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS |
| 151 | #define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS |
| 152 | #define CONFIG_ENV_OFFSET 0x10000 |
| 153 | #define CONFIG_ENV_SIZE 0x10000 |
| 154 | #define CONFIG_ENV_SECT_SIZE 0x1000 |
| 155 | #define CONFIG_BOOTCOMMAND "sf probe 0; " \ |
| 156 | "sf read 0x21000000 0xa0000 0x60000; " \ |
| 157 | "sf read 0x22000000 0x100000 0x300000; " \ |
| 158 | "bootz 0x22000000 - 0x21000000" |
| 159 | #elif CONFIG_SYS_USE_NANDFLASH |
| 160 | /* bootstrap + u-boot + env in nandflash */ |
| 161 | #define CONFIG_ENV_IS_IN_NAND |
| 162 | #define CONFIG_ENV_OFFSET 0xc0000 |
| 163 | #define CONFIG_ENV_OFFSET_REDUND 0x100000 |
| 164 | #define CONFIG_ENV_SIZE 0x20000 |
| 165 | #define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \ |
| 166 | "nand read 0x22000000 0x200000 0x600000;" \ |
| 167 | "bootz 0x22000000 - 0x21000000" |
| 168 | #elif CONFIG_SYS_USE_MMC |
| 169 | /* bootstrap + u-boot + env in sd card */ |
| 170 | #define CONFIG_ENV_IS_IN_FAT |
| 171 | #define CONFIG_FAT_WRITE |
| 172 | #define FAT_ENV_INTERFACE "mmc" |
| 173 | /* |
| 174 | * We don't specify the part number, if device 0 has partition table, it means |
| 175 | * the first partition; it no partition table, then take whole device as a |
| 176 | * FAT file system. |
| 177 | */ |
| 178 | #define FAT_ENV_DEVICE_AND_PART "0" |
| 179 | #define FAT_ENV_FILE "uboot.env" |
| 180 | #define CONFIG_ENV_SIZE 0x4000 |
| 181 | #define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 sama5d4ek.dtb; " \ |
| 182 | "fatload mmc 0:1 0x22000000 zImage; " \ |
| 183 | "bootz 0x22000000 - 0x21000000" |
| 184 | #endif |
| 185 | |
| 186 | #ifdef CONFIG_SYS_USE_MMC |
| 187 | #define CONFIG_BOOTARGS \ |
| 188 | "console=ttyS0,115200 earlyprintk " \ |
| 189 | "root=/dev/mmcblk0p2 rw rootwait" |
| 190 | #else |
| 191 | #define CONFIG_BOOTARGS \ |
| 192 | "console=ttyS0,115200 earlyprintk " \ |
| 193 | "mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro," \ |
| 194 | "256K(env),256k(evn_redundent),256k(spare)," \ |
| 195 | "512k(dtb),6M(kernel)ro,-(rootfs) " \ |
| 196 | "rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs" |
| 197 | #endif |
| 198 | |
| 199 | #define CONFIG_BAUDRATE 115200 |
| 200 | |
| 201 | #define CONFIG_SYS_PROMPT "U-Boot> " |
| 202 | #define CONFIG_SYS_CBSIZE 256 |
| 203 | #define CONFIG_SYS_MAXARGS 16 |
| 204 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ |
| 205 | sizeof(CONFIG_SYS_PROMPT) + 16) |
| 206 | #define CONFIG_SYS_LONGHELP |
| 207 | #define CONFIG_CMDLINE_EDITING |
| 208 | #define CONFIG_AUTO_COMPLETE |
| 209 | #define CONFIG_SYS_HUSH_PARSER |
| 210 | |
| 211 | /* Size of malloc() pool */ |
| 212 | #define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024) |
| 213 | |
| 214 | #endif |