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