Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 1 | /* |
Marek Vasut | 6efde71 | 2017-05-02 20:27:40 +0200 | [diff] [blame] | 2 | * Aries MA5D4 configuration |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 3 | * Copyright (C) 2015 Marek Vasut <marex@denx.de> |
| 4 | * |
| 5 | * SPDX-License-Identifier: GPL-2.0+ |
| 6 | */ |
| 7 | |
| 8 | #ifndef __MA5D4EVK_CONFIG_H__ |
| 9 | #define __MA5D4EVK_CONFIG_H__ |
| 10 | |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 11 | #define CONFIG_TIMESTAMP /* Print image info with timestamp */ |
| 12 | |
| 13 | #include "at91-sama5_common.h" |
| 14 | #undef CONFIG_BOOTARGS |
| 15 | #define CONFIG_SYS_USE_SERIALFLASH 1 |
Marek Vasut | d088c51 | 2017-05-02 20:27:50 +0200 | [diff] [blame] | 16 | #define CONFIG_BOARD_LATE_INIT |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 17 | |
| 18 | /* |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 19 | * Memory configurations |
| 20 | */ |
| 21 | #define CONFIG_NR_DRAM_BANKS 1 |
| 22 | #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_DDRCS |
| 23 | #define CONFIG_SYS_SDRAM_SIZE 0x10000000 |
| 24 | |
| 25 | #ifdef CONFIG_SPL_BUILD |
| 26 | #define CONFIG_SYS_INIT_SP_ADDR 0x210000 |
| 27 | #else |
| 28 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 29 | (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE) |
| 30 | #endif |
| 31 | |
| 32 | /* |
| 33 | * Environment |
| 34 | */ |
Marek Vasut | 15e80a2 | 2017-05-02 20:27:48 +0200 | [diff] [blame] | 35 | #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE |
| 36 | #define CONFIG_SYS_CONSOLE_ENV_OVERWRITE |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 37 | #define CONFIG_ENV_SIZE 0x4000 |
Marek Vasut | 15e80a2 | 2017-05-02 20:27:48 +0200 | [diff] [blame] | 38 | #define CONFIG_SYS_MMC_ENV_DEV 0 /* eMMC */ |
| 39 | #define CONFIG_ENV_OFFSET 512 /* just after the MBR */ |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 40 | |
| 41 | /* |
| 42 | * U-Boot general configurations |
| 43 | */ |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 44 | |
| 45 | /* |
| 46 | * Serial Driver |
| 47 | */ |
| 48 | #define CONFIG_ATMEL_USART |
| 49 | #define CONFIG_USART_BASE ATMEL_BASE_USART0 |
| 50 | #define CONFIG_USART_ID ATMEL_ID_USART0 |
| 51 | |
| 52 | /* |
| 53 | * Ethernet |
| 54 | */ |
| 55 | #ifdef CONFIG_CMD_NET |
| 56 | #define CONFIG_MACB |
| 57 | #define CONFIG_RMII |
| 58 | #define CONFIG_NET_RETRY_COUNT 20 |
| 59 | #define CONFIG_MACB_SEARCH_PHY |
| 60 | #define CONFIG_ARP_TIMEOUT 200UL |
| 61 | #define CONFIG_IP_DEFRAG |
| 62 | #endif |
| 63 | |
| 64 | /* |
| 65 | * LCD |
| 66 | */ |
| 67 | #ifdef CONFIG_LCD |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 68 | #define CONFIG_BMP_16BPP |
| 69 | #define CONFIG_BMP_24BPP |
| 70 | #define CONFIG_BMP_32BPP |
| 71 | #define LCD_BPP LCD_COLOR16 |
| 72 | #define LCD_OUTPUT_BPP 24 |
| 73 | #define CONFIG_ATMEL_HLCD |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 74 | #endif |
| 75 | |
| 76 | /* |
| 77 | * SD/MMC |
| 78 | */ |
| 79 | #ifdef CONFIG_CMD_MMC |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 80 | #define CONFIG_GENERIC_ATMEL_MCI |
| 81 | #endif |
| 82 | |
| 83 | /* |
| 84 | * SPI NOR (boot memory) |
| 85 | */ |
| 86 | #ifdef CONFIG_CMD_SF |
| 87 | #define CONFIG_ATMEL_SPI |
| 88 | #define CONFIG_ATMEL_SPI0 |
| 89 | #define CONFIG_SPI_FLASH_ATMEL |
| 90 | #define CONFIG_SF_DEFAULT_BUS 0 |
| 91 | #define CONFIG_SF_DEFAULT_CS 0 |
| 92 | #define CONFIG_SF_DEFAULT_SPEED 30000000 |
| 93 | #endif |
| 94 | |
| 95 | /* |
| 96 | * USB |
| 97 | */ |
| 98 | #ifdef CONFIG_CMD_USB |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 99 | |
| 100 | /* USB device */ |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 101 | #define CONFIG_USB_ETHER |
| 102 | #define CONFIG_USB_ETH_RNDIS |
Marek Vasut | 6efde71 | 2017-05-02 20:27:40 +0200 | [diff] [blame] | 103 | #define CONFIG_USBNET_MANUFACTURER "AriesEmbedded" |
Marek Vasut | 9a541bf | 2017-05-02 20:27:43 +0200 | [diff] [blame] | 104 | #define CONFIG_USB_FUNCTION_MASS_STORAGE |
| 105 | #define CONFIG_SYS_DFU_DATA_BUF_SIZE (1 * 1024 * 1024) |
| 106 | #define DFU_DEFAULT_POLL_TIMEOUT 300 |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 107 | #endif |
| 108 | |
| 109 | /* |
| 110 | * Boot Linux |
| 111 | */ |
| 112 | #define CONFIG_CMDLINE_TAG |
| 113 | #define CONFIG_INITRD_TAG |
| 114 | #define CONFIG_SETUP_MEMORY_TAGS |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 115 | #define CONFIG_BOOTFILE "fitImage" |
| 116 | #define CONFIG_BOOTARGS "console=ttyS3,115200" |
| 117 | #define CONFIG_LOADADDR 0x20800000 |
| 118 | #define CONFIG_BOOTCOMMAND "run mmc_mmc" |
| 119 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 120 | |
| 121 | /* |
| 122 | * Extra Environments |
| 123 | */ |
| 124 | #define CONFIG_PREBOOT "run try_bootscript" |
| 125 | #define CONFIG_HOSTNAME ma5d4evk |
| 126 | |
| 127 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 128 | "consdev=ttyS3\0" \ |
| 129 | "baudrate=115200\0" \ |
| 130 | "bootscript=boot.scr\0" \ |
Marek Vasut | f2228b3 | 2017-05-02 20:27:45 +0200 | [diff] [blame] | 131 | "bootdev=/dev/mmcblk0p1\0" \ |
| 132 | "bootpart=0:1\0" \ |
| 133 | "rootdev=/dev/mmcblk0p2\0" \ |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 134 | "netdev=eth0\0" \ |
Marek Vasut | 9a541bf | 2017-05-02 20:27:43 +0200 | [diff] [blame] | 135 | "dfu_alt_info=mmc raw 0 3867148288\0" \ |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 136 | "kernel_addr_r=0x22000000\0" \ |
| 137 | "update_spi_firmware_spl_addr=0x21000000\0" \ |
| 138 | "update_spi_firmware_spl_filename=boot.bin\0" \ |
| 139 | "update_spi_firmware_addr=0x22000000\0" \ |
| 140 | "update_spi_firmware_filename=u-boot.img\0" \ |
| 141 | "update_spi_firmware=" /* Update the SPI flash firmware */ \ |
| 142 | "if sf probe ; then " \ |
| 143 | "if tftp ${update_spi_firmware_spl_addr} " \ |
| 144 | "${update_spi_firmware_spl_filename} ; then " \ |
| 145 | "setenv update_spi_firmware_spl_filesize ${filesize} ; "\ |
| 146 | "if tftp ${update_spi_firmware_addr} " \ |
| 147 | "${update_spi_firmware_filename} ; then " \ |
| 148 | "setenv update_spi_firmware_filesize ${filesize} ; " \ |
| 149 | "sf update ${update_spi_firmware_spl_addr} 0x0 " \ |
| 150 | "${update_spi_firmware_spl_filesize} ; " \ |
| 151 | "sf update ${update_spi_firmware_addr} 0x10000 " \ |
| 152 | "${update_spi_firmware_filesize} ; " \ |
| 153 | "fi ; " \ |
| 154 | "fi ; " \ |
| 155 | "fi\0" \ |
| 156 | "addcons=" \ |
| 157 | "setenv bootargs ${bootargs} " \ |
| 158 | "console=${consdev},${baudrate}\0" \ |
| 159 | "addip=" \ |
| 160 | "setenv bootargs ${bootargs} " \ |
| 161 | "ip=${ipaddr}:${serverip}:${gatewayip}:" \ |
| 162 | "${netmask}:${hostname}:${netdev}:off\0" \ |
| 163 | "addmisc=" \ |
| 164 | "setenv bootargs ${bootargs} ${miscargs}\0" \ |
| 165 | "addargs=run addcons addmisc\0" \ |
| 166 | "mmcload=" \ |
| 167 | "mmc rescan ; " \ |
| 168 | "load mmc ${bootpart} ${kernel_addr_r} ${bootfile}\0" \ |
| 169 | "netload=" \ |
| 170 | "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \ |
| 171 | "miscargs=nohlt panic=1\0" \ |
| 172 | "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \ |
| 173 | "nfsargs=" \ |
| 174 | "setenv bootargs root=/dev/nfs rw " \ |
| 175 | "nfsroot=${serverip}:${rootpath},v3,tcp\0" \ |
Marek Vasut | d088c51 | 2017-05-02 20:27:50 +0200 | [diff] [blame] | 176 | "fdtimg=if test ${bootmode} = \"sf\" ; then " \ |
| 177 | "setenv kernel_fdt 1 ; " \ |
| 178 | "else ; " \ |
| 179 | "setenv kernel_fdt 2 ; " \ |
| 180 | "fi\0" \ |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 181 | "mmc_mmc=" \ |
Marek Vasut | d088c51 | 2017-05-02 20:27:50 +0200 | [diff] [blame] | 182 | "run fdtimg mmcload mmcargs addargs ; " \ |
| 183 | "bootm ${kernel_addr_r}:kernel@1 - ${kernel_addr_r}:fdt@${kernel_fdt}\0" \ |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 184 | "mmc_nfs=" \ |
Marek Vasut | d088c51 | 2017-05-02 20:27:50 +0200 | [diff] [blame] | 185 | "run fdtimg mmcload nfsargs addip addargs ; " \ |
| 186 | "bootm ${kernel_addr_r}:kernel@1 - ${kernel_addr_r}:fdt@${kernel_fdt}\0" \ |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 187 | "net_mmc=" \ |
Marek Vasut | d088c51 | 2017-05-02 20:27:50 +0200 | [diff] [blame] | 188 | "run fdtimg netload mmcargs addargs ; " \ |
| 189 | "bootm ${kernel_addr_r}:kernel@1 - ${kernel_addr_r}:fdt@${kernel_fdt}\0" \ |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 190 | "net_nfs=" \ |
Marek Vasut | d088c51 | 2017-05-02 20:27:50 +0200 | [diff] [blame] | 191 | "run fdtimg netload nfsargs addip addargs ; " \ |
| 192 | "bootm ${kernel_addr_r}:kernel@1 - ${kernel_addr_r}:fdt@${kernel_fdt}\0" \ |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 193 | "try_bootscript=" \ |
| 194 | "mmc rescan;" \ |
Marek Vasut | f2228b3 | 2017-05-02 20:27:45 +0200 | [diff] [blame] | 195 | "if test -e mmc 1:1 ${bootscript} ; then " \ |
| 196 | "if load mmc 1:1 ${kernel_addr_r} ${bootscript};" \ |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 197 | "then ; " \ |
| 198 | "echo Running bootscript... ; " \ |
| 199 | "source ${kernel_addr_r} ; " \ |
| 200 | "fi ; " \ |
| 201 | "fi\0" |
| 202 | /* SPL */ |
| 203 | #define CONFIG_SPL_FRAMEWORK |
| 204 | #define CONFIG_SPL_TEXT_BASE 0x200000 |
| 205 | #define CONFIG_SPL_MAX_SIZE 0x10000 |
| 206 | #define CONFIG_SPL_BSS_START_ADDR 0x20000000 |
| 207 | #define CONFIG_SPL_BSS_MAX_SIZE 0x80000 |
| 208 | #define CONFIG_SYS_SPL_MALLOC_START 0x20080000 |
| 209 | #define CONFIG_SYS_SPL_MALLOC_SIZE 0x80000 |
| 210 | |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 211 | #define CONFIG_SYS_MONITOR_LEN (512 << 10) |
| 212 | |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 213 | #define CONFIG_SPL_SPI_LOAD |
| 214 | #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x10000 |
| 215 | |
Marek Vasut | 0eaab23 | 2017-05-02 20:27:46 +0200 | [diff] [blame] | 216 | #define CONFIG_SYS_USE_MMC |
| 217 | #define CONFIG_SPL_LDSCRIPT arch/arm/mach-at91/armv7/u-boot-spl.lds |
| 218 | #define CONFIG_SPL_MMC_SUPPORT |
| 219 | #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200 |
| 220 | #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1 |
| 221 | #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img" |
| 222 | #define CONFIG_SPL_FAT_SUPPORT |
| 223 | #define CONFIG_SPL_LIBDISK_SUPPORT |
| 224 | |
Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 225 | #endif /* __MA5D4EVK_CONFIG_H__ */ |