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